client.private.agents.download_sandbox_file(...) -> typing.Iterator[bytes]
-
-
-
Download a file produced by an agent inside a sandbox.
-
-
-
from truefoundry_gateway_sdk import TrueFoundryGateway client = TrueFoundryGateway( api_key="<token>", base_url="https://yourhost.com/path/to/api", ) client.private.agents.download_sandbox_file( sandbox_id="sandboxId", path="x", )
-
-
-
sandbox_id:
str— The sandbox containing the file.
-
path:
str— Absolute path of the file inside the sandbox.
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-
client.private.agents.sessions.list(...) -> ListSessionsResponse
-
-
-
List sessions for an agent (newest first by default), keyset-paginated. Pass
page_tokento fetch the next page, keeping the other query params constant.
-
-
-
from truefoundry_gateway_sdk import TrueFoundryGateway, ListSessionsOrder client = TrueFoundryGateway( api_key="<token>", base_url="https://yourhost.com/path/to/api", ) client.private.agents.sessions.list( agent_name="agent_name", limit=1, order=ListSessionsOrder.ASC, page_token="page_token", start_timestamp="start_timestamp", end_timestamp="end_timestamp", )
-
-
-
agent_name:
str— Agent whose sessions to list. Must exist in the tenant.
-
limit:
typing.Optional[int]— Page size. Defaults to 10, max 100.
-
order:
typing.Optional[ListSessionsOrder]— Sort sessions by creation time. Defaults to "desc".
-
page_token:
typing.Optional[str]— Opaque token from a previous responsenext_page_token.
-
start_timestamp:
typing.Optional[str]— Inclusive lower bound oncreated_at(ISO-8601). Defaults upstream to 30 min beforeend_timestamp.
-
end_timestamp:
typing.Optional[str]— Inclusive upper bound oncreated_at(ISO-8601). Defaults upstream to now.
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-
client.private.agents.sessions.create(...) -> GetSessionResponse
-
-
-
Create a session for an existing named agent.
-
-
-
from truefoundry_gateway_sdk import TrueFoundryGateway client = TrueFoundryGateway( api_key="<token>", base_url="https://yourhost.com/path/to/api", ) client.private.agents.sessions.create( agent_name="agent_name", )
-
-
-
agent_name:
str— Name of an existing agent in the tenant.
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-
client.private.agents.sessions.get(...) -> GetSessionResponse
-
-
-
Get a session by id. Visible to the session owner or a manager of the session agent.
-
-
-
from truefoundry_gateway_sdk import TrueFoundryGateway client = TrueFoundryGateway( api_key="<token>", base_url="https://yourhost.com/path/to/api", ) client.private.agents.sessions.get( session_id="sessionId", )
-
-
-
session_id:
str— Session identifier.
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-
client.private.agents.sessions.cancel(...) -> CancelSessionResponse
-
-
-
Cancel the running last turn for a session.
-
-
-
from truefoundry_gateway_sdk import TrueFoundryGateway client = TrueFoundryGateway( api_key="<token>", base_url="https://yourhost.com/path/to/api", ) client.private.agents.sessions.cancel( session_id="01arz3ndektsv4rrffq69g5fav.g", )
-
-
-
session_id:
str
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-
client.private.agents.sessions.list_events(...) -> ListSessionEventsResponse
-
-
-
List session events as
{ turn_id, event }across a turn hierarchy (newest first). Each turn contributes turn.created, content events (model.message, tool.call, …), and turn.done; streaming deltas are not included.last_turn_id(initial load only) sets the newest turn in the window plus its ancestors; omit to use the session last turn. If that turn is still running, it is excluded — listing anchors on its parent so persisted events are returned without overlapping the live stream; subscribe to the running turn for live events. An emptydataarray is returned when the anchor is a running first turn with no parent. Usepage_tokento paginate backward toward older events; chains longer than the stored ancestor window are walked via spill to the session root.
-
-
-
from truefoundry_gateway_sdk import TrueFoundryGateway client = TrueFoundryGateway( api_key="<token>", base_url="https://yourhost.com/path/to/api", ) client.private.agents.sessions.list_events( session_id="01arz3ndektsv4rrffq69g5fav.g", page_token="page_token", last_turn_id="last_turn_id", limit=1, )
-
-
-
session_id:
str
-
page_token:
typing.Optional[str]— Pagination cursor frompagination.next_page_token. Returns older events before the cursor (toward session start). Decoded JSON:{ turn_id, sequence_number }.
-
last_turn_id:
typing.Optional[str]— Newest turn in the listing window (initial load only; ignored whenpage_tokenis set). Lists that turn and its ancestors, newest events first. Omit to use the session last turn. If the resolved turn is still running, its events are excluded and listing starts from its parent instead — subscribe to the running turn for live events. Returns empty data when the anchor is a running first turn with no parent.
-
limit:
typing.Optional[int]— Max events per response. Default 100, max 100.
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-
client.private.agents.sessions.list_turns(...) -> ListTurnsResponse
-
-
-
List turns for a session (newest first). Pagination walks the ancestor chain from the session last turn, or from the turn in page_token when continuing.
-
-
-
from truefoundry_gateway_sdk import TrueFoundryGateway client = TrueFoundryGateway( api_key="<token>", base_url="https://yourhost.com/path/to/api", ) client.private.agents.sessions.list_turns( session_id="01arz3ndektsv4rrffq69g5fav.g", page_token="page_token", limit=1, )
-
-
-
session_id:
str
-
page_token:
typing.Optional[str]
-
limit:
typing.Optional[int]— Page size. Defaults to 10, max 25.
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-
client.private.agents.sessions.create_turn(...) -> typing.Iterator[bytes]
-
-
-
Start or continue a turn within a session. Responds with a Server-Sent Events stream. Use
previous_turn_idto chain to the session's last turn (defaults toauto).
-
-
-
from truefoundry_gateway_sdk import TrueFoundryGateway client = TrueFoundryGateway( api_key="<token>", base_url="https://yourhost.com/path/to/api", ) client.private.agents.sessions.create_turn( session_id="01arz3ndektsv4rrffq69g5fav.g", )
-
-
-
session_id:
str
-
input:
typing.Optional[typing.List[TurnInputItem]]
-
previous_turn_id:
typing.Optional[PreviousTurnIdInput]
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-
client.private.agents.sessions.get_turn(...) -> GetTurnResponse
-
-
-
Get a single turn by ID from Redis.
-
-
-
from truefoundry_gateway_sdk import TrueFoundryGateway client = TrueFoundryGateway( api_key="<token>", base_url="https://yourhost.com/path/to/api", ) client.private.agents.sessions.get_turn( session_id="01arz3ndektsv4rrffq69g5fav.g", turn_id="01arz3ndektsv4rrffq69g5fav.g.ab12cd", )
-
-
-
session_id:
str
-
turn_id:
str
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-
client.private.agents.sessions.subscribe_to_turn(...) -> typing.Iterator[bytes]
-
-
-
Subscribe to the live SSE stream for a turn. Pass after_sequence_number to resume after disconnect or server timeout, or send Last-Event-Id when after_sequence_number is omitted.
-
-
-
from truefoundry_gateway_sdk import TrueFoundryGateway client = TrueFoundryGateway( api_key="<token>", base_url="https://yourhost.com/path/to/api", ) client.private.agents.sessions.subscribe_to_turn( session_id="01arz3ndektsv4rrffq69g5fav.g", turn_id="01arz3ndektsv4rrffq69g5fav.g.ab12cd", )
-
-
-
session_id:
str
-
turn_id:
str
-
after_sequence_number:
typing.Optional[int]
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-
client.private.agents.sessions.list_turn_events(...) -> ListEventsResponse
-
-
-
Paginated list of content turn events from the Redis events stream (model.message, tool.call, …).
turn.createdandturn.doneare stored in the stream but excluded from this endpoint — use session list_events for lifecycle. Only available after the turn has reached a terminal state; use subscribe for running turns.
-
-
-
from truefoundry_gateway_sdk import TrueFoundryGateway, ListEventsOrder client = TrueFoundryGateway( api_key="<token>", base_url="https://yourhost.com/path/to/api", ) client.private.agents.sessions.list_turn_events( session_id="01arz3ndektsv4rrffq69g5fav.g", turn_id="01arz3ndektsv4rrffq69g5fav.g.ab12cd", page_token="page_token", limit=1, order=ListEventsOrder.ASC, )
-
-
-
session_id:
str
-
turn_id:
str
-
page_token:
typing.Optional[str]
-
limit:
typing.Optional[int]— Page size. Defaults to 25, max 25.
-
order:
typing.Optional[ListEventsOrder]— Sort events by creation time. Defaults to "asc".
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-
client.private.agents.private.draft_sessions.list(...) -> ListDraftSessionsResponse
-
-
-
List the caller-owned draft sessions (newest first by default), keyset-paginated. Optionally filter by
agent_name. Passpage_tokento fetch the next page, keeping the other query params constant.
-
-
-
from truefoundry_gateway_sdk import TrueFoundryGateway, ListDraftSessionsOrder client = TrueFoundryGateway( api_key="<token>", base_url="https://yourhost.com/path/to/api", ) client.private.agents.private.draft_sessions.list( agent_name="agent_name", limit=1, order=ListDraftSessionsOrder.ASC, page_token="page_token", start_timestamp="start_timestamp", end_timestamp="end_timestamp", )
-
-
-
agent_name:
typing.Optional[str]— Filter to drafts linked to this saved agent. Omit to list all of the caller-owned drafts.
-
limit:
typing.Optional[int]— Page size. Defaults to 10, max 100.
-
order:
typing.Optional[ListDraftSessionsOrder]— Sort draft sessions by creation time. Defaults to "desc".
-
page_token:
typing.Optional[str]— Opaque token from a previous responsenext_page_token.
-
start_timestamp:
typing.Optional[str]— Inclusive lower bound oncreated_at. Defaults upstream to 30 min beforeend_timestamp.
-
end_timestamp:
typing.Optional[str]— Inclusive upper bound oncreated_at. Defaults upstream to now.
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-
client.private.agents.private.draft_sessions.create(...) -> GetDraftSessionResponse
-
-
-
Create a draft session holding an inline agent spec, optionally linked to a saved agent. Owner is the token subject.
-
-
-
from truefoundry_gateway_sdk import TrueFoundryGateway, AgentSpec, Model client = TrueFoundryGateway( api_key="<token>", base_url="https://yourhost.com/path/to/api", ) client.private.agents.private.draft_sessions.create( agent_spec=AgentSpec( model=Model( name="name", ), ), )
-
-
-
agent_spec:
AgentSpec
-
agent_name:
typing.Optional[str]— Optionally link the draft to an existing saved agent in the tenant. Omit for a standalone draft.
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-
client.private.agents.private.draft_sessions.get(...) -> GetDraftSessionResponse
-
-
-
Get a draft session by id. Owner-only.
-
-
-
from truefoundry_gateway_sdk import TrueFoundryGateway client = TrueFoundryGateway( api_key="<token>", base_url="https://yourhost.com/path/to/api", ) client.private.agents.private.draft_sessions.get( draft_session_id="draftSessionId", )
-
-
-
draft_session_id:
str— Draft session identifier.
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-
client.private.agents.private.draft_sessions.update(...) -> GetDraftSessionResponse
-
-
-
Update a draft session's inline spec. Owner-only. An empty body is a valid no-op that refreshes
updated_at.
-
-
-
from truefoundry_gateway_sdk import TrueFoundryGateway client = TrueFoundryGateway( api_key="<token>", base_url="https://yourhost.com/path/to/api", ) client.private.agents.private.draft_sessions.update( draft_session_id="draftSessionId", )
-
-
-
draft_session_id:
str— Draft session identifier.
-
agent_spec:
typing.Optional[AgentSpec]
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-