Real-time session for conversational agents and chatbots. Created viaDocumentation Index
Fetch the complete documentation index at: https://docs.vectorshift.ai/llms.txt
Use this file to discover all available pages before exploring further.
agent.create_session() or chatbot.create_session().
Use as an async context manager or manually call connect/disconnect.
Usage
Lifecycle
connect
disconnect
terminate
disconnect() which just detaches this client,
terminate() tells the engine to destroy the session entirely.
The session cannot be resumed after termination.
Messaging
send
Message content. Accepts str, Path, bytes, or file-like objects. See
Union.Optional list of additional file attachments (reserved for future use). See
Union.Optional MIME type for non-text content.
Optional filename override for bytes/IOBase content.
send_many
UserSessionMessage for full multimodal control.
All entries use the same encoding rules as send().
Parameters
Streaming
listen
Optional filter — only events whose
type is in this collection are yielded. See SessionEventType.Maximum size of the internal subscriber queue. When a slow consumer lets this fill up, the listener will drop the offending event and emit a synthetic
ERROR event with data["error"] == "subscriber queue overflow" so the consumer can react. Pass 0 for an unbounded queue.See
SessionEvent.get_messages
SessionMessage objects.
Each message has id, session_id, sender, content_type,
text, status, and the original raw dict.
Returns
See
SessionMessage.State
session_id
is_connected
Types
Configuration objects, response shapes, and enums used by the methods above.SessionEvent
SessionEvent(type: ‘SessionEventType’, session_id: ‘str’, message_id: ‘Optional[str]’ = None, data: ‘dict[str, Any]’ = <factory>)
Fields
SessionEventType
Members
MESSAGE_DELTA="message_delta"MESSAGE_COMPLETE="message_complete"MESSAGE_STREAMING="message_streaming"TOOL_CALL="tool_call"TOOL_RESULT="tool_result"THINKING="thinking"SEARCH_RESULT="search_result"APPROVAL_REQUEST="approval_request"REAUTH_REQUEST="reauth_request"ERROR="error"PARTICIPANT_STATUS="participant_status"SESSION_CREATED="session_created"SESSION_CONNECTED="session_connected"MESSAGE_POSTED="message_posted"MESSAGES_POSTED="messages_posted"PONG="pong"
SessionMessage
A message from session history (returned by session.get_messages()).
Fields
SessionMessageStatus
Members
STREAMING="streaming"COMPLETE="complete"ERROR="error"
MessageSender
Who sent a session message.
Fields
UserSessionMessage
Authored outbound message for use with session.send_many().
Each field mirrors the keyword arguments of session.send():
