flutter_ui_agent library

Flutter UI Agent - A revolutionary package that enables AI agents to understand and interact with your app's UI using natural language commands.

This package provides three core components:

Classes

AgentAction
Represents an action that the agent can execute
AgentActionParameter
Metadata describing a parameter that an agent action accepts
AgentConfig
Configuration for the agent service
AgentHost
The main widget that hosts the agent and provides it to the widget tree
AgentNavigatorObserver
A NavigatorObserver that tracks route changes and updates the AgentService with the current page/route information.
AgentService
The central service that manages all agent actions and LLM communication
AgentServiceProvider
A pure Flutter InheritedWidget that provides AgentService to the widget tree This replaces the Provider package dependency
AiActionWidget
A wrapper widget that registers a UI element as an actionable item for the agent
ConversationMessage
Represents a message in conversation history
LlmFunctionCall
Represents a function call returned by the LLM
LlmProvider
Simple LLM provider interface. Implement this in your app and pass an instance into AgentService.setLlmProvider(...).
LlmResponse
Lightweight response object returned by an LLM provider
SystemPromptContext
Context that is passed to the system prompt builder.

Enums

AgentLogLevel
Logging levels for the agent service
AgentParameterType
Supported parameter types for agent actions
RetryBackoffStrategy
Strategy for calculating retry delays

Typedefs

SystemPromptBuilder = String Function(SystemPromptContext context)
Signature for building a custom system prompt.