Class CreateChatCompletionStreamResponse
java.lang.Object
com.sap.ai.sdk.foundationmodels.openai.generated.model.CreateChatCompletionStreamResponse
- All Implemented Interfaces:
ChatCompletionsCreate200Response
public class CreateChatCompletionStreamResponse
extends Object
implements ChatCompletionsCreate200Response
Represents a streamed chunk of 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.chunk`. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSet the _object of thisCreateChatCompletionStreamResponseinstance and return the same instance.Add one choices instance to thisCreateChatCompletionStreamResponse.Set the choices of thisCreateChatCompletionStreamResponseinstance and return the same instance.Set the created of thisCreateChatCompletionStreamResponseinstance 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 theCreateChatCompletionStreamResponse.getId()A unique identifier for the chat completion.getModel()The model to generate the completion.The object type, which is always `chat.completion.chunk`.This fingerprint represents the backend configuration that the model runs with.inthashCode()Set the id of thisCreateChatCompletionStreamResponseinstance and return the same instance.Set the model of thisCreateChatCompletionStreamResponseinstance and return the same instance.voidSet the choices of thisCreateChatCompletionStreamResponseinstance.voidsetCreated(Integer created) Set the created of thisCreateChatCompletionStreamResponseinstance.voidsetCustomField(String customFieldName, Object customFieldValue) Set an unrecognizable property of thisCreateChatCompletionStreamResponseinstance.voidSet the id of thisCreateChatCompletionStreamResponseinstance.voidSet the model of thisCreateChatCompletionStreamResponseinstance.voidSet the _object of thisCreateChatCompletionStreamResponseinstance.voidsetSystemFingerprint(String systemFingerprint) Set the systemFingerprint of thisCreateChatCompletionStreamResponseinstance.systemFingerprint(String systemFingerprint) Set the systemFingerprint of thisCreateChatCompletionStreamResponseinstance and return the same instance.toMap()Get the value of all properties of thisCreateChatCompletionStreamResponseinstance including unrecognized properties.toString()
-
Constructor Details
-
CreateChatCompletionStreamResponse
public CreateChatCompletionStreamResponse()
-
-
Method Details
-
id
Set the id of thisCreateChatCompletionStreamResponseinstance and return the same instance.- Parameters:
id- A unique identifier for the chat completion. Each chunk has the same ID.- Returns:
- The same instance of this
CreateChatCompletionStreamResponseclass
-
getId
A unique identifier for the chat completion. Each chunk has the same ID.- Returns:
- id The id of this
CreateChatCompletionStreamResponseinstance.
-
setId
Set the id of thisCreateChatCompletionStreamResponseinstance.- Parameters:
id- A unique identifier for the chat completion. Each chunk has the same ID.
-
choices
@Nonnull public CreateChatCompletionStreamResponse choices(@Nonnull List<CreateChatCompletionStreamResponseChoicesInner> choices) Set the choices of thisCreateChatCompletionStreamResponseinstance and return the same instance.- Parameters:
choices- A list of chat completion choices. Can contain more than one elements if `n` is greater than 1.- Returns:
- The same instance of this
CreateChatCompletionStreamResponseclass
-
addChoicesItem
@Nonnull public CreateChatCompletionStreamResponse addChoicesItem(@Nonnull CreateChatCompletionStreamResponseChoicesInner choicesItem) Add one choices instance to thisCreateChatCompletionStreamResponse.- Parameters:
choicesItem- The choices that should be added- Returns:
- The same instance of type
CreateChatCompletionStreamResponse
-
getChoices
A list of chat completion choices. Can contain more than one elements if `n` is greater than 1.- Returns:
- choices The choices of this
CreateChatCompletionStreamResponseinstance.
-
setChoices
Set the choices of thisCreateChatCompletionStreamResponseinstance.- Parameters:
choices- A list of chat completion choices. Can contain more than one elements if `n` is greater than 1.
-
created
Set the created of thisCreateChatCompletionStreamResponseinstance and return the same instance.- Parameters:
created- The Unix timestamp (in seconds) of when the chat completion was created. Each chunk has the same timestamp.- Returns:
- The same instance of this
CreateChatCompletionStreamResponseclass
-
getCreated
The Unix timestamp (in seconds) of when the chat completion was created. Each chunk has the same timestamp.- Returns:
- created The created of this
CreateChatCompletionStreamResponseinstance.
-
setCreated
Set the created of thisCreateChatCompletionStreamResponseinstance.- Parameters:
created- The Unix timestamp (in seconds) of when the chat completion was created. Each chunk has the same timestamp.
-
model
Set the model of thisCreateChatCompletionStreamResponseinstance and return the same instance.- Parameters:
model- The model to generate the completion.- Returns:
- The same instance of this
CreateChatCompletionStreamResponseclass
-
getModel
The model to generate the completion.- Returns:
- model The model of this
CreateChatCompletionStreamResponseinstance.
-
setModel
Set the model of thisCreateChatCompletionStreamResponseinstance.- Parameters:
model- The model to generate the completion.
-
systemFingerprint
@Nonnull public CreateChatCompletionStreamResponse systemFingerprint(@Nullable String systemFingerprint) Set the systemFingerprint of thisCreateChatCompletionStreamResponseinstance 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
CreateChatCompletionStreamResponseclass
-
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
CreateChatCompletionStreamResponseinstance.
-
setSystemFingerprint
Set the systemFingerprint of thisCreateChatCompletionStreamResponseinstance.- 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 CreateChatCompletionStreamResponse _object(@Nonnull CreateChatCompletionStreamResponse.ObjectEnum _object) Set the _object of thisCreateChatCompletionStreamResponseinstance and return the same instance.- Parameters:
_object- The object type, which is always `chat.completion.chunk`.- Returns:
- The same instance of this
CreateChatCompletionStreamResponseclass
-
getObject
The object type, which is always `chat.completion.chunk`.- Returns:
- _object The _object of this
CreateChatCompletionStreamResponseinstance.
-
setObject
Set the _object of thisCreateChatCompletionStreamResponseinstance.- Parameters:
_object- The object type, which is always `chat.completion.chunk`.
-
getCustomFieldNames
Get the names of the unrecognizable properties of theCreateChatCompletionStreamResponse.- 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 thisCreateChatCompletionStreamResponseinstance.- 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 thisCreateChatCompletionStreamResponseinstance including unrecognized properties.- Returns:
- The map of all properties
-
setCustomField
Set an unrecognizable property of thisCreateChatCompletionStreamResponseinstance. 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.