Observed since 21 Oct, 10:48 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
An AI agent that processes natural language commands through LLM and executes corresponding actions
A powerful AI agent framework for natural language command processing using LLMs.
Aigent-py is a Python framework that enables seamless integration of natural language commands with your applications. Built on top of OpenAI's GPT models, it provides a flexible command system that translates natural language into structured actions.
pip install aigent-py
# or with Poetry
poetry add aigent-py
from aigent_py import Agent
# Initialize the agent with custom parameters
agent = Agent(
agent_purpose="Help users manage their tasks",
base_url="https://api.openai.com/v1",
api_key="your-api-key",
model_name="gpt-3.5-turbo", # Default model
max_tokens=1000, # Maximum response length
temperature=0.7, # Controls randomness (0.0 to 1.0)
frequency_penalty=0.0, # Reduces repetition (-2.0 to 2.0)
presence_penalty=0.0 # Encourages diversity (-2.0 to 2.0)
)
# Process user input with streaming response
async def main():
async for response in agent.process_input("Create a new task called 'Write documentation'"):
print(response, end="", flush=True)
The command system in Aigent-py is powerful and flexible. Here's a comprehensive example showing advanced features:
from aigent_py.commands import CommandRegistry, command, VariableMetadata
# Create a command registry
registry = CommandRegistry()
@command(
registry=registry,
name="generate_wallet",
description="Generates a new cryptocurrency wallet",
explanation="Creates a secure cryptocurrency wallet with public and private keys using industry-standard encryption.",
pattern="[[GENERATE_WALLET_{user_id}]]",
variables=[
VariableMetadata(
name="user_id",
description="Unique identifier of the user requesting the wallet",
example="user123"
)
],
example_inputs=[
"Please generate me a wallet",
"Create me a new wallet",
"I need a cryptocurrency wallet"
],
# Example responses for successful operations
example_success_responses=[
{
"result": "Generated wallet with address: 0x123...",
"response": """Great news! I've generated your new cryptocurrency wallet.
Wallet Details:
✓ Address: 0x123...
✓ Status: Active and ready
Next steps:
1. Back up your credentials
2. Set up 2FA
3. You're ready to receive crypto!"""
}
],
# Example responses for error handling
example_failed_responses=[
{
"result": "Error: Network connection failed",
"response": """I couldn't generate your wallet due to network issues.
Troubleshooting steps:
1. Check your connection
2. Wait a few minutes
3. Try again
Your security wasn't compromised. Want to retry?"""
}
],
# Template for formatting successful results
result_prompt="""You are a cryptocurrency assistant presenting wallet generation results.
Format the current result in a user-friendly way.
Examples of good responses: {examples}""",
# Template for formatting errors
unsuccessful_prompt="""You are a cryptocurrency assistant handling wallet generation failures.
Explain what went wrong and provide next steps.
Examples of good responses: {examples}"""
)
def generate_wallet(user_id: str) -> str:
if user_id == "error":
raise ValueError("Wallet generation failed")
return f"Generated wallet with address: 0x{user_id}123..."
# Initialize agent with commands
agent = Agent(
agent_purpose="I am a cryptocurrency assistant that helps users manage their digital assets.",
base_url="https://api.openai.com/v1",
api_key="your-api-key",
model_name="gpt-3.5-turbo",
max_tokens=1000
)
agent.initialize_commands(registry)
# Use the agent
async def main():
async for response in agent.process_input("I need a new crypto wallet"):
print(response, end="", flush=True)
Key Features Demonstrated:
# Clone the repository
git clone https://github.com/ChefJodlak/aigent.git
cd aigent
# Install dependencies with Poetry
poetry install
# Activate virtual environment
poetry shell
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
git checkout -b feature/AmazingFeature)git commit -m 'Add some AmazingFeature')git push origin feature/AmazingFeature)This project is licensed under the MIT License - see the LICENSE file for details.
Rafal Jodełka - @ChefJodlak - rafaljodlak@gmail.com
Project Link: https://github.com/ChefJodlak/aigent
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.1.1 | 21 Jan 2025 | 2 |
This describes our collected data; it is not a security assessment.
Observed since 21 Oct, 10:48 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:cd4f8bfc51e08da38214d5ea50c4cf2bca0dee1253fab8677188e8d77fb72f0b