Class ToolChoice

java.lang.Object
com.codename1.ai.ToolChoice

public final class ToolChoice extends Object
Controls how aggressively the model will call tools. Use the constants for the three common modes; use named(String) to force the model to call a specific tool.
  • Field Details

    • AUTO

      public static final ToolChoice AUTO
      Model picks freely between calling tools and replying with text.
    • NONE

      public static final ToolChoice NONE
      Model must not call any tool -- it must reply with text.
    • REQUIRED

      public static final ToolChoice REQUIRED
      Model must call exactly one tool (any tool). Useful for forcing a structured-output path.
  • Method Details

    • named

      public static ToolChoice named(String toolName)
      Forces the model to call the named tool.
    • getMode

      public String getMode()
    • getForcedToolName

      public String getForcedToolName()