Google Gemini now can be accessed via OpenAI python library:

from openai import OpenAI

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

## rest of the code as you would use openai

It support basic text generation, image input, function calling, structured output, and embeddings. More info and code examples can be found on Gemini docs .


Comment? Reply via Email, Mastodon or Twitter.