Class CohereChatResponse
- java.lang.Object
-
- com.oracle.bmc.http.client.internal.ExplicitlySetBmcModel
-
- com.oracle.bmc.generativeaiinference.model.BaseChatResponse
-
- com.oracle.bmc.generativeaiinference.model.CohereChatResponse
-
@Generated(value="OracleSDKGenerator", comments="API Version: 20231130") public final class CohereChatResponse extends BaseChatResponse
The response to the chat conversation.
Note: Objects should always be created or deserialized using theCohereChatResponse.Builder
. This model distinguishes fields that are null because they are unset from fields that are explicitly set to null. This is done in the setter methods of theCohereChatResponse.Builder
, which maintain a set of all explicitly set fields calledCohereChatResponse.Builder.__explicitlySet__
. ThehashCode()
andequals(Object)
methods are implemented to take the explicitly set fields into account. The constructor, on the other hand, does not take the explicitly set fields into account (since the constructor cannot distinguish explicit null from unset null).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CohereChatResponse.Builder
static class
CohereChatResponse.FinishReason
Why the generation stopped.-
Nested classes/interfaces inherited from class com.oracle.bmc.generativeaiinference.model.BaseChatResponse
BaseChatResponse.ApiFormat
-
-
Constructor Summary
Constructors Constructor Description CohereChatResponse(String text, List<CohereMessage> chatHistory, List<Citation> citations, Boolean isSearchRequired, CohereChatResponse.FinishReason finishReason, String errorMessage, List<SearchQuery> searchQueries, List<Object> documents, List<CohereToolCall> toolCalls, String prompt)
Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CohereChatResponse.Builder
builder()
Create a new builder.boolean
equals(Object o)
List<CohereMessage>
getChatHistory()
The list of previous messages between the user and the model.List<Citation>
getCitations()
Inline citations for the generated response.List<Object>
getDocuments()
The documents that the model can refer to when generating a response.String
getErrorMessage()
If there is an error during the streaming scenario, then the errorMessage parameter contains details for the error.CohereChatResponse.FinishReason
getFinishReason()
Why the generation stopped.Boolean
getIsSearchRequired()
If set to true, a search for documents is required.String
getPrompt()
The full prompt that was sent to the model if isEcho is true when request.List<SearchQuery>
getSearchQueries()
The generated search queries.String
getText()
Contents of the response that the model generates.List<CohereToolCall>
getToolCalls()
A list of tool calls generated by the model.int
hashCode()
CohereChatResponse.Builder
toBuilder()
String
toString()
String
toString(boolean includeByteArrayContents)
Return a string representation of the object.
-
-
-
Constructor Detail
-
CohereChatResponse
@Deprecated public CohereChatResponse(String text, List<CohereMessage> chatHistory, List<Citation> citations, Boolean isSearchRequired, CohereChatResponse.FinishReason finishReason, String errorMessage, List<SearchQuery> searchQueries, List<Object> documents, List<CohereToolCall> toolCalls, String prompt)
Deprecated.
-
-
Method Detail
-
builder
public static CohereChatResponse.Builder builder()
Create a new builder.
-
toBuilder
public CohereChatResponse.Builder toBuilder()
-
getText
public String getText()
Contents of the response that the model generates.- Returns:
- the value
-
getChatHistory
public List<CohereMessage> getChatHistory()
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.
- Returns:
- the value
-
getCitations
public List<Citation> getCitations()
Inline citations for the generated response.- Returns:
- the value
-
getIsSearchRequired
public Boolean getIsSearchRequired()
If set to true, a search for documents is required.- Returns:
- the value
-
getFinishReason
public CohereChatResponse.FinishReason getFinishReason()
Why the generation stopped.- Returns:
- the value
-
getErrorMessage
public String getErrorMessage()
If there is an error during the streaming scenario, then the errorMessage parameter contains details for the error.- Returns:
- the value
-
getSearchQueries
public List<SearchQuery> getSearchQueries()
The generated search queries.- Returns:
- the value
-
getDocuments
public List<Object> getDocuments()
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" } ]'
- Returns:
- the value
-
getToolCalls
public List<CohereToolCall> getToolCalls()
A list of tool calls generated by the model.- Returns:
- the value
-
getPrompt
public String getPrompt()
The full prompt that was sent to the model if isEcho is true when request.- Returns:
- the value
-
toString
public String toString()
- Overrides:
toString
in classBaseChatResponse
-
toString
public String toString(boolean includeByteArrayContents)
Return a string representation of the object.- Overrides:
toString
in classBaseChatResponse
- Parameters:
includeByteArrayContents
- true to include the full contents of byte arrays- Returns:
- string representation
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classBaseChatResponse
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classBaseChatResponse
-
-