Record Class Tool.Function
java.lang.Object
java.lang.Record
io.github.glaforge.gemini.interactions.model.Tool.Function
- Record Components:
type- The type of tool (must be "function").name- The name of the function.description- A description of the function.parameters- The parameters of the function (JSON Schema).
- All Implemented Interfaces:
Tool
- Enclosing interface:
Tool
public static record Tool.Function(String type, String name, String description, Map<String,Object> parameters)
extends Record
implements Tool
Tool definition for a function.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.github.glaforge.gemini.interactions.model.Tool
Tool.AllowedTools, Tool.CodeExecution, Tool.ComputerUse, Tool.FileSearch, Tool.Function, Tool.GoogleSearch, Tool.McpServer, Tool.Mode, Tool.ToolChoiceConfig, Tool.UrlContext -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedescriptionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.Returns the value of theparametersrecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
Function
Creates a new Function tool.- Parameters:
name- The name of the function.description- A description of the function.parameters- The parameters of the function.
-
Function
Creates an instance of aFunctionrecord class.- Parameters:
type- the value for thetyperecord componentname- the value for thenamerecord componentdescription- the value for thedescriptionrecord componentparameters- the value for theparametersrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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
Returns the value of thetyperecord component. -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
parameters
Returns the value of theparametersrecord component.- Returns:
- the value of the
parametersrecord component
-