Agent skill · google

developing-genkit-python

Develop AI-powered applications using Genkit in Python. Use when the user asks about Genkit, AI agents, flows, or tools in Python, or when encountering Genkit errors, import issues, or API problems.

What it needs

About 3k tokens when loaded.

What this skill does

Genkit Python Build AI features in Python — generate, stream, tools, flows, and multi-turn agents — with one SDK. Prerequisites Python 3.10+ and uv (install) Genkit CLI: npm install -g genkit-cli if genkit --version is missing New app? Setup. Patterns? Examples. Hello World Agents (Beta) Multi-turn chats with history, typed state, human approval, branching, and background work. Start here: Agents. More: sessions · HITL · branching · background · state · artifacts · custom · HTTP Imports Google AI: from genkitgooglegenai import GoogleAI Agents: from genkit.agent import InMemorySessionStore, ... Middleware: from genkitmiddleware import Middleware, ToolApproval, ... FastAPI: from genkitfastapi import serveagent, serveflow Evals: from genkitevaluators import registergenkitevaluators Workflow 1. Agent or flow? If the task is conversational, multi-turn, or described as "an agent", "assistant", or "chatbot", build it with ai.defineagent (see Agents) rather than hand-rolling a generate + tools loop inside a flow. Reach for a plain flow only for single-shot, stateless generation. 2. Set GEMINIAPIKEY. Use prefixed model ids (googleai/gemini-flash-latest). 3. Enter via ai.runmain(main()) for Genkit apps (especially under genkit start). See Common Errors. 4. Run with Dev Workflow (genkit start + Dev UI). 5. Verify with traces, not a blind run. Running the app directly (uv run) does not capture dev traces. See Genkit CLI for how to run your app and capture traces. 6. Stuck? Common Errors first. Genkit CLI (recommended) genkit start unintrusively wraps any Python program that uses the Genkit library, running it unchanged while capturing traces from every Genkit action so you can prove tools were actually called and inspect model I/O from the terminal, even for headless checks. It forwards stdio, so interactive CLI tools that rely on stdin/stdout work without issues. Running the app directly (uv run) skips trace capture, so you're debugging blind. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills google/genkit-python

View the source on GitHub

Browse the @skills marketplace