flutter_adk library

Flutter-facing ADK facade package.

This library re-exports the Web-safe ADK runtime surface from package:adk_dart/adk_core.dart and adds plugin platform utilities.

Classes

App
App container describing root agent, plugins, and runtime options.
ArtifactVersion
Metadata describing one persisted artifact version.
BaseAgent
Base class for all agent implementations.
BaseAgentState
Generic mutable state holder for agent-local state.
BaseArtifactService
Base contract for artifact persistence services.
BaseLlm
Base interface for model adapters used by the runner.
BaseMemoryService
Base contract for memory ingestion and search implementations.
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.
Content
One conversation turn consisting of a role and Part list.
Context
Mutable context for a single agent invocation.
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.
FileData
File reference payload attached to a Part.
FlutterAdk
Provides the Flutter-facing entry point for ADK platform features.
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.
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.
GenerateContentConfig
Generation configuration for text/content model calls.
GetSessionConfig
Options for narrowing session retrieval results.
HttpOptions
HTTP configuration for model API requests.
HttpRetryOptions
Retry policy for HTTP model requests.
InlineData
Inline binary payload attached to a Part.
InMemoryArtifactService
Artifact service backed by process-local memory maps.
InMemoryMemoryService
Memory service backed by process-local event collections.
InMemoryRunner
Runner wired with in-memory session and artifact services.
InMemorySessionService
Session service backed by process-local maps.
InMemoryTelemetryService
In-memory telemetry implementation for local development and tests.
InvocationContext
Mutable invocation context shared across agent execution steps.
InvocationPlan
One invocation strategy used to call flexible user functions.
ListSessionsResponse
Response model for session list operations.
LiveActivityEnd
Marker indicating the end of a live activity segment.
LiveActivityStart
Marker indicating the start of a live activity segment.
LiveConnectConfig
Realtime connection configuration for live model sessions.
LiveRequest
A single queued live request payload.
LiveRequestQueue
In-memory FIFO queue for live requests.
LiveSkillGcsStore
Web stub for live GCS-backed skill storage.
LlmAgent
Core LLM agent that drives model and tool orchestration flows.
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.
LoopAgent
Workflow agent that iterates through sub-agents repeatedly.
LoopAgentState
Serialized resumability state for LoopAgent.
McpBaseTool
Lightweight MCP tool descriptor used by McpTool.
McpResourceContent
Content returned by resources/read.
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.
MemoryEntry
One memory item with content and optional metadata.
ParallelAgent
Workflow agent that runs sub-agents concurrently.
Part
One multimodal content part within a Content turn.
PluginManager
Coordinates plugin registration and callback dispatching.
Resources
L3 skill resources loaded from references/assets/scripts directories.
ResumabilityConfig
Resumability settings for an app.
RunConfig
Configuration object controlling one agent run behavior.
Runner
Coordinates session lifecycle, plugins, and agent execution.
Script
Wrapper for script content.
SearchMemoryResponse
Response model returned by memory search operations.
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.
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.
SkillRegistry
In-memory registry for named Skill objects.
SkillToolset
Toolset exposing skill-discovery, loading, and script-execution tools.
StdioConnectionParams
Process launch options for an MCP stdio server.
StreamableHTTPConnectionParams
Connection options for an MCP server that supports Streamable HTTP.
TelemetryLogRecord
One log entry recorded under a telemetry span.
TelemetrySpan
Span model representing one traced operation.
ToolDeclaration
Tool declaration payload sent to model backends.
ToolThreadPoolConfig
Thread-pool configuration for concurrent tool execution.

Enums

FunctionCallingConfigMode
Function-calling modes recognized by model providers.
StreamingMode
Streaming transport mode used by a run.
ToolErrorType
Semantic tool error types aligned with OpenTelemetry error attributes.

Constants

defaultSkillSystemInstruction → const String
Default system instruction injected when skill tools are enabled.

