Class ToolOutputGuardrailRequest.Builder
java.lang.Object
dev.langchain4j.guardrail.ToolOutputGuardrailRequest.Builder
- Enclosing class:
ToolOutputGuardrailRequest
Builder for
ToolOutputGuardrailRequest.- Since:
- 1.25.0
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the request.isError(boolean isError) Sets whether the tool result is an error.requestParams(GuardrailRequestParams requestParams) Sets the parameters of the AI service invocation, required.resultContents(@Nullable List<Content> resultContents) Sets the contents of the tool result.toolExecutionRequest(ToolExecutionRequest toolExecutionRequest) Sets the tool execution request, required.toolSource(ToolSource toolSource) Sets where the tool comes from.toolSpecification(ToolSpecification toolSpecification) Sets the specification of the tool.
-
Method Details
-
toolExecutionRequest
public ToolOutputGuardrailRequest.Builder toolExecutionRequest(ToolExecutionRequest toolExecutionRequest) Sets the tool execution request, required.- Parameters:
toolExecutionRequest- the tool execution request- Returns:
- this builder
-
toolSpecification
Sets the specification of the tool. Required.- Parameters:
toolSpecification- the tool specification- Returns:
- this builder
-
toolSource
Sets where the tool comes from. Required: guardrails can trust a tool, or not, by its source, so it has no default.- Parameters:
toolSource- the tool source- Returns:
- this builder
-
requestParams
Sets the parameters of the AI service invocation, required.- Parameters:
requestParams- the request params- Returns:
- this builder
-
resultContents
Sets the contents of the tool result.- Parameters:
resultContents- the contents, ornullfor no contents- Returns:
- this builder
-
isError
Sets whether the tool result is an error.- Parameters:
isError- whether the result is an error- Returns:
- this builder
-
build
-