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 BaseChatResponseThe 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 SummaryNested Classes Modifier and Type Class Description static classCohereChatResponse.Builderstatic classCohereChatResponse.FinishReasonWhy the generation stopped.- 
Nested classes/interfaces inherited from class com.oracle.bmc.generativeaiinference.model.BaseChatResponseBaseChatResponse.ApiFormat
 
- 
 - 
Constructor SummaryConstructors 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, Usage usage)Deprecated.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CohereChatResponse.Builderbuilder()Create a new builder.booleanequals(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.StringgetErrorMessage()If there is an error during the streaming scenario, then the errorMessage parameter contains details for the error.CohereChatResponse.FinishReasongetFinishReason()Why the generation stopped.BooleangetIsSearchRequired()If set to true, a search for documents is required.StringgetPrompt()The full prompt that was sent to the model if isEcho is true when request.List<SearchQuery>getSearchQueries()The generated search queries.StringgetText()Contents of the response that the model generates.List<CohereToolCall>getToolCalls()A list of tool calls generated by the model.UsagegetUsage()inthashCode()CohereChatResponse.BuildertoBuilder()StringtoString()StringtoString(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, Usage usage) Deprecated.
 
- 
 - 
Method Detail- 
builderpublic static CohereChatResponse.Builder builder() Create a new builder.
 - 
toBuilderpublic CohereChatResponse.Builder toBuilder() 
 - 
getTextpublic String getText() Contents of the response that the model generates.- Returns:
- the value
 
 - 
getChatHistorypublic 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
 
 - 
getCitationspublic List<Citation> getCitations() Inline citations for the generated response.- Returns:
- the value
 
 - 
getIsSearchRequiredpublic Boolean getIsSearchRequired() If set to true, a search for documents is required.- Returns:
- the value
 
 - 
getFinishReasonpublic CohereChatResponse.FinishReason getFinishReason() Why the generation stopped.- Returns:
- the value
 
 - 
getErrorMessagepublic String getErrorMessage() If there is an error during the streaming scenario, then the errorMessage parameter contains details for the error.- Returns:
- the value
 
 - 
getSearchQueriespublic List<SearchQuery> getSearchQueries() The generated search queries.- Returns:
- the value
 
 - 
getDocumentspublic 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
 
 - 
getToolCallspublic List<CohereToolCall> getToolCalls() A list of tool calls generated by the model.- Returns:
- the value
 
 - 
getPromptpublic String getPrompt() The full prompt that was sent to the model if isEcho is true when request.- Returns:
- the value
 
 - 
getUsagepublic Usage getUsage() 
 - 
toStringpublic String toString() - Overrides:
- toStringin class- BaseChatResponse
 
 - 
toStringpublic String toString(boolean includeByteArrayContents) Return a string representation of the object.- Overrides:
- toStringin class- BaseChatResponse
- Parameters:
- includeByteArrayContents- true to include the full contents of byte arrays
- Returns:
- string representation
 
 - 
equalspublic boolean equals(Object o) - Overrides:
- equalsin class- BaseChatResponse
 
 - 
hashCodepublic int hashCode() - Overrides:
- hashCodein class- BaseChatResponse
 
 
- 
 
-