Package com.sap.ai.sdk.orchestration.model

# Class ChoiceLogprobs

java.lang.Object
com.sap.ai.sdk.orchestration.model.ChoiceLogprobs

public class ChoiceLogprobs extends Object
Log probabilities for the choice.

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `ChoiceLogprobs()`
  Default constructor for ChoiceLogprobs.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `ChoiceLogprobs`
  `addContentItem(ChatCompletionTokenLogprob contentItem)`
  Add one content instance to this `ChoiceLogprobs`.
  `ChoiceLogprobs`
  `addRefusalItem(ChatCompletionTokenLogprob refusalItem)`
  Add one refusal instance to this `ChoiceLogprobs`.
  `ChoiceLogprobs`
  `content(List<ChatCompletionTokenLogprob> content)`
  Set the content of this `ChoiceLogprobs` instance and return the same instance.
  `static ChoiceLogprobs`
  `create()`
  Create a new `ChoiceLogprobs` instance.
  `boolean`
  `equals(Object o)`
  `List<ChatCompletionTokenLogprob>`
  `getContent()`
  A list of message content tokens with log probability information.
  `Object`
  `getCustomField(String name)`
  Deprecated.
  Use `toMap()` instead.
  `Set<String>`
  `getCustomFieldNames()`
  Get the names of the unrecognizable properties of the `ChoiceLogprobs`.
  `List<ChatCompletionTokenLogprob>`
  `getRefusal()`
  A list of message refusal tokens with log probability information.
  `int`
  `hashCode()`
  `ChoiceLogprobs`
  `refusal(List<ChatCompletionTokenLogprob> refusal)`
  Set the refusal of this `ChoiceLogprobs` instance and return the same instance.
  `void`
  `setContent(List<ChatCompletionTokenLogprob> content)`
  Set the content of this `ChoiceLogprobs` instance.
  `void`
  `setCustomField(String customFieldName, Object customFieldValue)`
  Set an unrecognizable property of this `ChoiceLogprobs` instance.
  `void`
  `setRefusal(List<ChatCompletionTokenLogprob> refusal)`
  Set the refusal of this `ChoiceLogprobs` instance.
  `Map<String,Object>`
  `toMap()`
  Get the value of all properties of this `ChoiceLogprobs` instance including unrecognized properties.
  `String`
  `toString()`

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

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

- ## Constructor Details

  - ### ChoiceLogprobs

    protected ChoiceLogprobs()
    Default constructor for ChoiceLogprobs.

- ## Method Details

  - ### content

    @Nonnull public ChoiceLogprobs content(@Nullable List<ChatCompletionTokenLogprob> content)
    Set the content of this `ChoiceLogprobs` instance and return the same instance.
    Parameters:
      `content` - A list of message content tokens with log probability information.
    Returns:
      The same instance of this `ChoiceLogprobs` class

  - ### addContentItem

    @Nonnull public ChoiceLogprobs addContentItem(@Nonnull ChatCompletionTokenLogprob contentItem)
    Add one content instance to this `ChoiceLogprobs`.
    Parameters:
      `contentItem` - The content that should be added
    Returns:
      The same instance of type `ChoiceLogprobs`

  - ### getContent

    @Nonnull public List<ChatCompletionTokenLogprob> getContent()
    A list of message content tokens with log probability information.
    Returns:
      content The content of this `ChoiceLogprobs` instance.

  - ### setContent

    public void setContent(@Nullable List<ChatCompletionTokenLogprob> content)
    Set the content of this `ChoiceLogprobs` instance.
    Parameters:
      `content` - A list of message content tokens with log probability information.

  - ### refusal

    @Nonnull public ChoiceLogprobs refusal(@Nullable List<ChatCompletionTokenLogprob> refusal)
    Set the refusal of this `ChoiceLogprobs` instance and return the same instance.
    Parameters:
      `refusal` - A list of message refusal tokens with log probability information.
    Returns:
      The same instance of this `ChoiceLogprobs` class

  - ### addRefusalItem

    @Nonnull public ChoiceLogprobs addRefusalItem(@Nonnull ChatCompletionTokenLogprob refusalItem)
    Add one refusal instance to this `ChoiceLogprobs`.
    Parameters:
      `refusalItem` - The refusal that should be added
    Returns:
      The same instance of type `ChoiceLogprobs`

  - ### getRefusal

    @Nonnull public List<ChatCompletionTokenLogprob> getRefusal()
    A list of message refusal tokens with log probability information.
    Returns:
      refusal The refusal of this `ChoiceLogprobs` instance.

  - ### setRefusal

    public void setRefusal(@Nullable List<ChatCompletionTokenLogprob> refusal)
    Set the refusal of this `ChoiceLogprobs` instance.
    Parameters:
      `refusal` - A list of message refusal tokens with log probability information.

  - ### getCustomFieldNames

    @Nonnull public Set<String> getCustomFieldNames()
    Get the names of the unrecognizable properties of the `ChoiceLogprobs`.
    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 `ChoiceLogprobs` 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 `ChoiceLogprobs` 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 `ChoiceLogprobs` 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`

  - ### create

    public static ChoiceLogprobs create()
    Create a new `ChoiceLogprobs` instance. No arguments are required.