I’m trying to migrate to v2.X and having some issues in replacing the “old” playground which we use to get all sessions per agent. How should i add the get sessions routes per agent using the new lib?
using get_session_router or agent_os?
the old code was
# Get the playground router directly with the shared agents list
playground_router = get_async_playground_router(
agents=shared_agents, workflows=[MockWorkflow()]
)
# allow users to pull and edit their sessions data
open_playground_routes = [
"get_all_agent_sessions",
"get_agent_session",
"rename_agent_session",
"delete_agent_session",
]
# Add the dependency to all routes in the playground router
for route in playground_router.routes:
if route.name in open_playground_routes:
route.dependencies.append(Depends(open_populate_agents))
else:
route.dependencies.append(Depends(populate_agents))
# Include the modified router
router.include_router(playground_router)