Migrate playground get sessions to url to v2

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)

Hi @Saa, thanks for reaching out and supporting Agno. I’ve shared this with the team, we’re working through all queries one by one and will get back to you soon. If it’s urgent, please let us know. We appreciate your patience!

Hi @Saa , You can filter by the component_id and get sessions of an agent/team in the v2.0 AgentOs apis.
You can refer to this section in the documentation for more details.