@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 the CohereChatResponse.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 the CohereChatResponse.Builder
, which maintain a
set of all explicitly set fields called CohereChatResponse.Builder.__explicitlySet__
. The hashCode()
and equals(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
).
Modifier and Type | Class and Description |
---|---|
static class |
CohereChatResponse.Builder |
static class |
CohereChatResponse.FinishReason
Why the generation stopped.
|
BaseChatResponse.ApiFormat
EXPLICITLY_SET_FILTER_NAME, EXPLICITLY_SET_PROPERTY_NAME
Constructor and 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.
|
Modifier and Type | Method and 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.
|
markPropertyAsExplicitlySet, wasPropertyExplicitlySet
@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)
public static CohereChatResponse.Builder builder()
Create a new builder.
public CohereChatResponse.Builder toBuilder()
public String getText()
Contents of the response that the model generates.
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.
public List<Citation> getCitations()
Inline citations for the generated response.
public Boolean getIsSearchRequired()
If set to true, a search for documents is required.
public CohereChatResponse.FinishReason getFinishReason()
Why the generation stopped.
public String getErrorMessage()
If there is an error during the streaming scenario, then the errorMessage
parameter
contains details for the error.
public List<SearchQuery> getSearchQueries()
The generated search queries.
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" } ]'
public List<CohereToolCall> getToolCalls()
A list of tool calls generated by the model.
public String getPrompt()
The full prompt that was sent to the model if isEcho is true when request.
public String toString()
toString
in class BaseChatResponse
public String toString(boolean includeByteArrayContents)
Return a string representation of the object.
toString
in class BaseChatResponse
includeByteArrayContents
- true to include the full contents of byte arrayspublic boolean equals(Object o)
equals
in class BaseChatResponse
public int hashCode()
hashCode
in class BaseChatResponse
Copyright © 2016–2024. All rights reserved.