Package com.sap.ai.sdk.foundationmodels.openai.generated.model

# 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 Classes
  Modifier and Type
  Class
  Description
  `static enum`
  `CreateChatCompletionResponse.ObjectEnum`
  The object type, which is always `chat.completion`.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CreateChatCompletionResponse()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `CreateChatCompletionResponse`
  `_object(CreateChatCompletionResponse.ObjectEnum _object)`
  Set the _object of this `CreateChatCompletionResponse` instance and return the same instance.
  `CreateChatCompletionResponse`
  `addChoicesItem(CreateChatCompletionResponseChoicesInner choicesItem)`
  Add one choices instance to this `CreateChatCompletionResponse`.
  `CreateChatCompletionResponse`
  `addPromptFilterResultsItem(PromptFilterResult promptFilterResultsItem)`
  Add one promptFilterResults instance to this `CreateChatCompletionResponse`.
  `CreateChatCompletionResponse`
  `choices(List<CreateChatCompletionResponseChoicesInner> choices)`
  Set the choices of this `CreateChatCompletionResponse` instance and return the same instance.
  `CreateChatCompletionResponse`
  `created(Integer created)`
  Set the created of this `CreateChatCompletionResponse` instance and return the same instance.
  `boolean`
  `equals(Object o)`
  `List<CreateChatCompletionResponseChoicesInner>`
  `getChoices()`
  A list of chat completion choices.
  `Integer`
  `getCreated()`
  The Unix timestamp (in seconds) of when the chat completion was created.
  `Object`
  `getCustomField(String name)`
  Deprecated.
  Use `toMap()` instead.
  `Set<String>`
  `getCustomFieldNames()`
  Get the names of the unrecognizable properties of the `CreateChatCompletionResponse`.
  `String`
  `getId()`
  A unique identifier for the chat completion.
  `String`
  `getModel()`
  The model used for the chat completion.
  `CreateChatCompletionResponse.ObjectEnum`
  `getObject()`
  The object type, which is always `chat.completion`.
  `List<PromptFilterResult>`
  `getPromptFilterResults()`
  Content filtering results for zero or more prompts in the request.
  `String`
  `getSystemFingerprint()`
  This fingerprint represents the backend configuration that the model runs with.
  `CompletionUsage`
  `getUsage()`
  Get usage
  `int`
  `hashCode()`
  `CreateChatCompletionResponse`
  `id(String id)`
  Set the id of this `CreateChatCompletionResponse` instance and return the same instance.
  `CreateChatCompletionResponse`
  `model(String model)`
  Set the model of this `CreateChatCompletionResponse` instance and return the same instance.
  `CreateChatCompletionResponse`
  `promptFilterResults(List<PromptFilterResult> promptFilterResults)`
  Set the promptFilterResults of this `CreateChatCompletionResponse` instance and return the same instance.
  `void`
  `setChoices(List<CreateChatCompletionResponseChoicesInner> choices)`
  Set the choices of this `CreateChatCompletionResponse` instance.
  `void`
  `setCreated(Integer created)`
  Set the created of this `CreateChatCompletionResponse` instance.
  `void`
  `setCustomField(String customFieldName, Object customFieldValue)`
  Set an unrecognizable property of this `CreateChatCompletionResponse` instance.
  `void`
  `setId(String id)`
  Set the id of this `CreateChatCompletionResponse` instance.
  `void`
  `setModel(String model)`
  Set the model of this `CreateChatCompletionResponse` instance.
  `void`
  `setObject(CreateChatCompletionResponse.ObjectEnum _object)`
  Set the _object of this `CreateChatCompletionResponse` instance.
  `void`
  `setPromptFilterResults(List<PromptFilterResult> promptFilterResults)`
  Set the promptFilterResults of this `CreateChatCompletionResponse` instance.
  `void`
  `setSystemFingerprint(String systemFingerprint)`
  Set the systemFingerprint of this `CreateChatCompletionResponse` instance.
  `void`
  `setUsage(CompletionUsage usage)`
  Set the usage of this `CreateChatCompletionResponse` instance.
  `CreateChatCompletionResponse`
  `systemFingerprint(String systemFingerprint)`
  Set the systemFingerprint of this `CreateChatCompletionResponse` instance and return the same instance.
  `Map<String,Object>`
  `toMap()`
  Get the value of all properties of this `CreateChatCompletionResponse` instance including unrecognized properties.
  `String`
  `toString()`
  `CreateChatCompletionResponse`
  `usage(CompletionUsage usage)`
  Set the usage of this `CreateChatCompletionResponse` instance and return the same instance.

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### CreateChatCompletionResponse

    public CreateChatCompletionResponse()

