@@ -112,86 +112,22 @@ graph LR
112
112
<Step title = " Create Agent" >
113
113
Create ` app.py ` :
114
114
<CodeGroup >
115
- ``` python Single Agent
116
- from praisonaiagents import Agent, Task, PraisonAIAgents
115
+ ``` python Single Agent
116
+ from praisonaiagents import Agent
117
117
118
- # Create an agent
119
- researcher = Agent(
120
- name = " Researcher" ,
121
- role = " Senior Research Analyst" ,
122
- goal = " Uncover cutting-edge developments in AI" ,
123
- backstory = " You are an expert at a technology research group" ,
124
- verbose = True ,
125
- llm = " gpt-4o"
126
- )
127
-
128
- # Define a task
129
- task = Task(
130
- name = " research_task" ,
131
- description = " Analyze 2024's AI advancements" ,
132
- expected_output = " A detailed report" ,
133
- agent = researcher
134
- )
135
-
136
- # Run the agents
137
- agents = PraisonAIAgents(
138
- agents = [researcher],
139
- tasks = [task],
140
- verbose = False
141
- )
142
-
143
- result = agents.start()
144
- ```
145
-
146
- ``` python Multiple Agents
147
- from praisonaiagents import Agent, Task, PraisonAIAgents
148
-
149
- # Create multiple agents
150
- researcher = Agent(
151
- name = " Researcher" ,
152
- role = " Senior Research Analyst" ,
153
- goal = " Uncover cutting-edge developments in AI" ,
154
- backstory = " You are an expert at a technology research group" ,
155
- verbose = True ,
156
- llm = " gpt-4o" ,
157
- markdown = True
158
- )
159
-
160
- writer = Agent(
161
- name = " Writer" ,
162
- role = " Tech Content Strategist" ,
163
- goal = " Craft compelling content on tech advancements" ,
164
- backstory = " You are a content strategist" ,
165
- llm = " gpt-4o" ,
166
- markdown = True
167
- )
168
-
169
- # Define multiple tasks
170
- task1 = Task(
171
- name = " research_task" ,
172
- description = " Analyze 2024's AI advancements" ,
173
- expected_output = " A detailed report" ,
174
- agent = researcher
175
- )
118
+ agent = Agent(instructions = " Your are a helpful AI assistant" )
119
+ agent.start(" Write a movie script about a robot in Mars" )
120
+ ```
176
121
177
- task2 = Task(
178
- name = " writing_task" ,
179
- description = " Create a blog post about AI advancements" ,
180
- expected_output = " A blog post" ,
181
- agent = writer
182
- )
122
+ ``` python Multi Agents
123
+ from praisonaiagents import Agent, PraisonAIAgents
183
124
184
- # Run with hierarchical process
185
- agents = PraisonAIAgents(
186
- agents = [researcher, writer],
187
- tasks = [task1, task2],
188
- verbose = False ,
189
- process = " hierarchical" ,
190
- manager_llm = " gpt-4o"
191
- )
125
+ research_agent = Agent(instructions = " Research about AI" )
126
+ summarise_agent = Agent(instructions = " Summarise research agent's findings" )
192
127
193
- result = agents.start()
194
- ```
128
+ agents = PraisonAIAgents(agents = [research_agent, summarise_agent])
129
+ agents.start()
130
+ ```
195
131
</CodeGroup >
196
132
</Step >
197
133
0 commit comments