PyAgentix
PyAgentix is a Python framework to build AI agents and chatbots using large language models (LLMs). It supports agents, groups of agents, synchronous and asynchronous calls, JSON and text responses, and includes a basic CLI chatbot.
Installation
pip install pyagentix
Note: This package requires Python 3.8+.
Features
- Agent and AgentGroup abstractions
- Synchronous and asynchronous support
- JSON and text response formats
- CLI chatbot with file upload support
Quick Start
1. Create and use a text response agent
from pyagentix.agent import AgentUnit
agent = AgentUnit(
instruction="You are a helpful assistant."
)
agent.llm.provider = "openai"
response = agent.work("Who is the first person walking on the Moon?")
print("Text response:", response.content)
2. Create and use a JSON response agent
from pyagentix.agent import AgentUnit
json_agent = AgentUnit(
instruction=(
"You are a helpful assistant. Always respond with a JSON object "
"with exactly two keys: 'first_name' and 'last_name'."
),
response_format="json_object"
)
json_agent.llm.provider = "openai"
json_response = json_agent.work("Who is the first person walking on the Moon?")
print("JSON response:", json_response.data)
3. Use the agent asynchronously
import asyncio
query = "Who is the first person walking on the Moon?"
text_response = asyncio.run(agent.work_async(query))
print("Async text response:", text_response.content)
4. Run the CLI chatbot
from pyagentix.agent import AgentUnit
from pyagentix.chatbot import Chatbot
agent = AgentUnit(
instruction="You are a helpful assistant."
)
agent.llm.provider = "openai"
chatbot = Chatbot(client=agent)
chatbot.cli_run()
Configuration
PyAgentix reads API keys from environment variables by default:
OPENAI_API_KEYGROQ_API_KEYGEMINI_API_KEYPERPLEXITY_API_KEY
You can also set API keys and providers programmatically on the agent's LLM instance.
Contributing
Contributions are welcome. Please open issues or pull requests on GitHub.
License
This project is licensed under the MIT License. See the LICENSE file for details.
If you have questions or need help, feel free to open an issue or contact the maintainer.
Release files for PyAgentix 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyagentix-0.1.5.tar.gz | 10.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyagentix-0.1.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.0 kB
Release files / pyagentix-0.1.5.tar.gz
| Download URL | pyagentix-0.1.5.tar.gz |
|---|---|
| Size | 10.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c5e25a804620b203fedeffdbbc25173efbf0af8477a158a69d2dd77184f218fa
|
|
BLAKE2b-256 checksum How to use checksums |
23201bec5535c485414157f764c5bf88f76a7cfcf6e791d0aecc25bef32f8ed2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Release files / pyagentix-0.1.5-py3-none-any.whl
| Download URL | pyagentix-0.1.5-py3-none-any.whl |
|---|---|
| Size | 11.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d97bfbbffe023b66ca816e1a3bf63a8b32ac84bfde93229832452ff290c4bf77
|
|
BLAKE2b-256 checksum How to use checksums |
09dc2ce7b4bd9344a8a2caf5bc630a2858e3e59affd3d6ef1eeffdbdbfb72d4f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|