agno 2.2.4__py3-none-any.whl → 2.2.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
agno/os/app.py CHANGED
@@ -224,13 +224,59 @@ class AgentOS:
224
224
  except (ValueError, TypeError):
225
225
  return lifespan
226
226
 
227
- def resync(self) -> None:
227
+ def resync(self, app: FastAPI) -> None:
228
228
  """Resync the AgentOS to discover, initialize and configure: agents, teams, workflows, databases and knowledge bases."""
229
229
  self._initialize_agents()
230
230
  self._initialize_teams()
231
231
  self._initialize_workflows()
232
232
  self._auto_discover_databases()
233
233
  self._auto_discover_knowledge_instances()
234
+ self._reprovision_routers(app=app)
235
+
236
+ def _reprovision_routers(self, app: FastAPI) -> None:
237
+ """Re-provision all routes for the AgentOS."""
238
+ updated_routers = [
239
+ get_session_router(dbs=self.dbs),
240
+ get_memory_router(dbs=self.dbs),
241
+ get_eval_router(dbs=self.dbs, agents=self.agents, teams=self.teams),
242
+ get_metrics_router(dbs=self.dbs),
243
+ get_knowledge_router(knowledge_instances=self.knowledge_instances),
244
+ ]
245
+
246
+ # Clear all previously existing routes
247
+ app.router.routes = []
248
+
249
+ # Add the updated routes
250
+ for router in updated_routers:
251
+ self._add_router(app, router)
252
+
253
+ # Add the built-in routes
254
+ self._add_built_in_routes(app=app)
255
+
256
+ def _add_built_in_routes(self, app: FastAPI) -> None:
257
+ """Add all AgentOSbuilt-in routes to the given app."""
258
+ self._add_router(app, get_base_router(self, settings=self.settings))
259
+ self._add_router(app, get_websocket_router(self, settings=self.settings))
260
+ self._add_router(app, get_health_router())
261
+ self._add_router(app, get_home_router(self))
262
+
263
+ # Add A2A interface if relevant
264
+ has_a2a_interface = False
265
+ for interface in self.interfaces:
266
+ if not has_a2a_interface and interface.__class__.__name__ == "A2A":
267
+ has_a2a_interface = True
268
+ interface_router = interface.get_router()
269
+ self._add_router(app, interface_router)
270
+ if self.a2a_interface and not has_a2a_interface:
271
+ from agno.os.interfaces.a2a import A2A
272
+
273
+ a2a_interface = A2A(agents=self.agents, teams=self.teams, workflows=self.workflows)
274
+ self.interfaces.append(a2a_interface)
275
+ self._add_router(app, a2a_interface.get_router())
276
+
277
+ # Add the home router if MCP server is not enabled
278
+ if not self.enable_mcp_server:
279
+ self._add_router(app, get_home_router(self))
234
280
 
235
281
  def _make_app(self, lifespan: Optional[Any] = None) -> FastAPI:
236
282
  # Adjust the FastAPI app lifespan to handle MCP connections if relevant
@@ -381,26 +427,7 @@ class AgentOS:
381
427
 
382
428
  fastapi_app = self._make_app(lifespan=wrapped_user_lifespan)
383
429
 
384
- # Add routes
385
- self._add_router(fastapi_app, get_base_router(self, settings=self.settings))
386
- self._add_router(fastapi_app, get_websocket_router(self, settings=self.settings))
387
- self._add_router(fastapi_app, get_health_router())
388
- self._add_router(fastapi_app, get_home_router(self))
389
-
390
- has_a2a_interface = False
391
- for interface in self.interfaces:
392
- if not has_a2a_interface and interface.__class__.__name__ == "A2A":
393
- has_a2a_interface = True
394
- interface_router = interface.get_router()
395
- self._add_router(fastapi_app, interface_router)
396
-
397
- # Add A2A interface if requested and not provided in self.interfaces
398
- if self.a2a_interface and not has_a2a_interface:
399
- from agno.os.interfaces.a2a import A2A
400
-
401
- a2a_interface = A2A(agents=self.agents, teams=self.teams, workflows=self.workflows)
402
- self.interfaces.append(a2a_interface)
403
- self._add_router(fastapi_app, a2a_interface.get_router())
430
+ self._add_built_in_routes(app=fastapi_app)
404
431
 
