Class CohereChatResponse.Builder
- java.lang.Object
-
- com.oracle.bmc.generativeaiinference.model.CohereChatResponse.Builder
-
- Enclosing class:
- CohereChatResponse
public static class CohereChatResponse.Builder extends Object
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CohereChatResponsebuild()CohereChatResponse.BuilderchatHistory(List<CohereMessage> chatHistory)The list of previous messages between the user and the model.CohereChatResponse.Buildercitations(List<Citation> citations)Inline citations for the generated response.CohereChatResponse.Buildercopy(CohereChatResponse model)CohereChatResponse.Builderdocuments(List<Object> documents)The documents that the model can refer to when generating a response.CohereChatResponse.BuildererrorMessage(String errorMessage)If there is an error during the streaming scenario, then the errorMessage parameter contains details for the error.CohereChatResponse.BuilderfinishReason(CohereChatResponse.FinishReason finishReason)Why the generation stopped.CohereChatResponse.BuilderisSearchRequired(Boolean isSearchRequired)If set to true, a search for documents is required.CohereChatResponse.Builderprompt(String prompt)The full prompt that was sent to the model if isEcho is true when request.CohereChatResponse.BuildersearchQueries(List<SearchQuery> searchQueries)The generated search queries.CohereChatResponse.Buildertext(String text)Contents of the response that the model generates.CohereChatResponse.BuildertoolCalls(List<CohereToolCall> toolCalls)A list of tool calls generated by the model.CohereChatResponse.Builderusage(Usage usage)
-
-
-
Method Detail
-
text
public CohereChatResponse.Builder text(String text)
Contents of the response that the model generates.- Parameters:
text- the value to set- Returns:
- this builder
-
chatHistory
public 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.
- Parameters:
chatHistory- the value to set- Returns:
- this builder
-
citations
public CohereChatResponse.Builder citations(List<Citation> citations)
Inline citations for the generated response.- Parameters:
citations- the value to set- Returns:
- this builder
-
isSearchRequired
public CohereChatResponse.Builder isSearchRequired(Boolean isSearchRequired)
If set to true, a search for documents is required.- Parameters:
isSearchRequired- the value to set- Returns:
- this builder
-
finishReason
public CohereChatResponse.Builder finishReason(CohereChatResponse.FinishReason finishReason)
Why the generation stopped.- Parameters:
finishReason- the value to set- Returns:
- this builder
-
errorMessage
public CohereChatResponse.Builder errorMessage(String errorMessage)
If there is an error during the streaming scenario, then the errorMessage parameter contains details for the error.- Parameters:
errorMessage- the value to set- Returns:
- this builder
-
searchQueries
public CohereChatResponse.Builder searchQueries(List<SearchQuery> searchQueries)
The generated search queries.- Parameters:
searchQueries- the value to set- Returns:
- this builder
-
documents
public 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" } ]'
- Parameters:
documents- the value to set- Returns:
- this builder
-
toolCalls
public CohereChatResponse.Builder toolCalls(List<CohereToolCall> toolCalls)
A list of tool calls generated by the model.- Parameters:
toolCalls- the value to set- Returns:
- this builder
-
prompt
public CohereChatResponse.Builder prompt(String prompt)
The full prompt that was sent to the model if isEcho is true when request.- Parameters:
prompt- the value to set- Returns:
- this builder
-
usage
public CohereChatResponse.Builder usage(Usage usage)
-
build
public CohereChatResponse build()
-
copy
public CohereChatResponse.Builder copy(CohereChatResponse model)
-
-