From b164a1587deff738d04a75665bdb863d82b3264c Mon Sep 17 00:00:00 2001 From: sigoden Date: Fri, 6 Dec 2024 18:14:43 +0800 Subject: feat: update cohere api to v2 (#1041) --- Argcfile.sh | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'Argcfile.sh') diff --git a/Argcfile.sh b/Argcfile.sh index c192232..c9fb34a 100755 --- a/Argcfile.sh +++ b/Argcfile.sh @@ -250,7 +250,7 @@ chat-claude() { # @flag -S --no-stream # @arg text~ chat-cohere() { - _wrapper curl -i https://api.cohere.ai/v1/chat \ + _wrapper curl -i https://api.cohere.ai/v2/chat \ -X POST \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $COHERE_API_KEY" \ @@ -398,7 +398,7 @@ _build_body() { else shift case "$kind" in - openai) + openai|cohere) echo '{ "model": "'$argc_model'", "messages": [ @@ -408,13 +408,6 @@ _build_body() { } ], "stream": '$stream' -}' - ;; - cohere) - echo '{ - "model": "'$argc_model'", - "message": "'"$*"'", - "stream": '$stream' }' ;; claude) -- cgit v1.2.3