Class ReadResourceToolConfig.Builder
- Enclosing class:
ReadResourceToolConfig
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()description(String description) Sets the description of theread_skill_resourcetool.Sets the name of theread_skill_resourcetool.relativePathParameterDescription(String relativePathParameterDescription) Sets the description of therelative_pathparameter of theread_skill_resourcetool.relativePathParameterDescriptionProvider(Function<List<? extends Skill>, String> relativePathParameterDescriptionProvider) Sets a function that produces the description of therelative_pathparameter of theread_skill_resourcetool.relativePathParameterName(String relativePathParameterName) Sets the name of therelative_pathparameter of theread_skill_resourcetool.skillNameParameterDescription(String skillNameParameterDescription) Sets the description of theskill_nameparameter of theread_skill_resourcetool.skillNameParameterName(String skillNameParameterName) Sets the name of theskill_nameparameter of theread_skill_resourcetool.throwToolArgumentsExceptions(Boolean throwToolArgumentsExceptions) Controls which exception type is thrown when tool arguments are missing, invalid, or cannot be parsed.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
name
Sets the name of theread_skill_resourcetool.Default value is "read_skill_resource".
-
description
Sets the description of theread_skill_resourcetool.Default value is "Returns the content of a resource referenced in the skill".
-
skillNameParameterName
Sets the name of theskill_nameparameter of theread_skill_resourcetool.Default value is "skill_name".
-
skillNameParameterDescription
public ReadResourceToolConfig.Builder skillNameParameterDescription(String skillNameParameterDescription) Sets the description of theskill_nameparameter of theread_skill_resourcetool.Default value is "The name of the skill for which the resource should be read".
-
relativePathParameterName
Sets the name of therelative_pathparameter of theread_skill_resourcetool.Default value is "relative_path".
-
relativePathParameterDescription
public ReadResourceToolConfig.Builder relativePathParameterDescription(String relativePathParameterDescription) Sets the description of therelative_pathparameter of theread_skill_resourcetool.By default, the description is generated dynamically and includes an example path taken from the first available skill resource.
Takes precedence over
relativePathParameterDescriptionProvider(Function). -
relativePathParameterDescriptionProvider
public ReadResourceToolConfig.Builder relativePathParameterDescriptionProvider(Function<List<? extends Skill>, String> relativePathParameterDescriptionProvider) Sets a function that produces the description of therelative_pathparameter of theread_skill_resourcetool.The function receives the list of configured skills and returns the full parameter description. This allows customizing the description template while still incorporating dynamic information such as an example path derived from the available skill resources. Ignored if
relativePathParameterDescription(String)is set.Default:
skills -> "Relative path to the resource. For example: " + <first resource path> -
throwToolArgumentsExceptions
public ReadResourceToolConfig.Builder throwToolArgumentsExceptions(Boolean throwToolArgumentsExceptions) Controls which exception type is thrown when tool arguments are missing, invalid, or cannot be parsed.Although all errors produced by this tool are argument-related, this strategy throws
ToolExecutionExceptionby default instead ofToolArgumentsException.The reason is historical: by default, AI Services fail fast when a
ToolArgumentsExceptionis thrown, whereasToolExecutionExceptionallows the error message to be returned to the LLM. For these tools, returning the error message to the LLM is usually the desired behavior.If this flag is set to
true,ToolArgumentsExceptionwill be thrown instead.- Parameters:
throwToolArgumentsExceptions- whether to throwToolArgumentsException- Returns:
- this builder
-
build
-