This repository contains a simple Python Flask App running with the Google AI Gemini API, designed to get you started building with Gemini's multi-modal capabilities. The app comes with a basic UI and a Flask backend.
To send your first API request with the Google Gen AI SDK, make sure you have the right dependencies installed (see installation steps below) and then run the following code:
from google import genai client = genai.Client(api_key="GEMINI_API_KEY") chat = client.chats.create(model="gemini-2.0-flash") response = chat.send_message("Hello world!") print(response.text) response = chat.send_message("Explain to me how AI works") print(response.text) for message in chat.get_history(): print(f'role - {message.role}',end=": ") print(message.parts[0].text)
If you don’t have Python installed, install it from Python.org.
Clone this repository.
Create a new virtual environment:
macOS:
$ python -m venv venv $ . venv/bin/activate
Windows:
> python -m venv venv > .\venv\Scripts\activate
Linux:
$ python -m venv venv $ source venv/bin/activate
Install the requirements:
$ pip install -r requirements.txt
Make a copy of the example environment variables file:
Add your API key to the newly created .env
file or as an environment variable.
Run the app:
You should now be able to access the app from your browser at the following URL: http://localhost:5000!
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4