flutter_ai_core 0.1.2
flutter_ai_core: ^0.1.2 copied to clipboard
Dependency-free Dart foundation for AI chat: message and conversation models, a streaming MessageProcessor with granular mutations, and the provider and renderer contracts the rest of the flutter_ai f [...]
Changelog #
0.1.2 #
- Docs: added a "Buy me a coffee" (Ko-fi) support section to the README. No code changes.
0.1.1 #
Bug fixes in MessageProcessor:
- Zero-argument tool calls (a
ToolCallReadywith no streamed arguments) now resolve to empty args +inputAvailableinstead of being marked errored. - A
ToolResultReceivedwhosemessageIddiffers from the call's message (the normal case — results arrive in a separate tool-role message) now correctly advances the original call tooutputAvailable. - A tool-scoped
StreamErrorEvent(withtoolCallId) now marks only that call errored and lets generation continue, instead of failing the whole message — matchingUseChatController. - Doc fix: corrected a stale reference to
flutter_markdown_plus. JsonAccumulatorno longer surfaces an unterminated trailing number/keyword (e.g.1234from{"n": 1234) as a complete value — a literal must be delimiter-terminated, preserving the "a partial is always a prefix" contract.MessageProcessorresolves a tool result to its owning call by scanning the conversation when the in-memory map misses (afterreset()/rehydration).deepHashuses order-independent hashing for maps (better distribution).
0.1.0 #
Initial release.
- Models:
AiConversation,AiMessage,AiMessageStatus,AiRole,FinishReason, and the sealedAiParthierarchy (TextPart,ReasoningPart,ToolCallPart,ToolResultPart,FilePart,SourcePart,DataPart) with manual JSON serialization and value equality. - Streaming: sealed
AiStreamEventset,MessageProcessorreducer with granularMutationResults, and the tolerantJsonAccumulatorfor partial tool-call arguments. - Contracts:
LlmProvider,TextRenderer,AiRequestOptions,ToolDefinition. - Zero runtime dependencies (
dart:core+dart:convertonly).