Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace CohereChatResponse

The response to the chat conversation.

Properties

Const apiFormat

apiFormat: string = "COHERE"

Optional chatHistory

chatHistory: Array<CohereMessage>

The list of previous messages between the user and the model. The chat history gives the model context for responding to the user's inputs.

Optional citations

citations: Array<Citation>

Inline citations for the generated response.

Optional documents

documents: Array<any>

The documents that the model can refer to when generating a response. Each document is a JSON string that represents the field and values of the document.

Example: '[ { \"id\": \"doc_0\", \"snippet\": \"Emperor penguins are the tallest.\", \"title\": \"Tall penguins\" }, { \"id\": \"doc_1\", \"snippet\": \"Emperor penguins only live in Antarctica.\", \"title\": \"Penguin habitats\" } ]'

Optional errorMessage

errorMessage: undefined | string

If there is an error during the streaming scenario, then the {@code errorMessage} parameter contains details for the error.

finishReason

finishReason: FinishReason

Why the generation stopped.

Optional isSearchRequired

isSearchRequired: undefined | false | true

If set to true, a search for documents is required.

Optional prompt

prompt: undefined | string

The full prompt that was sent to the model if isEcho is true when request.

Optional searchQueries

searchQueries: Array<SearchQuery>

The generated search queries.

text

text: string

Contents of the response that the model generates.

Optional toolCalls

toolCalls: Array<CohereToolCall>

A list of tool calls generated by the model.

Methods

getDeserializedJsonObj

getJsonObj