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.

referencesreasoning.md

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

Reasoning (Thinking)

Reasoning models generate "thoughts" before the final response to improve accuracy on complex tasks.

Configuration

Gemini 3 Series

Use thinking_level to control reasoning depth.

  • MINIMAL: Minimal reasoning, lowest latency.
  • LOW: Simple tasks.
  • MEDIUM: Balanced.
  • HIGH: Maximum depth (default).
config = types.GenerateContentConfig(
    thinking_config=types.ThinkingConfig(
        thinking_level=types.ThinkingLevel.HIGH,
        include_thoughts=True # Returns thoughts in response
    )
)

Gemini 2.5 Series

Use thinking_budget (token count).

  • 0: Thinking OFF.
  • 1024: Specific token budget.
config = types.GenerateContentConfig(
    thinking_config=types.ThinkingConfig(
        thinking_budget=1024,
        include_thoughts=True
    )
)

Accessing Thoughts

If include_thoughts=True, thoughts are returned as parts.

for part in response.candidates[0].content.parts:
    if part.thought:
        print(f"Thought: {part.text}")
    else:
        print(f"Response: {part.text}")

Thought Signatures

When using tools with reasoning models, the API returns an encrypted thought_signature.

  • Automatic: The SDK handles this automatically when using chats or preserving the full response object in history.
  • Manual: If manually constructing history, you must include the thought_signature from the model's turn in the next request to avoid errors.

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