Skip to content

Commit

Permalink
feat: update cohere api to v2 (#1041)
Browse files Browse the repository at this point in the history
  • Loading branch information
sigoden authored Dec 6, 2024
1 parent 5f7edc0 commit b164a15
Show file tree
Hide file tree
Showing 4 changed files with 113 additions and 189 deletions.
11 changes: 2 additions & 9 deletions Argcfile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Expand Down Expand Up @@ -398,7 +398,7 @@ _build_body() {
else
shift
case "$kind" in
openai)
openai|cohere)
echo '{
"model": "'$argc_model'",
"messages": [
Expand All @@ -408,13 +408,6 @@ _build_body() {
}
],
"stream": '$stream'
}'
;;
cohere)
echo '{
"model": "'$argc_model'",
"message": "'"$*"'",
"stream": '$stream'
}'
;;
claude)
Expand Down
2 changes: 1 addition & 1 deletion config.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ clients:

# See https://docs.cohere.com/docs/the-cohere-platform
- type: cohere
api_base: https://api.cohere.ai/v1 # Optional
api_base: https://api.cohere.ai/v2 # Optional
api_key: xxx

# See https://docs.perplexity.ai/docs/getting-started
Expand Down
15 changes: 15 additions & 0 deletions models.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -283,12 +283,27 @@
max_tokens_per_chunk: 512
default_chunk_size: 1000
max_batch_size: 96
- name: embed-english-light-v3.0
type: embedding
input_price: 0.1
max_tokens_per_chunk: 512
default_chunk_size: 700
max_batch_size: 96
- name: embed-multilingual-v3.0
type: embedding
input_price: 0.1
max_tokens_per_chunk: 512
default_chunk_size: 1000
max_batch_size: 96
- name: embed-multilingual-light-v3.0
type: embedding
input_price: 0.1
max_tokens_per_chunk: 512
default_chunk_size: 700
max_batch_size: 96
- name: rerank-v3.5
type: reranker
max_input_tokens: 4096
- name: rerank-english-v3.0
type: reranker
max_input_tokens: 4096
Expand Down
Loading

0 comments on commit b164a15

Please sign in to comment.