Add conversations modal
This commit is contained in:
@@ -55,6 +55,27 @@ export class Api {
|
||||
|
||||
// --- Conversations ---
|
||||
|
||||
/**
|
||||
* listConversations returns every conversation of the user, most
|
||||
* recently updated first. Each row holds id, title, created_at,
|
||||
* and updated_at. It holds no messages.
|
||||
* @returns {Promise<Array<Object>>}
|
||||
*/
|
||||
async listConversations() {
|
||||
return this._json('/conversations');
|
||||
}
|
||||
|
||||
/**
|
||||
* getConversation returns one conversation row. Use it to verify
|
||||
* that a conversation exists before the local selection moves to
|
||||
* it. It returns no messages.
|
||||
* @param {string} id
|
||||
* @returns {Promise<Object>}
|
||||
*/
|
||||
async getConversation(id) {
|
||||
return this._json(`/conversations/${encodeURIComponent(id)}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* createConversation saves a new conversation with its initial
|
||||
* system message. An empty systemMessage makes the server use its
|
||||
|
||||
Reference in New Issue
Block a user