Python API link to Google AI LLM
This repo contains a simple implementations of the GoogleAI API for using Gemini LLMs.
- Python 3.x and Pip Python package manager installed
- Git distributed version control system installed
-
Clone this repository:
git clone https://github.com/colinmccrae/GoogleAI/
-
Navigate to the project directory:
cd GoogleAI
-
Run the installation script:
install.bat
. If you do this you can move straight to Step 8. If you don't want to run this batch file, you can alternatively manually swtich to a virtual environment and install the dependencies as per Steps 4-7. -
Create a virtual environment:
python -m venv venv
-
Activate the virtual environment:
venv\Scripts\activate
-
Install dependencies from requirements.txt
pip install -r requirements.txt -U
-
Create a new file called '.env'.
-
Edit the
.env
file to add your API keys. Enter your GoogleAI API key into the .env file, as per example text shown below.
# GoogleAI API Key
GEMINI_API_KEY = "your_googleai_api_key"
- Execute any of the Python scripts. For example:
python main.py
Note: These will require API access to run and it may cost you money.
For more information about Google AI Studio, see the AI Studio Quickstart, and the Getting Started: Python pages.
Below are the projects I'm currently working on in this repo.
A simple implemention of Google's Gemma 1.5 Pro model (gemini-1.5-pro-exp-0801).