From 732eae532c8e8632db95ab80e0dde5071e744386 Mon Sep 17 00:00:00 2001 From: sigoden Date: Wed, 10 Jul 2024 18:53:32 +0800 Subject: feat: adjust the way of returning data to LLM (#69) --- Argcfile.sh | 40 +++++++--------------------------------- 1 file changed, 7 insertions(+), 33 deletions(-) (limited to 'Argcfile.sh') diff --git a/Argcfile.sh b/Argcfile.sh index 5a9fcce..6c2e221 100644 --- a/Argcfile.sh +++ b/Argcfile.sh @@ -362,39 +362,12 @@ test@tool() { declarations_file="$TMP_DIR/functions.json" argc list@tool > "$names_file" argc build@tool --names-file "$names_file" --declarations-file "$declarations_file" - test-execute-code-tools -} - -# @cmd Test maybe_execute_* tools -# @alias tool:test-execute-code -test-execute-code-tools() { - if _is_win; then - ext=".cmd" - fi - test_cases=( \ - 'sh#execute_command#{"command":"echo \"✓\""}' \ - 'js#execute_js_code#{"code":"console.log(\"✓\")"}' \ - 'py#execute_py_code#{"code":"print(\"✓\")"}' \ - ) - - for test_case in "${test_cases[@]}"; do - IFS='#' read -r lang tool_name data <<<"${test_case}" - cmd="$(_lang_to_cmd "$lang")" - if command -v "$cmd" &> /dev/null; then - cmd_path="$BIN_DIR/$tool_name$ext" - echo -n "Test $cmd_path: " - "$cmd_path" "$data" - if ! _is_win; then - echo -n "Test $cmd scripts/run-tool.$lang $tool_name: " - "$cmd" "scripts/run-tool.$lang" "$tool_name" "$data" - fi - fi - done + test-demo@tool } # @cmd Test demo tools # @alias tool:test-demo -test-demo-tools() { +test-demo@tool() { for item in "${LANG_CMDS[@]}"; do lang="${item%:*}" tool="demo_$lang.$lang" @@ -429,22 +402,23 @@ test@agent() { names_file="$tmp_dir/agents.txt" argc list@agent > "$names_file" argc build@agent --names-file "$names_file" - test-demo-agents + test-demo@agent } # @cmd Test demo agents # @alias agent:test-demo -test-demo-agents() { - echo "Test demo agent:" +test-demo@agent() { + echo "---- Test demo agent ---" argc run@agent demo get_sysinfo '{}' for item in "${LANG_CMDS[@]}"; do cmd="${item#*:}" lang="${item%:*}" - echo "Test agents/demo/tools.$lang:" + echo "---- Test agents/demo/tools.$lang ---" if [[ "$cmd" == "sh" ]]; then "$(argc --argc-shell-path)" ./scripts/run-agent.sh demo get_sysinfo '{}' elif command -v "$cmd" &> /dev/null; then $cmd ./scripts/run-agent.$lang demo get_sysinfo '{}' + echo fi done } -- cgit v1.2.3