developing-genkit-python
하는 일
이 스킬은 Genkit SDK로 Python에서 AI 기능을 만드는 개발자를 돕습니다. 앱에 모델 호출, 도구 또는 에이전트를 추가하려는 Python 팀을 위한 스킬입니다.
사용하는 경우
- ✓Genkit을 써서 Python으로 AI 기능, 플로우 또는 도구를 만들고 싶을 때.
- ✓Python 앱에서 기록을 가진 여러 턴의 에이전트 대화가 필요할 때.
- ✓Python 코드에서 Genkit 가져오기 오류나 API 문제를 고쳐야 할 때.
스킬 링크
https://github.com/google/skills/blob/main/skills/cloud/developing-genkit-python/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“Genkit으로 Gemini에 프롬프트를 보내고 답을 출력하는 Python 스크립트를 작성해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
Google GenAI 플러그인을 사용하는 Genkit API로 Python 코드를 작성하고, 설정과 예제에 대한 참조 가이드를 안내합니다. 스킬이 설명하는 uv 도구 설정을 사용합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
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-cliifgenkit --versionis missing
New app? Setup. Patterns? Examples.
Hello World
from genkit import Genkit
from genkit_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())
Agents (Beta)
Multi-turn chats with history, typed state, human approval, branching, and background work. Start here: Agents.
chat = agent.chat()
res = await chat.send('Hello') # AgentResponse
turn = chat.send_stream('Hello') # AgentTurn — .stream / .response
More: sessions · HITL · branching · background · state · artifacts · custom · HTTP
Imports
- Google AI:
from genkit_google_genai import GoogleAI - Agents:
from genkit.agent import InMemorySessionStore, ... - Middleware:
from genkit_middleware import Middleware, ToolApproval, ... - FastAPI:
from genkit_fastapi import serve_agent, serve_flow - Evals:
from genkit_evaluators import register_genkit_evaluators
Workflow
- Agent or flow? If the task is conversational, multi-turn, or described as
"an agent", "assistant", or "chatbot", build it with
ai.define_agent(see Agents) rather than hand-rolling agenerate+ tools loop inside a flow. Reach for a plain flow only for single-shot, stateless generation. - Set
GEMINI_API_KEY. Use prefixed model ids (googleai/gemini-flash-latest). - Enter via
ai.run_main(main())for Genkit apps (especially undergenkit start). See Common Errors. - Run with Dev Workflow (
genkit start+ Dev UI). - 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. - 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.
Primary pattern (default): prefix genkit start -- to your normal run command. This collects telemetry from any Genkit code your program runs, whether triggered from the dev UI, your own web server/web UI, or a plain script:
genkit start -- uv run src/main.py
genkit start --noui -- uv run src/main.py # same, without the Dev UI (still a persistent server)
genkit start runs until you stop it with Ctrl+C. That is expected and correct for the common cases: a server your web/mobile app calls, or an interactive CLI you exit yourself. --noui only drops the Dev UI; it is not a one-shot command and will not exit on its own. Do not use genkit start as a blocking step in automated/non-interactive contexts; use flow:run (below) for that.
Non-interactive use (agents/CI): add the global --non-interactive flag before -- so the CLI uses defaults and never blocks on a prompt (e.g. the first-run analytics notice): genkit start --non-interactive -- uv run src/main.py (works with flow:run too).
Run a flow (flow:run): invoke a specific flow by name from the CLI. Append your run command after -- to spin up the runtime just for this run (the command runs as-is to register your flows):
genkit flow:run myFlow '{"data": "input"}' -- uv run src/main.py
This is self-terminating: i
자주 묻는 질문
어떤 Python 버전이 필요한가요?
Python 3.10 이상과 uv 도구가 필요합니다.
에이전트를 지원하나요?
네. 세션과 사람의 승인 단계를 포함해 Genkit의 베타 에이전트 API를 다룹니다.
예제가 있나요?
네. 흔한 작업을 위한 예제 패턴을 안내합니다.
상세 정보
작성자의 원본 설명
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.
repo: google/skills
인기도
- GitHub 스타
- 22k
- 순위
- #10258
- 라이선스
- Apache-2.0
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
finding-google-skills
22k에이전트가 호스팅, 데이터베이스, 저장소, 로그인, AI 모델 제공처럼 설정 작업에 맞는 Google 가이드를 찾도록 돕습니다.
gcloud
22k에이전트가 Google Cloud gcloud 명령을 작성하고 확인하도록 돕습니다. 플래그를 추측하지 않도록 무엇이든 실행하기 전에 정확한 문법을 확인합니다.
google-cloud-recipe-auth
22k에이전트가 Google Cloud의 신원과 접근 권한을 안내합니다. 사람과 서비스가 어떻게 로그인하고 어떤 권한을 받는지 포함합니다.
google-cloud-recipe-onboarding
22k새 개발자가 Google Cloud에서 프로젝트 선택, 결제 연결, 첫 리소스 배포 같은 첫 단계를 밟도록 안내합니다.
비슷한 스킬
api-connector-builder
280k에이전트가 기존 패턴을 따라 새로운 API 연결을 만들도록 합니다. 새로운 방식을 도입하지 않고 연동을 하나 더 추가할 때 씁니다.
api-design
280k에이전트가 모범 사례에 따라 REST API를 설계하도록 돕습니다. API가 통신하는 방식, 오류를 보여 주는 방식, 데이터를 정리하는 방식을 정하는 데 유용합니다.
backend-patterns
280k에이전트가 서버 쪽 아키텍처 패턴과 데이터베이스 최적화를 다루도록 돕습니다. 서버에서 실행되는 코드를 만들거나 검토할 때 유용합니다.