evaluation library

Agent evaluation framework, metrics, LLM-as-a-Judge, and user simulation.

Provides AgentEvaluator, EvalSet, EvalCase, EvalMetric, and multi-run aggregation models such as MultiRunCaseResult, MultiRunCaseSummary, and MethodResult.

import 'package:adk_dart/evaluation.dart';

const metric = EvalMetric(
  metricName: 'response_match_score',
  threshold: 0.8,
);

Classes

AgentDetails
Per-agent metadata captured during one invocation.
AgentEvalCaseSummary
Evaluation summary for a single eval case.
AgentEvaluator
Utilities for loading eval sets and evaluating agents against them.
AgentMetricAggregate
Aggregated metric result for one metric across repeated runs.
AggregationMethod
Descriptor for a cross-run aggregation method.
AppDetails
Invocation-scoped metadata for all participating agents.
ArgumentConfig
Named or positional argument configuration.
AutoRaterResponseParser
Parser interface for converting auto-rater text into rubric responses.
AutoRaterScore
Parsed scoring output from one auto-rater response.
BaseCriterion
Base criterion definition for evaluation thresholds and metadata.
BaseEvalService
Runs inference and metric scoring pipelines for eval workloads.
BaseUserSimulatorConfig
Base configuration payload for user simulator implementations.
CallScoreCancellationToken
Token notified if a sibling call-score task fails during concurrent scoring.
CloudTtsClient
Client interface for synthesizing speech via Google Cloud Text-to-Speech.
CloudTtsLlm
BaseLlm implementation that converts text in LlmRequest into audio inline data using Google Cloud Text-to-Speech semantics.
CloudTtsLlmConnection
Live connection wrapper for CloudTtsLlm.
CloudTtsSynthesisRequest
Request payload passed to a CloudTtsClient or CloudTtsSynthesizer.
CodeConfig
Callable code reference and arguments.
ConversationGenerationConfig
Configuration parameters for generating synthetic conversation scenarios.
ConversationScenario
Defines a synthetic multi-turn conversation scenario for simulation.
ConversationScenarios
Wraps multiple ConversationScenario entries.
CrossRunCriterionSummary
The mean of one cross-run criterion's values over the cases of an eval set.
CustomCrossRunMethodConfig
Configuration for a custom cross-run aggregation method.
CustomMetricConfig
Declares one custom metric implementation used during evaluation.
CustomMetricEvaluator
Evaluator that delegates scoring to a registered custom metric function.
DefaultAutoRaterResponseParser
Default parser for Property/Rationale/Verdict auto-rater output.
DefaultCloudTtsClient
Default local CloudTtsClient that generates deterministic synthesized audio bytes when no external Cloud TTS client is injected.
DurationDetails
Detailed invocation duration breakdown recorded by efficiency evaluators.
EnsureRetryOptionsPlugin
Plugin that ensures default retry options on outgoing model requests.
EvalCase
One evaluation case definition.
EvalCaseResponses
Generated responses for one EvalCase across repeated runs.
EvalCaseResult
Aggregated evaluation result for one eval case.
EvalCaseResultMultiRunAggregator
Aggregator that combines per-repetition EvalCaseResult instances into MultiRunCaseResult summaries.
EvalConfig
Top-level evaluation configuration loaded from disk or defaults.
EvalConstants
Canonical keys used by evaluation fixtures and intermediate payloads.
EvalMetricResult
One metric evaluation result.
EvalMetricResultDetails
Detailed per-metric evaluation outputs.
EvalMetricResultPerInvocation
Metric results grouped by invocation pair.
EvalMetricResultSpec
Metric specification enriched with score and status.
EvalMetricSpec
Evaluation metric specification used in test configuration.
EvalSet
Collection of eval cases executed as one suite.
EvalSetResult
Aggregated result for an eval-set execution.
EvalSetResultsManager
Persists and reads stored eval set execution results.
EvalSetsManager
Persists and mutates evaluation set definitions.
EvalToolDeclaration
JSON-serializable ToolDeclaration with value equality for evaluation metadata.
EvaluateConfig
Runtime configuration for evaluation execution.
EvaluateRequest
Input for metric evaluation after inference completes.
EvaluationGenerator
Generates inference trajectories from eval sets.
EvaluationResult
Aggregated evaluation result for a full case.
Evaluator
Base interface for scoring one evaluation case.
FileSystemGcsStorageStore
Filesystem-backed fake implementation of GcsStorageStore for local use.
FinalResponseMatchV2Evaluator
LLM-as-a-judge evaluator for semantic final-response matching.
FinalResponseMatchV2EvaluatorMetricInfoProvider
Metric metadata provider for final response match v2 evaluation.
GcsEvalSetResultsManager
Cloud Storage-backed eval result manager.
GcsEvalSetsManager
Cloud Storage-backed eval set manager.
GcsStorageStore
Minimal storage abstraction for GCS-like text object operations.
HallucinationsCriterion
Criterion for hallucination evaluation.
HallucinationsV1Evaluator
Evaluator for hallucination metrics using LLM-judge prompts.
HallucinationsV1EvaluatorMetricInfoProvider
Metric metadata provider for hallucinations v1 evaluation.
InferenceCallCountV1Evaluator
Counts the number of inference (model) calls made in an invocation.
InferenceCallCountV1MetricInfoProvider
Metric metadata provider for inference_call_count_v1.
InferenceConfig
Options that control how inference is generated for eval cases.
InferenceRequest
Input for evaluation inference runs.
InferenceResult
Result of running model inference for an eval case.
InMemoryEvalSetResultsManager
In-memory eval result manager implementation.
InMemoryEvalSetsManager
In-memory eval set manager implementation.
IntermediateData
Intermediate tool-use and response payloads for an invocation.
Interval
Closed or open numeric interval.
Invocation
One invocation inside an eval conversation.
InvocationDurationV1Evaluator
Reports how long an invocation took in seconds, and where the time went across model, tool, and framework buckets.
InvocationDurationV1MetricInfoProvider
Metric metadata provider for invocation_duration_v1.
InvocationEvent
One invocation event entry.
InvocationEvents
Collection of invocation events.
InvocationResponse
One intermediate model response.
InvocationResultsSummarizer
Summarizer interface for invocation-level results.
JudgeEvaluationSemaphore
Async semaphore used to bound concurrent judge model requests.
JudgeModelOptions
Options for judge-model-based metric evaluation.
LiveModelConfig
Configuration for running an agent in live/bidirectional mode during evaluation.
LlmAsAJudgeCriterion
Criterion scored by an LLM judge model.
LlmAsJudge<C extends BaseCriterion>
Base evaluator that delegates scoring to a judge LLM.
LlmAudioUserSimulator
A multimodal UserSimulator that synthesizes 16 kHz PCM speech audio user messages by decorating a text-producing UserSimulator.
LlmAudioUserSimulatorConfig
Configuration for an LLM-backed audio user simulator.
LlmBackedUserSimulator
User simulator implementation driven by an LLM.
LlmBackedUserSimulatorConfig
Configuration for an LLM-backed user simulator.
LlmBackedUserSimulatorCriterion
Criterion configuration for LLM-backed user simulator metrics.
LocalEvalService
Local evaluation service that runs eval cases with an in-memory runner.
LocalEvalSetResultsManager
Filesystem-backed eval result manager for local history.
LocalEvalSetsManager
Filesystem-backed eval set manager for local projects.
MajorityVotePerInvocationResultsAggregator
Majority-vote aggregator for per-invocation rubric scores.
MeanInvocationResultsSummarizer
Mean-based summarizer for invocation-level rubric results.
MethodResult
How one aggregation rule judged the runs of an eval case.
MetricEvaluatorRegistry
Registry mapping metric names to evaluator factories and metadata.
MetricInfo
Human-readable information for one metric.
MetricInfoProvider
Provider interface for metric metadata.
MetricValueInfo
Range information for metric values.
MultiRunCaseResult
Aggregated cross-run result for one (evalSetId, evalId) pair.
MultiRunCaseSummary
Persisted cross-run summary for one eval case across all of its runs.
MultiRunConfig
Configuration for running each eval case multiple times and aggregating across runs.
MultiRunCriterion
An aggregation method paired with a pass/fail threshold across runs.
MultiTurnTaskSuccessV1Evaluator
Evaluates whether a multi-turn conversation achieves its overall goal.
MultiTurnTaskSuccessV1MetricInfoProvider
Metric metadata provider for multi-turn task success v1.
MultiTurnToolUseQualityV1Evaluator
Evaluates tool usage quality across a full multi-turn conversation.
MultiTurnToolUseQualityV1MetricInfoProvider
Metric metadata provider for multi-turn tool use quality v1.
MultiTurnTrajectoryQualityV1Evaluator
Evaluates the overall path taken across a multi-turn conversation.
MultiTurnTrajectoryQualityV1MetricInfoProvider
Metric metadata provider for multi-turn trajectory quality v1.
MultiTurnVertexAiEvalFacade
Multi-turn Vertex AI Eval facade that scores only the final turn.
NextUserMessage
Represents the next user message generated by a simulator.
PassKMultiRunCriterion
A pass@k or pass^k criterion over whole runs of an eval case.
PerInvocationResult
Per-invocation evaluation details for one conversation turn.
PerInvocationResultsAggregator
Aggregator interface for multiple per-invocation samples.
PerTurnUserSimulatorQualityV1
Evaluator for per-turn user simulator response quality.
PerTurnUserSimulatorQualityV1MetricInfoProvider
Metric metadata provider for per-turn user simulator quality v1.
PreBuiltBehaviors
Namespace of pre-built UserBehavior definitions used to compose personas.
PrebuiltMetricNames
Canonical names for built-in evaluation metrics.
RequestIntercepterPlugin
Plugin that captures model requests for evaluation workflows.
ResponseEvaluator
Evaluator for final-response matching metrics.
ResponseEvaluatorMetricInfoProvider
Metric metadata provider for response evaluation and response matching.
RougeEvaluator
Evaluator that scores final responses with ROUGE-style matching.
Rubric
One rubric definition that can be applied during evaluation.
RubricBasedEvaluator
Base evaluator for rubric-driven LLM-as-a-judge metrics.
RubricBasedFinalResponseQualityV1Evaluator
Evaluator for rubric-based final response quality.
RubricBasedFinalResponseQualityV1EvaluatorMetricInfoProvider
Metric metadata provider for rubric-based final response quality v1.
RubricBasedMultiTurnTrajectoryEvaluator
Evaluator for rubric-based assessment of a multi-turn agent trajectory.
RubricBasedMultiTurnTrajectoryMetricInfoProvider
Metric metadata provider for rubric-based multi-turn trajectory quality v1.
RubricBasedToolUseV1Evaluator
Evaluator for rubric-based tool-use quality.
RubricBasedToolUseV1EvaluatorMetricInfoProvider
Metric metadata provider for rubric-based tool-use quality v1.
RubricContent
Rubric body content used by LLM-as-judge criteria.
RubricResponse
Parsed rubric evaluation response item.
RubricsBasedCriterion
Criterion scored against explicit rubrics.
RubricScore
Score assigned to one rubric for a single evaluation result.
RunResult
Per-run data for one metric (or the case overall), passed to aggregation methods.
SafetyEvaluatorV1
Evaluator for safety policy adherence metrics.
SafetyEvaluatorV1MetricInfoProvider
Metric metadata provider for safety v1 evaluation.
ScenarioGenerator
Generates synthetic ConversationScenario instances for evaluating an agent via Vertex AI GenAI Evaluation semantics.
SessionInput
Session initialization payload used by eval runs.
StaticUserSimulator
Replays a fixed conversation as simulator output.
TimedInvocation
An Invocation carrying wall-clock duration measurements for efficiency evaluation.
TokenUsageDetails
Detailed token usage breakdown recorded by efficiency evaluators.
TokenUsageV1Evaluator
Sums the token usage reported across all model calls in an invocation.
TokenUsageV1MetricInfoProvider
Metric metadata provider for token_usage_v1.
ToolCallCountV1Evaluator
Counts the number of tool (function) calls made in an invocation.
ToolCallCountV1MetricInfoProvider
Metric metadata provider for tool_call_count_v1.
ToolParameterMatchCriterion
Criterion for evaluating tool parameter matches with ToolArgsMatcher.
ToolParameterMatchEvaluator
Scores each invocation by how well actual tool call arguments match expected calls.
ToolParameterMatchEvaluatorMetricInfoProvider
Metric metadata provider for tool_parameter_match.
ToolTrajectoryCriterion
Criterion for tool trajectory matching.
TrajectoryEvaluator
Evaluator for tool-trajectory quality metrics.
TrajectoryEvaluatorMetricInfoProvider
Metric metadata provider for tool trajectory evaluation.
UserBehavior
Describes one behavior pattern for a simulated user persona.
UserPersona
Defines a reusable user persona composed of multiple behaviors.
UserPersonaRegistry
Registry of named personas available to simulators.
UserSimulator<T extends BaseUserSimulatorConfig>
Base interface for producing simulated user turns.
UserSimulatorProvider
Selects the appropriate simulator implementation for an eval case.
VertexAiEvalFacade
Evaluator facade that scores invocations through Vertex AI Eval semantics.
VertexAiEvalMetricResult
Per-metric detail result returned by Vertex AI Eval.
VertexAiEvalOutput
Output payload returned by a Vertex AI Eval invocation.
VertexAiEvalSummaryMetric
Summary metric returned by Vertex AI Eval.
VertexAiRubricVerdict
Individual rubric verdict returned by Vertex AI Eval.

Enums

EvalMetric
Built-in evaluation metrics supported by the evaluator.
EvalStatus
Evaluation pass/fail status.
InferenceStatus
Inference execution status for one eval case.
Label
Labels parsed from evaluator outputs.
MatchType
Matching strategies for tool trajectories.
PrebuiltMetrics
Enum wrapper for built-in metric identifiers.
Status
Outcome status for generating the next simulated user turn.

Extensions

EfficiencyDurationDetailsX on DurationDetails
Nullable duration breakdown accessors matching ADK Python's DurationDetails model.
EfficiencyEvaluationResultX on EvaluationResult
Efficiency breakdown accessors on EvaluationResult.
EfficiencyInvocationTimingX on Invocation
Timing accessors on Invocation used by InvocationDurationV1Evaluator.
EfficiencyPerInvocationResultX on PerInvocationResult
Efficiency breakdown accessors on PerInvocationResult.
EfficiencyTokenUsageDetailsX on TokenUsageDetails
Nullable per-type token breakdown accessors matching ADK Python's TokenUsageDetails model.
MatchTypeX on MatchType
Utility methods for MatchType.

Constants

defaultAggregationMethod → const AggregationMethod
Default score-combining aggregation method (mean_over_invocations).
defaultAuthor → const String
Fallback author label for agent-generated events.
defaultEvalAppName → const String
Default application name used when an EvalCase has no SessionInput.
defaultEvalUserId → const String
Default user identifier used when an EvalCase has no SessionInput.
defaultLiveTimeoutSeconds → const int
Timeout for waiting for live model turn completion during eval inference.
errorMessageSuffix → const String
Guidance appended to errors when Vertex AI project/location is missing.
evalSessionIdPrefix → const String
Prefix used for generated evaluation session IDs.
liveInputMimeType → const String
Canonical MIME type for 16 kHz PCM Live API input.
liveInputRateHz → const int
Live API input sample rate in Hz (16-bit mono PCM).
liveOutputRateHz → const int
Common Live/TTS output sample rate in Hz (16-bit mono PCM).
llmRequestIdKey → const String
The metadata/state key used to correlate model responses with requests.
maxConcurrentCallScores → const int
Maximum number of (expectedCall, actualCall) pairs scored concurrently.
missingEvalDependenciesMessage → const String
The guidance message shown when evaluation dependencies are unavailable.
retryHttpStatusCodes → const List<int>
The HTTP status codes considered retryable by default.
scenarioErrorMessageSuffix → const String
Guidance appended to errors when Vertex AI project/location is missing.
ttsEncodingToMimeType → const Map<String, String>
Mapping from Cloud TTS AudioEncoding names to output MIME types.
userAuthor → const String
Author value used for synthetic user events.

