Skip to main content

GemAgent

GemAgent is a lightweight Python SDK to build Gemini-powered agents with tool-calling capability. It provides a simple interface to run Gemini 1.5 models with custom tools and simulated event streaming.


✅ Current Features

  • 🎯 Supports Google Gemini 1.5 models (via google.generativeai)
  • 🧰 Register and use custom tools easily
  • 🔁 Agent and runner system with clean separation
  • 📤 Simulated streaming output (run_streamed)
  • ✅ Simple tool call parsing using call_tool(tool_name, arg=value) format

🔧 Example Usage

from gemagent import Agent, Runner, tool_custom

@tool_custom
def say_hello(name="world"):
    return f"Hello, {name}!"

agent = Agent(
    name="DemoAgent",
    instructions="Be helpful and use tools if needed.",
    tools=[say_hello],
)

import asyncio
response = asyncio.run(Runner.run(agent, "call_tool(say_hello, name='Rishabh')"))
print(response.final_output)

📦 Installation

pip install gemagent

📍 Environment

Set your Gemini API key in .env file:

GOOGLE_API_KEY=your_api_key_here

🚧 Roadmap (Coming Soon)

  • 🔌 Native support for multiple models (OpenAI, Claude, local models)
  • 🧠 Tool chaining and multi-step reasoning
  • 🔄 Agent memory and context persistence
  • 🎥 Real token-level streaming (for terminal and web)
  • ⚙️ CLI interface and Web playground
  • 📁 Plugin-style tool loading

📄 License

MIT License

💡 Inspiration

OpenAI recently released the Agents SDK, which provides a powerful tool-using agent system. However, it requires a paid API key with at least $5 balance to access.

GemAgent was born out of the need for:

  • A free, minimal alternative using Gemini 1.5 Flash
  • Similar design and syntax to OpenAI's Agents SDK for easy migration later
  • Local dev/testing without paying just to prototype tool-based agents

Metadata

Release files for gemagent 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gemagent 0.1.1
File Size Uploaded Provenance
gemagent-0.1.1.tar.gz 5.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for gemagent 0.1.1
File Interpreter ABI Platform
gemagent-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 12.5 kB

Release files / gemagent-0.1.1.tar.gz

Download URL gemagent-0.1.1.tar.gz
Size 5.6 kB
Tags Source
SHA-256 checksum
How to use checksums
3574910ac4941b6c34831ad1088a04cf79354abe8c418c785ceb247164ddc828
BLAKE2b-256 checksum
How to use checksums
9e8e1668eb784f787b330216366fd7defb84ffda9f237e3b6127f38f38647d0c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.11

Release files / gemagent-0.1.1-py3-none-any.whl

Download URL gemagent-0.1.1-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e1e38c382b5443ba4a3dceabd2c739acc78c0742398ba3dd0dbc9b30df8acbc2
BLAKE2b-256 checksum
How to use checksums
7ee3c57df8f130380a36dea61556b68fed2b07b217d280c29d5bc0b7d778fa9e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.11

Security for gemagent 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page