今日已更新 339 条资讯 | 累计 19899 条内容
关于我们

Genesis AI SDK — A Universal Flutter SDK for AI Agents

Devansh Verma 2026年05月29日 17:55 4 次阅读 来源:Dev.to

One unified API for Gemini, OpenAI, Anthropic, HuggingFace, Ollama, on-device Gemma, and GGUF models — with tool calling, memory, and safety guardrails built in. The Problem Building AI agents in Flutter is fragmented. Every provider has a different API shape. There's no standard way to switch between cloud and on-device inference. Tool calling, persistent memory, and safety guardrails are always custom implementations. The result: developers rebuild the same plumbing for every project. What It Is genesis_ai_sdk is a universal Flutter SDK for building AI agents that run locally and in the cloud. One clean API. Seven providers. Zero vendor lock-in. Supports: Gemini (Google) OpenAI (GPT-4o) Anthropic (Claude) HuggingFace (any public model, no download needed) Ollama (local server, no API key) On-device Gemma (fully offline) On-device GGUF via llama.cpp (fully offline) Switch providers by changing one line. Your agent code stays the same. Quick Start — 10 Lines of Code import 'package:genesis_ai_sdk/genesis_ai_sdk.dart' ; final agent = GenesisAgent ( provider: GeminiProvider ( apiKey: 'YOUR_KEY' ), systemPrompt: 'You are a helpful assistant.' , tools: [ GenesisTools . calculator , GenesisTools . dateTime ], ); final response = await agent . chat ( 'What is 1337 * 42, and what day is it?' ); print ( response ); The agent figures out which tool to call, executes it, and returns the answer. No prompt engineering needed. The Features That Actually Matter Real Tool Calling — Not Just Text The ReAct loop is fully implemented. The agent reasons → calls tools → observes results → repeats until it has a complete answer. An onStep callback fires for every intermediate step — perfect for building a "thinking…" UI. Custom tools are five lines: final weatherTool = GenesisTool . define ( name: 'get_weather' , description: 'Returns weather for a city.' , params: { 'city' : ToolParam . string ( description: 'City name' )}, execute: ( args ) async = > fetchWeather ( args [ 'city' ]), )

本文内容来源于互联网,版权归原作者所有
查看原文