Package akka.javasdk.agent
Class ModelCallSimilarityGuard
Object
akka.javasdk.agent.ModelCallSimilarityGuard
- All Implemented Interfaces:
Guardrail,ModelCallGuardrail
Built-in
ModelCallGuardrail. Denies a model call when a user message or tool result
matches a "bad example" at or above the threshold.
Its config must not define use-for.
-
Nested Class Summary
Nested classes/interfaces inherited from interface akka.javasdk.agent.Guardrail
Guardrail.GuardrailException, Guardrail.Message, Guardrail.ResultNested classes/interfaces inherited from interface akka.javasdk.agent.ModelCallGuardrail
ModelCallGuardrail.CallContext -
Constructor Summary
ConstructorsConstructorDescriptionModelCallSimilarityGuard(GuardrailContext context) Readsbad-examples-resource-dirandthresholdfrom the guardrail's config. -
Method Summary
Modifier and TypeMethodDescriptionNot supported.Not supported.
-
Constructor Details
-
ModelCallSimilarityGuard
Readsbad-examples-resource-dirandthresholdfrom the guardrail's config.- Throws:
IllegalArgumentException- ifthresholdis not in (0, 1], or ifbad-examples-resource-diris not on the classpath
-
-
Method Details
-
decide
Not supported. ThrowsIllegalStateException.- Specified by:
decidein interfaceModelCallGuardrail- Returns:
- the decision
-
decideAsync
Not supported. ThrowsIllegalStateException.- Specified by:
decideAsyncin interfaceModelCallGuardrail- Returns:
- a CompletionStage with the decision
-