Functions

eventActionsFromJson(Map<String, Object?> json) EventActions
Deserializes json into EventActions.
eventActionsToJson(EventActions actions) Map<String, Object?>
Serializes actions into a JSON-compatible map.
formatSkillsAsXml(List<SkillDescriptor> skills) String
Renders a skill summary list as XML text for model prompts.
getTime() double
Returns the current time in seconds since the Unix epoch.
getUtcNow() DateTime
Returns the current UTC time derived from getTime.
listSkillsInDir(String skillsBasePath) 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.
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.
newUuid() String
Returns a new unique identifier string.
readSkillProperties(String skillDirPath) Frontmatter
Throws because skill-property file loading is unsupported on Web.
resetIdProvider() → void
Restores the default unique ID provider.
resetTimeProvider() → void
Restores the default system time provider.
setIdProvider(IdProvider provider) → void
Sets the provider used by newUuid.
setTimeProvider(TimeProvider provider) → void
Sets the provider used by getTime.
validateAppName(String name) → void
Validates that name is a supported app identifier.
validateSkillDir(String skillDirPath) List<String>
Reports unsupported validation mode on Web.

Typedefs

AfterModelCallback = FutureOr<LlmResponse?> Function(CallbackContext callbackContext, LlmResponse llmResponse)
Callback invoked after model generation.
AfterToolCallback = FutureOr<Map<String, dynamic>?> Function(BaseTool tool, Map<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.
BeforeModelCallback = FutureOr<LlmResponse?> Function(CallbackContext callbackContext, LlmRequest llmRequest)
Callback invoked before model generation.
BeforeToolCallback = FutureOr<Map<String, dynamic>?> Function(BaseTool tool, Map<String, dynamic> args, ToolContext toolContext)
Callback invoked before a tool call executes.
CallbackContext = Context
Mutable agent context exposed to callbacks.
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.
GoogleLlm = Gemini
Backward-compatible alias for Gemini.
IdProvider = String Function()
InstructionProvider = FutureOr<String> Function(ReadonlyContext context)
Dynamic instruction provider callback.
JsonMap = Map<String, dynamic>
JSON-compatible map type used across model and tool payloads.
McpConnectionParams = Object
Union type alias for supported MCP transport connection parameters.
McpHeaderProvider = Map<String, String> Function(ReadonlyContext readonlyContext)
Header-builder callback applied to MCP tool calls in this toolset.
McpSamplingCallback = FutureOr<Object?> Function(List<Map<String, Object?>> messages, {Map<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.
OnModelErrorCallback = FutureOr<LlmResponse?> Function(CallbackContext callbackContext, LlmRequest llmRequest, Exception error)
Callback invoked when model generation throws.
OnToolErrorCallback = FutureOr<Map<String, dynamic>?> Function(BaseTool tool, Map<String, dynamic> args, ToolContext toolContext, Exception error)
Callback invoked when a tool call throws.
SkillMetadataValue = Object?
Metadata value allowed in skill frontmatter.
SkillResourceData = Object
Resource payload allowed in skill references/assets.
TimeProvider = double Function()
ToolContext = Context
Mutable tool execution context alias used by tool interfaces.

Exceptions / Errors

AlreadyExistsError
Exception indicating that a resource already exists.
InputValidationError
Exception indicating invalid user or API input.
LlmCallsLimitExceededError
Error thrown when LLM call count exceeds the configured limit.
McpHttpStatusException
Thrown when an HTTP request returns a non-success status code.
McpJsonRpcException
Thrown when a JSON-RPC response contains an error object.
NotFoundError
Exception indicating missing resources.
PluginManagerException
Exception thrown for plugin manager callback/close failures.
ResourceExhaustedModelException
Exception thrown when model capacity is exhausted.
SessionNotFoundError
Error thrown when a requested session cannot be found.
ToolExecutionError
Exception raised when a tool fails with a semantic error classification.