Documentation
ChatResource
Access via client.chats
session()
Create a chat session context manager for automatic lifecycle management
def session( *, title: Optional[str] = None, image_ids: Optional[list[str]] = None, use_all_images: bool = True, auto_close: bool = True,) -> ChatSessionContextReturns: ChatSessionContext - Context manager for use with 'async with'
send()
Send a message and get a complete response
async def send( message: str, *, session_id: str, force_detailed_analysis: bool = False,) -> ChatResponsesend_stream()
Send a message and stream response tokens as they arrive
async def send_stream( message: str, *, session_id: str, force_detailed_analysis: bool = False,) -> AsyncIterator[ChatToken]Yields: ChatToken objects with type, content, and data
create_session()
Create a new chat session
async def create_session( *, title: Optional[str] = None, image_ids: Optional[list[str]] = None, use_all_images: bool = True,) -> ChatSessionget_session()
Get session details with message history
async def get_session( session_id: str, *, include_messages: bool = True, message_limit: Optional[int] = None,) -> ChatSessionDetaillist_sessions()
List user's chat sessions
async def list_sessions( *, limit: int = 20, offset: int = 0, active_only: bool = False,) -> SessionListiter_sessions()
Auto-paginating async iterator over all chat sessions
async def iter_sessions( *, page_size: int = 20, active_only: bool = False,) -> AsyncIterator[ChatSession]Yields: ChatSession objects one at a time
get_messages()
Get messages from a chat session
async def get_messages( session_id: str, *, limit: Optional[int] = None,) -> list[ChatMessage]update_images()
Update images for a chat session
async def update_images( session_id: str, image_ids: list[str],) -> dict[str, Any]close_session()
Close a chat session
async def close_session(session_id: str) -> dict[str, Any]update_documents()
Update selected documents for session context
async def update_documents( session_id: str, document_ids: list[str],) -> dict[str, Any]update_mode()
Switch between all images and selected images mode
async def update_mode( session_id: str, use_all_images: bool,) -> dict[str, Any]approve_plan()
Approve an execution plan for a chat session
async def approve_plan( session_id: str, plan_id: str,) -> PlanActionResponseReturns: PlanActionResponse with execution results or accepted status
cancel_plan()
Cancel a pending execution plan
async def cancel_plan( session_id: str, plan_id: str,) -> PlanActionResponseReturns: PlanActionResponse confirming cancellation
rename_session()
Rename a chat session
async def rename_session( session_id: str, title: str,) -> dict[str, Any]export_session()
Export chat session in specified format
async def export_session( session_id: str, *, format: str = "markdown", include_metadata: bool = False,) -> bytesget_all_images()
Get all user images available for chat context
async def get_all_images( *, limit: int = 1000, offset: int = 0,) -> ChatImageListReturns: ChatImageList with images and pagination info
search_images()
Search images available for chat context
async def search_images( query: str, *, limit: int = 50, offset: int = 0,) -> list[ImageReference]