405
432
  self._auto_discover_databases()
406
433
  self._auto_discover_knowledge_instances()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agno
3
- Version: 2.2.4
3
+ Version: 2.2.5
4
4
  Summary: Agno: a lightweight library for building Multi-Agent Systems
5
5
  Author-email: Ashpreet Bedi <ashpreet@agno.com>
6
6
  Project-URL: homepage, https://agno.com
@@ -257,7 +257,7 @@ agno/models/vllm/vllm.py,sha256=UtiiSvUR4pG_1CzuhY5MWduRgzM2hGVTakKJ6ZBdQmo,2730
257
257
  agno/models/xai/__init__.py,sha256=ukcCxnCHxTtkJNA2bAMTX4MhCv1wJcbiq8ZIfYczIxs,55
258
258
  agno/models/xai/xai.py,sha256=jA6_39tfapkjkHKdzbKaNq1t9qIvO1IaZY1hQqEmFVs,4181
259
259
  agno/os/__init__.py,sha256=h8oQu7vhD5RZf09jkyM_Kt1Kdq_d5kFB9gJju8QPwcY,55
260
- agno/os/app.py,sha256=N6sBJqx2ShfuPaPJdy3waHC5cZ5OH-Owa0ApgTojNm8,30217
260
+ agno/os/app.py,sha256=SDvchR-fqrDROT2vRF03Pj-inXj1JZLmOSLIblPJMOw,31218
261
261
  agno/os/auth.py,sha256=FyBtAKWtg-qSunCas5m5pK1dVEmikOSZvcCp5r25tTA,1844
262
262
  agno/os/config.py,sha256=u4R9yazQXIcKjR3QzEIZw_XAe_OHp3xn0ff7SVkj2jA,2893
263
263
  agno/os/mcp.py,sha256=vJhjjSm1KC61HLoxPj24lSrjkjo7plkoFfcQX2BmTp0,10253
@@ -561,8 +561,8 @@ agno/workflow/step.py,sha256=3t83LwEajM-jHjcXzJR74iEO36P4ZVqenocmiWLtQOg,60532
561
561
  agno/workflow/steps.py,sha256=O3lbKw56ziSnuJndAGm8hjlEwdTh2jQXf1s0587Va3M,25671
562
562
  agno/workflow/types.py,sha256=J474F5MWHCHHVjrzTUPJihlcrRLUnQ3hVW2-9TWdxWw,18519
563
563
  agno/workflow/workflow.py,sha256=LBy_jVjvglRE4sOLAITZGaOJctJYbP59oV0HvuiHopA,147346
564
- agno-2.2.4.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
565
- agno-2.2.4.dist-info/METADATA,sha256=IRtlV1luuV_lGWilSVIOVmjhZnUf90G2ZbRPJBHQKNA,28193
566
- agno-2.2.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
567
- agno-2.2.4.dist-info/top_level.txt,sha256=MKyeuVesTyOKIXUhc-d_tPa2Hrh0oTA4LM0izowpx70,5
568
- agno-2.2.4.dist-info/RECORD,,
564
+ agno-2.2.5.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
565
+ agno-2.2.5.dist-info/METADATA,sha256=A7a12CJlQD0pcz6w19KkD2mMOQHzc36pYZ5eW5WCr5g,28193
566
+ agno-2.2.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
567
+ agno-2.2.5.dist-info/top_level.txt,sha256=MKyeuVesTyOKIXUhc-d_tPa2Hrh0oTA4LM0izowpx70,5
568
+ agno-2.2.5.dist-info/RECORD,,
File without changes