Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/**
* Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
* This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
*/
package com.oracle.bmc.generativeaiinference.model;
/**
* The response to the chat conversation.
* Note: Objects should always be created or deserialized using the {@link Builder}. This model
* distinguishes fields that are {@code null} because they are unset from fields that are explicitly
* set to {@code null}. This is done in the setter methods of the {@link Builder}, which maintain a
* set of all explicitly set fields called {@link Builder#__explicitlySet__}. The {@link
* #hashCode()} and {@link #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 {@code null} from unset {@code
* null}).
*/
@jakarta.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20231130")
@com.fasterxml.jackson.databind.annotation.JsonDeserialize(
builder = CohereChatResponse.Builder.class)
@com.fasterxml.jackson.annotation.JsonTypeInfo(
use = com.fasterxml.jackson.annotation.JsonTypeInfo.Id.NAME,
include = com.fasterxml.jackson.annotation.JsonTypeInfo.As.PROPERTY,
property = "apiFormat")
@com.fasterxml.jackson.annotation.JsonFilter(
com.oracle.bmc.http.client.internal.ExplicitlySetBmcModel.EXPLICITLY_SET_FILTER_NAME)
public final class CohereChatResponse extends BaseChatResponse {
@com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(withPrefix = "")
public static class Builder {
/** Contents of the response that the model generates. */
@com.fasterxml.jackson.annotation.JsonProperty("text")
private String text;
/**
* Contents of the response that the model generates.
*
* @param text the value to set
* @return this builder
*/
public Builder text(String text) {
this.text = text;
this.__explicitlySet__.add("text");
return this;
}
/**
* 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.
*/
@com.fasterxml.jackson.annotation.JsonProperty("chatHistory")
private java.util.List 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.
*
* @param chatHistory the value to set
* @return this builder
*/
public Builder chatHistory(java.util.List chatHistory) {
this.chatHistory = chatHistory;
this.__explicitlySet__.add("chatHistory");
return this;
}
/** Inline citations for the generated response. */
@com.fasterxml.jackson.annotation.JsonProperty("citations")
private java.util.List citations;
/**
* Inline citations for the generated response.
*
* @param citations the value to set
* @return this builder
*/
public Builder citations(java.util.List citations) {
this.citations = citations;
this.__explicitlySet__.add("citations");
return this;
}
/** If set to true, a search for documents is required. */
@com.fasterxml.jackson.annotation.JsonProperty("isSearchRequired")
private Boolean isSearchRequired;
/**
* If set to true, a search for documents is required.
*
* @param isSearchRequired the value to set
* @return this builder
*/
public Builder isSearchRequired(Boolean isSearchRequired) {
this.isSearchRequired = isSearchRequired;
this.__explicitlySet__.add("isSearchRequired");
return this;
}
/** Why the generation stopped. */
@com.fasterxml.jackson.annotation.JsonProperty("finishReason")
private FinishReason finishReason;
/**
* Why the generation stopped.
*
* @param finishReason the value to set
* @return this builder
*/
public Builder finishReason(FinishReason finishReason) {
this.finishReason = finishReason;
this.__explicitlySet__.add("finishReason");
return this;
}
/**
* If there is an error during the streaming scenario, then the {@code errorMessage}
* parameter contains details for the error.
*/
@com.fasterxml.jackson.annotation.JsonProperty("errorMessage")
private String errorMessage;
/**
* If there is an error during the streaming scenario, then the {@code errorMessage}
* parameter contains details for the error.
*
* @param errorMessage the value to set
* @return this builder
*/
public Builder errorMessage(String errorMessage) {
this.errorMessage = errorMessage;
this.__explicitlySet__.add("errorMessage");
return this;
}
/** The generated search queries. */
@com.fasterxml.jackson.annotation.JsonProperty("searchQueries")
private java.util.List searchQueries;
/**
* The generated search queries.
*
* @param searchQueries the value to set
* @return this builder
*/
public Builder searchQueries(java.util.List searchQueries) {
this.searchQueries = searchQueries;
this.__explicitlySet__.add("searchQueries");
return this;
}
/**
* 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" } ]'
*/
@com.fasterxml.jackson.annotation.JsonProperty("documents")
private java.util.List