Skip to content

Commit

Permalink
Add Cohere.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmurdza authored Dec 14, 2023
1 parent 7fa113f commit 1ef25cc
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,42 @@ curl "https://api.anthropic.com/v1/complete" \
}'
```

## Cohere

🔑 Get API key [here](https://dashboard.cohere.com/api-keys).

### Chat
```bash
curl "https://api.cohere.ai/v1/chat" \
-H 'accept: application/json' \
-H 'content-type: application/json' \
-H "Authorization: Bearer $COHERE_API_KEY" \
-d '{
"chat_history": [
{"role": "USER", "message": "Who discovered gravity?"},
{"role": "CHATBOT", "message": "The man who is widely credited with discovering gravity is Sir Isaac Newton"}
],
"message": "What year was he born?",
"connectors": [{"id": "web-search"}]
}'
```

### Embeddings
```bash
curl "https://api.cohere.ai/v1/embed" \
-H 'accept: application/json' \
-H "Authorization: Bearer $COHERE_API_KEY" \
-H 'content-type: application/json' \
-H "Authorization: Bearer $COHERE_API_KEY" \
-d '{
"texts": [
"hello",
"goodbye"
],
"truncate": "END"
}'
```

## Mistral

🔑 Get API key [here](https://console.mistral.ai/users/api-keys/).
Expand Down

0 comments on commit 1ef25cc

Please sign in to comment.