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 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.
-
-
-
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
-
build
public CohereChatResponse build()
-
copy
public CohereChatResponse.Builder copy(CohereChatResponse model)
-
-