Record Class ChatOptions
java.lang.Object
java.lang.Record
smile.llm.ChatOptions
- Record Components:
tools- available tools;nullor empty means no tools.toolChoice- tool selection policy;nulldefaults toToolChoice.AUTO.parallelToolCalls- whether multiple tool calls in one turn are allowed.
public record ChatOptions(ToolDefinition[] tools, ToolChoice toolChoice, boolean parallelToolCalls)
extends Record
Per-request chat options for tool calling.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionChatOptions(ToolDefinition[] tools, ToolChoice toolChoice, boolean parallelToolCalls) Compact canonical constructor. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanhasTools()Returns whether tools should be injected into the chat template.booleanReturns the value of theparallelToolCallsrecord component.booleanReturns whether the tool-call output parser should run.Returns the value of thetoolChoicerecord component.tools()Returns the value of thetoolsrecord component.Tools filtered for template injection (named choice → single function).final StringtoString()Returns a string representation of this record class.
-
Field Details
-
NONE
Empty options (no tools).
-
-
Constructor Details
-
ChatOptions
Compact canonical constructor.
-
-
Method Details
-
hasTools
public boolean hasTools()Returns whether tools should be injected into the chat template.- Returns:
truewhen tools should be injected into the chat template.
-
toolsForTemplate
Tools filtered for template injection (named choice → single function).- Returns:
- tools to expose, or empty list when none.
-
parseToolCalls
public boolean parseToolCalls()Returns whether the tool-call output parser should run.- Returns:
truewhen the tool-call output parser should run.
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
tools
-
toolChoice
Returns the value of thetoolChoicerecord component.- Returns:
- the value of the
toolChoicerecord component
-
parallelToolCalls
public boolean parallelToolCalls()Returns the value of theparallelToolCallsrecord component.- Returns:
- the value of the
parallelToolCallsrecord component
-