Class OpenAiApi.ChatCompletionRequest.ToolChoiceBuilder

java.lang.Object
org.springframework.ai.openai.api.OpenAiApi.ChatCompletionRequest.ToolChoiceBuilder
Enclosing class:
OpenAiApi.ChatCompletionRequest

public static class OpenAiApi.ChatCompletionRequest.ToolChoiceBuilder extends Object
Helper factory that creates a tool_choice of type 'none', 'auto' or selected function by name.
Author:
Christian Tzolov, Michael Lavelle, Mariusz Bernacki, Thomas Vitale, David Frizelle, Alexandros Pappas, Filip Hrisafov
  • Field Details

    • AUTO

      public static final String AUTO
      Model can pick between generating a message or calling a function.
      See Also:
    • NONE

      public static final String NONE
      Model will not call a function and instead generates a message
      See Also:
  • Constructor Details

    • ToolChoiceBuilder

      public ToolChoiceBuilder()
  • Method Details

    • function

      public static Object function(String functionName)
      Specifying a particular function forces the model to call that function.