discontinuedPackage flutter_ai_operator has been discontinued and replaced by flutter_app_copilot.

flutter_ai_operator library

Classes

AiActionHandler
Runs the functions an AI model asks the app to call.
AIConfiguration
Runtime configuration for an AI session: instructions and available tools.
AiExecutableAction<Input, Output, Failure extends Error>
One app capability an AI model can call, such as a use case.
AIService
One AI provider (Gemini, OpenAI, or Claude) behind a single contract.
AIServiceFactory
Creates a provider-specific AIService from runtime configuration.
ChatMessage
A message sent to or from the AI model.
Either<L, R>
Represents a value of one of two possible types. Instances of Either are either an instance of Left or Right.
FunctionCallResponse
A function call response from the model.
FunctionDefinition
Describes an app function that a supported AI provider may call.
FunctionParameter
Named function argument: parameter key plus its FunctionParameterValue.
FunctionParameterValue
Schema metadata for one function argument (type, description, allowed values).
Left<L, R>
Used for "failure"
Used for "success"

Enums

AIProvider
Provider implementation available in the core AI layer.
ChatMessageType
FunctionParameterType
JSON Schema parameter types shared by supported provider adapters.

Extensions

AIProviderExtension on AIProvider
GoRouterStateContext on GoRouter
Navigation context for the AI layer, derived from GoRouter.

Exceptions / Errors

AIProviderEmptyResponseFailure
The model finished without any text to show.
AIProviderFailure
An AI request has invalid input, failed, or returned something unusable.
AIProviderInvalidInputFailure
The conversation is empty or does not end with a non-blank user message.
AIProviderInvalidResponseFailure
The response body was not the JSON shape the provider documents.
AIProviderMalformedToolCallFailure
A tool call from the model was missing fields or had unreadable arguments.
AIProviderRequestFailure
The request failed. code is the HTTP status, or 0 when there is none (offline, timeout, or Gemini, whose SDK hides the status). message is the provider's error text if any.
AIProviderTooManyCallsFailure
The model kept requesting tools past AIConstants.maxToolRounds.