flutter_ai_toolkit library

A library for integrating AI-powered chat functionality into Flutter applications.

This library provides a set of tools and widgets to easily incorporate AI language models into your Flutter app, enabling interactive chat experiences with various AI providers.

Key components:

  • LLM providers: Interfaces and implementations for different AI services.
  • Chat UI: Ready-to-use widgets for displaying chat interfaces.

Classes

ActionButtonStyle
Style for icon buttons.
Attachment
An abstract class representing an attachment in a chat message.
ChatInputStyle
Style for the input text box.
ChatMessage
Represents a message in a chat conversation.
EchoProvider
A simple LLM provider that echoes the input prompt and attachment information.
FileAttachment
Represents a file attachment in a chat message.
FileAttachmentStyle
Style for file attachments in the chat view.
FirebaseProvider
A provider class for interacting with Firebase Vertex AI's language model.
ImageFileAttachment
Represents an image attachment in a chat message.
LinkAttachment
Represents a link attachment in a chat message.
LlmChatView
A widget that displays a chat interface for interacting with an LLM (Language Model).
LlmChatViewStyle
Style for the entire chat widget.
LlmMessageStyle
Style for LLM messages.
LlmProvider
An abstract class representing a Language Model (LLM) provider.
SuggestionStyle
A class that defines the style for suggestions.
UserMessageStyle
Style for user messages.
VoiceNoteRecorderStyle
Style for the waveform recorder widget.

Enums

ActionButtonType
Enum representing different types of action buttons in the chat view.
MessageOrigin
Represents the origin of a chat message.

Typedefs

LlmStreamGenerator = Stream<String> Function(String prompt, {required Iterable<Attachment> attachments})
A function that generates a stream of text based on a prompt and attachments.
SpeechToTextConverter = Stream<String> Function(XFile file)
A function that converts speech to text.

Exceptions / Errors

LlmCancelException
Exception thrown when an LLM operation is cancelled.
LlmException
Exception class for LLM-related errors.
LlmFailureException
Exception thrown when an LLM operation fails.