A lightweight LLM agent framework with standard and structured tool support use, prompt management, and support for OpenAI.
Project description
๐ง Bruce Agent
AgentX is a lightweight, extensible agentic framework for building custom LLM agents with structured tool use, prompt templates, and integration with OpenAI and Gemini models.
๐ Features
- ๐ Custom reasoning loop (
AgentRunner) - ๐งฉ Structured tool execution (Pydantic-based)
- ๐ฌ Prompt templating and management
- ๐ LLM-agnostic: supports OpenAI function calling and Google Gemini
- ๐ช Easy-to-use API for building agents
๐ฆ Installation
published to PyPI:
pip install agentx-dev==2.3
Example use
from agentx_dev import AgentRunner, AgentType,ChatModel
from pydantic import BaseModel
from agentx_dev.Tools import StructuredTool,StandardTool
# Define a sample Stuctured tool
class MultiplyTool(BaseModel):
a: int
b: int
def multiply(a: int, b: int) -> int:
return a * b
# Define a sample Standard tool
def Weather(weather:str):
return f"{weather} is currently at 28 degree with a high of 32 and a low of 18 "
# Create chat model and agent
ReAct=AgentType.ReAct
chat_model = ChatModel.GPT(model="gpt-4", temperature=0.7)
tools = [StructuredTool(name="MultiplyTool",
description="useful when you need to add two numbers",
func=multiply,
args_schema=MultiplyTool
),
StandardTool(name="Weather",
description="when you need to check the weather of a location, input should be the str of the location",
func=Weather)]
# Create an AgentRunner instance
agent = AgentRunner(model=chat_model,Agent=ReAct, tools=tools)
# Initialize the agent with user input
response = agent.Initialize("What is 5 times 8?",ChatHistory=[{'role':"assistant",'content':'hello there how is it going'}])
# Print the result
print(response.content)
# output the Agent completion
agent.Initialize("i need the weather in Barrie")
โโโagentx_dev/
โ โโโ __init__.py
โ โโโ agent/
โ โ โโโ __init__.py
โ โ โโโ agent.py
โ โโโ runner/
โ โ โโโ __init__.py
โ โ โโโ agent_run.py
โ โโโ chatmodel.py
โโโ README.md
โโโ LICENSE
โโโ pyproject.toml
๐ Documentation (Coming Soon)
More tutorials, tool examples, and structured prompting guides coming soon.
๐งโ๐ป Author
Bruce-Arhin Shadrach
๐ง brucearhin098@gmail.com
๐ GitHub
๐ License MIT License
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 agentx_dev-2.3.4.tar.gz.
File metadata
- Download URL: agentx_dev-2.3.4.tar.gz
- Upload date:
- Size: 18.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2fa7a86cf80d4cb4d1a447411ab1fe4f8c9743b0c14db30637b95516136d0dfd
|
|
| MD5 |
6543f177fc99f619710d580ce9f5770f
|
|
| BLAKE2b-256 |
97edf0a3064cada85781c73bce2199194deeeeba6091cacc0bf4457e1d503312
|
File details
Details for the file agentx_dev-2.3.4-py3-none-any.whl.
File metadata
- Download URL: agentx_dev-2.3.4-py3-none-any.whl
- Upload date:
- Size: 23.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ad644cf5663c7ac886d6c72d1cd984060a7b7666a75b5954cdee879a485fa39e
|
|
| MD5 |
69795a96f59fae2abd75ca463aa1d14f
|
|
| BLAKE2b-256 |
d22c8b2431e4dc452819935c4569c03a08bb6d736bb2b7e6d46fa9edf9f9b334
|