diff options
| author | sigoden <sigoden@gmail.com> | 2024-07-10 18:53:32 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-10 18:53:32 +0800 |
| commit | 732eae532c8e8632db95ab80e0dde5071e744386 (patch) | |
| tree | 94e9f6d15b64cff5a26d6bbf44f16c53deb8c324 /Argcfile.sh | |
| parent | 01e07c0cc0be0b1600d688616d12ad0afa9edc71 (diff) | |
| download | llm-functions-docker-732eae532c8e8632db95ab80e0dde5071e744386.tar.gz | |
feat: adjust the way of returning data to LLM (#69)
Diffstat (limited to 'Argcfile.sh')
| -rw-r--r-- | Argcfile.sh | 40 |
1 files changed, 7 insertions, 33 deletions
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 } |
