Record Class ToolDefinition
java.lang.Object
java.lang.Record
smile.llm.ToolDefinition
- Record Components:
type- tool type; always"function"for v1.function- function schema.
OpenAI-compatible tool definition (
type: "function").-
Constructor Summary
ConstructorsConstructorDescriptionToolDefinition(String type, FunctionDefinition function) Compact canonical constructor. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.function()Returns the value of thefunctionrecord component.static ToolDefinitionfunction(FunctionDefinition function) Convenience factory for a function tool.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
ToolDefinition
Compact canonical constructor.
-
-
Method Details
-
function
Convenience factory for a function tool.- Parameters:
function- function definition.- Returns:
- tool definition with
type = "function".
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
type
-
function
-