|
126 | 126 | "def demonstrate_basic_agents():\n", |
127 | 127 | " \"\"\"\n", |
128 | 128 | " Demonstrate basic agent creation and team coordination.\n", |
129 | | - " \n", |
| 129 | + "\n", |
130 | 130 | " This function shows how to:\n", |
131 | 131 | " 1. Create specialized agents with specific roles\n", |
132 | 132 | " 2. Organize agents into a team\n", |
133 | 133 | " 3. Use the team to solve tasks that require multiple perspectives\n", |
134 | 134 | " \"\"\"\n", |
135 | | - " tracer = agentops.start_trace(trace_name=\"Agno Basic Agents and Teams Demonstration\",)\n", |
| 135 | + " tracer = agentops.start_trace(\n", |
| 136 | + " trace_name=\"Agno Basic Agents and Teams Demonstration\",\n", |
| 137 | + " )\n", |
136 | 138 | "\n", |
137 | 139 | " try:\n", |
138 | 140 | " # Create individual agents with specific roles\n", |
139 | 141 | " # Each agent has a name and a role that defines its expertise\n", |
140 | 142 | "\n", |
141 | 143 | " # News Agent: Specializes in gathering and analyzing news information\n", |
142 | 144 | " news_agent = Agent(\n", |
143 | | - " name=\"News Agent\", \n", |
144 | | - " role=\"Get the latest news and provide news analysis\", \n", |
145 | | - " model=OpenAIChat(id=\"gpt-4o-mini\")\n", |
| 145 | + " name=\"News Agent\", role=\"Get the latest news and provide news analysis\", model=OpenAIChat(id=\"gpt-4o-mini\")\n", |
146 | 146 | " )\n", |
147 | 147 | "\n", |
148 | 148 | " # Weather Agent: Specializes in weather forecasting and analysis\n", |
149 | 149 | " weather_agent = Agent(\n", |
150 | | - " name=\"Weather Agent\", \n", |
151 | | - " role=\"Get weather forecasts and provide weather analysis\", \n", |
152 | | - " model=OpenAIChat(id=\"gpt-4o-mini\")\n", |
| 150 | + " name=\"Weather Agent\",\n", |
| 151 | + " role=\"Get weather forecasts and provide weather analysis\",\n", |
| 152 | + " model=OpenAIChat(id=\"gpt-4o-mini\"),\n", |
153 | 153 | " )\n", |
154 | 154 | "\n", |
155 | 155 | " # Create a team with coordination mode\n", |
156 | 156 | " # The \"coordinate\" mode allows agents to work together and share information\n", |
157 | 157 | " team = Team(\n", |
158 | | - " name=\"News and Weather Team\", \n", |
| 158 | + " name=\"News and Weather Team\",\n", |
159 | 159 | " mode=\"coordinate\", # Agents will coordinate their responses\n", |
160 | | - " members=[news_agent, weather_agent]\n", |
| 160 | + " members=[news_agent, weather_agent],\n", |
161 | 161 | " )\n", |
162 | 162 | "\n", |
163 | 163 | " # Run a task that requires team coordination\n", |
164 | 164 | " # The team will automatically determine which agent(s) should respond\n", |
165 | 165 | " response = team.run(\"What is the weather in Tokyo?\")\n", |
166 | | - " \n", |
| 166 | + "\n", |
167 | 167 | " print(\"\\nTeam Response:\")\n", |
168 | 168 | " print(\"-\" * 60)\n", |
169 | 169 | " print(f\"{response.content}\")\n", |
|
0 commit comments