A CLI tool to bootstrap Gemini agents with OpenAI Agent SDK using UV.
Project description
Gemini Starter Agent - Simplifying Gemini Chat Completions in the OpenAI Agents SDK
Gemini Starter Agent is a Python CLI tool to quickly bootstrap AI agents using the Gemini API and OpenAI Agent SDK. It leverages UV for project scaffolding, virtual environment management, and dependency handling.
Features
-
Quick scaffolding of a Gemini AI agent project.
-
Automatic creation of virtual environments.
-
Easy dependency installation (openai-agents, python-dotenv).
-
Generates a ready-to-run main.py for your agent.
-
Friendly CLI prompts for agent name, purpose, and API key.
-
PEP-621 compliant pyproject.toml scripts for easy CLI execution.
-
Cross-platform support.
Installation
Install the package via pip:
pip install gemini-starter-agent
Run the package
gemini-starter-agent
Usage
Run the CLI to generate a new Gemini agent:
`pip install gemini-starter-agent `
You will be prompted for:
-
Project name (default: agent)
-
Gemini API key
-
Gemini model (choose from default or enter your own)
-
Agent name (default: Helpful Assistant)
-
Agent purpose/instructions
After completion, your project structure will look like:
/your-project-name/
├── src/
│ └── your_project_name/
│ ├── __init__.py
│ └── main.py
├── .env
├── pyproject.toml
└── uv.lock
Example main.py
Here is how the generated main.py will look:
import asyncio
import os
from dotenv import load_dotenv
from agents import Agent, Runner, RunConfig, OpenAIChatCompletionsModel, set_tracing_disabled
from openai import AsyncOpenAI
# Load environment variables
load_dotenv()
GEMINI_MODEL = os.getenv("GEMINI_MODEL")
GEMINI_API_KEY = os.getenv("GEMINI_API_KEY")
BASE_URL = os.getenv("BASE_URL")
# Disable tracing for cleaner output
set_tracing_disabled(True)
client: AsyncOpenAI = AsyncOpenAI(api_key=GEMINI_API_KEY, base_url=BASE_URL)
model: OpenAIChatCompletionsModel = OpenAIChatCompletionsModel(GEMINI_MODEL, client)
agent: Agent = Agent(
name="{agent_name}",
instructions="{agent_purpose}",
model=model,
)
async def main() -> None:
prompt = "What is Agentic AI? The output format should be in haiku" # enter a prompt here
result = await Runner.run(agent, prompt, run_config=RunConfig(model))
print(result.final_output)
def start():
asyncio.run(main())
Running Your Agent
Change into the project folder:
Run the agent using UV scripts:
cd [project_name]
uv run helpful-assistant
Environment Variables
The .env file is automatically generated and contains:
GEMINI_API_KEY=your_api_key_here
GEMINI_MODEL=your_model_here
BASE_URL=https://generativelanguage.googleapis.com/v1beta/openai/`
Contributing
-
Submit bug reports or feature requests via GitHub Issues.
-
Fork the repository and create pull requests for improvements.
-
Ensure code style consistency and add documentation for new features.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Author
Marjan Ahmed
-
Email:Â marjanahmed.dev@gmail.com
-
GitHub:Â https://github.com/marjan-ahmed
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gemini_starter_agent-0.1.2.tar.gz.
File metadata
- Download URL: gemini_starter_agent-0.1.2.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8a1d0f589f57e7f79516c99b254836b33c8673f8fdfab335a44e49a814d0e00
|
|
| MD5 |
bae0058304e536f689b8dcdf243b015c
|
|
| BLAKE2b-256 |
737480026c62a276277ccef12a30ab67bc5c0f0259b569d24e8e5e59dcdf2a39
|
File details
Details for the file gemini_starter_agent-0.1.2-py3-none-any.whl.
File metadata
- Download URL: gemini_starter_agent-0.1.2-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f48ab666145f6ad77d7bc364b1cfb90ab4fa0af819e576fb6061c8706747ef8b
|
|
| MD5 |
28928448814130acf0547112e8a22abb
|
|
| BLAKE2b-256 |
ca6545b6befc1e99be4d0b00b0257e21a915d6a698eb8f6816f1dc8cee19d614
|