Initial Release
Core
AiClient— primary orchestrator with middleware pipelineAiProvider— abstract provider interface with factory constructorsAiRequest/AiResponse/AiStreamChunk— core data modelsAiCapabilities— runtime capability introspection
Providers
OpenAiProvider— full support: chat, streaming, tool calling, structured output, embeddings, image inputGeminiProvider— full support: chat, streaming, tool calling, structured output, embeddings, multimodalAnthropicProvider— chat, streaming, tool calling, image inputCustomProvider— any OpenAI-compatible endpoint (Ollama, LocalAI, Azure, Groq, etc.)
Models
AiMessage— factory constructors for all roles (system, developer, user, assistant, tool)AiContent— sealed hierarchy: text, image, audio, file, tool call, tool resultAiUsage,AiFinishReason,AiModel
Features
- Tool Calling —
AiTooldefinition with schema + auto-execution viaToolExecutor - Structured Output —
AiJsonSchema+ai.generate<T>()with native provider support - Streaming — SSE parsing with buffering for all providers
- Conversations —
AiConversationwith auto-managed history, streaming support - Conversation Storage —
AiConversationStorageinterface +InMemoryConversationStorage - Embeddings —
AiEmbeddingServicewith single and batch support - RAG —
AiKnowledgeBasewithingest(),search(),ask() - Vector Store —
AiVectorStoreinterface +MemoryVectorStorewith cosine similarity - Autonomous Agents —
AiAgentwith tool loop, instructions, max iterations
Middleware & Production
AiRetryPolicy— exponential backoff with jitterRetryMiddleware— automatic retry on transient failuresCacheMiddleware+MemoryAiCache— response caching with TTLLoggingMiddleware+ConsoleAiLogger— debug and info loggingMetricsMiddleware— request count, error count, latency tracking
Utilities
AiPromptTemplate—{{variable}}template rendering with validationAiCostTracker+AiPricing— token usage and cost estimation
Error Handling
- Complete exception hierarchy extending
AiException:
AiAuthenticationException,AiAuthorizationException,AiRateLimitException,
AiNetworkException,AiTimeoutException,AiInvalidRequestException,
AiProviderException,AiParsingException,AiContentFilterException,
AiUnsupportedCapabilityException,AiStructuredOutputException,
AiToolNotFoundException,AiToolException
Quality
- 146 unit tests covering all modules
- Zero
dart analyzeissues - Comprehensive DartDoc on all public APIs
- MIT License