sessions
FastAPI endpoint functions for managing session resources.
Attributes
sessions_router
module-attribute
sessions_router = APIRouter(
prefix=format_path(RESOURCE_SESSIONS),
tags=[RESOURCE_SESSIONS],
responses=DEFAULT_HTTP_ERROR_RESPONSES,
)
Classes
Functions
bind_participant
async
bind_participant(
fastapi_request: Request,
namespace: str = namespace_path_param,
activity_session: str = session_path_param,
participant: str = participant_path_param,
job_pool: ThreadPoolExecutor = Depends(
job_pool_dependency
),
)
Bind a participant to a session
create_session
async
create_session(
fastapi_request: Request,
request: SessionCreateRequestV1,
namespace: str = namespace_path_param,
job_pool: ThreadPoolExecutor = Depends(
job_pool_dependency
),
)
Create a new session
get_session
async
get_session(
fastapi_request: Request,
namespace: str = namespace_path_param,
activity_session: str = session_path_param,
job_pool: ThreadPoolExecutor = Depends(
job_pool_dependency
),
)
Get a session resource
integrate_session
async
integrate_session(
fastapi_request: Request,
namespace: str = namespace_path_param,
activity_session: str = session_path_param,
job_pool: ThreadPoolExecutor = Depends(
job_pool_dependency
),
)
Execute a memory integration operation for all agents participating in this session
list_sessions
async
list_sessions(
fastapi_request: Request,
namespace: str = namespace_path_param,
include_deleted: bool = Query(
False,
description="Include deleted sessions in the response",
),
job_pool: ThreadPoolExecutor = Depends(
job_pool_dependency
),
)
List all sessions in the namespace
soft_delete_session
async
soft_delete_session(
fastapi_request: Request,
namespace: str = namespace_path_param,
activity_session: str = session_path_param,
job_pool: ThreadPoolExecutor = Depends(
job_pool_dependency
),
)
Soft delete a session resource
truncate_session
async
truncate_session(
fastapi_request: Request,
namespace: str = namespace_path_param,
activity_session: str = session_path_param,
job_pool: ThreadPoolExecutor = Depends(
job_pool_dependency
),
)
Performs a truncate operation on the session, effectively re-initializing it to a clean state. At a low-level this means clearing content from the following fields in the RDBMS: activity_session.data, activity_session_participant.chat_turns, activity_session_participant.insights, and activity_session_participant.last_integration_turn
unbind_participant
async
unbind_participant(
fastapi_request: Request,
namespace: str = namespace_path_param,
activity_session: str = session_path_param,
participant: str = participant_path_param,
job_pool: ThreadPoolExecutor = Depends(
job_pool_dependency
),
)
Unbind a participant to a session
undelete_session
async
undelete_session(
fastapi_request: Request,
namespace: str = namespace_path_param,
activity_session: str = Path(..., description=comment),
job_pool: ThreadPoolExecutor = Depends(
job_pool_dependency
),
)
Undeletes a soft-deleted collection resource
update_session
async
update_session(
fastapi_request: Request,
request: SessionUpdateRequestV1,
namespace: str = namespace_path_param,
activity_session: str = session_path_param,
job_pool: ThreadPoolExecutor = Depends(
job_pool_dependency
),
)
Update a session resource