Skip to content

Commit 66c8f4a

Browse files
authored
v0.3.0 (#2)
* build: add dill as req * git: ignore .DS_Store * git: ignore .dill & .pkl * refactor(demo): remove useless print * refactor(demo): name the agents * !refactor: separate actions from agent and switch pickl to dill * refactor(demo): use new custom action system * doc: update docstrings * chore: bump version to 0.3.0 * test: add unit tests * test: remove 3.11-related tests (not needed) * chore(checkpoint): remove unused code * fix(action): think action no longer trigger talk action * fix(interaction): check if agent exist before storing interaction * fix(checkpoint): check if user tryies to create a new checkpoint manager * fix(test): resolve failing UTs * doc: README --------- Signed-off-by: Valentin De Matos <[email protected]>
1 parent cb32d00 commit 66c8f4a

21 files changed

+992
-238
lines changed

.github/workflows/tests.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Run Tests
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
push:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ["3.10"]
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install -e ".[test]"
28+
29+
- name: Run tests with pytest
30+
env:
31+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
32+
run: |
33+
pytest

.gitignore

+5-1
Original file line numberDiff line numberDiff line change
@@ -174,5 +174,9 @@ cython_debug/
174174
*.pickle
175175
*.pkl
176176

177+
*.dill
178+
*.pkl
179+
177180
# VS Code
178-
*.code-workspace
181+
*.code-workspace
182+
.DS_Store

README.md

+73-32
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,22 @@ from agentarium import Agent
3232
agent1 = Agent(name="agent1")
3333
agent2 = Agent(name="agent2")
3434

35-
agent1.talk_to(agent2, "Hello, how are you?")
36-
agent2.talk_to(agent1, "I'm fine, thank you!")
35+
# Direct communication between agents
36+
alice.talk_to(bob, "Hello Bob! I heard you're working on some interesting ML projects.")
3737

38-
agent1.act() # Same as agent.talk_to but it's the agent who decides what to do
38+
# Agent autonomously decides its next action based on context
39+
bob.act()
3940
```
4041

4142
## ✨ Features
4243

4344
- **🤖 Advanced Agent Management**: Create and orchestrate multiple AI agents with different roles and capabilities
44-
- **🔄 Robust Interaction Management**: Coordinate complex interactions between agents
45-
- **💾 Checkpoint System**: Save and restore agent states and interactions
46-
- **📊 Data Generation**: Generate synthetic data through agent interactions
45+
- **🔄 Autonomous Decision Making**: Agents can make decisions and take actions based on their context
46+
- **💾 Checkpoint System**: Save and restore agent states and interactions for reproducibility
47+
- **🎭 Customizable Actions**: Define custom actions beyond the default talk/think capabilities
48+
- **🧠 Memory & Context**: Agents maintain memory of past interactions for contextual responses
49+
- **⚡ AI Integration**: Seamless integration with various AI providers through aisuite
4750
- **⚡ Performance Optimized**: Built for efficiency and scalability
48-
- **🌍 Flexible Environment Configuration**: Define custom environments with YAML configuration files
4951
- **🛠️ Extensible Architecture**: Easy to extend and customize for your specific needs
5052

5153
## 📚 Examples
@@ -54,56 +56,101 @@ agent1.act() # Same as agent.talk_to but it's the agent who decides what to do
5456
Create a simple chat interaction between agents:
5557

5658
```python
57-
# examples/basic_chat/demo.py
5859
from agentarium import Agent
5960

60-
alice = Agent.create_agent()
61-
bob = Agent.create_agent()
61+
# Create agents with specific characteristics
62+
alice = Agent.create_agent(name="Alice", occupation="Software Engineer")
63+
bob = Agent.create_agent(name="Bob", occupation="Data Scientist")
64+
65+
# Direct communication
66+
alice.talk_to(bob, "Hello Bob! I heard you're working on some interesting projects.")
6267

63-
alice.talk_to(bob, "Hello Bob! I heard you're working on some interesting data science projects.")
68+
# Let Bob autonomously decide how to respond
6469
bob.act()
6570
```
6671

67-
### Synthetic Data Generation
68-
Generate synthetic data through agent interactions:
72+
### Adding Custom Actions
73+
Add new capabilities to your agents:
74+
75+
```python
76+
from agentarium import Agent, Action
77+
78+
# Define a simple greeting action
79+
def greet(name: str, **kwargs) -> str:
80+
return f"Hello, {name}!"
81+
82+
# Create an agent and add the greeting action
83+
agent = Agent.create_agent(name="Alice")
84+
agent.add_action(
85+
Action(
86+
name="GREET",
87+
description="Greet someone by name",
88+
parameters=["name"],
89+
function=greet
90+
)
91+
)
92+
93+
# Use the custom action
94+
agent.execute_action("GREET", "Bob")
95+
```
96+
97+
### Using Checkpoints
98+
Save and restore agent states:
6999

70100
```python
71-
# examples/synthetic_data/demo.py
72101
from agentarium import Agent
73102
from agentarium.CheckpointManager import CheckpointManager
74103

104+
# Initialize checkpoint manager
75105
checkpoint = CheckpointManager("demo")
76106

77-
alice = Agent.create_agent()
78-
bob = Agent.create_agent()
107+
# Create and interact with agents
108+
alice = Agent.create_agent(name="Alice")
109+
bob = Agent.create_agent(name="Bob")
79110

80111
alice.talk_to(bob, "What a beautiful day!")
81112
checkpoint.update(step="interaction_1")
82113

114+
# Save the current state
83115
checkpoint.save()
84116
```
85117

86118
More examples can be found in the [examples/](examples/) directory.
87119

88120
## 📖 Documentation
89121

90-
### Environment Configuration
91-
Configure your environment using YAML files:
122+
### Agent Creation
123+
Create agents with custom characteristics:
124+
125+
```python
126+
agent = Agent.create_agent(
127+
name="Alice",
128+
age=28,
129+
occupation="Software Engineer",
130+
location="San Francisco",
131+
bio="A passionate developer who loves AI"
132+
)
133+
```
134+
135+
### LLM Configuration
136+
Configure your LLM provider and credentials using a YAML file:
92137

93138
```yaml
94139
llm:
95-
provider: "openai" # any provider supported by aisuite
96-
model: "gpt-4o-mini" # any model supported by the provider
140+
provider: "openai" # The LLM provider to use (any provider supported by aisuite)
141+
model: "gpt-4" # The specific model to use from the provider
97142

98-
aisuite: # optional, credentials for aisuite
99-
openai:
100-
api_key: "sk-..."
143+
aisuite: # (optional) Credentials for aisuite
144+
openai: # Provider-specific configuration
145+
api_key: "sk-..." # Your API key
101146
```
102147
103148
### Key Components
104149
105-
- **Agent**: Base class for creating AI agents
106-
- **CheckpointManager**: Handles saving and loading of agent states
150+
- **Agent**: Core class for creating AI agents with personalities and autonomous behavior
151+
- **CheckpointManager**: Handles saving and loading of agent states and interactions
152+
- **Action**: Base class for defining custom agent actions
153+
- **AgentInteractionManager**: Manages and tracks all agent interactions
107154
108155
## 🤝 Contributing
109156
@@ -122,11 +169,5 @@ This project is licensed under the Apache 2.0 License - see the [LICENSE](LICENS
122169

123170
## 🙏 Acknowledgments
124171

125-
- Thanks to all contributors who have helped shape Agentarium
126-
- Special thanks to the open-source community
127-
128-
---
172+
Thanks to all contributors who have helped shape Agentarium 🫶
129173

130-
<div align="center">
131-
Made with ❤️ by <a href="https://github.com/thytu">thytu</a>
132-
</div>

0 commit comments

Comments
 (0)