All skills
cnemri avatar

/google-genai-sdk-python

@8caf714

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.

Use this Skill: https://skilld.dev/gh/cnemri/google-genai-skills/google-genai-sdk-python

This session only. Nothing lands on disk.

referencessetup.md

≈224 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Setup and Initialization

Installation

Golden Rule: Always use the google-genai SDK. Do not use legacy google-generativeai.

pip install google-genai

Initialization

The SDK requires a client object. It implicitly uses the GEMINI_API_KEY (or GOOGLE_API_KEY) environment variable.

from google import genai
from google.genai import types

# Standard initialization
client = genai.Client()

# Explicit API key (avoid hardcoding in production)
# client = genai.Client(api_key='YOUR_API_KEY')

# Vertex AI Initialization
# client = genai.Client(
#     vertexai=True,
#     project='your-project-id',
#     location='us-central1'
# )

Best Practices

  • Imports: Use from google import genai and from google.genai import types.
  • Statelessness: The client is predominantly stateless. Access methods via client.models, client.chats, etc.

Source: SKILL.md on GitHub

1 warning16d4 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    The Google GenAI Python SDK Skill is a documentation and code-reference skill designed to assist in developing Python applications using the Gemini API. It contains comprehensive setup guides, code examples for text/multimodal generation, chat interfaces, and tool usage. All external references are to official Google-owned GitHub repositories, which are recognized as trusted sources. No malicious patterns, unauthorized command execution, or data exfiltration behaviors were detected.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer7mo

    11/11 files flagged

Signed by skilld at 8caf714. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Dormantupdated 8 months ago

README badge

README badge for cnemri/google-genai-skills/google-genai-sdk-python