aboutsummaryrefslogtreecommitdiffstats
path: root/agents/todo-sh
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2024-07-09 21:28:35 +0800
committerGitHub <noreply@github.com>2024-07-09 21:28:35 +0800
commit48cb8381eae03aa45b34fa79f4e0037f6a5c0225 (patch)
tree88a4c333013ad92a0bd99d0b59feae9231f15243 /agents/todo-sh
parent02e335c99526fe52dee0d0a016aee6bf62d874c2 (diff)
downloadllm-functions-docker-48cb8381eae03aa45b34fa79f4e0037f6a5c0225.tar.gz
feat: remove todo-js/todo-py and rename todo-sh to todo (#68)
Diffstat (limited to 'agents/todo-sh')
-rw-r--r--agents/todo-sh/index.yaml19
-rwxr-xr-xagents/todo-sh/tools.sh67
2 files changed, 0 insertions, 86 deletions
diff --git a/agents/todo-sh/index.yaml b/agents/todo-sh/index.yaml
deleted file mode 100644
index 490280e..0000000
--- a/agents/todo-sh/index.yaml
+++ /dev/null
@@ -1,19 +0,0 @@
-name: Todo
-description: A helpful ai agent that manages a todo list.
-instructions: |
- You will be provided with a list of todos.
- Users can interact with you using the following commands:
- * add_todo: Add a todo to the list.
- * rm_todo: Remove a todo from the list.
- * list_todos: Display the current todo list.
- * clear_todos: Delete the entire todo list.
- Based on the interaction, ensure that you provide appropriate confirmations or errors for the requested operation. For example:
- - Confirmations: "Todo item added successfully!", "Todo item removed successfully!", "All todo items deleted!"
- - Errors: "Cannot add todo item, missing description.", "Todo item with id {id} not found.", "No todo items to delete."
- Make sure you understand the user request properly before performing any action. If unsure, ask clarifying questions like "Do you want to remove all todos or just a specific one?"
-conversation_starters:
- - "Add a new todo item 'Finish report'."
- - "Remove the todo item with id=2."
- - "Delete all my todos."
- - "What todos do I have pending?"
- - "How can I remove a specific todo item?" \ No newline at end of file
diff --git a/agents/todo-sh/tools.sh b/agents/todo-sh/tools.sh
deleted file mode 100755
index 29454aa..0000000
--- a/agents/todo-sh/tools.sh
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/usr/bin/env bash
-set -e
-
-# @cmd Add a new todo item
-# @option --desc! The task description
-add_todo() {
- todos_file="$(_get_todos_file)"
- if [[ -f "$todos_file" ]]; then
- num="$(cat "$todos_file" | jq '[.[].id] | max + 1')"
- data="$(cat "$todos_file")"
- else
- num=1
- data="[]"
- fi
- echo "$data" | \
- jq --arg new_id $num \
- --arg new_desc "$argc_desc" \
- '. += [{"id": $new_id | tonumber, "desc": $new_desc}]' \
- > "$todos_file"
- echo "Successfully added todo id=$num"
-}
-
-# @cmd Delete an existing todo item
-# @option --id! <INT> The task id
-del_todo() {
- todos_file="$(_get_todos_file)"
- if [[ -f "$todos_file" ]]; then
- data="$(cat "$todos_file")"
- echo "$data" | \
- jq --arg id $argc_id '[.[] | select(.id != ($id | tonumber))]' \
- > "$todos_file"
- echo "Successfully deleted todo id=$argc_id"
- else
- echo "Empty todo list"
- fi
-}
-
-# @cmd Display the current todo list in json format.
-list_todos() {
- todos_file="$(_get_todos_file)"
- if [[ -f "$todos_file" ]]; then
- cat "$todos_file"
- else
- echo '[]'
- fi
-}
-
-# @cmd Delete the entire todo list.
-clear_todos() {
- todos_file="$(_get_todos_file)"
- if [[ -f "$todos_file" ]]; then
- rm -rf "$todos_file"
- fi
- echo "Successfully deleted entry todo list"
-}
-
-_argc_before() {
- todos_file="$(_get_todos_file)"
- mkdir -p "$(dirname "$todos_file")"
-}
-
-_get_todos_file() {
- echo "${LLM_AGENT_CACHE_DIR:-/tmp}/todos.json"
-}
-
-# See more details at https://github.com/sigoden/argc
-eval "$(argc --argc-eval "$0" "$@")"