aboutsummaryrefslogtreecommitdiffstats
path: root/bots/todo-sh
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2024-06-10 19:57:37 +0800
committerGitHub <noreply@github.com>2024-06-10 19:57:37 +0800
commit7225ee331a82cf1f8d8afab8923c4f35a792e5b8 (patch)
tree7166211462ff174b6d9701e80b2200b8f52f3e41 /bots/todo-sh
parent8f3385ca9e87f6941914953cabe8ed1e325305cb (diff)
downloadllm-functions-docker-7225ee331a82cf1f8d8afab8923c4f35a792e5b8.tar.gz
refactor: improve bots/todo-* (#41)
Diffstat (limited to 'bots/todo-sh')
-rw-r--r--bots/todo-sh/index.yaml2
-rwxr-xr-xbots/todo-sh/tools.sh9
2 files changed, 3 insertions, 8 deletions
diff --git a/bots/todo-sh/index.yaml b/bots/todo-sh/index.yaml
index 0988e01..a3c8eb1 100644
--- a/bots/todo-sh/index.yaml
+++ b/bots/todo-sh/index.yaml
@@ -1,4 +1,4 @@
-name: Todo List
+name: TodoBot
description: Your name is TodoBot and you are a helpful chatbot that manages a todo list.
instructions: |
You will be provided with a list of todos.
diff --git a/bots/todo-sh/tools.sh b/bots/todo-sh/tools.sh
index 1b1758a..e387d75 100755
--- a/bots/todo-sh/tools.sh
+++ b/bots/todo-sh/tools.sh
@@ -31,7 +31,7 @@ del_todo() {
> "$todos_file"
echo "Successfully deleted todo id=$argc_id"
else
- _die "Empty todo list"
+ echo "Empty todo list"
fi
}
@@ -41,7 +41,7 @@ list_todos() {
if [[ -f "$todos_file" ]]; then
cat "$todos_file"
else
- _die "Empty todo list"
+ echo '[]'
fi
}
@@ -63,10 +63,5 @@ _get_todos_file() {
echo "${LLM_BOT_CACHE_DIR:-/tmp}/todos.json"
}
-_die() {
- echo "$*" >&2
- exit 1
-}
-
# See more details at https://github.com/sigoden/argc
eval "$(argc --argc-eval "$0" "$@")"