cozy-client / models / assistant
Namespace: assistant¶
models.assistant
Interfaces¶
Functions¶
createAssistant¶
▸ createAssistant(client, assistantData): Promise<Assistant>
Creates a new assistant with the provided data.
throws {Error} - Throws an error if the creation fails
Parameters
| Name | Type | Description |
|---|---|---|
client |
CozyClient |
An instance of CozyClient |
assistantData |
Assistant |
Data for the new assistant |
Returns
Promise<Assistant>
- A promise that resolves with the created assistant document
Defined in
packages/cozy-client/src/models/assistant.js:27
deleteAssistant¶
▸ deleteAssistant(client, assistantId): Promise<void>
Deletes an assistant by its ID.
throws {Error} - Throws an error if the deletion fails
Parameters
| Name | Type | Description |
|---|---|---|
client |
CozyClient |
An instance of CozyClient |
assistantId |
string |
The ID of the assistant to delete |
Returns
Promise<void>
- A promise that resolves when the assistant is deleted
Defined in
packages/cozy-client/src/models/assistant.js:96
editAssistant¶
▸ editAssistant(client, assistantId, assistantData): Promise<void>
Edit assistant with the provided data.
throws {Error} - Throws an error if the edition fails
Parameters
| Name | Type | Description |
|---|---|---|
client |
CozyClient |
An instance of CozyClient |
assistantId |
string |
ID of existed assistant |
assistantData |
Assistant |
Data for the editted assistant |
Returns
Promise<void>
- A promise that resolves when the assistant is edited
Defined in