developing-genkit-dart

Generates Dart code and documentation for building AI agents with the Genkit Dart SDK.

Updated Aug 17, 2026
One-click install
npx skills add https://github.com/DingJun1028/esggo-kv --skill developing-genkit-dart-dingjun1028
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: developing-genkit-dart
Source: https://github.com/DingJun1028/esggo-kv/tree/main/.agents/skills/developing-genkit-dart
Command: npx skills add https://github.com/DingJun1028/esggo-kv --skill developing-genkit-dart-dingjun1028

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Building AI agents and LLM-powered features in Dart or Flutter requires learning the Genkit Dart SDK's APIs for generation, tools, flows, embeddings, and plugins, which are spread across many packages. This Skill provides the correct usage patterns and reference documentation so generated code compiles and follows Genkit conventions. ## Core Features & Use Cases - Core Framework Guidance: Covers initialization, text generation, streaming, structured output, tool definition, flows, embeddings, and calling remote flows from Dart or JavaScript clients. - Plugin References: Provides per-plugin documentation for Google GenAI, Anthropic, OpenAI-compatible endpoints, Firebase AI, Chrome built-in AI, MCP integration, Shelf HTTP serving, and middleware for filesystem, skills, and tool approval. - Schemantic Integration: Explains the schemantic library used for all typed schemas in Genkit Dart, including @Schema() classes, $-prefixed abstract models, and build_runner code generation. - Use Case: A developer asks to build a Dart CLI agent that calls Gemini with a weather tool and streams responses; the Skill supplies the correct ai.defineTool, ai.generateStream, and schemantic schema code. ## Quick Start Ask the assistant to write a Genkit Dart flow that generates text with the Gemini model and streams the response.

Frequently Asked Questions about developing-genkit-dart

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I define a tool in Genkit Dart?▼

Use ai.defineTool with a name, description, inputSchema, and an async fn implementing the logic. Input schemas are defined with the schemantic library using @Schema() abstract classes prefixed with $, then passed as YourClass.$schema.

How do I stream responses from Gemini in Dart?▼

Call ai.generateStream with a model reference such as googleAI.gemini('gemini-2.5-flash') and a prompt, then iterate over the returned stream with await for to read each chunk's text.

Does Genkit Dart support OpenAI-compatible APIs like Groq?▼

Yes, the genkit_openai plugin accepts a custom baseUrl and CustomModelDefinition entries, so providers like Groq, DeepSeek, and Together AI can be used by overriding the endpoint and declaring model capabilities.

How do I connect Genkit Dart to MCP servers?▼

Use the genkit_mcp package's defineMcpHost to connect to one or more MCP servers and automatically register their tools. Tools can then be referenced in ai.generate via wildcard names like 'my-host:tool/fs/*' or exact tool names.

Why does my Genkit Dart schema code fail to compile?▼

Schemantic requires running dart run build_runner build to generate the .g.dart files for @Schema() classes. Missing part directives or ungenerated files cause compile errors, so verify the part statement matches the filename and rerun the builder.

How do I serve Genkit flows over HTTP in Dart?▼

Use the genkit_shelf plugin's startFlowServer for a standalone server, or mount flows onto an existing Shelf Router with shelfHandler. Deployed flows can then be called from Dart or JavaScript clients using defineRemoteAction or the genkit npm client.