summaryrefslogtreecommitdiffstats
path: root/Argcfile.sh
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2024-12-06 18:14:43 +0800
committerGitHub <noreply@github.com>2024-12-06 18:14:43 +0800
commitb164a1587deff738d04a75665bdb863d82b3264c (patch)
tree556e94d58e378246a736c638705abd84e9b40e81 /Argcfile.sh
parent5f7edc0ded187d86712639f3f7c48e6e4d72927b (diff)
downloadaichat-b164a1587deff738d04a75665bdb863d82b3264c.tar.gz
feat: update cohere api to v2 (#1041)
Diffstat (limited to 'Argcfile.sh')
-rwxr-xr-xArgcfile.sh11
1 files changed, 2 insertions, 9 deletions
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": [
@@ -410,13 +410,6 @@ _build_body() {
"stream": '$stream'
}'
;;
- cohere)
- echo '{
- "model": "'$argc_model'",
- "message": "'"$*"'",
- "stream": '$stream'
-}'
- ;;
claude)
echo '{
"model": "'$argc_model'",