google-genai-sdk-python
Original:🇺🇸 English
Translated
Expert guidance for writing Python code using the official Google GenAI SDK (google-genai) for Gemini API and Vertex AI. Use for text generation, multimodal inputs, reasoning, tools, and media generation.
3installs
Added on
NPX Install
npx skill4agent add cnemri/google-genai-skills google-genai-sdk-pythonTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Google GenAI Python SDK Skill
Use this skill to write high-quality, idiomatic Python code for the Gemini API.
Reference Materials
Identify the user's task and refer to the relevant file:
- Setup & Client: Installation, auth, client initialization.
- Models: Recommended models (Flash, Pro, Lite, Imagen, Veo).
- Text Generation: Basic inference, streaming, system instructions, safety.
- Chat: Multi-turn conversations and history.
- Reasoning: Thinking config (/
thinking_level), thought signatures.thinking_budget - Structured Output: JSON schemas, Pydantic models, Enums.
- Multimodal Inputs: Images, audio, video, PDFs, media resolution.
- Tools: Function calling, code execution, Google Search grounding.
- Media Generation: Image generation/editing (Imagen), video generation (Veo).
- Source Code: Raw SDK source code for deep inspection.
Core Principles
- Unified SDK: Always use .
google-genai - Stateless Models: Use for single requests.
client.models - Stateful Chats: Use for conversations.
client.chats - Types: Import from .
google.genai.types