Chat Sessions
A ChatSession represents one conversation with the Files.com AI Assistant.
List Chat Sessions
SDK Method
chat_session.List()
Return Values
Returns a *chat_session.Iter and an error. Range over All() to receive files_sdk.ChatSession values and errors.
Check each loop error before using its resource. Next() and Err() remain supported.
Authorization Requirement
Requires a Site-Wide API key, or a User API key or session from a Site Administrator or a Workspace Administrator for the relevant workspace.
Additional Arguments
Show Chat Session
SDK Method
chat_session.Find()
Return Values
Returns a files_sdk.ChatSession value and an error.
Authorization Requirement
Requires a Site-Wide API key, or a User API key or session from a Site Administrator or a Workspace Administrator for the relevant workspace.
ChatSessionFindParams Fields
| Field | Description |
|---|---|
| Id string Required | Chat Session ID. |
The ChatSession Object
Some of the methods above return a ChatSession object. The attributes of this object are listed below.
| Attribute | Description |
|---|---|
| Id string | Chat Session ID. |
| Title string | Short AI-generated chat title. |
| UserId int64 | User ID. |
| AiTaskId int64 | AI Task ID. Present when the conversation was started by an AI Task. |
| WorkspaceId int64 | Workspace ID. 0 means the default workspace. |
| LastActiveAt date-time | Most recent chat activity date/time. |
| CreatedAt date-time | Chat session creation date/time. |
| Messages array(object) | Visible conversation messages in this chat session. For performance reasons, this is not provided when listing chat sessions. |