Class AiServiceTool.Builder
java.lang.Object
dev.langchain4j.service.tool.AiServiceTool.Builder
- Enclosing class:
AiServiceTool
- Since:
- 1.13.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()immediateReturn(boolean immediateReturn) Deprecated.returnBehavior(ReturnBehavior returnBehavior) toolExecutor(ToolExecutor toolExecutor) toolInputGuardrails(ToolInputGuardrail... toolInputGuardrails) Sets theToolInputGuardrails of this tool.toolInputGuardrails(@Nullable List<? extends ToolInputGuardrail> toolInputGuardrails) Sets theToolInputGuardrails of this tool, which run in the order given, after the guardrails set on theAiServicesbuilder, after the ones of the class annotation and after the ones of the method annotation, if any.toolOutputGuardrails(ToolOutputGuardrail... toolOutputGuardrails) Sets theToolOutputGuardrails of this tool.toolOutputGuardrails(@Nullable List<? extends ToolOutputGuardrail> toolOutputGuardrails) Sets theToolOutputGuardrails of this tool, which run in the order given, first: before the ones of the method annotation, of the class annotation and the guardrails set on theAiServicesbuilder, if any.toolSource(@Nullable ToolSource toolSource) Sets where this tool comes from.toolSpecification(ToolSpecification toolSpecification)
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
toolSpecification
-
toolExecutor
-
returnBehavior
- Since:
- 1.14.0
-
toolSource
Sets where this tool comes from. It is exposed to tool guardrails as trusted information, so it must be set by the application, never derived from remote data. When it is not set, a tool backed by aDefaultToolExecutorislocal(the original method of the executor), and any other tool isprogrammatic.- Parameters:
toolSource- where this tool comes from;nullmeans the default above- Returns:
- this builder
- Since:
- 1.25.0
-
toolInputGuardrails
@Experimental public AiServiceTool.Builder toolInputGuardrails(@Nullable List<? extends ToolInputGuardrail> toolInputGuardrails) Sets theToolInputGuardrails of this tool, which run in the order given, after the guardrails set on theAiServicesbuilder, after the ones of the class annotation and after the ones of the method annotation, if any.nullmeans none.- Parameters:
toolInputGuardrails- the tool input guardrails of this tool, ornullfor none- Returns:
- this builder
- Since:
- 1.25.0
-
toolInputGuardrails
@Experimental public AiServiceTool.Builder toolInputGuardrails(ToolInputGuardrail... toolInputGuardrails) Sets theToolInputGuardrails of this tool.- Parameters:
toolInputGuardrails- the tool input guardrails of this tool- Returns:
- this builder
- Since:
- 1.25.0
- See Also:
-
toolOutputGuardrails
@Experimental public AiServiceTool.Builder toolOutputGuardrails(@Nullable List<? extends ToolOutputGuardrail> toolOutputGuardrails) Sets theToolOutputGuardrails of this tool, which run in the order given, first: before the ones of the method annotation, of the class annotation and the guardrails set on theAiServicesbuilder, if any.nullmeans none.- Parameters:
toolOutputGuardrails- the tool output guardrails of this tool, ornullfor none- Returns:
- this builder
- Since:
- 1.25.0
-
toolOutputGuardrails
@Experimental public AiServiceTool.Builder toolOutputGuardrails(ToolOutputGuardrail... toolOutputGuardrails) Sets theToolOutputGuardrails of this tool.- Parameters:
toolOutputGuardrails- the tool output guardrails of this tool- Returns:
- this builder
- Since:
- 1.25.0
- See Also:
-
immediateReturn
Deprecated.usereturnBehavior(ReturnBehavior)instead -
build
-
returnBehavior(ReturnBehavior)instead