Package akka.javasdk.agent
Class SimilarityGuard
Object
akka.javasdk.agent.SimilarityGuard
- All Implemented Interfaces:
Guardrail
,TextGuardrail
The SimilarityGuard evaluates the text by making a similarity search in a dataset of "bad
examples". If the similarity exceeds a threshold, the result is flagged as blocked.
-
Nested Class Summary
Nested classes/interfaces inherited from interface akka.javasdk.agent.Guardrail
Guardrail.GuardrailException, Guardrail.Result
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionEvaluates if the text passes the guardrail or not.double
-
Constructor Details
-
SimilarityGuard
-
-
Method Details
-
threshold
public double threshold() -
badExamplesResourceDir
-
evaluate
Description copied from interface:TextGuardrail
Evaluates if the text passes the guardrail or not.- Specified by:
evaluate
in interfaceTextGuardrail
-