- ## Method Details

  - ### id

    @Nonnull public CreateChatCompletionResponse id(@Nonnull String id)
    Set the id of this `CreateChatCompletionResponse` instance and return the same instance.
    Parameters:
      `id` - A unique identifier for the chat completion.
    Returns:
      The same instance of this `CreateChatCompletionResponse` class

  - ### getId

    @Nonnull public String getId()
    A unique identifier for the chat completion.
    Returns:
      id The id of this `CreateChatCompletionResponse` instance.

  - ### setId

    public void setId(@Nonnull String id)
    Set the id of this `CreateChatCompletionResponse` instance.
    Parameters:
      `id` - A unique identifier for the chat completion.

  - ### promptFilterResults

    @Nonnull public CreateChatCompletionResponse promptFilterResults(@Nullable List<PromptFilterResult> promptFilterResults)
    Set the promptFilterResults of this `CreateChatCompletionResponse` instance 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 `CreateChatCompletionResponse` class

  - ### addPromptFilterResultsItem

    @Nonnull public CreateChatCompletionResponse addPromptFilterResultsItem(@Nonnull PromptFilterResult promptFilterResultsItem)
    Add one promptFilterResults instance to this `CreateChatCompletionResponse`.
    Parameters:
      `promptFilterResultsItem` - The promptFilterResults that should be added
    Returns:
      The same instance of type `CreateChatCompletionResponse`

  - ### getPromptFilterResults

    @Nonnull public List<PromptFilterResult> 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 `CreateChatCompletionResponse` instance.

  - ### setPromptFilterResults

    public void setPromptFilterResults(@Nullable List<PromptFilterResult> promptFilterResults)
    Set the promptFilterResults of this `CreateChatCompletionResponse` 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.

  - ### choices

    @Nonnull public CreateChatCompletionResponse choices(@Nonnull List<CreateChatCompletionResponseChoicesInner> choices)
    Set the choices of this `CreateChatCompletionResponse` instance 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 `CreateChatCompletionResponse` class

  - ### addChoicesItem

    @Nonnull public CreateChatCompletionResponse addChoicesItem(@Nonnull CreateChatCompletionResponseChoicesInner choicesItem)
    Add one choices instance to this `CreateChatCompletionResponse`.
    Parameters:
      `choicesItem` - The choices that should be added
    Returns:
      The same instance of type `CreateChatCompletionResponse`

  - ### getChoices

    @Nonnull public List<CreateChatCompletionResponseChoicesInner> getChoices()
    A list of chat completion choices. Can be more than one if `n` is greater than 1.
    Returns:
      choices The choices of this `CreateChatCompletionResponse` instance.

  - ### setChoices

    public void setChoices(@Nonnull List<CreateChatCompletionResponseChoicesInner> choices)
    Set the choices of this `CreateChatCompletionResponse` instance.
    Parameters:
      `choices` - A list of chat completion choices. Can be more than one if `n` is greater than 1.

  - ### created

    @Nonnull public CreateChatCompletionResponse created(@Nonnull Integer created)
    Set the created of this `CreateChatCompletionResponse` instance 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 `CreateChatCompletionResponse` class

  - ### getCreated

    @Nonnull public Integer getCreated()
    The Unix timestamp (in seconds) of when the chat completion was created.
    Returns:
      created The created of this `CreateChatCompletionResponse` instance.

  - ### setCreated

    public void setCreated(@Nonnull Integer created)
    Set the created of this `CreateChatCompletionResponse` instance.
    Parameters:
      `created` - The Unix timestamp (in seconds) of when the chat completion was created.

  - ### model

    @Nonnull public CreateChatCompletionResponse model(@Nonnull String model)
    Set the model of this `CreateChatCompletionResponse` instance and return the same instance.
    Parameters:
      `model` - The model used for the chat completion.
    Returns:
      The same instance of this `CreateChatCompletionResponse` class

  - ### getModel

    @Nonnull public String getModel()
    The model used for the chat completion.
    Returns:
      model The model of this `CreateChatCompletionResponse` instance.

  - ### setModel

    public void setModel(@Nonnull String model)
    Set the model of this `CreateChatCompletionResponse` instance.
    Parameters:
      `model` - The model used for the chat completion.

  - ### systemFingerprint

    @Nonnull public CreateChatCompletionResponse systemFingerprint(@Nullable String systemFingerprint)
    Set the systemFingerprint of this `CreateChatCompletionResponse` instance 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 `CreateChatCompletionResponse` class

  - ### getSystemFingerprint

    @Nonnull public String 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 `CreateChatCompletionResponse` instance.

  - ### setSystemFingerprint

    public void setSystemFingerprint(@Nullable String systemFingerprint)
    Set the systemFingerprint of this `CreateChatCompletionResponse` 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.

  - ### _object

    @Nonnull public CreateChatCompletionResponse _object(@Nonnull CreateChatCompletionResponse.ObjectEnum _object)
    Set the _object of this `CreateChatCompletionResponse` instance and return the same instance.
    Parameters:
      `_object` - The object type, which is always `chat.completion`.
    Returns:
      The same instance of this `CreateChatCompletionResponse` class

  - ### getObject

    @Nonnull public CreateChatCompletionResponse.ObjectEnum getObject()
    The object type, which is always `chat.completion`.
    Returns:
      _object The _object of this `CreateChatCompletionResponse` instance.

  - ### setObject

    public void setObject(@Nonnull CreateChatCompletionResponse.ObjectEnum _object)
    Set the _object of this `CreateChatCompletionResponse` instance.
    Parameters:
      `_object` - The object type, which is always `chat.completion`.

  - ### usage

    @Nonnull public CreateChatCompletionResponse usage(@Nullable CompletionUsage usage)
    Set the usage of this `CreateChatCompletionResponse` instance and return the same instance.
    Parameters:
      `usage` - The usage of this `CreateChatCompletionResponse`
    Returns:
      The same instance of this `CreateChatCompletionResponse` class

  - ### getUsage

    @Nonnull public CompletionUsage getUsage()
    Get usage
    Returns:
      usage The usage of this `CreateChatCompletionResponse` instance.

  - ### setUsage

    public void setUsage(@Nullable CompletionUsage usage)
    Set the usage of this `CreateChatCompletionResponse` instance.
    Parameters:
      `usage` - The usage of this `CreateChatCompletionResponse`

  - ### getCustomFieldNames

    @Nonnull public Set<String> getCustomFieldNames()
    Get the names of the unrecognizable properties of the `CreateChatCompletionResponse`.
    Returns:
      The set of properties names

  - ### getCustomField

    @Nullable @Deprecated public Object getCustomField(@Nonnull String name) throws NoSuchElementException
    Deprecated.
    Use `toMap()` instead.
    Get the value of an unrecognizable property of this `CreateChatCompletionResponse` instance.
    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

    @Nonnull public Map<String,Object> toMap()
    Get the value of all properties of this `CreateChatCompletionResponse` instance including unrecognized properties.
    Returns:
      The map of all properties

  - ### setCustomField

    public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue)
    Set an unrecognizable property of this `CreateChatCompletionResponse` instance. 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 property
      `customFieldValue` - The value of the property

  - ### equals

    public boolean equals(@Nullable Object o)
    Overrides:
      `equals` in class `Object`

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`

  - ### toString

    @Nonnull public String toString()
    Overrides:
      `toString` in class `Object`