Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2 final #151

Merged
merged 18 commits into from
Sep 26, 2024
Merged

V2 final #151

merged 18 commits into from
Sep 26, 2024

Conversation

billytrend-cohere
Copy link
Collaborator

@billytrend-cohere billytrend-cohere commented Sep 26, 2024

This PR introduces a new version of the Cohere API, v2, which includes improvements to the Chat, Classify, Embed, and Rerank APIs. It also introduces a new SDK, cohere.ClientV2.

Changes

  • The model parameter is now required for Embed, Rerank, Classify, and Chat.
  • The embedding_types parameter is now required for Embed.
  • The messages parameter now consists of a list of roles (system, user, assistant, or tool). The system role in v2 replaces the preamble parameter in v1.
  • Chat history is now managed via the messages list.
  • Response content is now accessed via message.content[0].text.
  • The seed and temperature parameters of the Chat API can be used to control the predictability of the model's output.
  • The system role in the messages parameter can be used to provide instructions for the model.
  • The documents parameter now supports a few different options for structuring documents: a list of objects with data object, a list of objects with data string, or a list of strings.
  • The message.citations parameter is now used to access citations.
  • Cited documents are now accessed as part of message.citations, in the sources field.
  • The search_queries_only parameter is now supported via tools.
  • The connectors parameter is now supported via user-defined tools.
  • The web-search connector in the connectors parameter is now supported via tools.
  • The conversation_id parameter is no longer supported (chat history is now managed by the developer via the messages parameter).
  • The search_queries_only, connectors, and prompt_truncation parameters are no longer supported.
  • The force_single_step parameter is no longer supported (all tool calls are now multi-step by default).
  • The tool_call_id parameter is now used to emit tool call IDs.
  • Tool execution is now handled by appending tool_call_id and tool_content to messages to the chat history.
  • User message is now set as empty ("") by default.
  • The citations parameter is now used to access citations.
  • Cited tools are now accessed as part of message.citations, in the sources field.
  • The citation_quality parameter is now controlled via the citation_options parameter (with mode as a key).
  • The following v1 features are not supported in v2: general chat, RAG, tool use, and unsupported features in v2.

billytrend-cohere and others added 3 commits September 26, 2024 04:45
* V2 specs

* v2

* v2

* Update v2.yml

Signed-off-by: billytrend-cohere <[email protected]>

---------

Signed-off-by: billytrend-cohere <[email protected]>
* release notes for API v2

* Rename 2024-09-18-api-v2 to 2024-09-18-api-v2.mdx

Signed-off-by: billytrend-cohere <[email protected]>

* what's new details

---------

Signed-off-by: billytrend-cohere <[email protected]>
Co-authored-by: billytrend-cohere <[email protected]>
* add v2 docs - first batch

* add v2 docs

* update image paths

* temp remove param types docs

* misc updates

* add models section and update yml

* multi step tool use updates

* Update fern/pages/fine-tuning/chat-fine-tuning/chat-starting-the-training.mdx

Co-authored-by: Michael <[email protected]>
Signed-off-by: Meor Amer <[email protected]>

* Update fern/pages/fine-tuning/chat-fine-tuning/chat-starting-the-training.mdx

Co-authored-by: Michael <[email protected]>
Signed-off-by: Meor Amer <[email protected]>

* Update fern/pages/v2/models/the-command-family-of-models/command-r.mdx

Co-authored-by: Michael <[email protected]>
Signed-off-by: Meor Amer <[email protected]>

* Update fern/pages/v2/text-generation/chat-api.mdx

Co-authored-by: Michael <[email protected]>
Signed-off-by: Meor Amer <[email protected]>

* Update fern/pages/v2/text-generation/migrating-v1-to-v2.mdx

Co-authored-by: Michael <[email protected]>
Signed-off-by: Meor Amer <[email protected]>

* Update fern/pages/v2/text-generation/migrating-v1-to-v2.mdx

Co-authored-by: Michael <[email protected]>
Signed-off-by: Meor Amer <[email protected]>

* clean up migration guide

* update text gen docs

* update command model to latest

* add tool use param types docs

* ft updates

* update tool content to accept string

* update agent getting started nb

* safety mode

* update fern

* upd search query gen and web search for v2

* change RAG documents to top level param

* remove gen->chat migration, misc updates

* embedding types required

* update rag query generation

* chg term - preamble to system message

* update client to use v2 for misc endpoints

* multi step updates

* update getting started tutorials

* update migration guide title

* update migration guide

* Update preview-docs.yml (#143)

Signed-off-by: billytrend-cohere <[email protected]>

* update chat

* Revert "Update preview-docs.yml (#143)" (#144)

This reverts commit abfd2bd.

* update links

* Apply suggestions from code review

Co-authored-by: Michael <[email protected]>
Signed-off-by: Meor Amer <[email protected]>

* Apply suggestions from code review

Co-authored-by: Michael <[email protected]>
Signed-off-by: Meor Amer <[email protected]>

* chat api updates

* update web search and search query gen migration guide

* fix formatting

* search query gen upd

* add 2 missing pages

* v2 slug change

* Apply suggestions from code review

Co-authored-by: Michael <[email protected]>
Signed-off-by: Meor Amer <[email protected]>

* migration guide - simplify chat history

* update links to point to v2

* update RAG responses

* update streaming docs

* update deployment options and misc

* deployment options edits

* v1 usage notes

* fix formatting

* update meta desc

* update meta desc

* updates on tool use structure and migration guide, + misc

* make v2 default

* fix links

---------

Signed-off-by: Michael <[email protected]>
Signed-off-by: Meor Amer <[email protected]>
Signed-off-by: billytrend-cohere <[email protected]>
Co-authored-by: Michael <[email protected]>
Co-authored-by: billytrend-cohere <[email protected]>
Signed-off-by: billytrend-cohere <[email protected]>
Copy link

Copy link

Copy link

Copy link

Signed-off-by: Michael <[email protected]>
Copy link

Copy link

Copy link

@billytrend-cohere billytrend-cohere enabled auto-merge (squash) September 26, 2024 14:13
billytrend-cohere and others added 8 commits September 26, 2024 09:13
…re.mdx

Co-authored-by: Meor Amer <[email protected]>
Signed-off-by: billytrend-cohere <[email protected]>
…re.mdx

Co-authored-by: Meor Amer <[email protected]>
Signed-off-by: billytrend-cohere <[email protected]>
…ch-with-cohere.mdx

Co-authored-by: Meor Amer <[email protected]>
Signed-off-by: billytrend-cohere <[email protected]>
…ag.mdx

Co-authored-by: Meor Amer <[email protected]>
Signed-off-by: billytrend-cohere <[email protected]>
…ag.mdx

Co-authored-by: Meor Amer <[email protected]>
Signed-off-by: billytrend-cohere <[email protected]>
Co-authored-by: Meor Amer <[email protected]>
Signed-off-by: billytrend-cohere <[email protected]>
Co-authored-by: Meor Amer <[email protected]>
Signed-off-by: billytrend-cohere <[email protected]>
@billytrend-cohere billytrend-cohere merged commit 649fc60 into main Sep 26, 2024
2 checks passed
@billytrend-cohere billytrend-cohere deleted the v2-final branch September 26, 2024 14:15
Copy link

Copy link

Copy link

Copy link

Copy link

Copy link

Copy link

billytrend-cohere pushed a commit that referenced this pull request Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants