adk_core library
Flutter and Web-safe ADK entrypoint.
This surface intentionally excludes APIs that require dart:io,
dart:ffi, dart:mirrors, local process execution, or local filesystem
access. Use package:adk_dart/adk_dart.dart for the full VM and CLI
surface.
import 'package:adk_dart/adk_core.dart';
Future<void> runCoreAgent() async {
final agent = LlmAgent(
name: 'core_assistant',
model: Gemini(model: 'gemini-2.5-flash'),
instruction: 'Provide helpful responses.',
);
final runner = InMemoryRunner(agent: agent);
final session = await runner.sessionService.createSession(
appName: runner.appName,
userId: 'user_1',
);
await for (final event in runner.runAsync(
userId: 'user_1',
sessionId: session.id,
newMessage: Content.userText('Hi from Flutter or Web!'),
)) {
// Handle streamed events in your UI.
}
}
Classes
- ActiveBackgroundTool
- One tool call running in the background of a live invocation.
- ActiveNonBlockingToolTasksView
-
Live
MapBaseview of non-blocking tool tasks backed by InvocationContext.activeBackgroundTools. - ActiveStreamingToolsView
-
Live
MapBaseview of streaming tools backed by InvocationContext.activeBackgroundTools. - ActivityEvent
- Generic activity or status event.
- AdkAbortController
- Controller used by callers to cancel an ADK invocation.
- AdkAbortSignal
- Read-only cancellation signal propagated through an invocation.
- AdkMetricRecord
- One ADK metric sample.
- AdkMetricsRecorder
- Sink for ADK metric samples.
- AdvisorResult
- Successful response payload returned by ModelConsultTool.
- AdvisorUsage
- Token usage reported by the advisor model.
- AgentInfo
- Metadata summary for an LlmAgent and its sub-agents.
- AgentNode
- Node that wraps an ADK BaseAgent.
- AgentSpokenOutput
- Text segment whose corresponding audio has been emitted by the TTS stage.
- AgentTool
- Tool adapter that executes another agent as a tool call.
- AgentToolConfig
- Configuration model for AgentTool.
- AnthropicGcsObject
-
Metadata and raw bytes downloaded from a
gs://object for Claude. - AnthropicGenerateContentConfig
- Specialized generation configuration for Anthropic Claude models.
- AnthropicLlm
- Anthropic Claude adapter for ADK model requests.
- AnthropicRestHttpTransport
- Default HTTP-backed transport for the Anthropic Messages API.
- AnthropicRestTransport
- Transport abstraction for Anthropic Messages API calls.
- App
- App container describing root agent, plugins, and runtime options.
- ArgMatchResult
- Result of matching a single argument value.
- ArtifactVersion
- Metadata describing one persisted artifact version.
- AudioChunk
- Synthesized audio chunk ready to be streamed to the caller.
- AutomaticFunctionCallingConfig
- Configuration for SDK-managed automatic function calling.
- AutoTracingPlugin
- Automatically records run, agent, model, and tool spans.
- BaseAgent
- Base class for all agent implementations.
- BaseAgentState
- Generic mutable state holder for agent-local state.
- BaseArgMatcher
- Abstract base class for single-argument matchers.
- BaseArtifactService
- Base contract for artifact persistence services.
- BaseClassifier
- Stateless model that answers typed questions with probability distributions.
- BaseCriterion
- Base criterion definition for evaluation thresholds and metadata.
- BaseLlm
- Base interface for model adapters used by the runner.
- BaseMemoryService
- Base contract for memory ingestion and search implementations.
- BaseNode
- Base class for node-based workflow units.
- BasePlugin
- Base class for ADK runtime plugins.
- BaseSessionService
- Contract for session lifecycle and event persistence operations.
- BaseTelemetryService
- Contract for telemetry trace/span lifecycle services.
- BaseTool
- Base contract for one callable tool exposed to the model runtime.
- BaseUserSimulatorConfig
- Base configuration payload for user simulator implementations.
- Binary
- Question that asks for the calibrated probability that a statement is true.
- BinaryAnswer
- Answer to a Binary question.
- BranchPath
- Hierarchical path representation for dynamic execution branches.
- BufferedSessionService
- A session service that writes events to another one in the background.
- BufferedSessionServiceConfig
- Configuration for BufferedSessionService.
- CallbackInfo
- Metadata describing the currently executing callback.
- CallCodeEvent
- Request to execute code.
- CancelSignal
- Cooperative cancellation signal passed to LiveEgress transforms.
- CascadeLive
- Wraps any text BaseLlm with speech-to-text and text-to-speech transforms to support live audio sessions.
- CascadeLiveConnection
- Live connection bridging STT ingress, text reasoning, and TTS egress.
- CasefoldArgMatcher
- Case-insensitive string equality matcher (trims surrounding whitespace).
- ChildScanState
- Recovered child scan state from event history for replay interception.
- Choice
- Question that asks a classifier to pick one of N labels.
- ChoiceAnswer
- Answer to a Choice question.
- ClassifierAnswer
- Base class for typed answers returned by a classifier.
- ClassifierNode
- Workflow node that classifies its input and routes to the resulting label.
- ClassifierQuestion
- Base class for typed questions answered by a classifier.
- ClassifierResponse
- Answers returned from a single classifier call.
-
CloseableSyncIterable<
T> - Synchronous Iterable returned by AutoTracingPlugin.wrapSyncGenerator that tracks active iterators and supports explicit close on early exit.
-
CloseableSyncIterator<
T> - Synchronous Iterator that closes its underlying generator and span when exhausted, when an error is thrown, or when close is called explicitly.
- CodeResultEvent
- Result of code execution.
- ConsultModelTool
-
Alias class for ModelConsultTool providing the
ConsultModelToolname. - ConsultModelToolset
-
Alias class for ModelConsultToolset providing the
ConsultModelToolsetname. - ContainsArgMatcher
- Substring or collection element containment matcher.
- Content
- One conversation turn consisting of a role and Part list.
- ContentEvent
- User-visible text content.
- Context
- Mutable context for a single agent invocation.
- 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.
- DurationDetails
- Detailed invocation duration breakdown recorded by efficiency evaluators.
- DynamicJson
- Helpers for tolerant JSON encode/decode behavior.
- DynamicNodeRun
- Current in-memory state of a dynamic or static node run.
- Edge
- Directed workflow edge.
- EdgeChain
- A chain of edges positioned at a node, started by EdgesBuilder.from, EdgesBuilder.fromStart, or NodeGroupChain.joinTo.
- EdgesBuilder
- A builder for the edges of a workflow graph, declared as chains of calls that start at from or fromStart.
- EgressEvent
- Base class for events emitted by a LiveEgress transform.
- ErrorEvent
- Runtime error event.
- 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.
- 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.
- EvalSetResult
- Aggregated result for an eval-set execution.
- EvaluateConfig
- Runtime configuration for evaluation execution.
- Event
- One runtime event emitted during an invocation.
- EventActions
- Mutable action payload attached to one event.
- EventCompaction
- Compaction summary metadata attached to an event.
- EventsCompactionConfig
- Configuration for event compaction behavior.
- ExactArgMatcher
- Exact equality argument matcher.
- FileData
- File reference payload attached to a Part.
- FinishedEvent
- Final response marker.
- FinishTaskTool
- Tool that validates final task output and signals completion.
- ForceEscalationPlugin
- Enforces deterministic model escalation triggers for ModelConsultTool.
- Frontmatter
- L1 skill metadata parsed from SKILL.md frontmatter.
- FunctionCall
- Function-call payload emitted by model responses.
- FunctionCallingConfig
- Function-calling configuration attached to tool settings.
- FunctionDeclaration
- Function-calling declaration exposed to the model.
- FunctionNode
- Function-backed workflow node.
- FunctionResponse
- Function-response payload sent back to the model.
- FunctionTool
- Wraps a Dart callable as a runtime tool.
- Gemini
- Google Gemini model adapter with REST, interactions, and live support.
- GeminiDecisionsClassifier
- Answers typed questions with the Gemini Decisions API.
- GeminiSTT
- Speech-to-text transform converting live audio into transcripts using Gemini.
- GeminiTTS
- Text-to-speech transform converting text deltas into speech using Gemini.
- Gemma
- Integration for Gemma 3 models exposed via the Gemini API.
- Gemma3Ollama
- Integration for Gemma 3 models running locally via Ollama.
- GemmaFunctionCallModel
- Parsed inline Gemma function call payload.
- GenerateContentConfig
- Generation configuration for text/content model calls.
- GetSessionConfig
- Options for narrowing session retrieval results.
- GetUserChoiceTool
- Long-running function tool that prompts user to select from a list of options.
- GlobalInstructionPlugin
- Prepends a global system instruction to outgoing model requests.
- GoogleSearchTool
- Tool wrapper for Google Search grounding.
- HallucinationsCriterion
- Criterion for hallucination evaluation.
- HttpOptions
- HTTP configuration for model API requests.
- HttpRetryOptions
- Retry policy for HTTP model requests.
- IgnoreArgMatcher
- Wildcard matcher that ignores the argument value and always succeeds.
- InferenceResult
- Result of running model inference for an eval case.
- IngressEvent
- Base class for events emitted by a LiveIngress transform.
- InlineData
- Inline binary payload attached to a Part.
- InMemoryAdkMetricsRecorder
- Metrics recorder that stores samples in memory for tests and adapters.
- InMemoryArtifactService
- Artifact service backed by process-local memory maps.
- InMemoryMemoryService
- Memory service backed by process-local event collections.
- InMemoryMongoDbSessionClient
- In-memory implementation of MongoDbSessionClient.
- InMemoryMongoDbSessionCollection
- In-memory implementation of MongoDbSessionCollection for testing and local use.
- InMemoryMongoDbSessionDatabase
- In-memory implementation of MongoDbSessionDatabase.
- InMemoryRunner
- Runner wired with in-memory session and artifact services.
- InMemorySessionService
- Session service backed by process-local maps.
- InMemorySkillBuilder
- Builder for one in-memory skill.
- InMemorySkillData
- Complete in-memory payload for one skill source entry.
- InMemorySkillSource
- In-memory SkillSource implementation.
- InMemorySkillSourceBuilder
- Builder for InMemorySkillSource.
- InMemoryTelemetryService
- In-memory telemetry implementation for local development and tests.
- InterceptionResult
- Decision returned by checkInterception.
- Interval
- Closed or open numeric interval.
- InvocationContext
- Mutable invocation context shared across agent execution steps.
- InvocationPlan
- One invocation strategy used to call flexible user functions.
- JoinNode
- Node that passes through aggregated predecessor inputs.
- JudgeModelOptions
- Options for judge-model-based metric evaluation.
- ListSessionsResponse
- Response model for session list operations.
- ListSkillsTool
- Tool to list all locally available skills.
- LiteLlm
- OpenAI-compatible adapter that targets LiteLLM providers.
- LiveActivityEnd
- Marker indicating the end of a live activity segment.
- LiveActivityStart
- Marker indicating the start of a live activity segment.
- LiveClientRealtimeInput
- Structured realtime input payload for CascadeLiveConnection.sendRealtimeInput.
- LiveConnectConfig
- Realtime connection configuration for live model sessions.
- LiveEgress
- Text-to-speech stream transform converting text deltas to EgressEvents.
- LiveIngress
- Speech-to-text stream transform converting audio chunks to IngressEvents.
- LiveModelConfig
- Configuration for running an agent in live/bidirectional mode during evaluation.
- LiveRequest
- A single queued live request payload.
- LiveRequestQueue
- In-memory FIFO queue for live requests.
- LiveSkillGcsStore
- Web stub for live GCS-backed skill storage.
- LiveTranscription
- Transcription payload emitted on LlmResponse.inputTranscription and LlmResponse.outputTranscription.
- LlmAgent
- Core LLM agent that drives model and tool orchestration flows.
- LlmAsAJudgeCriterion
- Criterion scored by an LLM judge model.
- LlmBackedUserSimulatorCriterion
- Criterion configuration for LLM-backed user simulator metrics.
- LlmCapabilities
- Resolved capabilities for an LLM instance.
- LlmClassifier
- Classifier that answers typed questions with any BaseLlm via structured output.
- LLMRegistry
- Registry that maps model patterns to concrete LLM adapters.
- LlmRequest
- Full model request payload used by LLM adapters.
- LlmResponse
- Normalized model response emitted by LLM adapters.
- LlmToolConfig
- Tool-level configuration wrapper for model requests.
- LoadMcpResourceTool
- Tool that injects MCP resource contents into pending LLM requests.
- LoadSkillResourceTool
- Tool to load a resource from a skill bundle.
- LoadSkillTool
- Tool to load a skill's main instructions.
- LocalSkillSource
- Filesystem-backed SkillSource, unsupported on Web.
- LoggingPlugin
- Console logging plugin for invocation, model, and tool lifecycle events.
- LoopAgent
- Workflow agent that iterates through sub-agents repeatedly.
- LoopAgentState
- Serialized resumability state for LoopAgent.
- ManagedAgent
- An agent backed by the Managed Agents API (interactions.create).
- McpBaseTool
- Lightweight MCP tool descriptor used by McpTool.
- McpResourceContent
-
Content returned by
resources/read. - McpServerMessage
- A server-originated MCP message delivered by this client.
- McpSessionManager
- Central registry and transport manager for MCP sessions.
- McpTool
- Auth-aware MCP tool wrapper that delegates calls through McpSessionManager.
- McpToolset
- Toolset that exposes tools and resources from one MCP connection.
- McpToolsetConfig
- Declarative configuration model for constructing an McpToolset.
- MemoryEntry
- One memory item with content and optional metadata.
- MethodResult
- How one aggregation rule judged the runs of an eval case.
- MetricInfo
- Human-readable information for one metric.
- MetricInfoProvider
- Provider interface for metric metadata.
- MetricValueInfo
- Range information for metric values.
- ModalityTokenUsage
- Per-modality token count entry.
- ModelConsultContextConfig
- Controls how conversation history is formatted for the advisor model.
- ModelConsultObservabilityPlugin
- Plugin that records primary model usage, ConsultModelTool escalations, and estimated token costs across invocations.
- ModelConsultReport
- Immutable snapshot of model consultation observability metrics and costs.
- ModelConsultStats
- Token usage and cost statistics for a single model.
- ModelConsultTool
- Tool that allows an agent to consult a secondary advisor LLM for guidance.
- ModelConsultToolset
- Toolset that exposes a ModelConsultTool and injects usage instructions.
- ModelConsultUsage
- Aggregated token and call usage for a single model.
- MongoDbMemoryService
- A MongoDB-backed memory service supporting keyword, vector, and auto-embedding retrieval.
- MongoDbSessionClient
- Client interface used by MongoDbSessionService.
- MongoDbSessionCollection
- Collection interface used by MongoDbSessionService.
- MongoDbSessionDatabase
- Database interface used by MongoDbSessionService.
- MongoDbSessionService
- Session storage service backed by MongoDB collections.
- MongoDbUpdateResult
- Result returned by MongoDbSessionCollection.updateOne.
- 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.
- Node
- Node designed for subclassing.
- NodeGroupChain
- A chain of edges positioned at a node group from a fan-out or EdgesBuilder.fromGroup.
- NodeInfo
- Workflow node metadata attached to an Event.
- NodePathBuilder
- Represents a path to a node in a hierarchical workflow.
- NodeState
- Mutable state for one workflow node.
- NodeTool
- A tool wrapper that executes a BaseNode (e.g. a workflow function node or tool node) as a standard ADK BaseTool.
- NoopAdkMetricsRecorder
- Metrics recorder that intentionally drops all samples.
- NumericArgMatcher
- Numeric matcher with configurable tolerance.
- OpenInterrupt
- Represents an open, unanswered interrupt in an event stream.
- ParallelAgent
- Workflow agent that runs sub-agents concurrently.
- ParallelWorker
- Node that runs a wrapped child node for every input item in parallel.
- Part
- One multimodal content part within a Content turn.
- PartialTranscript
- Interim transcript emitted while the user is still speaking.
- PassKMultiRunCriterion
-
A
pass@korpass^kcriterion over whole runs of an eval case. - PluginManager
- Coordinates plugin registration and callback dispatching.
- PrebuiltMetricNames
- Canonical names for built-in evaluation metrics.
- PreciseTimestamp
- Utilities for preserving microsecond precision timestamps.
- ReflectAndRetryModelPlugin
- Provides self-healing, concurrent-safe error recovery for model failures.
- ReflectAndRetryToolPlugin
- Plugin that provides reflection guidance and bounded retries for tool errors.
- RefusalAnswer
- Answer for a question the classifier declined to answer.
- RemoteMcpServer
- A remote MCP server executed server-side by the Managed Agents API.
- ReplayManager
- ReplayManager - unified orchestrator for event rehydration, interception, and sequence barriers.
- ReplaySequenceBarrier
- Chronological barrier used to coordinate deterministic replay ordering.
- RequestInput
- Data used to request additional user input from a workflow or agent.
- RequestInputTool
- Long-running tool that requests human input before execution continues.
- Resources
- L3 skill resources loaded from references/assets/scripts directories.
- RestVertexAiRagClient
- Pure-Dart REST implementation of VertexAiRagClient.
- ResumabilityConfig
- Resumability settings for an app.
- RetryConfig
- Retry configuration for workflow node execution.
- RoutedLlm
- A BaseLlm implementation that delegates to one of multiple models based on an LlmRouter function.
- RoutedLlmErrorContext
- Error context passed to an LlmRouter when a candidate model fails before yielding any responses.
- RouteMap
- A routing map configured in EdgeChain.route mapping routes emitted by the source node to downstream target nodes.
- RouteMapEntry
- A routing-map entry started by RouteMap.on whose route has no target yet; then completes it.
- RouteSet
- A set of routes that select a single edge firing when the source emits any of them.
- RubricsBasedCriterion
- Criterion scored against explicit rubrics.
- RunConfig
- Configuration object controlling one agent run behavior.
- Runner
- Coordinates session lifecycle, plugins, and agent execution.
- RunSkillScriptTool
- Tool to execute scripts from a skill bundle.
- SaveFilesAsArtifactsPlugin
- Saves user inline files as artifacts and replaces them with file references.
- ScopedFailureTracker
- Synchronized per-scope failure counter shared by reflect-and-retry plugins.
- Score
- Question that places the input on an ordered rubric starting at level 0.
- ScoreAnswer
- Answer to a Score question.
- Script
- Wrapper for script content.
- SearchMemoryResponse
- Response model returned by memory search operations.
- SearchSkillsTool
- Tool to search a configured skill registry for relevant skills.
- SemanticArgMatcher
- Matches argument values that an LLM judges to have the same meaning.
- SequentialAgent
- Workflow agent that runs sub-agents one-by-one.
- SequentialAgentState
- Serialized resumability state for SequentialAgent.
- Session
- A conversational session containing state and event history.
- SessionKey
- Identifies one session.
- SessionStateDelta
- Split representation of app, user, and session-scoped state entries.
- SessionWriteBuffer
- Buffers the writes of many sessions until the store has them.
- SingleTurnAgentTool
-
Tool adapter for a sub-agent configured with
mode: 'single_turn'. - Skill
- Complete skill representation with metadata, instructions, and resources.
- SkillDescriptor
- Minimal shape shared by all skill descriptors.
- SkillGcsStore
- Web stub for GCS-backed skill storage.
- SkillLifecycleConfig
- Configuration for skill lifecycle management in SkillToolset.
- SkillRegistry
- In-memory registry for named Skill objects.
- SkillSource
- Asynchronous source interface for skill metadata, instructions, resources.
- SkillToolset
- Toolset exposing skill-discovery, loading, and script-execution tools.
- State
- Map-like state container with change tracking.
- StdioConnectionParams
- Process launch options for an MCP stdio server.
- StorageEventV1
- Event row model for schema v1.
- StorageMetadataV1
- Key-value metadata row model for schema v1.
- StorageSessionV1
- Session row model for schema v1.
- StreamableHTTPConnectionParams
- Connection options for an MCP server that supports Streamable HTTP.
-
StreamResult<
T> - Summary of yielded items captured from a traced stream or sync generator.
- StructuredEvent
- Base class for typed structured events.
- TaskAgentTool
-
Tool adapter for a sub-agent configured with
mode: 'task'. - TaskRequest
- A request to delegate work to a task agent.
- TaskResult
- Result returned by a task agent after completion.
- TelemetryLogRecord
- One log entry recorded under a telemetry span.
- TelemetrySpan
- Span model representing one traced operation.
- ThoughtEvent
- Reasoning text emitted by the model.
- TokenUsage
- Aggregated token usage extracted from one or more LLM responses.
- TokenUsageDetails
- Detailed token usage breakdown recorded by efficiency evaluators.
- ToolArgsMatcher
- Matches a dictionary of tool call arguments against configured matchers.
- ToolArgsMatchResult
- Result of matching a full map of tool call arguments.
- ToolCallEvent
- Request to execute a tool.
- ToolCallIntegrityPlugin
- Plugin that stamps model function calls with an HMAC and verifies them before session execution and before tool invocation.
- ToolConfirmationEvent
- Request for user confirmation of tool calls.
- ToolDeclaration
- Tool declaration payload sent to model backends.
- ToolFailureResponse
- Structured tool failure payload returned by reflect-and-retry flows.
- ToolNode
- Node that wraps an ADK BaseTool.
- ToolParameterMatchCriterion
- Criterion for evaluating tool parameter matches with ToolArgsMatcher.
- ToolReflectionContext
- Context passed to custom guidance callbacks when a tool fails.
- ToolResultClassification
- Verdict returned by a ToolResultClassifier for a tool result.
- ToolResultEvent
- Result returned by a tool.
- ToolThreadPoolConfig
- Thread-pool configuration for concurrent tool execution.
- ToolTrajectoryCriterion
- Criterion for tool trajectory matching.
- UiWidget
- Provider-specific UI widget payload.
- UnloadSkillTool
- Tool to unload an active skill, releasing its additional tools.
- UrlContextTool
- Built-in URL context retrieval tool for supported Gemini models.
- UserSpeechStarted
- Signal emitted when user speech begins so active agent output can stop.
- UserTurnFinished
- Final transcript emitted when the user finishes speaking a turn.
- VertexAiRagResource
- Vertex AI RAG resource reference.
- VertexAiRagRetrieval
- Retrieval tool that integrates with Vertex AI RAG.
- VertexAiRagStore
- Store-level RAG query configuration used by VertexAiRagRetrieval.
- VertexAiSearchConfig
- Retrieval configuration used by VertexAiSearchTool.
- VertexAiSearchDataStoreSpec
- One Vertex AI Search data store reference.
- VertexAiSearchTool
- Built-in retrieval tool wrapper for Vertex AI Search.
- VertexRagRetrievalTool
- Server-side Vertex AI RAG retrieval tool.
- VisualFrame
- A single visual frame and the wall-clock time it was received.
- VoiceActivity
- Voice activity event payload received from Live bidirectional stream.
- Workflow
- Node-based workflow agent.
- WorkflowContext
- Shared runtime context passed to workflow nodes.
- WorkflowResult
- Execution result from Workflow.runWorkflow.
Enums
- AgentMode
- Defines how an agent interacts with session history and control flow.
- CallbackType
- Identifies the lifecycle stage of an executing callback.
- EvalMetric
- Built-in evaluation metrics supported by the evaluator.
- EvalStatus
- Evaluation pass/fail status.
- EventType
- Categories emitted by toStructuredEvents.
- FunctionCallingConfigMode
- Function-calling modes recognized by model providers.
- FunctionResponseScheduling
- Controls when a function response should be scheduled and delivered during Live mode.
- InferenceStatus
- Inference execution status for one eval case.
- MatchType
- Matching strategies for tool trajectories.
- NodeStatus
- Runtime status for a workflow node.
- PrebuiltMetrics
- Enum wrapper for built-in metric identifiers.
- ServiceTier
- Serving tiers the Gemini/interactions API offers for a model call.
- SkillDiscoveryMode
- Discovery mode for how skills are presented to the model.
- SkillLifecycleMode
- Modes for managing the lifecycle of an active skill.
- StreamingMode
- Streaming transport mode used by a run.
- ToolBehavior
- Controls whether the model waits for a tool's response in Live API mode.
- ToolErrorType
- Semantic tool error types aligned with OpenTelemetry error attributes.
- ToolExecutionMode
- Execution mode used when a model requests multiple tools in one turn.
- TrackingScope
- Scope used to track per-tool retry counts.
- VoiceActivityType
- Type of voice activity detected on the audio channel.
Mixins
- GemmaFunctionCallingMixin
- Mixin providing function calling support for Gemma 3 models.
Extensions
- GeminiHttpOptionsBaseUrl on HttpOptions
- Extension providing client-level base URL metadata on HttpOptions.
- LiveFunctionDeclarationBehavior on FunctionDeclaration
- Live function-declaration behavior compatibility extension on FunctionDeclaration.
- MatchTypeX on MatchType
- Utility methods for MatchType.
Constants
- adkExperimentalInvokeAgentCacheReadInputTokensMetric → const String
- Metric name for per-invocation cache-read input tokens.
- adkExperimentalInvokeAgentInputTokensMetric → const String
- Metric name for per-invocation input tokens.
- adkExperimentalInvokeAgentOutputTokensMetric → const String
- Metric name for per-invocation output tokens.
- adkExperimentalInvokeAgentReasoningOutputTokensMetric → const String
- Metric name for per-invocation reasoning output tokens.
- adkExperimentalInvokeAgentSkillLoadsMetric → const String
- Metric name for per-invocation skill loads.
- adkExperimentalInvokeAgentToolInputTokensMetric → const String
- Metric name for per-invocation tool input tokens.
- adkExperimentalInvokeAgentTotalTokensMetric → const String
- Metric name for per-invocation total tokens.
- adkExperimentalInvokeWorkflowCacheReadInputTokensMetric → const String
- Metric name for per-workflow cache-read input tokens.
- adkExperimentalInvokeWorkflowCompactionsMetric → const String
- Metric name for per-workflow compactions.
- adkExperimentalInvokeWorkflowInferenceCallsMetric → const String
- Metric name for per-workflow inference calls.
- adkExperimentalInvokeWorkflowInputTokensMetric → const String
- Metric name for per-workflow input tokens.
- adkExperimentalInvokeWorkflowOutputTokensMetric → const String
- Metric name for per-workflow output tokens.
- adkExperimentalInvokeWorkflowReasoningOutputTokensMetric → const String
- Metric name for per-workflow reasoning output tokens.
- adkExperimentalInvokeWorkflowSkillLoadsMetric → const String
- Metric name for per-workflow skill loads.
- adkExperimentalInvokeWorkflowToolCallsMetric → const String
- Metric name for per-workflow tool calls.
- adkExperimentalInvokeWorkflowToolInputTokensMetric → const String
- Metric name for per-workflow tool input tokens.
- adkExperimentalInvokeWorkflowTotalTokensMetric → const String
- Metric name for per-workflow total tokens.
- adkExperimentalSkillLoadsMetric → const String
- Metric name for skill loads.
- adkExperimentalSkillScriptExecutionsMetric → const String
- Metric name for skill script executions.
- adkTelemetrySchemaVersionOptIn → const String
-
Environment variable pinning the ADK telemetry schema version (
1vs2). - afFunctionCallIdPrefix → const String
- Prefix for ADK-generated client-side function call identifiers.
-
agentDurationBucketBounds
→ const List<
double> - Explicit histogram bucket boundaries for agent invocation durations (s).
- argMatcherUnset → const Object
-
Sentinel used to distinguish an omitted
expectedargument fromnull. -
callCountBucketBounds
→ const List<
int> - Explicit histogram bucket boundaries for agent call-count metrics.
-
clientFunctionCallNames
→ const Set<
String> - Built-in client and HITL function call names emitted by ADK.
- consultRequiredStatus → const String
- Status string returned when a gated tool call is refused.
- DEFAULT_ROUTE → const String
- Default route value used by routed workflow edges.
- defaultAdvisorInputCostPerMillion → const double
- Default estimated input cost in USD per 1M tokens for the advisor model.
- defaultAdvisorOutputCostPerMillion → const double
- Default estimated output cost in USD per 1M tokens for the advisor model.
- defaultAdvisorSystemInstruction → const String
- Default system instruction passed to the advisor model.
- defaultConsultModelToolName → const String
- Default tool name for ModelConsultTool.
- defaultMaxKeyLength → const int
- Default max key length used by storage schemas.
- defaultMaxVarcharLength → const int
- Default max varchar length used by storage schemas.
- defaultMemoriesCollection → const String
- Default MongoDB collection name used by MongoDbMemoryService.
- defaultMongoDbAutoEmbeddingModel → const String
-
Default Voyage AI model name used by MongoDbMemoryService in
'auto'mode. - defaultMongoDbEmbeddingDimensions → const int
- Default embedding vector dimensions for defaultMongoDbEmbeddingModelName.
- defaultMongoDbEmbeddingModelName → const String
-
Default Google embedding model name used by MongoDbMemoryService in
'vector'mode. - defaultMongoDbMemoryVectorIndexName → const String
- Default Atlas Vector Search index name used by MongoDbMemoryService.
- defaultPrimaryInputCostPerMillion → const double
- Default estimated input cost in USD per 1M tokens for the primary model.
- defaultPrimaryOutputCostPerMillion → const double
- Default estimated output cost in USD per 1M tokens for the primary model.
- defaultRoute → const String
- Lower-camel alias for DEFAULT_ROUTE.
- defaultSemanticMatchModel → const String
- Default Gemini model used by SemanticArgMatcher when none is configured.
- defaultSkillSystemInstruction → const String
- Default system instruction injected when skill tools are enabled.
-
defaultStopWords
→ const Set<
String> - Default English stop words filtered out during keyword extraction.
-
delegatedTaskModes
→ const Set<
String> - Agent modes that represent delegated task execution rather than chat.
-
experimentalInputTokenBucketBounds
→ const List<
int> - Bucket boundaries for experimental input token histograms.
-
experimentalOutputTokenBucketBounds
→ const List<
int> - Bucket boundaries for experimental output token histograms.
- finishTaskErrorResult → const String
-
Error result returned by
finish_taskwhen a delegated task fails. - finishTaskSuccessResult → const String
- Success result returned by FinishTaskTool.run.
- finishTaskToolName → const String
- Function name used by task agents to signal completion.
- geminiDefaultApiVersion → const String
- Default API version used for the Gemini Developer API when none is explicitly configured.
- genAiAgentInvocationDurationMetric → const String
- Metric name for agent invocation durations.
- genAiAgentRequestSizeMetric → const String
- Metric name for agent request sizes.
- genAiAgentResponseSizeMetric → const String
- Metric name for agent response sizes.
- genAiClientInferenceChunkDurationMetric → const String
- Metric name for inference chunk durations.
- genAiClientInferenceDurationMetric → const String
- Alias for genAiClientInferenceDurationMetricName.
- genAiClientInferenceDurationMetricName → const String
- Metric name for client inference durations.
- genAiClientInferenceOperationInputTokensMetric → const String
- Histogram metric name for semconv per-operation input token counts.
- genAiClientInferenceOperationOutputTokensMetric → const String
- Histogram metric name for semconv per-operation output token counts.
- genAiClientInferenceTimePerOutputChunkMetric → const String
- Metric name for time per output inference chunk.
- genAiClientInferenceTimeToFirstChunkMetric → const String
- Metric name for time to first inference chunk (semconv-aligned).
- genAiClientInferenceUsageCacheReadInputTokensMetric → const String
- Counter metric name for semconv cache-read input token usage.
- genAiClientInferenceUsageCacheWriteInputTokensMetric → const String
- Counter metric name for semconv cache-write input token usage.
- genAiClientInferenceUsageInputTokensMetric → const String
- Counter metric name for semconv input token usage.
- genAiClientInferenceUsageOutputTokensMetric → const String
- Counter metric name for semconv output token usage.
- genAiClientInferenceUsageReasoningOutputTokensMetric → const String
- Counter metric name for semconv reasoning output token usage.
- genAiClientOperationDurationMetric → const String
- Metric name for client operation durations.
- genAiClientOperationTimeToFirstChunkMetric → const String
- Metric name for time to first inference chunk.
- genAiClientTokenUsageMetric → const String
- Metric name for client token usage.
- genAiExecuteToolDurationMetric → const String
- Metric name for tool execution durations (semconv-aligned).
- genAiInvokeAgentDurationMetric → const String
- Metric name for agent invocation durations (semconv-aligned).
- genAiInvokeAgentInferenceCallsMetric → const String
- Metric name for model calls made directly within an agent invocation.
- genAiInvokeAgentToolCallsMetric → const String
- Metric name for tool calls made directly within an agent invocation.
- genAiInvokeWorkflowDurationMetric → const String
- Metric name for workflow invocation durations (semconv-aligned).
- genAiToolExecutionDurationMetric → const String
- Metric name for tool execution durations.
- genAiToolRequestSizeMetric → const String
- Metric name for tool request sizes.
- genAiToolResponseSizeMetric → const String
- Metric name for tool response sizes.
- genAiWorkflowInvocationDurationMetric → const String
- Metric name for workflow invocation durations.
- getUserChoiceFunctionName → const String
- Default function name exposed by GetUserChoiceTool.
- globalScopeKey → const String
- Global scope key used when failure counters are shared process-wide.
- handleModelErrorToolName → const String
- Reserved tool name registered by ReflectAndRetryModelPlugin.
- hmacMetaKey → const String
- Custom metadata key under which per-call HMAC stamps are stored on Event.
- internalMetadataPrefix → const String
-
Prefix of
customMetadatakeys that callers cannot set. - invocationAbortedErrorCode → const String
- Error code assigned to synthetic abort events.
- invocationAbortedErrorMessage → const String
- Default error message for synthetic abort events.
- lastInstrumentorWithoutInferenceTokenMetrics → const String
-
Last
opentelemetry-instrumentation-google-genaiversion that did not emitgen_ai.client.token.usagemetrics on its own. - legacyConsultModelToolName → const String
- Legacy alias for defaultConsultModelToolName.
- listSkillsToolName → const String
- Tool name constant for ListSkillsTool.
-
llmResponseErrorCodes
→ const Set<
String> -
Error codes copied from an
LlmResponseinto Event.errorCode when the model stops or is blocked. - loadSkillResourceToolName → const String
- Tool name constant for LoadSkillResourceTool.
- loadSkillToolName → const String
- Tool name constant for LoadSkillTool.
- maxArtifactSizeBytes → const int
- Maximum allowed file artifact size (20 MB).
- maxRecordedYields → const int
- Maximum number of yielded items buffered for generator/stream span summaries.
- maxUnreportedFailures → const int
- How many sessions keep a failure to report before the oldest is forgotten.
- mcpInvalidRequestErrorCode → const int
- Standard JSON-RPC invalid request error code.
-
mcpReservedToolNames
→ const Set<
String> - Reserved tool names that cannot be overridden by external MCP tools.
- mcpSdkOperationalMajorVersion → const int
-
Operational major version of the MCP SDK supported by ADK (
< 2.0.0). - mcpSessionTerminatedLegacyCode → const int
- Legacy MCP session terminated error code.
- mcpSessionTerminatedMessage → const String
- Message indicating the server discarded or terminated the session.
- modelConsultClientLabel → const String
- Label used to denote advisor LLM calls made by ModelConsultTool.
-
mongoDbMemoryRetrievalModes
→ const Set<
String> - Supported retrieval modes for MongoDbMemoryService.
-
operationDurationBucketBounds
→ const List<
double> - Explicit histogram bucket boundaries for tool and client operation durations (s).
- reflectAndRetryResponseType → const String
- Response type emitted when this plugin handles a tool failure.
- requestConfirmationFunctionCallName → const String
- Internal function name used to request tool confirmation.
- requestEucFunctionCallName → const String
- Internal function name used to request credentials.
- requestInputFunctionCallName → const String
- Internal function name used to request additional user input.
- reservedToolCallErrorType → const String
- Error type marker emitted when a model invokes a framework-reserved tool directly.
- restoredEventKey → const String
- Set on events that ADK restored into a session from outside it.
- runSkillScriptToolName → const String
- Tool name constant for RunSkillScriptTool.
- schemaVersionLegacy → const int
-
Legacy telemetry schema version (
1/otel_semconv_1_36). - schemaVersionSemconvAligned → const int
-
Semconv-aligned telemetry schema version (
2/otel_semconv_1_44). - searchSkillsToolName → const String
- Tool name constant for SearchSkillsTool.
- stampPrefix → const String
- Version prefix applied to all tool-call HMAC stamps.
- START → const String
- Sentinel node name used for workflow start edges.
-
supportedAdvisorThinkingLevels
→ const Map<
String, String> - Supported SDK thinking level names mapped from lowercase name to wire value.
-
tokenUsageBucketBounds
→ const List<
int> - Explicit histogram bucket boundaries for token usage counts.
- toolDisplayNamesMetadataKey → const String
- Key in Event.customMetadata storing a mapping of tool names to display titles.
- unloadSkillToolName → const String
- Tool name constant for UnloadSkillTool.
- visualFramesZipMimeType → const String
- MIME type of the packed visual frames archive stored in the artifact service.
-
workflowDurationBucketBounds
→ const List<
int> - Explicit histogram bucket boundaries for workflow invocation durations (s).
Properties
- adkMetricsRecorder → AdkMetricsRecorder
-
The process-wide metrics recorder used by ADK helpers.
no setter
- anthropicGcsDownloaderForTest ↔ AnthropicGcsDownloader?
-
Optional process-wide GCS downloader override used by static helpers/tests.
getter/setter pair
- anthropicSdkMajorVersionForTest ↔ int?
-
Optional Anthropic SDK major version override used by tests.
getter/setter pair
- anthropicWarningHandlerForTest ↔ AnthropicWarningHandler?
-
Optional process-wide warning handler override used by tests.
getter/setter pair
- currentCallbackInfo → CallbackInfo?
-
Returns the active CallbackInfo in the current async Zone, if any.
no setter
- currentModelConsultClientLabel → String?
-
Returns the active model-consult client label in the current Zone, if any.
no setter
- getUserChoice → GetUserChoiceTool
-
Global singleton instance of GetUserChoiceTool.
final
- google_search → GoogleSearchTool
-
Backward-compatible alias for googleSearch.
final
- googleSearch → GoogleSearchTool
-
Shared singleton instance of GoogleSearchTool.
final
- requestInput → RequestInputTool
-
Default request-input tool instance.
final
- urlContext → UrlContextTool
-
Shared URL context tool instance.
final
Functions
-
aggregateEvalCaseResults(
List< EvalCaseResult> evalCaseResults, {MultiRunConfig? multiRunConfig}) → List<MultiRunCaseResult> -
Groups
evalCaseResultsby(evalSetId, evalId)and aggregates each case across runs. -
appendDefaultEfficiencyMetrics(
List< EvalMetricSpec> evalMetrics) → List<EvalMetricSpec> -
Returns
evalMetricswith the informational efficiency metrics added. -
applyRewinds(
List< Event> events) → List<Event> -
Returns
eventswith rewound invocations removed. -
authInterruptId(
String nodePath) → String -
Returns the auth interrupt identifier for
nodePath. -
buildAbortEvents(
List< Event> events, {required String invocationId, required String rootAgentName, String? branch, Set<String> keepOpen = const <String>{}}) → List<Event> - Returns the events that seal an aborted invocation.
-
buildAdkHttpOptions(
{Map< String, Object?> ? clientKwargs, Map<String, String> ? defaultHeaders, HttpRetryOptions? retryOptions, String? apiVersion, String? baseUrl, bool excludeRuntimeTag = false, Map<String, String> ? environment}) → HttpOptions -
Builds HttpOptions by merging caller
clientKwargshttp_optionswith ADK defaults and tracking headers. -
buildModelConsultSystemInstruction(
{required String toolName, String? customGuidance}) → String - Default guidance appended to the host agent's system instruction when ModelConsultToolset is attached.
-
buildMultiRunCaseSummaries(
List< EvalCaseResult> evalCaseResults, {MultiRunConfig? multiRunConfig}) → List<MultiRunCaseSummary> - Alias for summarizeEvalCaseResults.
-
buildMultiRunCaseSummary(
MultiRunCaseResult caseResult) → MultiRunCaseSummary - Alias for summarizeMultiRunCaseResult.
-
buildNode(
Object nodeLike, {String? name, String description = '', List< String> ? dependsOn, bool? rerunOnResume, bool? waitForOutput, RetryConfig? retryConfig, Duration? timeout, Object? outputSchema, Object? requireConfirmation}) → BaseNode - Converts a workflow-compatible object into a BaseNode.
-
buildSkillSystemInstruction(
{String? prefix, Set< String> ? allowedTools, String? skillsFolder, bool scriptExecutionEnabled = true}) → String - Builds the system instruction for skill tools.
-
callAdvisor(
BaseLlm llm, List< Content> contents, {String systemInstruction = defaultAdvisorSystemInstruction, GenerateContentConfig? generateContentConfig, Object? thinkingLevel, Duration? timeout, String agentName = defaultConsultModelToolName, TelemetryConfig? telemetryConfig, Map<String, String> ? environment, AdkMetricsRecorder? recorder}) → Future<AdvisorResult> -
Calls
llmas an advisor model overcontentsand records advisor metrics. -
checkInterception(
{required Object node, ChildScanState? recovered, DynamicNodeRun? currentRun}) → InterceptionResult - Evaluates whether a node's execution should be intercepted based on history.
-
checkPassKCriteriaAgainstNumRuns(
MultiRunConfig? multiRunConfig, int numRuns) → void -
Validates that any
pass@korpass^kcriterion hask <= numRuns. -
classifyToolResultError(
{required BaseTool tool, required Map< String, dynamic> toolArgs, required ToolContext toolContext, required Object? result, ToolResultClassifier? toolResultClassifier, void onWarning(String message)?}) → String? -
Returns the error message to record when
resultreports a tool failure, ornullwhenresultshould be recorded as a completed tool call. -
coerceBytesForJson(
Object? value) → Object? - Recursively coerces raw Uint8List byte buffers into JSON-compatible strings (UTF-8 decoded when valid, or base64-encoded for binary bytes).
-
confirmationInterruptId(
String nodePath) → String -
Returns the confirmation interrupt identifier for
nodePath. -
contentSizeBytes(
Content? content) → int -
Returns the UTF-8 and inline-data byte size of
content. -
copyRequestScopedFields(
GenerateContentConfig config) → GenerateContentConfig -
Copies request-scoped mutable containers on
configso per-request assembly or callbacks do not mutate the source configuration. -
countRunsFailedWithoutMetricResults(
List< EvalCaseResult> perCaseResults) → int -
Counts runs in
perCaseResultsthat failed during inference before metrics ran. -
createMongoDbClientFromUrl(
String dbUrl, {Map< String, Object?> ? mongoClientKwargs}) → MongoDbSessionClient -
Creates a MongoDbSessionClient from
dbUrlusing the active factory. -
createRequestInputEvent(
RequestInput requestInput, {String invocationId = '', String author = '', String? role}) → Event -
Creates a long-running function-call event for
requestInput. -
createRequestInputResponse(
String interruptId, Map< String, dynamic> response) → Part - Creates a function-response part for a request-input interrupt.
-
decodeEventData(
Map< String, Object?> eventData, {String? id, String? invocationId, double? timestamp}) → Event -
Decodes v1
event_datapayload into runtime Event. -
decodeModel<
T> (Object? data, T fromJson(Map< String, Object?> json)) → T? -
Decodes
datainto a model usingfromJson. -
deepArgEquals(
Object? a, Object? b) → bool - Deep equality check for tool argument values (maps, lists, numbers, primitives).
-
describeRunStatuses(
List< EvalStatus> statuses, {int crashed = 0}) → String -
Formats a human-readable summary of run
statusesandcrashedcounts. -
encodeEventData(
Event event) → Map< String, Object?> -
Encodes runtime
eventinto v1event_datapayload. -
eventActionsFromJson(
Map< String, Object?> json) → EventActions -
Deserializes
jsoninto EventActions. -
eventActionsToJson(
EventActions actions) → Map< String, Object?> -
Serializes
actionsinto a JSON-compatible map. -
eventNodeInfoFromJson(
Map< String, Object?> json) → NodeInfo -
Deserializes
jsoninto workflow NodeInfo. -
eventNodeInfoToJson(
NodeInfo nodeInfo, {bool snakeCase = false}) → Map< String, Object?> -
Serializes
nodeInfointo a JSON-compatible map. -
extractEventInterruptIds(
Event event) → Set< String> -
Returns all interrupt IDs carried by
event. -
extractMcpToolTitle(
Object mcpTool) → String? - Extracts the display title from an MCP tool descriptor or McpBaseTool.
-
extractStateDelta(
Map< String, Object?> ? state) → SessionStateDelta -
Splits a mixed
statemap into app, user, and session deltas. -
findActiveTaskScope(
Session session) → (String, String)? -
Finds the active paused task scope
(isolationScope, invocationId)insession, if any. -
formatArgForAutoTracing(
String name, Object? value, [int maxLen = _defaultMaxReprLen]) → String -
Formats argument
nameandvaluefor auto-tracing span attributes, redacting secret-named parameters before rendering. -
formatSkillsAsXml(
List< SkillDescriptor> skills) → String - Renders a skill summary list as XML text for model prompts.
-
getActiveEvents(
List< Event> events) → List<Event> -
Returns the active (non-rewound) events from
events. -
getAgentsDict(
Object agent) → Future< Map< String, AgentInfo> > -
Returns a map of AgentInfo keyed by agent name for every LlmAgent
reachable from
agent(which may be an LlmAgent, any non-LLM BaseAgent such asSequentialAgentor Workflow, or a BaseNode). -
getElapsedSeconds(
{int? spanStartTimeUnixNano, int? spanEndTimeUnixNano, required int fallbackStartMicros, int? fallbackEndMicros}) → double -
Computes elapsed duration in seconds from recorded span times when present,
falling back to
[fallbackStartMicros, fallbackEndMicros ?? now]. -
getEvalMetricsFromConfig(
EvalConfig evalConfig) → List< EvalMetricSpec> -
Converts
evalConfigcriteria into normalized metric specs. -
getEvaluationCriteriaOrDefault(
String? evalConfigFilePath) → EvalConfig -
Loads evaluation config from
evalConfigFilePathor returns defaults. -
getInMemoryMongoDbIndexOptions(
MongoDbSessionCollection collection) → Map< String, Map< String, Object?> > -
Returns index options (such as
expireAfterSeconds) recorded oncollectionin memory. -
getInMemoryMongoDbSearchIndexes(
MongoDbSessionCollection collection) → List< Map< String, Object?> > -
Returns the search indexes registered on
collectionin memory. -
getMetricThreshold(
EvalMetricSpec evalMetric) → double -
Returns the configured threshold for
evalMetricor throws ArgumentError. -
getRandom(
) → Random - Returns a Random instance from the active provider.
-
getRequestInputInterruptIds(
Event event) → List< String> -
Returns request-input interrupt ids contained in
event. -
getRunStatus(
EvalCaseResult evalCaseResult) → EvalStatus -
Computes the overall EvalStatus of a single
evalCaseResultacross its metrics. -
getTime(
) → double - Returns the current time in seconds since the Unix epoch.
-
getToolsInfo(
List< Object> tools) → Future<List< ToolDeclaration> > -
Resolves ToolDeclaration items for a list of agent
tools. -
getUtcNow(
) → DateTime - Returns the current UTC time derived from getTime.
-
guardedCallIds(
InvocationContext invocationContext) → Set< String> - Returns the IDs of function calls that an open interrupt still waits on.
-
hasOwnRetryConfig(
BaseNode node) → bool -
Returns whether
nodehas an explicit RetryConfig configured directly or on its wrapped worker. -
hasPassCountRules(
MultiRunConfig? multiRunConfig) → bool -
Returns
truewhenmultiRunConfigconfigures any pass-count rule or gated cross-run criterion. -
hasRequestInputFunctionCall(
Event event) → bool -
Whether
eventcontains a request-input function call. -
hasUnsealedToolCalls(
List< Event> events, {required String invocationId, Set<String> keepOpen = const <String>{}}) → bool -
Returns whether
eventshas any function calls ininvocationIdwithout a matching function response, excluding call IDs inkeepOpen. -
indexOpenInterrupts(
Iterable< Event> events) → Map<String, OpenInterrupt> -
Indexes interrupts in
eventsthat have not yet been answered. -
internalMetadata(
Map< String, Object?> ? metadata) → Map<String, Object?> -
Returns only the keys of
metadatathat have the internal prefix. -
isAbortEvent(
Event event) → bool -
Returns whether
eventwas synthesized to seal an aborted invocation. -
isDurableNodeError(
Event event) → bool -
Returns whether
eventreports that a durable workflow node failed. -
isFinishTaskTerminalFr(
Event event) → bool -
Whether
eventcontains a terminalfinish_taskFunctionResponse. -
isGeminiModelName(
String? model) → bool -
Returns
truewhenmodelrefers to a Google Gemini model. -
isInterruptEvent(
Event event) → bool -
Whether
eventrepresents an active interrupt pause. -
isPausedInvocation(
InvocationContext invocationContext) → bool -
Returns whether
invocationContextended in a paused state awaiting long-running tool results, tool confirmation, or authentication. -
isPausedTaskReply(
Event event, {List< Event> ? invocationEvents}) → bool -
Whether a task agent already paused on
eventto wait for the user. -
isSessionTerminatedError(
Object? error) → bool - Checks whether an error is an MCP server reporting it no longer holds our session.
-
isTransientUserContent(
LlmRequest llmRequest, Content content) → bool -
Returns whether ADK inserted
contentas transient user context onllmRequestrather than the user. -
joinNodePath(
String? parentPath, String nodeName, [String? runId]) → String - Appends a child segment to a node path, as NodePathBuilder does.
-
lastNonTransientContent(
LlmRequest llmRequest) → Content? -
Returns the last content in
llmRequestnot inserted as transient ADK context, ornullif none exists. -
listSkillsInDir(
String skillsBasePath, {void onError(String skillId, Object error)?}) → Map< String, Frontmatter> - Returns no directory-backed skills on Web.
-
listSkillsInGcsDir(
String bucketName, {String skillsBasePath = '', Object? storageStore}) → Future< Map< String, Frontmatter> > - Throws because GCS-backed skill loading is unsupported on Web.
-
loadAggregationMethods(
MultiRunConfig? multiRunConfig) → Map< String, AggregationMethod> -
Returns the map of built-in and custom AggregationMethods for
multiRunConfig. -
loadSkillFromDir(
String skillDirPath) → Skill - Throws because directory-based skill loading is unsupported on Web.
-
loadSkillFromGcsDir(
String bucketName, String skillId, {String skillsBasePath = '', Object? storageStore}) → Future< Skill> - Throws because GCS-backed skill loading is unsupported on Web.
-
loadSkillFromMarkdown(
String markdown, {Resources? resources}) → Skill -
Loads a Skill from the text of a
SKILL.mdfile. -
loadSkillFromZipBytes(
List< int> zipBytes) → Skill -
Loads a Skill from ZIP bytes containing a root-level
SKILL.md. -
makeJsonSafeState(
Map< String, Object?> ? state) → Map<String, Object?> -
Returns a copy of
statewith all values normalized via makeJsonSafeValue. -
makeJsonSafeValue(
Object? value) → Object? -
Recursively converts
valueinto a JSON-serializable structure. -
markRestored(
Event event) → Event - Marks an event restored from outside the session, in place or returning updated event.
-
markToolErrorRecorded(
Object plugin, ToolContext toolContext) → void -
Marks that
pluginrecorded the failure oftoolContextinonToolErrorCallback. -
mergeMcpAuthAndProviderHeaders(
{Map< String, String> ? authHeaders, Map<String, String> ? providerHeaders}) → Map<String, String> -
Merges MCP session headers so explicit
authHeaderstake precedence overproviderHeaderson case-insensitive header name collisions. -
newAdkId(
{String prefix = ''}) → String -
Returns a new identifier prefixed by
prefix. -
newUuid(
) → String - Returns a new unique identifier string.
-
node(
WorkflowFunction function, {required String name, String description = '', List< String> ? dependsOn, bool? rerunOnResume, bool? waitForOutput, RetryConfig? retryConfig, Duration? timeout, Object? outputSchema, Object? requireConfirmation}) → FunctionNode -
Convenience wrapper matching Python's
node(...)helper. -
nodeRetryConfig(
BaseNode node) → RetryConfig? -
Returns the effective RetryConfig configured on
node, unwrapping ParallelWorker and nested Workflow agents if needed. -
normalizeTtsPcmAudio(
InlineData blob, {int defaultSampleRate = _defaultSampleRate}) → InlineData -
Normalizes Gemini TTS audio
blob(including WAV containers andaudio/L16) into raw PCM labeledaudio/pcm;rate=<rate>. -
packVisualFrames(
List< VisualFrame> frames) → (Uint8List, Map<String, Object?> ) -
Packs
framesand their manifest into one uncompressed (ZIP_STORED) ZIP archive. -
parallelWorker(
Object nodeLike, {int? maxConcurrency, int? maxParallelWorkers, RetryConfig? retryConfig, Duration? timeout}) → ParallelWorker -
Wraps
nodeLikein a ParallelWorker. -
parentNodePath(
String path) → String - Returns the parent of a node path string, as NodePathBuilder does.
-
parseSemanticJudgement(
String text, {Object? expected, Object? actual}) → ArgMatchResult -
Parses a model response
textinto an ArgMatchResult. -
parseSemanticPayload(
String text) → Map< String, Object?> -
Parses a JSON object payload from
text, stripping optional markdown code fences. -
parseSemanticScore(
Object? raw, {required bool matched}) → double -
Parses a numeric score in
[0.0, 1.0]fromraw, defaulting frommatchedwhen null. -
parseSemanticVerdict(
Object? raw) → bool -
Parses a boolean verdict from
raw, rejecting numeric values and arbitrary strings. -
parseToolCallArguments(
Object? arguments, {String? functionName}) → Object? -
Parses tool call
argumentsinto a JSON-encodable object, throwing FormatException when the arguments cannot be parsed or encoded. -
parseToolCallsFromText(
String? textBlock, {bool allowBareJson = true}) → (List< Map< , String?)String, Object?> > -
Extracts inline JSON tool calls from LiteLLM text responses while ignoring
tool calls quoted inside Markdown code spans/fences,
<think>blocks, or bare JSON following prose. -
popToolErrorRecorded(
Object plugin, ToolContext toolContext) → bool -
Reports and clears whether
pluginalready recorded the failure oftoolContext. -
publicEvent(
Event event) → Event - Returns the event as callers see it, without internal metadata.
-
publicMetadata(
Map< String, Object?> ? metadata) → Map<String, Object?> ? -
Returns
metadataas callers see it, without internal keys. Returns null if no keys remain. -
publicSession(
Session session) → Session - Returns the session as callers see it, without internal metadata.
-
readSkillProperties(
String skillDirPath) → Frontmatter - Throws because skill-property file loading is unsupported on Web.
-
recordAgentInvocationDuration(
String agentName, Duration duration, {Object? error, AdkMetricsRecorder? recorder}) → void - Records the duration of an agent invocation.
-
recordAgentRequestSize(
String agentName, Content? userContent, {AdkMetricsRecorder? recorder}) → void - Records the byte size of the user content sent to an agent.
-
recordAgentResponseSize(
String agentName, List< Event> ? events, {AdkMetricsRecorder? recorder}) → void - Records the byte size of the last response content authored by an agent.
-
recordClientInferenceChunk(
Duration duration, {required bool isFirstChunk, String? agentName, String operationName = 'generate_content', String? requestModel, String? responseModel, String? system, String? providerName, String? serverAddress, int? serverPort, Map< String, String> ? environment, AdkMetricsRecorder? recorder}) → void - Records the latency of an inference chunk: either time to first chunk or time per output chunk (mutually exclusive).
-
recordClientInferenceDuration(
{required double elapsedS, required LlmRequest llmRequest, required List< LlmResponse> responses, Object? error, Map<String, String> ? environment, AdkMetricsRecorder? recorder}) → void -
Records
gen_ai.client.inference.duration. -
recordClientOperationDuration(
String agentName, Duration duration, {String operationName = 'generate_content', String? requestModel, String? responseModel, String? system, String? serverAddress, int? serverPort, List< String> ? finishReasons, Object? error, AdkMetricsRecorder? recorder}) → void -
Records the duration of a client operation (e.g.,
generate_content). -
recordClientTokenUsage(
{required String agentName, required LlmRequest llmRequest, required List< LlmResponse> responses, String? system, String? serverAddress, int? serverPort, Object? error, Map<String, String> ? environment, AdkMetricsRecorder? recorder}) → void -
Records client token usage metrics from
responses, keeping usage from earlier responses when the final response carries none. -
recordInferenceTokenUsage(
{required TokenUsage? tokenUsage, String? agentName, String operationName = 'generate_content', String? requestModel, String? responseModel, String? system, String? providerName, String? serverAddress, int? serverPort, List< String> ? finishReasons, Object? error, AdkMetricsRecorder? recorder}) → void -
Records semconv-genai inference token usage samples from
tokenUsage, including detail and modality breakdowns, and optionalerrorattributes for failed inference calls. -
recordInvokeAgentInferenceCalls(
String agentName, int count, {AdkMetricsRecorder? recorder}) → void - Records the number of model calls made directly within an agent invocation.
-
recordInvokeAgentSkillLoads(
String agentName, int count, {TelemetryConfig? telemetryConfig, Map< String, String> ? environment, AdkMetricsRecorder? recorder}) → void -
Records the number of skill loads in an agent invocation (gated on
skills). -
recordInvokeAgentTokenUsage(
String agentName, TokenUsage totals, {TelemetryConfig? telemetryConfig, Map< String, String> ? environment, AdkMetricsRecorder? recorder}) → void -
Records the token spend accumulated over one agent invocation (gated on
token_usage). -
recordInvokeAgentToolCalls(
String agentName, int count, {AdkMetricsRecorder? recorder}) → void - Records the number of tool calls made directly within an agent invocation.
-
recordInvokeWorkflowCompactions(
{required String rootAgentName, String? workflowName, required int count, bool nested = false, TelemetryConfig? telemetryConfig, Map< String, String> ? environment, AdkMetricsRecorder? recorder}) → void -
Records the conversation compactions made across one workflow (gated on
compactionandworkflow). -
recordInvokeWorkflowInferenceCalls(
{required String rootAgentName, String? workflowName, required int count, bool nested = false, TelemetryConfig? telemetryConfig, Map< String, String> ? environment, AdkMetricsRecorder? recorder}) → void -
Records the inference calls made across one workflow (gated on
workflow). -
recordInvokeWorkflowSkillLoads(
{required String rootAgentName, String? workflowName, required int count, bool nested = false, TelemetryConfig? telemetryConfig, Map< String, String> ? environment, AdkMetricsRecorder? recorder}) → void -
Records the skill loads made across one workflow (gated on
skillsandworkflow). -
recordInvokeWorkflowTokenUsage(
{required String rootAgentName, String? workflowName, required TokenUsage totals, bool nested = false, TelemetryConfig? telemetryConfig, Map< String, String> ? environment, AdkMetricsRecorder? recorder}) → void -
Records the token spend of one workflow (gated on
workflowandtoken_usage). -
recordInvokeWorkflowToolCalls(
{required String rootAgentName, String? workflowName, required int count, bool nested = false, TelemetryConfig? telemetryConfig, Map< String, String> ? environment, AdkMetricsRecorder? recorder}) → void -
Records the tool calls made across one workflow (gated on
workflow). -
recordSemconvInferenceTokenUsage(
{required LlmRequest llmRequest, required List< LlmResponse> responses, Object? error, Map<String, String> ? environment, AdkMetricsRecorder? recorder}) → void -
Records the 7 semconv-genai inference token metrics (
gen_ai.client.inference.*). -
recordSkillLoad(
{required String agentName, required MaybeHallucinated< String> skillName, String? errorType, TelemetryConfig? telemetryConfig, Map<String, String> ? environment, AdkMetricsRecorder? recorder}) → void -
Records one skill load (gated on
skills). -
recordSkillScriptExecution(
{required String agentName, required MaybeHallucinated< String> skillName, required MaybeHallucinated<String> scriptPath, int? scriptExitCode, TelemetryConfig? telemetryConfig, Map<String, String> ? environment, AdkMetricsRecorder? recorder}) → void -
Records a skill script execution (gated on
skills). -
recordToolExecutionDuration(
String toolName, String agentName, Duration duration, {String? toolType, Object? error, String? errorType, AdkMetricsRecorder? recorder}) → void - Records the duration of a tool execution.
-
recordToolRequestSize(
String toolName, String agentName, Map< String, Object?> functionArgs, {AdkMetricsRecorder? recorder}) → void - Records the byte size of string-valued tool arguments.
-
recordToolResponseSize(
String toolName, String agentName, Event? responseEvent, {AdkMetricsRecorder? recorder}) → void - Records the byte size of a tool response event.
-
recordWorkflowInvocationDuration(
String workflowName, Duration duration, {bool nested = false, Object? error, AdkMetricsRecorder? recorder}) → void - Records the duration of a workflow invocation.
-
redactFileUriForLog(
String fileUri, {String? displayName}) → String - Returns a privacy-preserving identifier for logs and error messages.
-
registerArgMatcher(
String type, ArgMatcherFactory factory) → void -
Registers a custom BaseArgMatcher factory for
type. -
rerunsWhileWaiting(
Object node) → bool -
Whether a
waitForOutputnode with no recorded outcome runs again. -
resetAdkMetricsRecorderForTest(
) → void - Restores the process-wide metrics recorder to a no-op recorder.
-
resetCustomArgMatchers(
) → void - Clears custom registered argument matchers (used in tests).
-
resetIdProvider(
) → void - Restores the default unique ID provider.
-
resetMongoDbSessionClientFactory(
) → void - Restores the default MongoDbSessionClient factory.
-
resetRandomProvider(
) → void - Restores the default Random provider.
-
resetTimeProvider(
) → void - Restores the default system time provider.
-
resolveCallbackName(
Object callback, {String fallback = '<anonymous>'}) → String -
Resolves a human-readable callback name for
callback. -
resolveGenAiProviderName(
String? model, {Map< String, String> ? environment}) → String -
Resolves the semconv
gen_ai.provider.namevalue formodel. -
resolveGenAiSystemNameV1(
String? model, {Map< String, String> ? environment}) → String -
Resolves the legacy schema v1
gen_ai.system/ provider name formodel. -
resolveNodeInputSchema(
Object nodeLike) → Object? -
Resolves the effective input schema for
nodeLike, if any. -
resolveScopeKey(
TrackingScope trackingScope, String? invocationId) → String -
Resolves the failure-tracking scope key for
trackingScopeandinvocationId, rejecting emptyinvocationIdin TrackingScope.invocation. -
resolveTelemetrySchemaVersion(
{Map< String, String> ? environment}) → int -
Resolves the active ADK telemetry schema version (
1or2). -
resolveThinkingLevel(
Object? level) → String? -
Maps a user-supplied thinking
levelto its canonical wire value, ornull. -
runWithCallbackScope<
T> (CallbackInfo info, FutureOr< T> fn(), {Context? callbackContext}) → Future<T> -
Runs
fnwithin a Zone bound toinfoand bindscallbackContext's scoped Context.callbackInfo when provided. -
runWithIdProvider<
R> (IdProvider provider, R body()) → R -
Runs
bodyin a Zone where newUuid usesprovider. -
runWithRandomProvider<
R> (RandomProvider provider, R body()) → R -
Runs
bodyin a Zone where getRandom usesprovider. -
runWithRouting<
T, C, TYield> (Map< String, T> items, C context, FutureOr<String?> router(Map<String, T> items, C context, {RoutedLlmErrorContext? errorContext}), Stream<TYield> runFn(T item)) → Stream<TYield> -
Runs
runFnagainst items selected byrouter, failing over if an item throws before emitting its first value. -
runWithTimeProvider<
R> (TimeProvider provider, R body()) → R -
Runs
bodyin a Zone where getTime and getUtcNow useprovider. -
safeReprForAutoTracing(
Object? value, [int maxLen = _defaultMaxReprLen]) → String -
Safely renders
valuefor auto-tracing attributes after redacting credential types and credential-keyed map entries. -
sampleRateOfAudioMime(
String? mimeType) → int -
Extracts the PCM sample rate from
mimeType(e.g.audio/pcm;rate=24000), defaulting to16000Hz when unspecified or invalid. -
sendsGoogleTrackingHeaders(
BaseLlm llm) → bool -
Whether
llmcalls Google APIs that accept ADK tracking headers. -
setAdkMetricsRecorder(
AdkMetricsRecorder recorder) → void -
Sets the process-wide ADK metrics
recorder. -
setIdProvider(
IdProvider provider) → void - Sets the provider used by newUuid.
-
setInMemoryMongoDbSearchIndexes(
MongoDbSessionCollection collection, List< Map< indexes) → voidString, Object?> > -
Seeds the search indexes registered on
collectionin memory. -
setMongoDbSessionClientFactory(
MongoDbSessionClientFactory factory) → void -
Overrides the factory used when MongoDbSessionService is created from
dbUrl. -
setRandomProvider(
RandomProvider provider) → void - Sets the provider used by getRandom.
-
setTimeProvider(
TimeProvider provider) → void - Sets the provider used by getTime.
-
shouldEmitInferenceTokenMetrics(
{String? system, bool? hasGenAiInstrumentor, String? instrumentorVersion, Map< String, String> ? environment}) → bool -
Whether ADK should emit
gen_ai.client.token.usagemetrics. -
shouldEmitSemconvInferenceTokenMetrics(
String? model, {required bool hasGenAiInstrumentor, String? utilGenAiVersion, String? instrumentorVersion, Map< String, String> ? environment}) → bool -
Whether ADK should emit the 7 semconv-genai
gen_ai.client.inference.*token metrics formodel. -
startEntryNodes(
Workflow workflow) → List< BaseNode> -
Returns the entry nodes of
workflowthat can receiveSTARTinput. -
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
evalCaseResultsinto serializable MultiRunCaseSummary values. -
summarizeMultiRunCaseResult(
MultiRunCaseResult caseResult) → MultiRunCaseSummary - Converts a MultiRunCaseResult into a serializable MultiRunCaseSummary.
-
toolRequestSizeBytes(
Map< String, Object?> functionArgs) → int - Returns the request byte size for string-valued tool arguments.
-
toPromptJson(
Object? value) → String -
Serializes
valueas canonical JSON for a semantic matcher prompt. -
toStructuredEvents(
Event event) → List< StructuredEvent> - Converts a raw Event into typed structured events.
-
trimTempState(
Map< String, Object?> ? state) → Map<String, Object?> -
Returns
statewithout transienttemp:entries. -
unpackVisualFrames(
List< int> archiveBytes) → (List<VisualFrame> , Map<String, Object?> ) -
Restores the frames and manifest from a packed
archiveBytesZIP archive. -
validateAppName(
String name) → void -
Validates that
nameis a supported app identifier. -
validateNodeData(
Object? schema, Object? data) → Object? -
Validates and sanitizes node input
dataagainstschema. -
validateRelativeResourcePath(
String path) → String -
Validates and normalizes a skill-relative resource
path. -
validateSkillDir(
String skillDirPath) → List< String> - Reports unsupported validation mode on Web.
-
withAdkHttpOptions(
{Map< String, Object?> ? clientKwargs, Map<String, String> ? defaultHeaders, HttpRetryOptions? retryOptions, String? apiVersion, String? baseUrl, bool excludeRuntimeTag = false, Map<String, String> ? environment}) → Map<String, Object?> -
Returns a copy of
clientKwargswith ADK HTTP options and tracking headers merged intohttp_options. -
withClientLabel(
GenerateContentConfig? config, String label) → GenerateContentConfig -
Returns a copy of
configwhose tracking headers also carrylabel. -
withModelConsultClientLabel<
T> (String label, Future< T> action()) → Future<T> -
Runs
actionin a zone tagged withlabelfor tracking header attribution. -
withoutInternalMetadata(
Map< String, Object?> ? metadata) → Map<String, Object?> ? -
Returns
metadatawithout keys that have the internal prefix. -
withRetryConfig(
BaseNode node, RetryConfig? retryConfig) → BaseNode -
Returns a copy of
nodewithretryConfigapplied.
Typedefs
-
AfterModelCallback
= FutureOr<
LlmResponse?> Function(CallbackContext callbackContext, LlmResponse llmResponse) - Callback invoked after model generation.
-
AfterToolCallback
= FutureOr<
Map< Function(BaseTool tool, Map<String, dynamic> ?>String, dynamic> args, ToolContext toolContext, Map<String, dynamic> toolResponse) - Callback invoked after a tool call succeeds.
- Agent = LlmAgent
- Alias for LlmAgent kept for API parity.
-
AgentLifecycleCallback
= FutureOr<
Content?> Function(CallbackContext callbackContext) - Callback signature for agent lifecycle hooks.
- Answer = ClassifierAnswer
-
Alias matching upstream Python's
Answertype alias. -
AnthropicApiInvoker
= Future<
List< Function({required Map<Map< >String, Object?> >String, Object?> request, required bool stream}) - Callback that invokes Anthropic message APIs and returns raw responses.
- AnthropicGcsDownloader = AnthropicGcsObject Function(String bucketName, String blobName)
-
Callback that downloads a GCS object for
gs://bucket/blobURIs. -
AnthropicGenerateHook
= Stream<
LlmResponse> Function(LlmRequest request, bool stream) - Hook for overriding Anthropic generation behavior.
-
AnthropicStreamInvoker
= Stream<
Map< Function({required Map<String, Object?> >String, Object?> request}) - Callback that streams raw Anthropic SSE event payloads.
- AnthropicWarningHandler = void Function(String message)
- Callback to intercept warnings emitted by AnthropicLlm (for testing).
-
ArgMatcherFactory
= BaseArgMatcher Function(Map<
String, Object?> config) - Factory signature for constructing a BaseArgMatcher from a JSON map.
-
BeforeModelCallback
= FutureOr<
LlmResponse?> Function(CallbackContext callbackContext, LlmRequest llmRequest) - Callback invoked before model generation.
-
BeforeToolCallback
= FutureOr<
Map< Function(BaseTool tool, Map<String, dynamic> ?>String, dynamic> args, ToolContext toolContext) - Callback invoked before a tool call executes.
- CallbackContext = Context
- Mutable agent context exposed to callbacks.
- Claude = AnthropicLlm
- Backward-compatible alias for AnthropicLlm.
-
ConfirmationPredicate
= FutureOr<
bool> Function(Map<String, dynamic> args) - Callback signature for dynamic confirmation requirements.
-
GeminiGenerateHook
= Stream<
LlmResponse> Function(LlmRequest request, bool stream) - Hook for overriding Gemini generation behavior.
-
GeminiInteractionsInvoker
= Stream<
LlmResponse> Function(LlmRequest request, {required bool stream}) - Invoker hook for Gemini interactions API generation.
- GeminiLiveSessionFactory = GeminiLiveSession Function(LlmRequest request)
- Factory that creates live Gemini session transports.
- GemmaLlm = Gemma
- Backwards-compatible alias for Gemma.
-
GlobalInstructionProvider
= FutureOr<
String> Function(CallbackContext readonlyContext) - Produces a global instruction string for each model callback context.
- GoogleLlm = Gemini
- Backward-compatible alias for Gemini.
- IdProvider = String Function()
- Signature for functions that generate a unique identifier string.
-
InstructionProvider
= FutureOr<
String> Function(ReadonlyContext context) - Dynamic instruction provider callback.
-
JsonMap
= Map<
String, dynamic> - JSON-compatible map type used across model and tool payloads.
-
LiteLlmCompletionsInvoker
= Future<
List< Function({required Map<Map< >String, Object?> >String, Object?> payload, required bool stream}) - Callback that invokes a LiteLLM-compatible completions endpoint.
-
LiteLlmGenerateHook
= Stream<
LlmResponse> Function(LlmRequest request, bool stream) - Hook for overriding LiteLLM generation behavior.
- LlmFactory = BaseLlm Function(String model)
- Factory function that creates an LLM adapter for a model string.
-
LlmRouter
= FutureOr<
String?> Function(Map<String, BaseLlm> models, LlmRequest request, {RoutedLlmErrorContext? errorContext}) -
Function that selects a model key from
modelsforrequest. - McpConnectionParams = Object
- Union type alias for supported MCP transport connection parameters.
-
McpElicitationCallback
= FutureOr<
Object?> Function(Map<String, Object?> params) -
Callback invoked when an MCP server requests client elicitation (
elicitation/create). -
McpHeaderProvider
= Map<
String, String> Function(ReadonlyContext readonlyContext) - Header-builder callback applied to MCP tool calls in this toolset.
-
McpMessageHandler
= FutureOr<
void> Function(McpServerMessage message) - Callback invoked when an MCP server sends a notification or server message.
-
McpSamplingCallback
= FutureOr<
Object?> Function(List<Map< messages, {Map<String, Object?> >String, Object?> ? params}) - Callback invoked when an MCP server requests client-side sampling.
-
McpToolExecutor
= FutureOr<
Object?> Function(Map<String, dynamic> args, {Map<String, String> ? headers}) - Callback signature for custom local MCP tool executors.
-
McpToolHeaderProvider
= Map<
String, String> Function(ReadonlyContext readonlyContext) - Header-builder callback used before making MCP tool HTTP calls.
-
MongoDbSessionClientFactory
= MongoDbSessionClient Function(String dbUrl, {Map<
String, Object?> ? mongoClientKwargs}) - Factory signature for constructing a MongoDbSessionClient from a MongoDB URI.
-
OnModelErrorCallback
= FutureOr<
LlmResponse?> Function(CallbackContext callbackContext, LlmRequest llmRequest, Exception error) - Callback invoked when model generation throws.
-
OnToolErrorCallback
= FutureOr<
Map< Function(BaseTool tool, Map<String, dynamic> ?>String, dynamic> args, ToolContext toolContext, Exception error) - Callback invoked when a tool call throws.
-
PersistFn
= Future<
Object?> Function(Session storeSession, List<Event> events) - Writes events, in order and all or none, through a store session.
- Question = ClassifierQuestion
-
Alias matching upstream Python's
Questiontype alias. - RandomProvider = Random Function()
- Signature for functions that return a Random instance.
-
RemoteMcpHeaderProvider
= FutureOr<
Map< Function(ReadonlyContext context)String, String> ?> - Callback signature for dynamic MCP headers.
- SkillMetadataValue = Object?
- Metadata value allowed in skill frontmatter.
- SkillResourceData = Object
- Resource payload allowed in skill references/assets.
- SseConnectionParams = StreamableHTTPConnectionParams
-
Alias for StreamableHTTPConnectionParams matching Python
SseConnectionParams. - SseServerParams = StreamableHTTPConnectionParams
-
Alias for StreamableHTTPConnectionParams matching Python
SseServerParams. - StdioServerParameters = StdioConnectionParams
-
Alias for StdioConnectionParams matching Python
StdioServerParameters. - StructuredErrorEvent = ErrorEvent
- Alias for callers that prefer an unambiguous Dart-specific name.
- Threshold = double
- Minimum passing score threshold for a metric.
- TimeProvider = double Function()
- Signature for functions that return the current Unix timestamp in seconds.
- ToolContext = Context
- Mutable tool execution context alias used by tool interfaces.
-
ToolGuidanceCallback
= FutureOr<
String> Function(ToolReflectionContext context) - Callback signature for generating custom tool reflection or retry-exceeded guidance.
-
ToolResultClassifier
= ToolResultClassification? Function({required Object? result, required BaseTool tool, required Map<
String, dynamic> toolArgs, required ToolContext toolContext}) - Synchronous classifier signature used by observability plugins to classify tool results that report failures without throwing.
-
VertexAiRagQueryHandler
= Future<
List< Function({List<String> >String> ? ragCorpora, List<VertexAiRagResource> ? ragResources, int? similarityTopK, required String text, double? vectorDistanceThreshold}) - Callback signature for live Vertex AI RAG querying.
-
WorkflowFunction
= FutureOr<
Object?> Function(WorkflowContext context, Object? nodeInput) - Function callback signature for FunctionNode.
- WorkflowRetryConfig = RetryConfig
- Retry configuration alias disambiguated for top-level barrel exports.
Exceptions / Errors
- AdkAbortException
- Exception thrown when an operation observes an aborted ADK signal.
- AdvisorError
- Error payload returned or thrown when an advisor model consultation fails.
- AlreadyExistsError
- Exception indicating that a resource already exists.
- AnthropicApiException
- Anthropic API exception with HTTP and body context.
- CascadeConnectionClosedException
- Exception thrown when CascadeLiveConnection.receive is called on an already-closed connection.
- DynamicNodeFailError
- Error thrown when a dynamic workflow node fails during execution.
- GraphValidationError
- Error thrown when a workflow graph fails static validation.
- InputValidationError
- Exception indicating invalid user or API input.
- InvocationNotFoundError
- Exception indicating an invocation ID was not found in a session.
- LiteLlmException
- Exception thrown when a LiteLLM/Ollama HTTP request fails.
- LlmCallsLimitExceededError
- Error thrown when LLM call count exceeds the configured limit.
- MalformedFunctionCallException
- Exception thrown when the model returned a malformed function call.
- McpHttpStatusException
- Thrown when an HTTP request returns a non-success status code.
- McpJsonRpcException
-
Thrown when a JSON-RPC response contains an
errorobject. - MongoDbDuplicateKeyException
-
Exception thrown when inserting a document with a duplicate
_id. - MongoDbOperationFailure
- Exception representing a MongoDB server operation failure with an error code.
- NodeInterruptedError
- Exception thrown when a dynamic workflow node pauses for user input or an interrupt.
- NodeTimeoutError
- Error thrown when a node exceeds its timeout.
- NotFoundError
- Exception indicating missing resources.
- PluginManagerException
- Exception thrown for plugin manager callback/close failures.
- ResourceExhaustedModelException
- Exception thrown when model capacity is exhausted.
- SessionNotFoundError
- Exception indicating missing session resource.
- SessionPersistenceError
- Raised when buffered session writes could not be persisted.
- SkillSourceException
- Exception used by SkillSource implementations.
- StaleSessionError
- Exception indicating an optimistic concurrency conflict during session update.
- StateSchemaError
- Exception thrown when a state key or value violates a declared state schema.
- ToolCallIntegrityError
- Error raised when a tool call fails integrity verification.
- ToolExecutionError
- Exception raised when a tool fails with a semantic error classification.
- WorkflowConfigurationError
- Error thrown when a workflow, node, or edge is configured invalidly.
- WorkflowDataError
- Error thrown when runtime workflow data does not match node expectations.
- WorkflowInvariantError
- Error thrown when an internal workflow runtime invariant is violated.