Class CohereChatResponse.Builder

    • Constructor Detail

      • Builder

        public Builder()
    • 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
      • 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
      • 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
      • 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