Properties

currentCallScoreCancellationToken → CallScoreCancellationToken?
Active CallScoreCancellationToken in the current async zone, if any.
no setter
defaultHttpRetryOptions → HttpRetryOptions
The default HTTP retry strategy for evaluator model calls.
final
defaultMetricEvaluatorRegistry → MetricEvaluatorRegistry
Shared default evaluator registry instance.
final

Functions

addDefaultRetryOptionsIfNotPresent(LlmRequest llmRequest) → void
Adds defaultHttpRetryOptions when llmRequest has no retry settings.
addEvalCaseToEvalSet(EvalSet evalSet, EvalCase evalCase) → EvalSet
The evalSet with evalCase appended.
aggregateEvalCaseResults(List<EvalCaseResult> evalCaseResults, {MultiRunConfig? multiRunConfig}) → List<MultiRunCaseResult>
Groups evalCaseResults by (evalSetId, evalId) and aggregates each case across runs.
appendDefaultEfficiencyMetrics(List<EvalMetricSpec> evalMetrics) → List<EvalMetricSpec>
Returns evalMetrics with the informational efficiency metrics added.
asDoubleOr(Object? value, {double fallback = 0.0}) → double
Returns value as double or fallback when conversion fails.
asEvalJson(Object? value) → EvalJson
Casts value to EvalJson, returning an empty map when invalid.
asEvalJsonList(Object? value) → List<EvalJson>
Casts value to a list of EvalJson maps.
asNullableDouble(Object? value) → double?
Returns value as double when numeric, otherwise null.
asNullableString(Object? value) → String?
Returns value when it is a String, otherwise null.
asObjectList(Object? value) → List<Object?>
Casts value to a JSON-like list, returning an empty list when invalid.
buildJudgeRequestConfig(Object? userConfig) → GenerateContentConfig
Builds a GenerateContentConfig for judge LLM calls with automatic function calling disabled while preserving caller settings.
buildMultiRunCaseSummaries(List<EvalCaseResult> evalCaseResults, {MultiRunConfig? multiRunConfig}) → List<MultiRunCaseSummary>
Alias for summarizeEvalCaseResults.
buildMultiRunCaseSummary(MultiRunCaseResult caseResult) → MultiRunCaseSummary
Alias for summarizeMultiRunCaseResult.
checkPassKCriteriaAgainstNumRuns(MultiRunConfig? multiRunConfig, int numRuns) → void
Validates that any pass@k or pass^k criterion has k <= numRuns.
clearCustomAggregationMethods() → void
Clears all registered custom cross-run aggregation methods.
convertEvalSetToModernSchema(String evalSetId, List oldFormat) → EvalSet
The modern EvalSet converted from legacy oldFormat entries.
countRunsFailedWithoutMetricResults(List<EvalCaseResult> perCaseResults) → int
Counts runs in perCaseResults that failed during inference before metrics ran.
createDurationDetails({double? totalSeconds, double? modelSeconds, double? toolSeconds, double? frameworkSeconds}) → DurationDetails
Constructs a DurationDetails with nullable timing buckets matching Python DurationDetails.
createEvalSetResult(String appName, String evalSetId, List<EvalCaseResult> evalCaseResults, {List<MultiRunCaseSummary>? multiRunCaseSummaries}) → EvalSetResult
The new EvalSetResult instance for one evaluation run.
createTokenUsageDetails({double? totalTokens, double? inputTokens, double? promptTokens, double? cachedTokens, double? toolUseTokens, double? outputTokens, double? candidatesTokens, double? reasoningTokens}) → TokenUsageDetails
Constructs a TokenUsageDetails with nullable floating-point token buckets matching Python TokenUsageDetails.
deleteEvalCaseFromEvalSet(EvalSet evalSet, String evalCaseId) → EvalSet
The evalSet with the eval case identified by evalCaseId removed.
describeRunStatuses(List<EvalStatus> statuses, {int crashed = 0}) → String
Formats a human-readable summary of run statuses and crashed counts.
gatherCancellingOnError<T>(Iterable<Future<T>> futures) → Future<List<T>>
Runs futures concurrently, propagating the first error and draining siblings.
getAllToolCalls(Object? intermediateData) → List<EvalJsonMap>
Returns all tool-call payloads from intermediateData.
getAllToolCallsWithResponses(Object? intermediateData) → List<(EvalJsonMap, EvalJsonMap?)>
Returns tool calls paired with optional matching responses.
getAllToolResponses(Object? intermediateData) → List<EvalJsonMap>
Returns all tool-response payloads from intermediateData.
getAllUsageMetadata(Invocation invocation) → List<EvalJsonMap>
Returns the usage metadata map for every invocation event in invocation that reported it.
getAverageRubricScore(List<RubricScore> rubricScores) → double?
Returns the arithmetic mean score across rubricScores.
getBuiltInAggregationMethods() → Map<String, AggregationMethod>
Returns a copy of the built-in aggregation methods keyed by method name.
getDefaultMetricEvaluatorRegistry() → MetricEvaluatorRegistry
Builds the default evaluator registry with all prebuilt metrics.
getDefaultPersonaRegistry() → UserPersonaRegistry
The registry pre-populated with built-in user simulator personas.
getEvalCaseFromEvalSet(EvalSet evalSet, String evalCaseId) → EvalCase?
The eval case in evalSet matching evalCaseId.
getEvalMetricsFromConfig(EvalConfig evalConfig) → List<EvalMetricSpec>
Converts evalConfig criteria into normalized metric specs.
getEvalSessionAppNameAndUserId(SessionInput? initialSession) → (String, String)
Resolves (appName, userId) for an evaluation session from initialSession.
getEvalSetFromAppAndId(EvalSetsManager manager, String appName, String evalSetId) → Future<EvalSet>
The EvalSet for appName and evalSetId from manager.
getEvalStatus(double? score, double threshold) → EvalStatus
Returns pass/fail status for score against threshold.
getEvaluationCriteriaOrDefault(String? evalConfigFilePath) → EvalConfig
Loads evaluation config from evalConfigFilePath or returns defaults.
getGroundingMetadataAsJsonStr(Object? intermediateData) → String
Serializes grounding metadata from intermediateData into indented JSON.
getLlmBackedUserSimulatorPrompt({required String conversationPlan, required String conversationHistory, required String stopSignal, String? customInstructions, UserPersona? userPersona}) → String
The rendered prompt used by the LLM-backed user simulator.
getMetricThreshold(EvalMetricSpec evalMetric) → double
Returns the configured threshold for evalMetric or throws ArgumentError.
getPerTurnUserSimulatorQualityPrompt({required String conversationPlan, required String conversationHistory, required String generatedUserResponse, required String stopSignal, UserPersona? userPersona}) → String
The rendered evaluator prompt for one simulated user turn.
getRunStatus(EvalCaseResult evalCaseResult) → EvalStatus
Computes the overall EvalStatus of a single evalCaseResult across its metrics.
getTextFromContent(Object? content, {bool includeIntermediateResponsesInFinal = false}) → String?
Extracts plain text from an evaluation content payload or Invocation.
getToolCallsAndResponsesAsJsonStr(Object? intermediateData) → String
Serializes tool calls and responses from intermediate invocation data.
getToolDeclarationsAsJsonStr(AppDetails appDetails) → String
Serializes app tool declarations into indented JSON.
hasPassCountRules(MultiRunConfig? multiRunConfig) → bool
Returns true when multiRunConfig configures any pass-count rule or gated cross-run criterion.
isValidUserSimulatorTemplate(String templateStr, {required List<String> requiredParams}) → bool
Whether templateStr is valid for the required placeholder parameters.
loadAggregationMethods(MultiRunConfig? multiRunConfig) → Map<String, AggregationMethod>
Returns the map of built-in and custom AggregationMethods for multiRunConfig.
loadCustomAggregationMethod(String name, CustomCrossRunMethodConfig config) → AggregationMethod
Loads a user-defined aggregation method from config.
loadEvalSetFromFile(String evalSetFilePath, String evalSetId) → EvalSet
The EvalSet loaded from evalSetFilePath.
meanOfRuns(List<RunResult> runs) → double?
Arithmetic mean of run-level scores across runs that produced a score.
meanOverInvocations(List<RunResult> runs) → double?
Mean over all per-invocation scores across all runs.
minOverRuns(List<RunResult> runs) → double?
Minimum run-level score across runs that produced a score.
parseCritique(String response) → Label
The normalized Label extracted from auto-rater response text.
parseEvalSetResultJson(String evalSetResultJson) → EvalSetResult
The parsed EvalSetResult object from evalSetResultJson.
parseSampleRate(String? mimeType, {int defaultRate = liveOutputRateHz}) → int
Extracts the sample rate from a MIME type such as 'audio/pcm;rate=24000'.
passAtK(List<RunResult> runs, int k) → double?
Unbiased estimator of pass@k: probability of >= 1 pass in k draws.
passHatK(List<RunResult> runs, int k) → double?
Unbiased estimator of pass^k: probability that all k draws pass.
passRate(List<RunResult> runs) → double?
Fraction of evaluated runs that passed (passed / (passed + failed)).
registerCustomAggregationFunction(String path, Object? function) → void
Alias for registerCustomAggregationMethod.
registerCustomAggregationMethod(String path, Object? function) → void
Registers a custom cross-run aggregation function or value at path.
registerCustomMetricFunction(String path, CustomMetricFunction function) → void
Registers a custom metric function at path.
registerCustomMetricsFromConfig(EvalConfig evalConfig, [MetricEvaluatorRegistry? metricEvaluatorRegistry]) → MetricEvaluatorRegistry
Registers custom metrics declared in evalConfig into metricEvaluatorRegistry (or defaultMetricEvaluatorRegistry when omitted).
resamplePcm16(Uint8List pcmBytes, {required int fromRate, int toRate = liveInputRateHz}) → Uint8List
Resamples 16-bit signed little-endian mono PCM via linear interpolation.
sanitizeEvalSetResultName(String evalSetResultName) → String
The normalized eval set result name derived from evalSetResultName.
serializeToolDeclarationToJson(ToolDeclaration tool) → Map<String, Object?>
Serializes a ToolDeclaration into a JSON-compatible map.
summarizeCrossRunCriteria(List<MultiRunCaseResult> caseResults) → List<CrossRunCriterionSummary>
Returns the mean of each cross-run criterion over caseResults.
summarizeEvalCaseResults(List<EvalCaseResult> evalCaseResults, {MultiRunConfig? multiRunConfig}) → List<MultiRunCaseSummary>
Aggregates per-run evalCaseResults into serializable MultiRunCaseSummary values.
summarizeMultiRunCaseResult(MultiRunCaseResult caseResult) → MultiRunCaseSummary
Converts a MultiRunCaseResult into a serializable MultiRunCaseSummary.
toLiveInput(Blob audioBlob, {int targetRate = liveInputRateHz}) → Blob
Converts synthesized speech audioBlob into a 16-bit mono PCM Blob at targetRate ('audio/pcm;rate=$targetRate') for Live API input.
unregisterCustomAggregationFunction(String path) → void
Alias for unregisterCustomAggregationMethod.
unregisterCustomAggregationMethod(String path) → void
Unregisters a previously registered custom aggregation method at path.
unregisterCustomMetricFunction(String path) → void
Removes a previously registered custom metric function at path.
updateEvalCaseInEvalSet(EvalSet evalSet, EvalCase updatedEvalCase) → EvalSet
The evalSet with an existing eval case replaced by updatedEvalCase.
validateInvocationLengths(List<Invocation> actualInvocations, List<Invocation>? expectedInvocations) → void
Validates that actualInvocations and expectedInvocations have equal length when expectedInvocations is provided.

