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) --- tools/demo_sh.sh | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'tools/demo_sh.sh') 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 <> "$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" "$@")" -- cgit v1.2.3