ai_sdk_flutter library
Classes
- AbortChunk
- Chat
- Main chat client for managing AI conversations with streaming support.
- ChatOptions
- Configuration options for a Chat instance.
- ChatTransport
- Transport interface for handling chat message communication and streaming.
- DataChunk
- DataUIPart
- Custom data part (data-*)
- DefaultChatTransport
- Default HTTP-based chat transport using the AI SDK data stream protocol.
- ErrorChunk
- FileChunk
- FileUIPart
- File attachment part
- FinishChunk
- FinishStepChunk
- FunctionTool
- A simple tool implementation using function callbacks.
- IdGenerator
- Generates unique IDs similar to AI SDK's generateId
- MessageMetadataChunk
- ReasoningDeltaChunk
- ReasoningEndChunk
- ReasoningStartChunk
- ReasoningUIPart
- Reasoning content part (for models with chain-of-thought)
- SourceDocumentChunk
- SourceDocumentUIPart
- Source document part (for RAG)
- SourceUrlChunk
- SourceUrlUIPart
- Source URL part (for RAG)
- StartChunk
- StartStepChunk
- StepStartUIPart
- Step start boundary part
- TextDeltaChunk
- TextEndChunk
- TextStartChunk
- TextUIPart
- Text content part of a message
-
Tool<
TParameters, TResult> - Represents a tool that can be called by the AI.
- ToolExecutor
- Manages tool registration and execution.
- ToolInputAvailableChunk
- ToolInputDeltaChunk
- ToolInputStartChunk
- ToolInvocation
- Tool invocation state and data for rendering in the UI
- ToolOutputAvailableChunk
- ToolUIPart
- Tool invocation part
- UIMessage
- Represents a message in the chat UI, similar to Vercel AI SDK's UIMessage.
- UIMessageChunk
- Represents a streaming chunk from the AI SDK data stream protocol
- UIMessagePart
- Base class for all UI message parts
- UnknownChunk
- UnknownUIPart
- Unknown part type (fallback)
Enums
- ChatStatus
- Chat status enumeration matching AI SDK's status types
- FinishReason
- Finish reason for a message generation
- MessageRole
- Message role enumeration
- TextState
- Text streaming state
- ToolCallState
- Tool call state enumeration
Extensions
- FinishReasonExtension on FinishReason
- Extension to parse finish reason from string
Typedefs
- OnDataCallback = void Function(UIMessageChunk chunk)
- Callback invoked when data is received.
- OnErrorCallback = void Function(Object error)
- Callback invoked when an error occurs.
- OnFinishCallback = void Function(UIMessage message)
- Callback invoked when a message is finished streaming.
-
OnToolCallCallback
= void Function(Map<
String, dynamic> toolCall) - Callback invoked when a tool call is made.
Exceptions / Errors
- ToolExecutionException
- Exception thrown when tool execution fails.