Class CreateChatCompletionResponse
java.lang.Object
com.sap.ai.sdk.foundationmodels.openai.generated.model.CreateChatCompletionResponse
- All Implemented Interfaces:
ChatCompletionsCreate200Response
public class CreateChatCompletionResponse
extends Object
implements ChatCompletionsCreate200Response
Represents a chat completion response returned by model, based on the provided input.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe object type, which is always `chat.completion`. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSet the _object of thisCreateChatCompletionResponseinstance and return the same instance.addChoicesItem(CreateChatCompletionResponseChoicesInner choicesItem) Add one choices instance to thisCreateChatCompletionResponse.addPromptFilterResultsItem(PromptFilterResult promptFilterResultsItem) Add one promptFilterResults instance to thisCreateChatCompletionResponse.Set the choices of thisCreateChatCompletionResponseinstance and return the same instance.Set the created of thisCreateChatCompletionResponseinstance and return the same instance.booleanA list of chat completion choices.The Unix timestamp (in seconds) of when the chat completion was created.getCustomField(String name) Deprecated.Get the names of the unrecognizable properties of theCreateChatCompletionResponse.getId()A unique identifier for the chat completion.getModel()The model used for the chat completion.The object type, which is always `chat.completion`.Content filtering results for zero or more prompts in the request.This fingerprint represents the backend configuration that the model runs with.getUsage()Get usageinthashCode()Set the id of thisCreateChatCompletionResponseinstance and return the same instance.Set the model of thisCreateChatCompletionResponseinstance and return the same instance.promptFilterResults(List<PromptFilterResult> promptFilterResults) Set the promptFilterResults of thisCreateChatCompletionResponseinstance and return the same instance.voidSet the choices of thisCreateChatCompletionResponseinstance.voidsetCreated(Integer created) Set the created of thisCreateChatCompletionResponseinstance.voidsetCustomField(String customFieldName, Object customFieldValue) Set an unrecognizable property of thisCreateChatCompletionResponseinstance.voidSet the id of thisCreateChatCompletionResponseinstance.voidSet the model of thisCreateChatCompletionResponseinstance.voidSet the _object of thisCreateChatCompletionResponseinstance.voidsetPromptFilterResults(List<PromptFilterResult> promptFilterResults) Set the promptFilterResults of thisCreateChatCompletionResponseinstance.voidsetSystemFingerprint(String systemFingerprint) Set the systemFingerprint of thisCreateChatCompletionResponseinstance.voidsetUsage(CompletionUsage usage) Set the usage of thisCreateChatCompletionResponseinstance.systemFingerprint(String systemFingerprint) Set the systemFingerprint of thisCreateChatCompletionResponseinstance and return the same instance.toMap()Get the value of all properties of thisCreateChatCompletionResponseinstance including unrecognized properties.toString()usage(CompletionUsage usage) Set the usage of thisCreateChatCompletionResponseinstance and return the same instance.
-
Constructor Details
-
CreateChatCompletionResponse
public CreateChatCompletionResponse()
-
-
Method Details
-
id
Set the id of thisCreateChatCompletionResponseinstance and return the same instance.- Parameters:
id- A unique identifier for the chat completion.- Returns:
- The same instance of this
CreateChatCompletionResponseclass
-
getId
A unique identifier for the chat completion.- Returns:
- id The id of this
CreateChatCompletionResponseinstance.
-
setId
Set the id of thisCreateChatCompletionResponseinstance.- Parameters:
id- A unique identifier for the chat completion.
-
promptFilterResults
@Nonnull public CreateChatCompletionResponse promptFilterResults(@Nullable List<PromptFilterResult> promptFilterResults) Set the promptFilterResults of thisCreateChatCompletionResponseinstance and return the same instance.- Parameters:
promptFilterResults- Content filtering results for zero or more prompts in the request. In a streaming request, results for different prompts may arrive at different times or in different orders.- Returns:
- The same instance of this
CreateChatCompletionResponseclass
-
addPromptFilterResultsItem
@Nonnull public CreateChatCompletionResponse addPromptFilterResultsItem(@Nonnull PromptFilterResult promptFilterResultsItem) Add one promptFilterResults instance to thisCreateChatCompletionResponse.- Parameters:
promptFilterResultsItem- The promptFilterResults that should be added- Returns:
- The same instance of type
CreateChatCompletionResponse
-
getPromptFilterResults
Content filtering results for zero or more prompts in the request. In a streaming request, results for different prompts may arrive at different times or in different orders.- Returns:
- promptFilterResults The promptFilterResults of this
CreateChatCompletionResponseinstance.
-
setPromptFilterResults
Set the promptFilterResults of thisCreateChatCompletionResponseinstance.- Parameters:
promptFilterResults- Content filtering results for zero or more prompts in the request. In a streaming request, results for different prompts may arrive at different times or in different orders.
-
choices
@Nonnull public CreateChatCompletionResponse choices(@Nonnull List<CreateChatCompletionResponseChoicesInner> choices) Set the choices of thisCreateChatCompletionResponseinstance and return the same instance.- Parameters:
choices- A list of chat completion choices. Can be more than one if `n` is greater than 1.- Returns:
- The same instance of this
CreateChatCompletionResponseclass
-
addChoicesItem
@Nonnull public CreateChatCompletionResponse addChoicesItem(@Nonnull CreateChatCompletionResponseChoicesInner choicesItem) Add one choices instance to thisCreateChatCompletionResponse.- Parameters:
choicesItem- The choices that should be added- Returns:
- The same instance of type
CreateChatCompletionResponse
-
getChoices
A list of chat completion choices. Can be more than one if `n` is greater than 1.- Returns:
- choices The choices of this
CreateChatCompletionResponseinstance.
-
setChoices
Set the choices of thisCreateChatCompletionResponseinstance.- Parameters:
choices- A list of chat completion choices. Can be more than one if `n` is greater than 1.
-
created
Set the created of thisCreateChatCompletionResponseinstance and return the same instance.- Parameters:
created- The Unix timestamp (in seconds) of when the chat completion was created.- Returns:
- The same instance of this
CreateChatCompletionResponseclass
-
getCreated
The Unix timestamp (in seconds) of when the chat completion was created.- Returns:
- created The created of this
CreateChatCompletionResponseinstance.
-
setCreated
Set the created of thisCreateChatCompletionResponseinstance.- Parameters:
created- The Unix timestamp (in seconds) of when the chat completion was created.
-
model
Set the model of thisCreateChatCompletionResponseinstance and return the same instance.- Parameters:
model- The model used for the chat completion.- Returns:
- The same instance of this
CreateChatCompletionResponseclass
-
getModel
The model used for the chat completion.- Returns:
- model The model of this
CreateChatCompletionResponseinstance.
-
setModel
Set the model of thisCreateChatCompletionResponseinstance.- Parameters:
model- The model used for the chat completion.
-
systemFingerprint
Set the systemFingerprint of thisCreateChatCompletionResponseinstance and return the same instance.- Parameters:
systemFingerprint- This fingerprint represents the backend configuration that the model runs with. Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism.- Returns:
- The same instance of this
CreateChatCompletionResponseclass
-
getSystemFingerprint
This fingerprint represents the backend configuration that the model runs with. Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism.- Returns:
- systemFingerprint The systemFingerprint of this
CreateChatCompletionResponseinstance.
-
setSystemFingerprint
Set the systemFingerprint of thisCreateChatCompletionResponseinstance.- Parameters:
systemFingerprint- This fingerprint represents the backend configuration that the model runs with. Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism.
-
_object
@Nonnull public CreateChatCompletionResponse _object(@Nonnull CreateChatCompletionResponse.ObjectEnum _object) Set the _object of thisCreateChatCompletionResponseinstance and return the same instance.- Parameters:
_object- The object type, which is always `chat.completion`.- Returns:
- The same instance of this
CreateChatCompletionResponseclass
-
getObject
The object type, which is always `chat.completion`.- Returns:
- _object The _object of this
CreateChatCompletionResponseinstance.
-
setObject
Set the _object of thisCreateChatCompletionResponseinstance.- Parameters:
_object- The object type, which is always `chat.completion`.
-
usage
Set the usage of thisCreateChatCompletionResponseinstance and return the same instance.- Parameters:
usage- The usage of thisCreateChatCompletionResponse- Returns:
- The same instance of this
CreateChatCompletionResponseclass
-
getUsage
Get usage- Returns:
- usage The usage of this
CreateChatCompletionResponseinstance.
-
setUsage
Set the usage of thisCreateChatCompletionResponseinstance.- Parameters:
usage- The usage of thisCreateChatCompletionResponse
-
getCustomFieldNames
Get the names of the unrecognizable properties of theCreateChatCompletionResponse.- Returns:
- The set of properties names
-
getCustomField
@Nullable @Deprecated public Object getCustomField(@Nonnull String name) throws NoSuchElementException Deprecated.UsetoMap()instead.Get the value of an unrecognizable property of thisCreateChatCompletionResponseinstance.- Parameters:
name- The name of the property- Returns:
- The value of the property
- Throws:
NoSuchElementException- If no property with the given name could be found.
-
toMap
Get the value of all properties of thisCreateChatCompletionResponseinstance including unrecognized properties.- Returns:
- The map of all properties
-
setCustomField
Set an unrecognizable property of thisCreateChatCompletionResponseinstance. If the map previously contained a mapping for the key, the old value is replaced by the specified value.- Parameters:
customFieldName- The name of the propertycustomFieldValue- The value of the property
-
equals
-
hashCode
public int hashCode() -
toString
-
toMap()instead.