Class 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 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).
    • Method Detail

      • 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
      • 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​(boolean includeByteArrayContents)
        Return a string representation of the object.
        Overrides:
        toString in class BaseChatResponse
        Parameters:
        includeByteArrayContents - true to include the full contents of byte arrays
        Returns:
        string representation