Package dev.langchain4j.agent.tool
Class ToolSpecification.Builder
-
- All Implemented Interfaces:
public final class ToolSpecification.BuilderToolSpecificationbuilder static inner class.
-
-
Method Summary
Modifier and Type Method Description ToolSpecification.Buildername(String name)Sets the name.ToolSpecification.Builderdescription(String description)Sets the description.ToolSpecification.Builderparameters(JsonObjectSchema parameters)Sets the parameters.ToolSpecification.Builderparameters(ToolParameters parameters)Sets the parameters.ToolSpecification.BuilderaddParameter(String name, Array<JsonSchemaProperty> jsonSchemaProperties)Adds a parameter to the tool. ToolSpecification.BuilderaddParameter(String name, Iterable<JsonSchemaProperty> jsonSchemaProperties)Adds a parameter to the tool. ToolSpecification.BuilderaddOptionalParameter(String name, Array<JsonSchemaProperty> jsonSchemaProperties)Adds an optional parameter to the tool. ToolSpecification.BuilderaddOptionalParameter(String name, Iterable<JsonSchemaProperty> jsonSchemaProperties)Adds an optional parameter to the tool. ToolSpecificationbuild()Returns a ToolSpecificationbuilt from the parameters previously set.-
-
Method Detail
-
name
ToolSpecification.Builder name(String name)
Sets the
name.- Parameters:
name- thename- Returns:
this
-
description
ToolSpecification.Builder description(String description)
Sets the
description.- Parameters:
description- thedescription- Returns:
this
-
parameters
ToolSpecification.Builder parameters(JsonObjectSchema parameters)
Sets the
parameters.- Parameters:
parameters- theparameters- Returns:
this
-
parameters
@Deprecated(forRemoval = true) ToolSpecification.Builder parameters(ToolParameters parameters)
Sets the
parameters.- Parameters:
parameters- theparameters- Returns:
this
-
addParameter
@Deprecated(forRemoval = true) ToolSpecification.Builder addParameter(String name, Array<JsonSchemaProperty> jsonSchemaProperties)
Adds a parameter to the tool.
- Parameters:
name- the name of the parameter.jsonSchemaProperties- the properties of the parameter.- Returns:
this
-
addParameter
@Deprecated(forRemoval = true) ToolSpecification.Builder addParameter(String name, Iterable<JsonSchemaProperty> jsonSchemaProperties)
Adds a parameter to the tool.
- Parameters:
name- the name of the parameter.jsonSchemaProperties- the properties of the parameter.- Returns:
this
-
addOptionalParameter
@Deprecated(forRemoval = true) ToolSpecification.Builder addOptionalParameter(String name, Array<JsonSchemaProperty> jsonSchemaProperties)
Adds an optional parameter to the tool.
- Parameters:
name- the name of the parameter.jsonSchemaProperties- the properties of the parameter.- Returns:
this
-
addOptionalParameter
@Deprecated(forRemoval = true) ToolSpecification.Builder addOptionalParameter(String name, Iterable<JsonSchemaProperty> jsonSchemaProperties)
Adds an optional parameter to the tool.
- Parameters:
name- the name of the parameter.jsonSchemaProperties- the properties of the parameter.- Returns:
this
-
build
ToolSpecification build()
Returns a
ToolSpecificationbuilt from the parameters previously set.- Returns:
a
ToolSpecificationbuilt with parameters of thisToolSpecification.Builder
-
-
-
-