public static class CohereChatResponse.Builder extends Object
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
CohereChatResponse |
build() |
CohereChatResponse.Builder |
chatHistory(List<CohereMessage> chatHistory)
The list of previous messages between the user and the model.
|
CohereChatResponse.Builder |
citations(List<Citation> citations)
Inline citations for the generated response.
|
CohereChatResponse.Builder |
copy(CohereChatResponse model) |
CohereChatResponse.Builder |
documents(List<Object> documents)
The documents that the model can refer to when generating a response.
|
CohereChatResponse.Builder |
errorMessage(String errorMessage)
If there is an error during the streaming scenario, then the
errorMessage
parameter contains details for the error. |
CohereChatResponse.Builder |
finishReason(CohereChatResponse.FinishReason finishReason)
Why the generation stopped.
|
CohereChatResponse.Builder |
isSearchRequired(Boolean isSearchRequired)
If set to true, a search for documents is required.
|
CohereChatResponse.Builder |
prompt(String prompt)
The full prompt that was sent to the model if isEcho is true when request.
|
CohereChatResponse.Builder |
searchQueries(List<SearchQuery> searchQueries)
The generated search queries.
|
CohereChatResponse.Builder |
text(String text)
Contents of the response that the model generates.
|
CohereChatResponse.Builder |
toolCalls(List<CohereToolCall> toolCalls)
A list of tool calls generated by the model.
|
public CohereChatResponse.Builder text(String text)
Contents of the response that the model generates.
text
- the value to setpublic CohereChatResponse.Builder chatHistory(List<CohereMessage> chatHistory)
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.
chatHistory
- the value to setpublic CohereChatResponse.Builder citations(List<Citation> citations)
Inline citations for the generated response.
citations
- the value to setpublic CohereChatResponse.Builder isSearchRequired(Boolean isSearchRequired)
If set to true, a search for documents is required.
isSearchRequired
- the value to setpublic CohereChatResponse.Builder finishReason(CohereChatResponse.FinishReason finishReason)
Why the generation stopped.
finishReason
- the value to setpublic CohereChatResponse.Builder errorMessage(String errorMessage)
If there is an error during the streaming scenario, then the errorMessage
parameter contains details for the error.
errorMessage
- the value to setpublic CohereChatResponse.Builder searchQueries(List<SearchQuery> searchQueries)
The generated search queries.
searchQueries
- the value to setpublic CohereChatResponse.Builder documents(List<Object> documents)
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" } ]'
documents
- the value to setpublic CohereChatResponse.Builder toolCalls(List<CohereToolCall> toolCalls)
A list of tool calls generated by the model.
toolCalls
- the value to setpublic CohereChatResponse.Builder prompt(String prompt)
The full prompt that was sent to the model if isEcho is true when request.
prompt
- the value to setpublic CohereChatResponse build()
public CohereChatResponse.Builder copy(CohereChatResponse model)
Copyright © 2016–2024. All rights reserved.