Перейти к содержанию
Skillpedia
API и серверы (бэкенд)22k · #10255

developing-genkit-dart

Что он делает

Скилл помогает разработчикам создавать ИИ-функции на Dart и Flutter с помощью Genkit SDK. Он нужен тем, кто хочет добавить ИИ-агентов или вызовы моделей в приложение на Dart.

Когда использовать

  • ✓Когда вы хотите создать ИИ-агента или поток на Dart с Genkit.
  • ✓Когда вы хотите добавить вызовы языковых моделей в приложение на Dart или Flutter.
  • ✓Когда вы переводите код Genkit на Dart со старой версии на API 1.0.

Ссылка на скилл

https://github.com/google/skills/blob/main/skills/cloud/developing-genkit-dart/SKILL.md

Скопируйте и вставьте её в ваш ИИ (Claude, ChatGPT или Cursor) с просьбой следовать инструкциям.

Как использовать

Самый простой способ: скопируйте сообщение и вставьте его в свой ИИ. Он прочитает скилл и выполнит инструкции.

Готовое сообщение для вставки

Используй этот скилл, чтобы помочь мне: https://github.com/google/skills/blob/main/skills/cloud/developing-genkit-dart/SKILL.md Прочитай файл SKILL.md по этой ссылке и следуй его инструкциям в моей задаче.
Хотите, чтобы ваш ИИ сам находил такие скиллы?Установите бесплатный MCP Skillpedia: одна строка, и перед каждой задачей он ищет среди 15 000+ скиллов.Установить за 1 минуту →

Пример запроса к вашему ИИ

“Создай поток Genkit на Dart, который принимает тему и возвращает короткую шутку от языковой модели.”

5 новых скиллов в неделю. 1 минута чтения.

Как это работает

Скилл пишет код Genkit на Dart с текущими именами и шаблонами API 1.0 и указывает на справочные руководства по каждой функции. Он помогает с настройкой, генерацией, инструментами и потоками.

Технический текст (оригинальный SKILL.md)

Оригинальный текст автора на английском, прямо с GitHub.

Genkit Dart

Genkit Dart is an AI SDK for Dart that provides a unified interface for code generation, structured outputs, tools, flows, and AI agents.

Core Features and Usage

If you need help with initializing Genkit (Genkit()), Generation (ai.generate), Tooling (ai.defineTool), Flows (ai.defineFlow), Embeddings (ai.embed), streaming, or calling remote flow endpoints, please load the core framework reference: references/genkit.md

1.0 vs pre-1.0 APIs

This skill targets Genkit Dart 1.0 (genkit: ^1.0.0). Older code and training data use pre-1.0 names that no longer compile; the common ones:

  • HTTP: startFlowServer / per-route shelfHandler / shelf_cors_headers are now GenkitRouter + serve() or asShelfHandler(), with CorsOptions; context providers take RequestData (genkit_shelf.md).
  • StatusCodes.UNAUTHENTICATED is StatusCode.unauthenticated (lowerCamelCase, same for EvalStatus.pass, ToolChoice.required).
  • No RetryPlugin; retry() is built in and takes Durations (initialDelay, maxDelay, also cacheTtl elsewhere).
  • Renames: GenerateResponseHelper -> GenerateResult (modelResponse, chunk.modelChunk), ExecutablePrompt -> Prompt<Input, Output>, embedMany -> embed, ToolFnArgs -> ToolFnArg, toolOutputSchema -> outputSchema, underlyingException -> cause, modelInfo: -> info:, RemoteAction.dispose() -> close(), prompt(input, PromptGenerateOptions(config: ...)) -> prompt(input, config: ...) (named options, like generate), defineMiddleware -> ai.defineGenerateMiddleware (app) / generateMiddleware (plugins).
  • Provider config types are prefixed: GeminiThinkingConfig, GeminiSafetySettings, GeminiGoogleSearch, GeminiSpeechConfig, GoogleGenAiEmbedderOptions, AnthropicThinkingConfig.
  • Removed: ToolInterruptException / ctx.interrupt() (return .interrupt(...)), GoogleAiModels / OpenAIModels constants (use googleAI.gemini('...'), openAI.model('...')). Simulated constrained output is opt-in via simulateConstrainedGeneration().
  • .prompt Picoschema is spec-compliant: name: type, description, never name(description): type (dotprompt.md).

Prompts (Dotprompt)

.prompt files keep prompt content out of Dart code with YAML frontmatter plus a Handlebars template. See references/dotprompt.md: promptDir, ai.prompt() (call/stream/render), variants, partials, named schemas via defineSchema, and the tools/maxTurns/returnToolRequests/use (middleware) frontmatter fields. A .prompt file can also back an agent directly via definePromptAgent.

Agents

Genkit Dart has an agent API for persistent, multi-turn conversations (sessions, snapshots, interrupts, branching, background execution, custom state, artifacts, and multi-agent delegation). The agent/session/snapshot APIs are experimental and live behind opt-in imports: server APIs come from package:genkit/experimental.dart (alongside package:genkit/genkit.dart), the browser/HTTP client from package:genkit/experimental_client.dart (alongside package:genkit/client.dart), and dart:io extras like FileSessionStore from package:genkit/experimental_io.dart. These entry points are @experimental, so importing them raises an experimental_member_use analyzer warning you can silence in analysis_options.yaml. The remoteAgent client works from any Dart app, including Flutter, and the backend is fully interchangeable — it can talk to a Genkit agent implemented in Dart, JS/TypeScript, or Go over the same HTTP protocol. A few Dart specifics: interrupts are ai.defineInterrupt(...) or tools that return .interrupt(...) (there is no ctx.interrupt()), sub-agent delegation uses the agents() middleware from package:genkit_middleware, and there is no artifacts() middleware yet (define artifact tools directly).

For more details see:

Частые вопросы

Поддерживает ли он старые версии Genkit?

Он ориентирован на Genkit Dart 1.0 и перечисляет, какие имена изменились по сравнению с предыдущими версиями.

Охватывает ли он приложения Flutter?

Да. Он помогает подключить языковые модели и к Dart, и к Flutter приложениям.

Какие функции он охватывает?

Настройку, генерацию, инструменты, потоки, эмбеддинги, потоковую передачу и вызов удалённых потоков по эндпоинтам.

Подробности

Оригинальное описание автора

Generates code and provides documentation for the Genkit Dart SDK. Use when the user asks to build AI agents in Dart, use Genkit flows, or integrate LLMs into Dart/Flutter applications.

repo: google/skills

Популярность

Звёзды на GitHub
22k
Место в рейтинге
#10255
Лицензия
Apache-2.0
Обновлён
02.11.2026

Полезен ли этот скилл?

0

Войдите , чтобы голосовать.

Комментарии

  • …

Другие скиллы из этого репозитория

Похожие скиллы