These are some examples of using the Gemini API in Python
Get your API-key here and export it as an environment variable.
$ export GOOGLE_API_KEY=YOUR_GOOGLE_API_KEY
In basic.py
there is a simple demo of creating a basic chat completion
In stream.py
there is an example of streaming the chat completion.
In chat.py
there is a simple terminal chatbot implementation using the `ChatSession`` class
In hard_chat.py
there is a terminal chatbot implementation using generate_content()
with a list of messages directly.
In vision.py
there is a demo of the gemini-pro-vision
model
In gemini-ai-agent
three is a demo of an AI agent that can write to files, using Gemini