Uses of Class
dev.langchain4j.guardrail.ToolInputGuardrailResult
Packages that use ToolInputGuardrailResult
Package
Description
-
Uses of ToolInputGuardrailResult in dev.langchain4j.guardrail
Subclasses with type arguments of type ToolInputGuardrailResult in dev.langchain4j.guardrailModifier and TypeClassDescriptionclassTheGuardrailExecutorforToolInputGuardrails.static classBuilder class for constructing instances ofToolInputGuardrailExecutor.Subinterfaces with type arguments of type ToolInputGuardrailResult in dev.langchain4j.guardrailModifier and TypeInterfaceDescriptioninterfaceA tool input guardrail is a rule applied before a tool is executed, to validate or rewrite the arguments the LLM chose.Classes in dev.langchain4j.guardrail that implement interfaces with type arguments of type ToolInputGuardrailResultModifier and TypeClassDescriptionfinal classThe result of the validation of aToolInputGuardrail.Methods in dev.langchain4j.guardrail that return ToolInputGuardrailResultModifier and TypeMethodDescriptionprotected ToolInputGuardrailResultToolInputGuardrailExecutor.composeResult(ToolInputGuardrailResult oldResult, ToolInputGuardrailResult newResult) Keeps the rewritten arguments on a failed result, so a rejected call is reported with the arguments as the guardrails that ran before the failing one left them.protected ToolInputGuardrailResultToolInputGuardrailExecutor.createFailure(List<ToolInputGuardrailResult.Failure> failures) protected ToolInputGuardrailResultToolInputGuardrailExecutor.createSuccess()default ToolInputGuardrailResultProduces a non-fatal failure.default ToolInputGuardrailResultProduces a non-fatal failure, seeToolInputGuardrail.failure(String).default ToolInputGuardrailResultProduces a fatal failure.default ToolInputGuardrailResultProduces a fatal failure, seeToolInputGuardrail.fatal(String).protected ToolInputGuardrailResultToolInputGuardrailExecutor.handleFatalResult(ToolInputGuardrailResult accumulatedResult, ToolInputGuardrailResult result) Keeps the arguments rewritten by the guardrails before a fatal one, forAbstractToolGuardrailExecutor.throwIfFatal(P, R).default ToolInputGuardrailResultToolInputGuardrail.success()Produces a successful result without any rewrite.static ToolInputGuardrailResultToolInputGuardrailResult.success()Gets a successful tool input guardrail result.default ToolInputGuardrailResultToolInputGuardrail.successWith(@Nullable String rewrittenArguments) Produces a successful result with rewritten tool arguments, which replace the original ones for the following guardrails and for the tool execution.static ToolInputGuardrailResultToolInputGuardrailResult.successWith(@Nullable String rewrittenArguments) Produces a successful result with rewritten tool arguments.default ToolInputGuardrailResultToolInputGuardrail.successWithArguments(Map<String, ?> rewrittenArguments) Produces a successful result with rewritten tool arguments, given as a map of argument names to values, which replace the original ones for the following guardrails and for the tool execution.static ToolInputGuardrailResultToolInputGuardrailResult.successWithArguments(Map<String, ?> rewrittenArguments) Produces a successful result with rewritten tool arguments, given as a map of argument names to values.ToolInputGuardrail.validate(ToolInputGuardrailRequest request) Validates the tool execution request before the tool is executed.protected ToolInputGuardrailResultToolInputGuardrailExecutor.validate(ToolInputGuardrailRequest request, ToolInputGuardrail guardrail) AToolArgumentsExceptionthrown by a guardrail, for example byToolInputGuardrailRequest.argumentsAsMap()for arguments that cannot be parsed, is not a guardrail failure: it is thrown as is, so that the caller handles it like an arguments error of the tool.Methods in dev.langchain4j.guardrail that return types with arguments of type ToolInputGuardrailResultModifier and TypeMethodDescriptionprotected CompletableFuture<ToolInputGuardrailResult> ToolInputGuardrailExecutor.validateAsync(ToolInputGuardrailRequest request, ToolInputGuardrail guardrail, CancellationChain chain) Non-blocking counterpart ofToolInputGuardrailExecutor.validate(ToolInputGuardrailRequest, ToolInputGuardrail).Methods in dev.langchain4j.guardrail with parameters of type ToolInputGuardrailResultModifier and TypeMethodDescriptionprotected ToolInputGuardrailResultToolInputGuardrailExecutor.composeResult(ToolInputGuardrailResult oldResult, ToolInputGuardrailResult newResult) Keeps the rewritten arguments on a failed result, so a rejected call is reported with the arguments as the guardrails that ran before the failing one left them.protected ToolInputGuardrailResultToolInputGuardrailExecutor.handleFatalResult(ToolInputGuardrailResult accumulatedResult, ToolInputGuardrailResult result) Keeps the arguments rewritten by the guardrails before a fatal one, forAbstractToolGuardrailExecutor.throwIfFatal(P, R). -
Uses of ToolInputGuardrailResult in dev.langchain4j.observability.api.event
Subclasses with type arguments of type ToolInputGuardrailResult in dev.langchain4j.observability.api.eventModifier and TypeClassDescriptionstatic classBuilder forToolInputGuardrailExecutedEventinstances.Subinterfaces with type arguments of type ToolInputGuardrailResult in dev.langchain4j.observability.api.eventModifier and TypeInterfaceDescriptioninterfaceRepresents an event triggered upon the execution of a tool input guardrail. -
Uses of ToolInputGuardrailResult in dev.langchain4j.observability.api.listener
Subinterfaces with type arguments of type ToolInputGuardrailResult in dev.langchain4j.observability.api.listenerModifier and TypeInterfaceDescriptioninterfaceA listener forToolInputGuardrailExecutedEvents, triggered upon the execution of tool input guardrails. -
Uses of ToolInputGuardrailResult in dev.langchain4j.observability.event
Subclasses with type arguments of type ToolInputGuardrailResult in dev.langchain4j.observability.eventModifier and TypeClassDescriptionclassDefault implementation ofToolInputGuardrailExecutedEvent. -
Uses of ToolInputGuardrailResult in dev.langchain4j.service.guardrail
Methods in dev.langchain4j.service.guardrail that return ToolInputGuardrailResultModifier and TypeMethodDescriptionToolGuardrailService.executeInputGuardrails(ToolGuardrailService.ToolKey key, ToolInputGuardrailRequest request) Executes the input guardrails of the tool.Methods in dev.langchain4j.service.guardrail that return types with arguments of type ToolInputGuardrailResultModifier and TypeMethodDescriptionToolGuardrailService.executeInputGuardrailsAsync(ToolGuardrailService.ToolKey key, ToolInputGuardrailRequest request) Non-blocking counterpart ofToolGuardrailService.executeInputGuardrails(ToolKey, ToolInputGuardrailRequest): nothing is thrown, a fatal failure, an invalid key or a request that does not match the key fails the returned future. -
Uses of ToolInputGuardrailResult in dev.langchain4j.spi.guardrail
Subinterfaces with type arguments of type ToolInputGuardrailResult in dev.langchain4j.spi.guardrailModifier and TypeInterfaceDescriptioninterfaceRepresents a factory for creating instances ofToolInputGuardrailExecutor.ToolInputGuardrailExecutorBuilder.