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.

referencesmultimodal_inputs.md

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

Multimodal Inputs

Gemini supports Text, Images, Audio, Video, and PDF documents.

Images (PIL & Bytes)

# PIL
from PIL import Image
img = Image.open('image.jpg')

# Bytes
with open('image.jpg', 'rb') as f:
    img_bytes = f.read()

response = client.models.generate_content(
    model='gemini-3-flash-preview',
    contents=[
        img, # Or types.Part.from_bytes(img_bytes, mime_type='image/jpeg')
        'Describe this.'
    ]
)

Audio & Video (File API)

For large files (video, long audio), use the Files API.

# Upload
video_file = client.files.upload(file='video.mp4')

# Generate
response = client.models.generate_content(
    model='gemini-3-flash-preview',
    contents=[video_file, 'What happens in this video?']
)

# Cleanup
client.files.delete(name=video_file.name)

Media Resolution

Control vision detail vs. token usage. Levels: LOW, MEDIUM, HIGH, ULTRA_HIGH.

# Per-part configuration
part = types.Part.from_uri(
    file_uri='...',
    mime_type='image/jpeg',
    media_resolution=types.PartMediaResolution(
        level=types.PartMediaResolutionLevel.MEDIA_RESOLUTION_LOW
    )
)

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