Kitaru

SessionsResource

Session API methods.

Functions

func__init__(self, client) -> None

Initialize the resource.

paramself
paramclientKitaruAPIClient

API client used to send requests.

Returns

None
funccreate(self, request, idempotency_key=None) -> SessionResponse

Create a session.

paramself
paramrequestSessionCreateRequest

Session create request.

paramidempotency_keystr | None
= None

Idempotency key overriding the transport's random default.

Returns

kitaru.api_models.v1.session.SessionResponse

Created session.

funcget(self, session_id) -> SessionDetailResponse

Get a session by id.

paramself
paramsession_iduuid.UUID

Id of the session.

Returns

kitaru.api_models.v1.session.SessionDetailResponse

Stored session.

funcget_with_nodes(self, session_id) -> SessionWithNodesResponse

Get a session together with every one of its nodes.

The node list is not paginated, so one call carries a whole session.

paramself
paramsession_iduuid.UUID

Id of the session.

Returns

kitaru.api_models.v1.session_node.SessionWithNodesResponse

Session with every node, ordered by index.

funcingest_nodes(self, session_id, batch) -> list[SessionNodeResponse]

Ingest a batch of session nodes.

An index already stored is replaced whole.

paramself
paramsession_iduuid.UUID

Id of the session to ingest into.

parambatchSessionNodeBatchRequest

Session node batch request.

Returns

list

Stored nodes in batch order.

funccreate_evaluations(self, session_id, request) -> list[EvaluationResponse]

Create manual evaluations on a session.

paramself
paramsession_iduuid.UUID

Id of the session to create evaluations on.

paramrequestSessionEvaluationsRequest

Session evaluations request.

Returns

list

Stored evaluations in request order.

funclist(self, params=None) -> Page[SessionResponse] | Page[SessionDetailResponse]

List sessions.

paramself
paramparamsSessionListParams | None
= None

Session list params.

Returns

Page[SessionResponse] | Page[SessionDetailResponse]

Page of sessions, with payloads when include_payloads is set.

funciter(self, params=None) -> AsyncIterator[SessionResponse]

Iterate over all sessions.

paramself
paramparamsSessionListParams | None
= None

Session list params.

Returns

collections.abc.AsyncIterator

Async iterator over every session.

funcupdate(self, session_id, request) -> SessionResponse

Update a session.

paramself
paramsession_iduuid.UUID

Id of the session.

paramrequestSessionUpdateRequest

Session update request, unset fields stay unchanged.

Returns

kitaru.api_models.v1.session.SessionResponse

Updated session.

funcdelete(self, session_id) -> None

Delete a session.

paramself
paramsession_iduuid.UUID

Id of the session.

Returns

None
funclist_nodes(self, session_id, params=None) -> Page[SessionNodeResponse]

List the nodes of a session, ordered by index ascending.

paramself
paramsession_iduuid.UUID

Id of the session.

paramparamsSessionNodeListParams | None
= None

Session node list params.

Returns

kitaru.api_models.v1.base.Page

Page of session nodes, ordered by index.

funciter_nodes(self, session_id, params=None) -> AsyncIterator[SessionNodeResponse]

Iterate over every node of a session, ordered by index ascending.

paramself
paramsession_iduuid.UUID

Id of the session.

paramparamsSessionNodeListParams | None
= None

Session node list params.

Returns

collections.abc.AsyncIterator

Async iterator over every node of the session.

On this page