Typedefs

AgentModuleLoader = Future<BaseAgent> Function(String moduleName)
Loads a root BaseAgent from a module name.
AggregationMethodFn = double? Function(List<RunResult> runs)
Function signature for cross-run aggregation methods.
AggregationMethodWithKFn = double? Function(List<RunResult> runs, int k)
Function signature for parameterized (k) cross-run aggregation methods.
AsyncScenarioGenerationInvoker = FutureOr<List<Object?>> Function({required BaseAgent agent, required ConversationGenerationConfig config, required String location, required String projectId})
Async callback signature for custom asynchronous scenario generation backends.
AutoRaterInvoker = Future<LlmResponse> Function({required JudgeModelOptions judgeModelOptions, required String prompt})
Function signature used to invoke the auto-rater model.
Blob = InlineData
Alias for InlineData matching google.genai.types.Blob.
CloudTTSLlm = CloudTtsLlm
Alias for CloudTtsLlm matching the Python CloudTTSLlm class name.
CloudTtsSynthesizer = FutureOr<List<int>> Function(CloudTtsSynthesisRequest request)
Callback signature for synthesizing speech audio bytes.
CustomMetricFunction = FutureOr<EvaluationResult> Function(EvalMetricSpec evalMetric, List<Invocation> actualInvocations, List<Invocation>? expectedInvocations, ConversationScenario? conversationScenario)
Signature for externally registered custom metric evaluators.
EvalJson = Map<String, Object?>
Canonical JSON-like map used by evaluation models.
EvalJsonMap = Map<String, Object?>
Canonical JSON map type for evaluation payloads.
EvaluatorFactory = Evaluator Function(EvalMetricSpec evalMetric)
Creates an Evaluator instance for one metric specification.
ScenarioGenerationInvoker = List<Object?> Function({required BaseAgent agent, required ConversationGenerationConfig config, required String location, required String projectId})
Callback signature for custom scenario generation backends.
StaticConversation = List<Invocation>
Static list of expected user-side invocations.
Threshold = double
Minimum passing score threshold for a metric.
UserSimulatorConfigDecoder<T extends BaseUserSimulatorConfig> = T Function(BaseUserSimulatorConfig config)
Decodes a concrete simulator config from a base config payload.
UserSimulatorFactory = UserSimulator<BaseUserSimulatorConfig> Function(BaseUserSimulatorConfig config, ConversationScenario scenario)
Factory signature for building a UserSimulator from config and scenario.
VertexAiEvalInvoker = Future<VertexAiEvalOutput> Function({required List<Map<String, String?>> dataset, required List<String> metrics})
Function signature that performs a Vertex AI Eval request.