Skip to main content

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

https://img.shields.io/badge/python-3.13+-bluehttps://img.shields.io/badge/License-MIT-yellow.svg

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

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
# the openai-agents runtime packages are installed by `uv add`
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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gemini_starter_agent-0.1.1.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gemini_starter_agent-0.1.1-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file gemini_starter_agent-0.1.1.tar.gz.

File metadata

  • Download URL: gemini_starter_agent-0.1.1.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

Hashes for gemini_starter_agent-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a98a37bad82dd5f6da970dbdcfc8bcc3326add8db3c193818aaa31d9880b6e95
MD5 009c9ee437dc912d8b8d02163c2147f9
BLAKE2b-256 dc8d0fc5a95eb6ec46c3d1be70dfae7b42bfb0c1e9861709734eabadc3e2aabe

See more details on using hashes here.

File details

Details for the file gemini_starter_agent-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for gemini_starter_agent-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 866c2016caf80e2bab6bc9c1bac16b18ecebeebb8bfdc10412cff868dc9627fb
MD5 9fdea9a85f28effa57da620219fd2e0a
BLAKE2b-256 090e407fc63de1c22144c4b204292a366d1ad93e1aa7a011e6276eb09e9e0b62

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page