Home/AI App Building & Integration/developing-genkit-python
D

developing-genkit-python

by @firebasev
4.6(120)

This skill guide assists developers in building AI-powered applications using the Genkit framework in Python. It covers project setup, code examples, development workflows, and common error troubleshooting, accelerating AI application development.

genkitpythonai-agentsdevelopmentframeworksGitHub
Installation
git clone https://github.com/firebase/agent-skills.git
compare_arrows

Before / After Comparison

1
Before

Developers often spend significant time on complex configurations, frequent API changes, and hard-to-diagnose errors in Genkit Python projects, leading to low efficiency and slow project progress.

After

With this skill guide, developers can quickly set up Genkit projects, master best practices, and efficiently resolve common issues, drastically shortening development cycles and accelerating AI application deployment.

SKILL.md

Genkit Python

Prerequisites

  • Runtime: Python 3.14+, uv for deps (install).
  • CLI: genkit --version — install via npm install -g genkit-cli if missing.

New projects: Setup (bootstrap + env). Patterns and code samples: Examples.

Hello World

from genkit import Genkit
from genkit.plugins.google_genai import GoogleAI

ai = Genkit(
    plugins=[GoogleAI()],
    model='googleai/gemini-flash-latest',
)

async def main():
    response = await ai.generate(prompt='Tell me a joke about Python.')
    print(response.text)

if __name__ == '__main__':
    ai.run_main(main())

Critical: Do Not Trust Internal Knowledge

The Python SDK changes often — verify imports and APIs against the references here or upstream docs. On any error, read Common Errors first.

Development Workflow

  1. Default provider: Google AI (GoogleAI()), GEMINI_API_KEY in the environment.
  2. Model IDs: always prefixed, e.g. googleai/gemini-flash-latest (always-on-latest Flash alias; same pattern as other skills).
  3. Entrypoint: ai.run_main(main()) for Genkit-driven apps (not asyncio.run() for long-lived servers started with genkit start — see Common Errors).
  4. After generating code, follow Dev Workflow for genkit start and the Dev UI.
  5. On errors: step 1 is always Common Errors.

References

  • Examples: Structured output, streaming, flows, tools, embeddings.
  • Setup: New project bootstrap and plugins.
  • Common Errors: Read first when something breaks.
  • FastAPI: HTTP, genkit_fastapi_handler, parallel flows.
  • Dotprompt: .prompt files and helpers.
  • Evals: Evaluators and datasets.
  • Dev Workflow: genkit start, Dev UI, checklist.

User Reviews (0)

Write a Review

Effect
Usability
Docs
Compatibility

No reviews yet

Statistics

Installs28.5K
Rating4.6 / 5.0
Version
Updated2026年5月23日
Comparisons1

User Rating

4.6(120)
5
37%
4
43%
3
13%
2
5%
1
2%

Rate this Skill

0.0

Compatible Platforms

🤖claude-code

Timeline

Created2026年5月8日
Last Updated2026年5月23日