Genkit Dart
Inspect pubspec.yaml, lockfile, Dart/Genkit/plugin versions, imports, configured provider/model, flows, tools, deployment, and tests. Dart support may evolve quickly; verify symbols and compatibility against installed packages and current official Genkit/provider documentation.
Guardrails
- Do not run global installs, broad upgrades,
latest, or network setup scripts implicitly.
- Preserve the project's provider. If none exists, present choices by deployment, privacy, region, capability, latency, cost, and support maturity.
- Keep the exact model ID in validated configuration and verify current plugin support at implementation time.
- Never expose keys in mobile/web clients, source, logs, or prompts. Put privileged provider calls behind an appropriate trusted boundary.
Implementation
- Register only needed plugins using APIs present in the installed version.
- Define typed/validated input and output schemas plus application invariants.
- Separate stable instructions from untrusted user/retrieved content.
- Give tools strict schemas, least privilege, authorization, timeouts, idempotency, and confirmation for destructive/costly/external effects.
- Bound tool rounds, retries, concurrency, tokens, time, and spend.
- Keep provider/model configuration outside reusable flow code where the installed API allows it.
- Add observability without logging secrets or sensitive payloads.
Conceptual configuration:
final modelId = Platform.environment['GENKIT_MODEL_ID'];
if (modelId == null || modelId.isEmpty) {
throw StateError('GENKIT_MODEL_ID is required');
}
// Pass modelId through the API supported by the installed provider plugin.
Verify
Run analyzer/format/tests/build, schema tests, mocked provider/tool tests, timeout/cancellation/retry/authorization cases, and a bounded live smoke test only when credentials/network/cost are authorized. Report installed versions, configuration source, commands, deployment/data boundary, and skipped checks.
1---2name: developing-genkit-dart3description: Build and troubleshoot Genkit applications in Dart with installed-version-first APIs, provider-neutral model configuration, flows, tools, schemas.4license: MIT5---67# Genkit Dart89Inspect `pubspec.yaml`, lockfile, Dart/Genkit/plugin versions, imports, configured provider/model, flows, tools, deployment, and tests. Dart support may evolve quickly; verify symbols and compatibility against installed packages and current official Genkit/provider documentation.1011## Guardrails1213- Do not run global installs, broad upgrades, `latest`, or network setup scripts implicitly.14- Preserve the project's provider. If none exists, present choices by deployment, privacy, region, capability, latency, cost, and support maturity.15- Keep the exact model ID in validated configuration and verify current plugin support at implementation time.16- Never expose keys in mobile/web clients, source, logs, or prompts. Put privileged provider calls behind an appropriate trusted boundary.1718## Implementation19201. Register only needed plugins using APIs present in the installed version.212. Define typed/validated input and output schemas plus application invariants.223. Separate stable instructions from untrusted user/retrieved content.234. Give tools strict schemas, least privilege, authorization, timeouts, idempotency, and confirmation for destructive/costly/external effects.245. Bound tool rounds, retries, concurrency, tokens, time, and spend.256. Keep provider/model configuration outside reusable flow code where the installed API allows it.267. Add observability without logging secrets or sensitive payloads.2728Conceptual configuration:2930```dart31final modelId = Platform.environment['GENKIT_MODEL_ID'];32if (modelId == null || modelId.isEmpty) {33 throw StateError('GENKIT_MODEL_ID is required');34}35// Pass modelId through the API supported by the installed provider plugin.36```3738## Verify3940Run analyzer/format/tests/build, schema tests, mocked provider/tool tests, timeout/cancellation/retry/authorization cases, and a bounded live smoke test only when credentials/network/cost are authorized. Report installed versions, configuration source, commands, deployment/data boundary, and skipped checks.