Skip to content

Commit

Permalink
Merge branch 'main' into tools-upd
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmer1 authored Oct 8, 2024
2 parents 9f6874d + 884a5dc commit ad5a748
Show file tree
Hide file tree
Showing 62 changed files with 1,846 additions and 188 deletions.
93 changes: 49 additions & 44 deletions cohere-openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4550,7 +4550,7 @@ paths:


response = co.chat(
model="command-r-plus",
model="command-r-plus-08-2024",
message="Who is more popular: Nsync or Backstreet Boys?",
documents=[
{
Expand Down Expand Up @@ -6077,7 +6077,7 @@ paths:

(async () => {
const response = await cohere.chat({
model: 'command-r-plus',
model: 'command-r-plus-08-2024',
messages: [
{
role: 'user',
Expand All @@ -6096,7 +6096,7 @@ paths:
co = cohere.ClientV2("<<apiKey>>")

response = co.chat(
model="command-r-plus",
model="command-r-plus-08-2024",
messages=[
{
"role": "user",
Expand All @@ -6117,7 +6117,7 @@ paths:

async def main():
response = await co.chat(
model="command-r-plus",
model="command-r-plus-08-2024",
messages=[
cohere.v2.ChatMessage2_User(
content="hello world!"
Expand All @@ -6136,14 +6136,15 @@ paths:
package chatv2post;


import java.util.List;


import com.cohere.api.Cohere;

import com.cohere.api.resources.v2.requests.V2ChatRequest;

import com.cohere.api.types.*;

import java.util.List;


public class Default {
public static void main(String[] args) {
Expand All @@ -6154,7 +6155,7 @@ paths:
.v2()
.chat(
V2ChatRequest.builder()
.model("command-r-plus")
.model("command-r-plus-08-2024")
.messages(
List.of(
ChatMessageV2.user(
Expand Down Expand Up @@ -6185,12 +6186,12 @@ paths:
name: Default
code: |-
curl --request POST \
--url https://api.cohere.com/v1/chat \
--url https://api.cohere.com/v2/chat \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header "Authorization: bearer $CO_API_KEY" \
--data '{
"model": "command-r-plus",
"model": "command-r-plus-08-2024",
"messages": [
{
"role": "user",
Expand Down Expand Up @@ -6292,7 +6293,7 @@ paths:

(async () => {
const response = await cohere.chat({
model: 'command-r-plus',
model: 'command-r-plus-08-2024',
documents: [{ id: '1', data: 'Cohere is the best!' }],
messages: [
{
Expand All @@ -6314,7 +6315,7 @@ paths:


response = co.chat(
model="command-r-plus",
model="command-r-plus-08-2024",
documents=[{'id': '1', 'data': {'text': 'Cohere is the best!', 'title': 'The best'}}],
messages=[
{
Expand All @@ -6334,6 +6335,9 @@ paths:
package chatv2post;


import java.util.List;


import com.cohere.api.Cohere;

import com.cohere.api.resources.v2.requests.V2ChatRequest;
Expand All @@ -6343,8 +6347,6 @@ paths:

import com.cohere.api.types.*;

import java.util.List;


public class Documents {
public static void main(String[] args) {
Expand All @@ -6355,7 +6357,7 @@ paths:
.v2()
.chat(
V2ChatRequest.builder()
.model("command-r-plus")
.model("command-r-plus-08-2024")
.messages(
List.of(
ChatMessageV2.user(
Expand Down Expand Up @@ -6492,12 +6494,12 @@ paths:
name: Documents
code: |-
curl --request POST \
--url https://api.cohere.com/v1/chat \
--url https://api.cohere.com/v2/chat \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header "Authorization: bearer $CO_API_KEY" \
--data '{
"model": "command-r-plus",
"model": "command-r-plus-08-2024",
"documents": [
{
"id": "1",
Expand Down Expand Up @@ -6995,7 +6997,7 @@ paths:

(async () => {
const stream = await cohere.chatStream({
model: 'command-r-plus',
model: 'command-r-plus-08-2024',
messages: [
{
role: 'user',
Expand All @@ -7018,7 +7020,7 @@ paths:
co = cohere.ClientV2("<<apiKey>>")

response = co.chat_stream(
model="command-r-plus",
model="command-r-plus-08-2024",
messages=[
{
"role": "user",
Expand All @@ -7038,14 +7040,15 @@ paths:
package chatv2post;


import java.util.List;


import com.cohere.api.Cohere;

import com.cohere.api.resources.v2.requests.V2ChatStreamRequest;

import com.cohere.api.types.*;

import java.util.List;


public class Stream {
public static void main(String[] args) {
Expand All @@ -7056,7 +7059,7 @@ paths:
.v2()
.chatStream(
V2ChatStreamRequest.builder()
.model("command-r-plus")
.model("command-r-plus-08-2024")
.messages(
List.of(
ChatMessageV2.user(
Expand Down Expand Up @@ -7100,13 +7103,13 @@ paths:
name: Streaming
code: |-
curl --request POST \
--url https://api.cohere.com/v1/chat \
--url https://api.cohere.com/v2/chat \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header "Authorization: bearer $CO_API_KEY" \
--data '{
"stream": true,
"model": "command-r-plus",
"model": "command-r-plus-08-2024",
"messages": [
{
"role": "user",
Expand Down Expand Up @@ -7246,7 +7249,7 @@ paths:

(async () => {
const response = await cohere.chat({
model: 'command-r-plus',
model: 'command-r-plus-08-2024',
tools: [
{
type: 'function',
Expand Down Expand Up @@ -7300,7 +7303,7 @@ paths:


response = co.chat(
model="command-r-plus",
model="command-r-plus-08-2024",
tools=[
cohere.ToolV2(type='function', function={
"name": 'query_daily_sales_report',
Expand Down Expand Up @@ -7343,16 +7346,17 @@ paths:
package chatv2post;


import java.util.List;

import java.util.Map;


import com.cohere.api.Cohere;

import com.cohere.api.resources.v2.requests.V2ChatRequest;

import com.cohere.api.types.*;

import java.util.List;

import java.util.Map;


public class Tools {
public static void main(String[] args) {
Expand All @@ -7363,7 +7367,7 @@ paths:
.v2()
.chat(
V2ChatRequest.builder()
.model("command-r-plus")
.model("command-r-plus-08-2024")
.tools(
List.of(
ToolV2.builder()
Expand Down Expand Up @@ -7448,12 +7452,12 @@ paths:
name: Tools
code: >
curl --request POST \
--url https://api.cohere.com/v1/chat \
--url https://api.cohere.com/v2/chat \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header "Authorization: bearer $CO_API_KEY" \
--data '{
"model": "command-r-plus",
"model": "command-r-plus-08-2024",
"tools": [
{
"type": "function",
Expand Down Expand Up @@ -10470,7 +10474,7 @@ paths:
name: cURL
code: |-
curl --request POST \
--url https://api.cohere.com/v1/embed \
--url https://api.cohere.com/v2/embed \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header "Authorization: bearer $CO_API_KEY" \
Expand Down Expand Up @@ -14085,7 +14089,7 @@ paths:
name: cURL
code: >-
curl --request POST \
--url https://api.cohere.com/v1/rerank \
--url https://api.cohere.com/v2/rerank \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header "Authorization: bearer $CO_API_KEY" \
Expand Down Expand Up @@ -16078,7 +16082,7 @@ paths:


response = co.tokenize(text="tokenize me! :D",
model="command-r-plus") # optional
model="command-r-plus-08-2024") # optional

print(response)
- sdk: python
Expand All @@ -16094,7 +16098,7 @@ paths:


async def main():
response = await co.tokenize(text="tokenize me! :D", model="command-r-plus")
response = await co.tokenize(text="tokenize me! :D", model="command-r-plus-08-2024")
print(response)

asyncio.run(main())
Expand All @@ -16116,7 +16120,7 @@ paths:

TokenizeResponse response =
cohere.tokenize(
TokenizeRequest.builder().text("tokenize me").model("command-r-plus").build());
TokenizeRequest.builder().text("tokenize me").model("command-r-plus-08-2024").build());

System.out.println(response);
}
Expand All @@ -16141,7 +16145,7 @@ paths:
--header 'content-type: application/json' \
--header "Authorization: bearer $CO_API_KEY" \
--data '{
"model": "command-r-plus",
"model": "command-r-plus-08-2024",
"text": "tokenize me! :D"
}'
request:
Expand Down Expand Up @@ -16353,7 +16357,7 @@ paths:


response = co.detokenize(
tokens=[8466, 5169, 2594, 8, 2792, 43], model="command-r-plus" # optional
tokens=[8466, 5169, 2594, 8, 2792, 43], model="command-r-plus-08-2024" # optional
)

print(response)
Expand All @@ -16371,7 +16375,7 @@ paths:

async def main():
response = await co.detokenize(
tokens=[8466, 5169, 2594, 8, 2792, 43], model="command-r-plus" # optional
tokens=[8466, 5169, 2594, 8, 2792, 43], model="command-r-plus-08-2024" # optional
)
print(response)

Expand All @@ -16381,14 +16385,15 @@ paths:
code: >
/* (C)2024 */

import java.util.List;


import com.cohere.api.Cohere;

import com.cohere.api.requests.DetokenizeRequest;

import com.cohere.api.types.DetokenizeResponse;

import java.util.List;


public class DetokenizePost {
public static void main(String[] args) {
Expand All @@ -16397,7 +16402,7 @@ paths:
DetokenizeResponse response =
cohere.detokenize(
DetokenizeRequest.builder()
.model("command-r-plus")
.model("command-r-plus-08-2024")
.tokens(List.of(8466, 5169, 2594, 8, 2792, 43))
.build());

Expand All @@ -16413,7 +16418,7 @@ paths:
--header 'content-type: application/json' \
--header "Authorization: bearer $CO_API_KEY" \
--data '{
"model": "command-r-plus",
"model": "command-r-plus-08-2024",
"tokens": [8466, 5169, 2594, 8, 2792, 43]
}'
request:
Expand Down
Binary file added fern/assets/images/7026fcc-komal-headshot.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fern/assets/images/929cb1c-youran-headshot.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fern/assets/images/d514b09-mike-headshot.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion fern/fern.config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"organization": "cohere",
"version": "*"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ description: >-
Cohere's multilingual model now supports semantic search across 100 languages
with a single index.
---
**[NOTE: `co.detect_language()` is deprecated.]**

Cohere's multilingual text understanding model is now available! The `multilingual-22-12` model can be used to semantically search within a single language, as well as across languages. Compared to keyword search, where you often need separate tokenizers and indices to handle different languages, the deployment of the multilingual model for search is trivial: no language-specific handling is needed — everything can be done by a single model within a single index.


Expand Down
Loading

0 comments on commit ad5a748

Please sign in to comment.