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 /tools/demo_sh.sh | |
| parent | 01e07c0cc0be0b1600d688616d12ad0afa9edc71 (diff) | |
| download | llm-functions-docker-732eae532c8e8632db95ab80e0dde5071e744386.tar.gz | |
feat: adjust the way of returning data to LLM (#69)
Diffstat (limited to 'tools/demo_sh.sh')
| -rwxr-xr-x | tools/demo_sh.sh | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/tools/demo_sh.sh b/tools/demo_sh.sh index da35e8f..11dc72b 100755 --- a/tools/demo_sh.sh +++ b/tools/demo_sh.sh @@ -1,3 +1,6 @@ +#!/usr/bin/env bash +set -e + # @describe Demonstrate how to create a tool using Bash and how to use comment tags. # @option --string! Define a required string property # @option --string-enum![foo|bar] Define a required string property with enum @@ -9,8 +12,17 @@ # @option --array-optional* Define a optional string array property main() { - ( set -o posix ; set ) | grep ^argc_ - printenv | grep '^LLM_' + cat <<EOF >> "$LLM_OUTPUT" +string: ${argc_string} +string_enum: ${argc_string_enum} +string_optional: ${argc_string_optional} +boolean: ${argc_boolean} +integer: ${argc_integer} +number: ${argc_number} +array: ${argc_array[@]} +array_optional: ${argc_array_optional[@]} +$(printenv | grep '^LLM_') +EOF } -eval "$(argc --argc-eval "$0" "$@")"
\ No newline at end of file +eval "$(argc --argc-eval "$0" "$@")" |
