A framework for creating AI agents and agent managers
Project description
Agentic
A simple framework for creating AI agents and agent managers with LLM backends.
Installation
pip install agentic
Usage
from agentic import Tool, Agent, ManagerAgent
import openai
# Initialize OpenAI client
client = AzureOpenAI(
api_key=os.getenv('AZURE_OPENAI_API_KEY'),
api_version="2024-02-15-preview",
azure_endpoint=os.getenv('AZURE_OPENAI_ENDPOINT')
)
# Create a simple tool
calculator_tool = Tool(
name="calculator",
description="Calculate a mathematical expression",
function=lambda expression: eval(expression),
inputs={"expression": ["string", "The math expression to evaluate"]}
)
# Create an agent with the tool
math_agent = Agent(
name="MathAgent",
system_prompt="You are a helpful mathematical assistant.",
llm=client,
tools=[calculator_tool],
verbose=True
)
# Use the agent
result = math_agent.go("What is 25 squared plus 13?")
print(result)
Creating a Manager Agent
# Create specialized agents
researcher = Agent("Researcher", "You research facts thoroughly.", client)
analyst = Agent("Analyst", "You analyze data and provide insights.", client)
# Create a manager agent
manager = ManagerAgent(
name="Manager",
system_prompt="You coordinate multiple agents to solve complex problems.",
llm=client,
agents=[(researcher, "Use for researching facts"), (analyst, "Use for data analysis")],
parallel=True,
verbose=True
)
# Use the manager agent
result = manager.go("Research the population of France and analyze its growth trend.")
print(result)
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
agentrix-0.0.1.tar.gz
(4.9 kB
view details)
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 agentrix-0.0.1.tar.gz.
File metadata
- Download URL: agentrix-0.0.1.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9dfa93736d9b2a0dc081e65017542bfa85d9a0caf269b8108a0c0726e05bbc2d
|
|
| MD5 |
3c54c131f9e3707896dec590ca9a2569
|
|
| BLAKE2b-256 |
8e879d0672152f92d6659d18f6c55e08ba22fd1825b164a99813396767eea5ea
|
File details
Details for the file agentrix-0.0.1-py3-none-any.whl.
File metadata
- Download URL: agentrix-0.0.1-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
25b76289cd90f68c74528e0964c3dad2ef9fff89b57356f020bf1685904d28aa
|
|
| MD5 |
823e2f4204f8b84d0067110e328dde68
|
|
| BLAKE2b-256 |
99c45f479ae2da78acc534398193878159dde54c31e592699ca3c96062d52062
|