From 5458150ed3203cf13b0371efa2c791ac696cee93 Mon Sep 17 00:00:00 2001 From: sigoden Date: Thu, 23 May 2024 19:28:56 +0800 Subject: fix: json stream parser and refine client modules (#538) --- Argcfile.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'Argcfile.sh') diff --git a/Argcfile.sh b/Argcfile.sh index 88615f9..3b29cda 100755 --- a/Argcfile.sh +++ b/Argcfile.sh @@ -217,12 +217,7 @@ chat-cohere() { -X POST \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $COHERE_API_KEY" \ ---data '{ - "model": "'$argc_model'", - "message": "'"$*"'", - "stream": '$stream' -} -' +-d "$(_build_body cohere "$@")" } # @cmd List cohere models @@ -468,6 +463,13 @@ _build_body() { } ], "stream": '$stream' +}' + ;; + cohere) + echo '{ + "model": "'$argc_model'", + "message": "'"$*"'", + "stream": '$stream' }' ;; claude) -- cgit v1.2.3