aboutsummaryrefslogtreecommitdiffstats
path: root/agents/todo
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2024-07-10 18:53:32 +0800
committerGitHub <noreply@github.com>2024-07-10 18:53:32 +0800
commit732eae532c8e8632db95ab80e0dde5071e744386 (patch)
tree94e9f6d15b64cff5a26d6bbf44f16c53deb8c324 /agents/todo
parent01e07c0cc0be0b1600d688616d12ad0afa9edc71 (diff)
downloadllm-functions-docker-732eae532c8e8632db95ab80e0dde5071e744386.tar.gz
feat: adjust the way of returning data to LLM (#69)
Diffstat (limited to 'agents/todo')
-rwxr-xr-xagents/todo/tools.sh14
1 files changed, 7 insertions, 7 deletions
diff --git a/agents/todo/tools.sh b/agents/todo/tools.sh
index 29454aa..6dbe869 100755
--- a/agents/todo/tools.sh
+++ b/agents/todo/tools.sh
@@ -17,7 +17,7 @@ add_todo() {
--arg new_desc "$argc_desc" \
'. += [{"id": $new_id | tonumber, "desc": $new_desc}]' \
> "$todos_file"
- echo "Successfully added todo id=$num"
+ echo "Successfully added todo id=$num" >> "$LLM_OUTPUT"
}
# @cmd Delete an existing todo item
@@ -29,9 +29,9 @@ del_todo() {
echo "$data" | \
jq --arg id $argc_id '[.[] | select(.id != ($id | tonumber))]' \
> "$todos_file"
- echo "Successfully deleted todo id=$argc_id"
+ echo "Successfully deleted todo id=$argc_id" >> "$LLM_OUTPUT"
else
- echo "Empty todo list"
+ echo "Empty todo list" >> "$LLM_OUTPUT"
fi
}
@@ -39,9 +39,9 @@ del_todo() {
list_todos() {
todos_file="$(_get_todos_file)"
if [[ -f "$todos_file" ]]; then
- cat "$todos_file"
+ cat "$todos_file" >> "$LLM_OUTPUT"
else
- echo '[]'
+ echo '[]' >> "$LLM_OUTPUT"
fi
}
@@ -49,9 +49,9 @@ list_todos() {
clear_todos() {
todos_file="$(_get_todos_file)"
if [[ -f "$todos_file" ]]; then
- rm -rf "$todos_file"
+ rm -rf "$todos_file" >> "$LLM_OUTPUT"
fi
- echo "Successfully deleted entry todo list"
+ echo "Successfully deleted entry todo list" >> "$LLM_OUTPUT"
}
_argc_before() {