flutter_ai_client 0.1.1
flutter_ai_client: ^0.1.1 copied to clipboard
Provider-agnostic chat controller for flutter_ai. Wraps any LlmProvider in a Listenable UseChatController with optimistic send, cancellation, regeneration, and frame-batched streaming — without imposi [...]
Changelog #
0.1.1 #
editMessage(id, text)/editLastUserMessage(text): edit a sent user message (keeping attachments), discard everything after it, and re-run from that point — starting a fresh branch set. Closes the previously dead "edit" affordance inAiMessageActions.- Persistence seam: a
ChatStoreinterface (load/save) plus anattachStore(controller, store, id)helper that debounce-auto-saves the conversation once each turn settles. History is still in memory by default; this makes saving/restoring a thread a few lines.AiConversationis already JSON-serializable, so a store is just encode/decode around your storage.
0.1.0 #
Initial release.
UseChatController— aChangeNotifierwrapping anyLlmProvider:- optimistic, synchronous user-message append
sendText/submit/stop/regenerate/clear- live model/provider switching (
setProvider,setOptions,setTools) - coalesced, injectable notification scheduling (frame-batched streaming)
- raw
eventsstream escape hatch
ChatStatus(idle / submitted / streaming / error).- Exposes
stackTracealongsideerrorso failures can be reported with full context. - A fatal (message-scoped)
StreamErrorEventtears down the active turn so a misbehaving provider can't keep mutating the conversation after a fatal error; tool-scoped errors remain non-fatal. - Re-exports
flutter_ai_core.