This topic describes the Thread class in the assistant API, including how to create, retrieve, modify, and delete threads.
Overview: For more information about the features and basic usage of the assistant API, see Assistant API overview.
Retention period: All Thread instances are stored on the Alibaba Cloud Model Studio server and do not expire. You can use the thread ID to retrieve context information.
Function name | Type |
|---|---|
create | Creates a Thread class. |
retrieve | Retrieves a Thread class. |
update | Modifies a Thread class. |
delete | Deletes a Thread class. |
Create a thread
- HTTP
- SDK
Input parameter name | Input parameter descriptions | Type | Required |
|---|---|---|---|
messages | The messages passed to the thread. | Message class | No |
metadata | Thread name | object | No |
- id: The thread ID.
- request_id: The request ID.
Retrieve a thread
- HTTP
- SDK
Parameter Name | Parameter description | Type | Required |
|---|---|---|---|
thread_id | The ID of the thread to retrieve. | str | Yes |
- ID: Thread ID
- request_id: The ID of the request.
Modify a thread
- HTTP
- SDK
Input Parameter Name | Input Parameter Descriptions | Type | Required |
|---|---|---|---|
thread_id | The ID of the thread to modify. | str | Yes |
metadata | Thread name | dict | No |
- id: thread_id
- request_id: The request ID.
Delete a thread
- HTTP
- SDK
Input Parameter Name | Description | Type | Required |
|---|---|---|---|
id | The ID of the thread to delete | str | Yes |