developing-genkit-dart

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

Updated Aug 5, 2024
One-click install
npx skills add https://github.com/nikhilkakarla/nikhilkakarla.github.io --skill developing-genkit-dart-nikhilkakarla
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: developing-genkit-dart
Source: https://github.com/nikhilkakarla/nikhilkakarla.github.io/tree/main/.agents/skills/developing-genkit-dart
Command: npx skills add https://github.com/nikhilkakarla/nikhilkakarla.github.io --skill developing-genkit-dart-nikhilkakarla

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Building AI-powered features in Dart or Flutter requires learning the Genkit Dart SDK's APIs for generation, tools, flows, embeddings, and plugins, and getting schemas, initialization, and streaming right without guidance is error-prone. ## Core Features & Use Cases - Code Generation for Genkit Dart: Produces working Dart code for text generation, streaming, structured output, tool definitions, flows, embeddings, and remote flow clients. - Plugin Guidance: Provides reference documentation for plugins including Google GenAI, Anthropic, OpenAI-compatible APIs, Firebase AI, Chrome built-in AI, MCP, Shelf HTTP serving, and middleware for filesystem access, skills, and tool approval. - Type-Safe Schemas with Schemantic: Teaches the schemantic library patterns (@Schema(), $-prefixed classes, generated $schema fields) required for all Genkit Dart data models. - Use Case: Ask the assistant to build a Dart flow that calls Gemini with a custom tool and structured output, and it generates compilable code using the correct plugin initialization and schemantic schemas, verified with dart analyze. ## Quick Start Ask the assistant to create a Genkit Dart flow that generates a joke about a given topic using the Google Gemini plugin.

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 handler function. Input schemas are defined with the schemantic library using @Schema() annotated abstract classes prefixed with $, then passed as YourClass.$schema.

How do I create a flow in Genkit Dart?▼

Use ai.defineFlow with a name, inputSchema, outputSchema, and an async function containing your AI logic. Flows support streaming via context.sendChunk and can be served over HTTP with the genkit_shelf plugin's startFlowServer.

Which LLM providers does Genkit Dart support?▼

Genkit Dart supports Google Gemini via genkit_google_genai or genkit_firebase_ai, Anthropic Claude via genkit_anthropic, OpenAI and compatible APIs like Groq via genkit_openai, and local Gemini Nano in Chrome via genkit_chrome.

Does Genkit Dart support structured output?▼

Yes, pass an outputSchema to ai.generate using a schemantic-generated schema like Person.$schema. The response's output property returns a typed Dart object parsed from the model's JSON response.

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. You can also create standalone MCP clients or expose Genkit actions as an MCP server over stdio or HTTP.

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

Schemantic requires running dart run build_runner build to generate the .g.dart files containing concrete classes and $schema fields. Also ensure the part directive matches your filename and abstract classes use the $ prefix.