如何用智增增API使用Gemini官方SDK

使用Gemini官方SDK

from google import genai
from google.genai import types

if __name__ == '__main__':
    client = genai.Client(
        api_key="sk-xxxxxxxxxxxxxxxxx",
        http_options={
            "base_url": "https://api.zhizengzeng.com/google"
        },
    )

    response = client.models.generate_content(
        model='gemini-2.0-flash',
        contents="Who won Wimbledon this year?",
        config=types.GenerateContentConfig()
    )

    print(response)
© 版权声明

相关文章

暂无评论

暂无评论...