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§

AgentPart
An agent delegation part within a message.
AgentPartInput
An agent input part for the chat endpoint.
AgentPartSource
Source information for an AgentPart.
AssistantMessage
An assistant-generated message.
AssistantMessagePath
Filesystem paths for an AssistantMessage.
AssistantMessageTime
Timing information for an AssistantMessage.
AssistantMessageTokens
Token usage breakdown for an AssistantMessage.
CompactionPart
A compaction marker part within a message.
FileDiff
A file diff within a session summary.
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.
PermissionRule
A permission rule governing tool access.
ReasoningPart
A reasoning/thinking step part within a message.
ReasoningPartTime
Timing information for a ReasoningPart.
RetryPart
A retry part within a message, indicating a failed attempt.
RetryPartTime
Timing information for a RetryPart.
Session
A conversation session.
SessionChatModel
Model selection for the chat endpoint.
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).
SessionSummary
Summary of changes in a session.
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.
SubtaskPart
A subtask delegation part within a message.
SubtaskPartInput
A subtask input part for the chat endpoint.
SubtaskPartModel
Model information for a SubtaskPart.
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.
UserMessageModel
Model information for a user message.
UserMessageSummary
Summary information for a user message.
UserMessageTime
Timing information for a UserMessage.

Enums§

FileDiffStatus
Status of a file diff.
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.
OutputFormat
Output format specification — text or JSON schema.
Part
A part within a message — discriminated by type.
PartInput
An input part — text, file, agent, or subtask — discriminated by type.
ToolState
The current state of a tool invocation — discriminated by status.

Type Aliases§

PermissionRuleset
A set of permission rules.
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.