Skip to content

Commit 61595af

Browse files
committed
fix ordered list in step 7
1 parent 006e84b commit 61595af

File tree

1 file changed

+34
-34
lines changed

1 file changed

+34
-34
lines changed

sources/academy/ai/ai-agents.mdx

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -162,50 +162,50 @@ The agent implementation in `src/main.py` includes:
162162

163163
1. Handle Actor input: Read the user's query and any other parameters from the Actor input.
164164

165-
```python
166-
async def main():
167-
async with Actor:
168-
actor_input = await Actor.get_input()
169-
query = actor_input.get("query")
170-
model_name = actor_input.get("modelName", "gpt-4")
171-
```
165+
```python
166+
async def main():
167+
async with Actor:
168+
actor_input = await Actor.get_input()
169+
query = actor_input.get("query")
170+
model_name = actor_input.get("modelName", "gpt-4")
171+
```
172172

173173
1. Define the agent: Instantiate the agent, giving it a role, a goal, and access to the tools you configured.
174174

175-
```python
176-
agent = Agent(
177-
role="Social Media Analyst",
178-
goal="Analyze Instagram posts and provide insights",
179-
backstory="Expert in social media analysis and trend identification",
180-
tools=[instagram_scraper_tool],
181-
llm=ChatOpenAI(model=model_name)
182-
)
183-
```
175+
```python
176+
agent = Agent(
177+
role="Social Media Analyst",
178+
goal="Analyze Instagram posts and provide insights",
179+
backstory="Expert in social media analysis and trend identification",
180+
tools=[instagram_scraper_tool],
181+
llm=ChatOpenAI(model=model_name)
182+
)
183+
```
184184

185185
1. Create task and crew: Define the task for the agent to complete based on the user's query.
186186

187-
```python
188-
task = Task(
189-
description=query,
190-
agent=agent,
191-
expected_output="Detailed analysis with insights"
192-
)
187+
```python
188+
task = Task(
189+
description=query,
190+
agent=agent,
191+
expected_output="Detailed analysis with insights"
192+
)
193193

194-
crew = Crew(
195-
agents=[agent],
196-
tasks=[task]
197-
)
198-
```
194+
crew = Crew(
195+
agents=[agent],
196+
tasks=[task]
197+
)
198+
```
199199

200200
1. Execute and save results: Kick off the crew to run the task and save the final result to the Actor's default dataset.
201201

202-
```python
203-
result = crew.kickoff()
204-
await Actor.push_data({
205-
"query": query,
206-
"response": str(result)
207-
})
208-
```
202+
```python
203+
result = crew.kickoff()
204+
await Actor.push_data({
205+
"query": query,
206+
"response": str(result)
207+
})
208+
```
209209

210210
### Step 8: Test locally
211211

0 commit comments

Comments
 (0)