Skip to content

Commit 4057601

Browse files
committed
feat: make agent plural
1 parent 36b86d8 commit 4057601

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ After initializing a new project, your project directory will look like this:
111111

112112
```
113113
my_project/
114-
├── agent/
114+
├── agents/
115115
│ ├── example_agent.py
116116
├── docker/
117117
│ ├── Dockerfile
@@ -224,24 +224,24 @@ This ensures that AgentServe will be installed when setting up the project in th
224224

225225
#### 3. Create an agents Directory
226226

227-
Create a new directory called agent in the root of your project. This is where your agent classes will reside.
227+
Create a new directory called agents in the root of your project. This is where your agent classes will reside.
228228

229229
```bash
230-
mkdir agent
230+
mkdir agents
231231
```
232232

233233
#### 4. Implement Your Agent Class
234234

235235
Inside the directory, create a new Python file for your agent. For example, my_agent.py:
236236

237237
```bash
238-
touch agent/my_agent.py
238+
touch agents/my_agent.py
239239
```
240240

241241
Open agent/my_agent.py and implement your agent by subclassing Agent from agentserve:
242242

243243
```python
244-
# agent/my_agent.py
244+
# agents/my_agent.py
245245
from agentserve import Agent
246246

247247
class MyAgent(Agent):
@@ -267,7 +267,7 @@ Open main.py and set up the AgentServer:
267267

268268
```python
269269
from agentserve import AgentServer
270-
from agent.my_agent import MyAgent
270+
from agents.my_agent import MyAgent
271271

272272
agent_server = AgentServer(MyAgent)
273273
app = agent_server.app

agentserve/cli.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,22 @@
1010
# Mapping of framework choices to their respective agent import and class names
1111
FRAMEWORKS = {
1212
'openai': {
13-
'agent_import': 'from agent.example_openai_agent import ExampleAgent',
13+
'agent_import': 'from agents.example_openai_agent import ExampleAgent',
1414
'agent_class': 'ExampleAgent',
1515
'agent_template_filename': 'example_openai_agent.py.tpl'
1616
},
1717
'langchain': {
18-
'agent_import': 'from agent.example_langchain_agent import ExampleAgent',
18+
'agent_import': 'from agents.example_langchain_agent import ExampleAgent',
1919
'agent_class': 'ExampleAgent',
2020
'agent_template_filename': 'example_langchain_agent.py.tpl'
2121
},
2222
'llama': {
23-
'agent_import': 'from agent.example_llama_agent import ExampleAgent',
23+
'agent_import': 'from agents.example_llama_agent import ExampleAgent',
2424
'agent_class': 'ExampleAgent',
2525
'agent_template_filename': 'example_llamaindex_agent.py.tpl'
2626
},
2727
'blank': {
28-
'agent_import': 'from agent.example_agent import ExampleAgent',
28+
'agent_import': 'from agents.example_agent import ExampleAgent',
2929
'agent_class': 'ExampleAgent',
3030
'agent_template_filename': 'example_agent.py.tpl'
3131
}
@@ -75,8 +75,8 @@ def init(project_name, framework):
7575

7676
# Copy agent template to agents directory
7777
agent_template_filename = FRAMEWORKS[framework]['agent_template_filename']
78-
agent_src_path = TEMPLATES_DIR / 'agent' / agent_template_filename
79-
agent_dst_path = project_path / 'agent' / agent_template_filename[:-4] # Remove '.tpl' extension
78+
agent_src_path = TEMPLATES_DIR / 'agents' / agent_template_filename
79+
agent_dst_path = project_path / 'agents' / agent_template_filename[:-4] # Remove '.tpl' extension
8080
shutil.copyfile(agent_src_path, agent_dst_path)
8181

8282
# Copy .env template

0 commit comments

Comments
 (0)