Back to list
nadeemsangrasi

gemini-agent-sdk-setup

by nadeemsangrasi

0🍴 0📅 Dec 17, 2025

SKILL.md


name: Gemini Agent SDK Setup description: Integrate OpenAI Agent SDK with Google Gemini backend into FastAPI service using the official Google Gemini API via OpenAI compatibility layer.

Gemini Agent SDK Setup

Instructions

  1. Generate the Agent SDK client initialization in app/services/agent/client.py:

  2. Create agent configuration in app/services/agent/config.py:

    • Define model name constants (gemini-1.5-flash, gemini-2.5-flash)
    • Set up default parameters for agent calls
    • Include proper timeout and retry configurations
  3. Implement tool registration system in app/services/tools/registry.py:

    • Create function to register tools with the agent
    • Define tool schemas following OpenAI Agent SDK specification
    • Include validation for tool inputs and outputs
  4. Create utility functions for calling Gemini models in app/services/agent/utils.py:

    • Wrapper function for agent completion calls
    • Error handling and logging utilities
    • Response parsing and validation
  5. Follow Context7 MCP conventions:

    • Only use Gemini models (no OpenAI inference)
    • Follow deterministic output formatting
    • Include proper error handling and logging

Examples

Input: "Setup Gemini Agent SDK integration" Output: Creates client.py with:

from openai import OpenAI
import os

client = OpenAI(
    api_key=os.getenv("GEMINI_API_KEY"),
    base_url="https://generativelanguage.googleapis.com/v1beta/openai/"
)

def call_gemini_agent(messages, tools=None, model="gemini-1.5-flash"):
    """Call the Gemini agent with provided messages and tools."""
    try:
        response = client.chat.completions.create(
            model=model,
            messages=messages,
            tools=tools,
            temperature=0.1
        )
        return response
    except Exception as e:
        # Handle errors appropriately
        raise e

Score

Total Score

50/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon