Skip to content

Commit

Permalink
Add spec changes
Browse files Browse the repository at this point in the history
Co-authored-by: Lucas Fayoux <[email protected]>
  • Loading branch information
platform-endpoints and lfayoux committed Sep 17, 2024
1 parent 2b57b69 commit 50cdcd8
Show file tree
Hide file tree
Showing 5 changed files with 191 additions and 132 deletions.
235 changes: 145 additions & 90 deletions cohere-openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5953,6 +5953,14 @@ paths:
A list of available tools (functions) that the model may suggest invoking before producing a text response.

When `tools` is passed (without `tool_results`), the `text` content in the response will be empty and the `tool_calls` field in the response will be populated with a list of tool calls that need to be made. If no calls need to be made, the `tool_calls` array will be empty.
documents:
type: array
items:
oneOf:
- type: string
- $ref: "#/components/schemas/Document"
description: |
A list of relevant documents that the model can cite to generate a more accurate reply. Each document is either a string or document object with content and metadata.
citation_mode:
type: string
enum:
Expand Down Expand Up @@ -6230,11 +6238,11 @@ paths:
(async () => {
const response = await cohere.chat({
model: 'command-r-plus',
documents: [{ id: '1', data: 'Cohere is the best!' }],
messages: [
{
role: 'user',
content: [{ type: 'text', text: "Who's the best?" }],
documents: [{ id: '1', text: 'Cohere is the best!' }],
},
],
});
Expand All @@ -6252,11 +6260,11 @@ paths:

response = co.chat(
model="command-r-plus",
documents=[{'id': '1', 'data': {'text': 'Cohere is the best!', 'title': 'The best'}}],
messages=[
{
"role": "user",
"content": "Who's the best?",
"documents": [{'id': '1', 'title': 'The best', 'text': 'Cohere is the best!'}]
"content": "Who's the best?"
}
]
)
Expand All @@ -6265,95 +6273,99 @@ paths:
print(response)
request:
model: "command-r"
messages:
- role: "user"
content: "Who is more popular: Nsync or Backstreet Boys?"
documents:
- title: "CSPC: Backstreet Boys Popularity Analysis - ChartMasters"
snippet: >-
↓ Skip to Main Content
documents:
- data:
content: "CSPC: Backstreet Boys Popularity Analysis - ChartMasters"
snippet: >-
↓ Skip to Main Content


Music industry – One step closer to being accurate
Music industry – One step closer to being accurate


CSPC: Backstreet Boys Popularity Analysis
CSPC: Backstreet Boys Popularity Analysis


Hernán Lopez Posted on February 9, 2017 Posted in CSPC 72
Comments Tagged with Backstreet Boys, Boy band
Hernán Lopez Posted on February 9, 2017 Posted in CSPC 72
Comments Tagged with Backstreet Boys, Boy band


At one point, Backstreet Boys defined success: massive
albums sales across the globe, great singles sales, plenty
of chart topping releases, hugely hyped tours and
tremendous media coverage.
At one point, Backstreet Boys defined success: massive
albums sales across the globe, great singles sales, plenty
of chart topping releases, hugely hyped tours and tremendous
media coverage.


It is true that they benefited from extraordinarily good
market conditions in all markets. After all, the all-time
record year for the music business, as far as revenues in
billion dollars are concerned, was actually 1999. That is,
back when this five men group was at its peak.
- title: "CSPC: NSYNC Popularity Analysis - ChartMasters"
snippet: >-
↓ Skip to Main Content
It is true that they benefited from extraordinarily good
market conditions in all markets. After all, the all-time
record year for the music business, as far as revenues in
billion dollars are concerned, was actually 1999. That is,
back when this five men group was at its peak.
- data:
content: "CSPC: NSYNC Popularity Analysis - ChartMasters"
snippet: >-
↓ Skip to Main Content


Music industry – One step closer to being accurate
Music industry – One step closer to being accurate


CSPC: NSYNC Popularity Analysis
CSPC: NSYNC Popularity Analysis


MJD Posted on February 9, 2018 Posted in CSPC 27 Comments
Tagged with Boy band, N'Sync
MJD Posted on February 9, 2018 Posted in CSPC 27 Comments
Tagged with Boy band, N'Sync


At the turn of the millennium three teen acts were huge in
the US, the Backstreet Boys, Britney Spears and NSYNC. The
latter is the only one we haven’t study so far. It took 15
years and Adele to break their record of 2,4 million units
sold of No Strings Attached in its first week alone.
At the turn of the millennium three teen acts were huge in
the US, the Backstreet Boys, Britney Spears and NSYNC. The
latter is the only one we haven’t study so far. It took 15
years and Adele to break their record of 2,4 million units
sold of No Strings Attached in its first week alone.


It wasn’t a fluke, as the second fastest selling album of
the Soundscan era prior 2015, was also theirs since
Celebrity debuted with 1,88 million units sold.
- title: "CSPC: Backstreet Boys Popularity Analysis - ChartMasters"
snippet: >-
1997, 1998, 2000 and 2001 also rank amongst some of the
very best years.
It wasn’t a fluke, as the second fastest selling album of
the Soundscan era prior 2015, was also theirs since
Celebrity debuted with 1,88 million units sold.
- data:
content: "CSPC: Backstreet Boys Popularity Analysis - ChartMasters"
snippet: >-
1997, 1998, 2000 and 2001 also rank amongst some of the very
best years.

Yet the way many music consumers – especially teenagers
and young women’s – embraced their output deserves its own
chapter. If Jonas Brothers and more recently One Direction
reached a great level of popularity during the past
decade, the type of success achieved by Backstreet Boys is
in a completely different level as they really dominated
the business for a few years all over the world, including
in some countries that were traditionally hard to
penetrate for Western artists.
Yet the way many music consumers – especially teenagers and
young women’s – embraced their output deserves its own
chapter. If Jonas Brothers and more recently One Direction
reached a great level of popularity during the past decade,
the type of success achieved by Backstreet Boys is in a
completely different level as they really dominated the
business for a few years all over the world, including in
some countries that were traditionally hard to penetrate for
Western artists.


We will try to analyze the extent of that hegemony with
this new article with final results which will more than
surprise many readers.
- title: "CSPC: NSYNC Popularity Analysis - ChartMasters"
snippet: >-
Was the teen group led by Justin Timberlake really that
big? Was it only in the US where they found success? Or
were they a global phenomenon?

As usual, I’ll be using the Commensurate Sales to
Popularity Concept in order to relevantly gauge their
results. This concept will not only bring you sales
information for all NSYNC‘s albums, physical and download
singles, as well as audio and video streaming, but it will
also determine their true popularity. If you are not yet
familiar with the CSPC method, the next page explains it
with a short video. I fully recommend watching the video
before getting into the sales figures.
We will try to analyze the extent of that hegemony with this
new article with final results which will more than surprise
many readers.
- data:
content: "CSPC: NSYNC Popularity Analysis - ChartMasters"
snippet: >-
Was the teen group led by Justin Timberlake really that big?
Was it only in the US where they found success? Or were they
a global phenomenon?

As usual, I’ll be using the Commensurate Sales to Popularity
Concept in order to relevantly gauge their results. This
concept will not only bring you sales information for all
NSYNC‘s albums, physical and download singles, as well as
audio and video streaming, but it will also determine their
true popularity. If you are not yet familiar with the CSPC
method, the next page explains it with a short video. I
fully recommend watching the video before getting into the
sales figures.
messages:
- role: "user"
content: "Who is more popular: Nsync or Backstreet Boys?"
stream: false
response:
body:
Expand Down Expand Up @@ -6384,7 +6396,7 @@ paths:
text: extremely popular at the turn of the millennium.
sources:
- type: document
id: doc_1
id: doc:1
document:
snippet: >-
↓ Skip to Main Content
Expand Down Expand Up @@ -6418,7 +6430,7 @@ paths:
text: massive album sales across the globe
sources:
- type: document
id: doc_0
id: doc:0
document:
snippet: >-
↓ Skip to Main Content
Expand Down Expand Up @@ -6453,7 +6465,7 @@ paths:
text: great singles sales
sources:
- type: document
id: doc_0
id: doc:0
document:
snippet: >-
↓ Skip to Main Content
Expand Down Expand Up @@ -6488,7 +6500,7 @@ paths:
text: plenty of chart-topping releases
sources:
- type: document
id: doc_0
id: doc:0
document:
snippet: >-
↓ Skip to Main Content
Expand Down Expand Up @@ -6523,7 +6535,7 @@ paths:
text: hyped tours
sources:
- type: document
id: doc_0
id: doc:0
document:
snippet: >-
↓ Skip to Main Content
Expand Down Expand Up @@ -6558,7 +6570,7 @@ paths:
text: tremendous media coverage.
sources:
- type: document
id: doc_0
id: doc:0
document:
snippet: >-
↓ Skip to Main Content
Expand Down Expand Up @@ -6593,7 +6605,7 @@ paths:
text: album No Strings Attached selling 2.4 million units in its first week.
sources:
- type: document
id: doc_1
id: doc:1
document:
snippet: >-
↓ Skip to Main Content
Expand Down Expand Up @@ -6627,7 +6639,7 @@ paths:
text: second fastest-selling album of the Soundscan era before 2015
sources:
- type: document
id: doc_1
id: doc:1
document:
snippet: >-
↓ Skip to Main Content
Expand Down Expand Up @@ -6661,7 +6673,7 @@ paths:
text: Celebrity debuting at 1.88 million units sold.
sources:
- type: document
id: doc_1
id: doc:1
document:
snippet: >-
↓ Skip to Main Content
Expand Down Expand Up @@ -6696,7 +6708,7 @@ paths:
Western artists.
sources:
- type: document
id: doc_2
id: doc:2
document:
snippet: >-
1997, 1998, 2000 and 2001 also rank amongst some of
Expand Down Expand Up @@ -16646,12 +16658,6 @@ components:
- type: array
items:
$ref: "#/components/schemas/Content"
documents:
type: array
minItems: 0
description: Documents seen by the model when generating the reply.
items:
$ref: "#/components/schemas/ChatDocument"
ToolCall-2:
x-fern-sdk-group-name: v2
description: A array of tool calls to be made.
Expand Down Expand Up @@ -16775,6 +16781,53 @@ components:
propertyName: type
mapping:
text: "#/components/schemas/TextContent"
Document:
x-fern-sdk-group-name: v2
type: object
description: |
Relevant information that could be used by the model to generate a more accurate reply.
The content of each document are generally short (should be under 300 words). Metadata should be used to provide additional information, both the key name and the value will be
passed to the model.
properties:
data:
type: object
x-fern-type: map<string, string>
additionalProperties:
type: string
description: |
A relevant documents that the model can cite to generate a more accurate reply. Each document is a string-string dictionary.
id:
type: string
description: Unique identifier for this document which will be referenced in
citations. If not provided an ID will be automatically generated
required:
- data
DocumentContent:
x-fern-sdk-group-name: v2
type: object
description: Document content.
required:
- type
- document
properties:
type:
type: string
enum:
- document
document:
$ref: "#/components/schemas/Document"
ToolContent:
x-fern-sdk-group-name: v2
description: A content block which contains information about the content of a
tool result
oneOf:
- $ref: "#/components/schemas/TextContent"
- $ref: "#/components/schemas/DocumentContent"
discriminator:
propertyName: type
mapping:
text: "#/components/schemas/TextContent"
document: "#/components/schemas/DocumentContent"
ToolMessage-2:
x-fern-sdk-group-name: v2
type: object
Expand All @@ -16793,11 +16846,13 @@ components:
description: The id of the associated tool call that has provided the given
content
tool_content:
type: array
description: A list of outputs from a tool. The content should formatted as a
JSON object string
items:
type: string
description: A single or list of outputs from a tool. The content should
formatted as a JSON object string, or a list of tool content blocks
oneOf:
- type: string
- type: array
items:
$ref: "#/components/schemas/ToolContent"
ChatMessage-2:
x-fern-sdk-group-name: v2
description: Represents a single message in the chat history from a given role.
Expand Down
2 changes: 1 addition & 1 deletion snippets/snippets/node/chat-v2-post/documents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ const cohere = new CohereClientV2({
(async () => {
const response = await cohere.chat({
model: 'command-r-plus',
documents: [{ id: '1', data: 'Cohere is the best!' }],
messages: [
{
role: 'user',
content: [{ type: 'text', text: "Who's the best?" }],
documents: [{ id: '1', text: 'Cohere is the best!' }],
},
],
});
Expand Down
Loading

0 comments on commit 50cdcd8

Please sign in to comment.