Skip to main content

portal_ai 0.1.2 copy "portal_ai: ^0.1.2" to clipboard
portal_ai: ^0.1.2 copied to clipboard

Platform-aware local and cloud AI backend discovery for Portal apps.

portal_ai #

Platform-aware AI backend discovery and a shared chat runtime for Flutter apps. Finds what is available on the device (Gemini Nano via AICore, a local Ollama on the LAN, a cloud key, or a server-side completion endpoint), picks one, and gives apps a single chat/tool interface on top.

Assistant page: markdown reply with a table, a proposal card and the composer Same reply with the thought process expanded

example/ drives the page with a canned conversation — no model needed to see the widgets.

  • AiBackendDiscovery — probe backends, ranked by preference and availability.
  • PortalAiRuntime — one entry point; apps supply prompts/tools, runtime picks the client.
  • AiChatSession / AiChatStore — persisted multi-turn threads.
  • AiProposal — structured "model proposes, user confirms" edits.
  • clients/ — Gemini, Ollama, server completion (streaming) and a document/multimodal client.
  • widgets/ — chat deck, composer, gate and thread inbox.
final ai = PortalAiRuntime.create(
  post: apiClient.post,            // Future<Map> Function(String path, Map body)
  env: dotenv.env,
  feature: 'gym-assistant',
  appDescription: 'Portal Gym - workouts, routines and exercise logs.',
  tools: gymAiTools(),
);
final result = await ai.ask('Summarise this week', onReply: (delta) => print(delta));

Server-backed clients take a post/postStream callback so the package has no dependency on any particular HTTP/auth layer.

0
likes
0
points
250
downloads

Publisher

unverified uploader

Weekly Downloads

Platform-aware local and cloud AI backend discovery for Portal apps.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

file_picker, flutter, google_generative_ai, http, markdown_widget, shared_preferences

More

Packages that depend on portal_ai

Packages that implement portal_ai