Package akka.javasdk.agent.evaluator
Class HallucinationEvaluator
Object
akka.javasdk.agent.Agent
akka.javasdk.agent.evaluator.HallucinationEvaluator
- All Implemented Interfaces:
AgentDelegationWorker
@Deprecated(since="3.7.1",
forRemoval=true)
@Component(id="hallucination-evaluator",
name="Hallucination Evaluator Agent",
description="An agent that acts as an LLM judge to evaluate whether an output contains information\nnot available in the reference text given an input question.\n")
public class HallucinationEvaluator
extends Agent
Deprecated, for removal: This API element is subject to removal in a future version.
An agent that acts as an LLM judge to evaluate whether an output contains information not
available in the reference text given an input question.
Model provider is defined in configuration
akka.javasdk.agent.evaluators.hallucination-evaluator.model-provider, which by default is the
same as the default model provider.
The system and user message prompts are loaded from PromptTemplate with id
hallucination-evaluator.system and hallucination-evaluator.user respectively. Default
prompts are used if these are not defined. The prompts can be initialized or updated with the
PromptTemplate entity.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordDeprecated, for removal: This API element is subject to removal in a future version.An answer to judge for hallucinated content.static final recordDeprecated, for removal: This API element is subject to removal in a future version.The verdict for an answer: whether it passed the hallucination check, and the judge's explanation for the label it assigned.Nested classes/interfaces inherited from class akka.javasdk.agent.Agent
Agent.AgentReply<T>, Agent.Effect<T>, Agent.StreamEffect, Agent.TokenUsage -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ComponentClientprotected final Stringprotected final com.typesafe.config.Config -
Constructor Summary
ConstructorsConstructorDescriptionHallucinationEvaluator(ComponentClient componentClient, com.typesafe.config.Config config) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionDeprecated, for removal: This API element is subject to removal in a future version.Judge whether the given answer contains information not available in the reference text.protected ModelProviderprotected StringMethods inherited from class akka.javasdk.agent.Agent
context, effects, streamEffects
-
Field Details
-
componentId
-
componentClient
-
config
protected final com.typesafe.config.Config config
-
-
Constructor Details
-
HallucinationEvaluator
Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
evaluate
public Agent.Effect<HallucinationEvaluator.Result> evaluate(HallucinationEvaluator.EvaluationRequest req) Deprecated, for removal: This API element is subject to removal in a future version.Judge whether the given answer contains information not available in the reference text.- Parameters:
req- the query, reference text, and answer to evaluate
-
modelProvider
-
prompt
-
Evaluatorcomponent that calls a judge agent of your own to judge whether an output is grounded in a reference text.