Skip to main content

Module session

Module session 

Source
Expand description

Session resource types and methods mirroring the JS SDK’s resources/session.ts.

Structs§

AssistantMessage
An assistant-generated message.
AssistantMessagePath
Filesystem paths for an AssistantMessage.
AssistantMessageTime
Timing information for an AssistantMessage.
AssistantMessageTokens
Token usage breakdown for an AssistantMessage.
FilePart
A file attachment part within a message.
FilePartInput
A file input part for the chat endpoint.
FilePartSourceText
Text content extracted from a source.
FileSource
A file-based source.
PatchPart
A patch describing file modifications.
Session
A conversation session.
SessionChatParams
Parameters for the chat endpoint (POST /session/{id}/message).
SessionInitParams
Parameters for session initialisation (POST /session/{id}/init).
SessionMessagesResponseItem
A single item in the session messages response.
SessionResource
Provides access to the Session-related API endpoints.
SessionRevert
Revert metadata attached to a Session.
SessionRevertParams
Parameters for reverting a session (POST /session/{id}/revert).
SessionShare
Share metadata attached to a Session.
SessionSummarizeParams
Parameters for summarising a session (POST /session/{id}/summarize).
SessionTime
Timing information for a Session.
SnapshotPart
A snapshot of the session state.
StepFinishPart
Marks the end of a reasoning step with cost and token info.
StepFinishTokens
Token usage for a StepFinishPart.
StepStartPart
Marks the beginning of a reasoning step.
SymbolSource
A symbol-based source (e.g. function, class).
SymbolSourcePosition
A line/character position within a file.
SymbolSourceRange
Range of a SymbolSource.
TextPart
A text part within a message.
TextPartInput
A text input part for the chat endpoint.
TextPartInputTime
Timing information for a TextPartInput.
TextPartTime
Timing information for a TextPart.
TokenCache
Cache token breakdown.
ToolPart
A tool invocation part within a message.
ToolStateCompleted
A successfully completed tool invocation.
ToolStateCompletedTime
Timing for ToolStateCompleted.
ToolStateError
A tool invocation that resulted in an error.
ToolStateErrorTime
Timing for ToolStateError.
ToolStatePending
A pending tool invocation.
ToolStateRunning
A currently-running tool invocation.
ToolStateRunningTime
Timing for ToolStateRunning.
UserMessage
A user-sent message.
UserMessageTime
Timing information for a UserMessage.

Enums§

FilePartSource
Source of a file part — either a file or a symbol.
Message
A message in a session — either from the user or the assistant.
Part
A part within a message — discriminated by type.
PartInput
An input part — either text or file — discriminated by type.
ToolState
The current state of a tool invocation — discriminated by status.

Type Aliases§

SessionAbortResponse
Response type for aborting a session.
SessionDeleteResponse
Response type for deleting a session.
SessionInitResponse
Response type for initialising a session.
SessionListResponse
Response type for listing sessions.
SessionMessagesResponse
Response type for listing session messages.
SessionSummarizeResponse
Response type for summarising a session.