Index of every page on this site: llms.txt
All skills
genkit-ai avatar

/developing-genkit-dart

@d12c988
by Genkitgenkit-ai/skills40 stars
13
Run it yourself

Provides guidance on developing AI-powered applications using 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. Don't use for Genkit in JavaScript/TypeScript, Go, or Python.

Use this Skill: https://skilld.dev/gh/genkit-ai/skills/developing-genkit-dart

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesgenkit_openai.md

≈714 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Genkit OpenAI Plugin (genkit_openai)

OpenAI-compatible API plugin for Genkit Dart. Supports OpenAI models and other compatible APIs (xAI, DeepSeek, Together AI, Groq, etc.).

Basic Usage

import 'dart:io';
import 'package:genkit/genkit.dart';
import 'package:genkit_openai/genkit_openai.dart';

void main() async {
  final ai = Genkit(plugins: [
    openAI(apiKey: Platform.environment['OPENAI_API_KEY']),
  ]);

  final response = await ai.generate(
    model: openAI.model('gpt-5'),
    prompt: 'Tell me a joke.',
    use: [retry()], // recommended for reliable runs
  );
}

The plugin does not require network access or an API key at startup; a key is only needed when you actually call a model.

Model and embedder refs

The plugin ships a curated per-model catalog (internal, not exported). Reference models and embedders by name: openAI.model('<name>') and openAI.embedder('<name>') accept any id (uncurated ids still resolve via dated-suffix aliases and generic defaults). There are no OpenAIModels / OpenAIEmbedders constants.

final response = await ai.generate(
  model: openAI.model('gpt-5-mini'),
  prompt: 'Tell me a joke.',
);

final embeddings = await ai.embed(
  embedder: openAI.embedder('text-embedding-3-small'),
  documents: [DocumentData(content: [TextPart(text: 'Hello world')])],
);

For a custom model that should behave like a curated one, start from its info: CustomModelDefinition(name: 'my-gpt-proxy', info: modelInfoFor('gpt-5.5')) (also xaiModelInfoFor / deepSeekModelInfoFor).

Capability detection is data-driven (per-model), not name-matching. -pro tiers are not curated because they are Responses API only and this plugin speaks Chat Completions (they still come back from discovery).

Options

OpenAIOptions allows configuring sampling temperature, nucleus sampling, token generation, seed, etc: config: OpenAIOptions(temperature: 0.7, maxTokens: 100)

Schemaless JSON output is advisory. When you request JSON output without a schema, the plugin now sends json_object (was strict json_schema), so schema conformance is best-effort rather than guaranteed. Provide an outputSchema when you need enforced structure.

Groq API override

Specify custom baseUrl and custom models to integrate with third-party providers.

final ai = Genkit(plugins: [
  openAI(
    apiKey: Platform.environment['GROQ_API_KEY'],
    baseUrl: 'https://api.groq.com/openai/v1',
    models: [
      CustomModelDefinition(
        name: 'llama-3.3-70b-versatile',
        info: ModelInfo(
          label: 'Llama 3.3 70B',
          supports: {'multiturn': true, 'tools': true, 'systemRole': true},
        ),
      ),
    ],
  ),
]);

final response = await ai.generate(
  model: openAI.model('llama-3.3-70b-versatile'),
  prompt: 'Hello!',
);

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 alert2d4 checks · Risk SAFE
  • Gen Agent Trust Hub3d

    The Genkit Dart skill provides comprehensive documentation and examples for building AI agents and flows using the Genkit framework. It includes guidance on using A2UI for interactive interfaces, managing agent sessions, and implementing middleware for filesystem access and multi-agent orchestration. While the skill includes instructions for installing the Genkit CLI from a vendor-controlled domain, its primary security considerations involve the attack surface for indirect prompt injection created by agents that ingest external data while possessing capabilities such as file modification and command execution.

  • Socket2d

    No alerts

  • Snyk3d

    Risk: CRITICAL · 2 issues

  • Runlayer8mo

    2/11 files flagged

Signed by skilld at d12c988. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 4 days ago.

Activeupdated 5 days ago
metadata
{
  "version": "1.0.0",
  "category": "AiAndMachineLearning"
}

README badge

README badge for genkit-ai/skills/developing-genkit-dart