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

# Class OpenAiToolChoice

java.lang.Object
com.sap.ai.sdk.foundationmodels.openai.OpenAiToolChoice

public class OpenAiToolChoice extends Object
OpenAi ToolChoice to specify whether to call which tool.

Since:
  1.4.0

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final OpenAiToolChoice`
  `NONE`
  Only message generation will be performed without calling any tool.
  `static final OpenAiToolChoice`
  `OPTIONAL`
  The model may decide whether to call a (one or more) tool.
  `static final OpenAiToolChoice`
  `REQUIRED`
  The model must call one or more tools as part of its processing.

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `OpenAiToolChoice(ChatCompletionToolChoiceOption toolChoice)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected boolean`
  `canEqual(Object other)`
  `boolean`
  `equals(Object o)`
  `static OpenAiToolChoice`
  `function(String functionName)`
  The model must call the function specified by `functionName`.
  `int`
  `hashCode()`

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

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

- ## Field Details

  - ### NONE

    public static final OpenAiToolChoice NONE
    Only message generation will be performed without calling any tool.

  - ### OPTIONAL

    public static final OpenAiToolChoice OPTIONAL
    The model may decide whether to call a (one or more) tool.

  - ### REQUIRED

    public static final OpenAiToolChoice REQUIRED
    The model must call one or more tools as part of its processing.

- ## Constructor Details

  - ### OpenAiToolChoice

    protected OpenAiToolChoice(@Nonnull ChatCompletionToolChoiceOption toolChoice)

- ## Method Details

  - ### function

    @Nonnull public static OpenAiToolChoice function(@Nonnull String functionName)
    The model must call the function specified by `functionName`.
    Parameters:
      `functionName` - the name of the function that must be called.
    Returns:
      the OpenAI tool choice.

  - ### equals

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

  - ### canEqual

    protected boolean canEqual(Object other)

  - ### hashCode

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