@@ -162,50 +162,50 @@ The agent implementation in `src/main.py` includes:
162162
1631631 . 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
1731731 . 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
1851851 . 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
2002001 . 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