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,) -> ChatSessionContextsend()
Send a message and get a complete response
async def send( message: str, *, session_id: str, force_detailed_analysis: bool = False, expected_image_ids: Optional[list[str]] = None,) -> 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, expected_image_ids: Optional[list[str]] = None, debug_reasoning: bool = False,) -> AsyncIterator[ChatToken]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]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_videos()
Replace the set of videos available to the VideoAnalysisAgent for the session (max 100)
async def update_videos( session_id: str, video_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]update_domain()
Set the knowledge domain for a session to guide agent behavior
async def update_domain( session_id: str, domain: str,) -> dict[str, Any]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,) -> ChatImageListsearch_images()
Search images available for chat context
async def search_images( query: str, *, limit: int = 50, offset: int = 0,) -> list[ImageReference]
