jan/core/src/plugins/conversational.ts
Louis 96dba2690d feat: class-based plugin manager
chore: add facades

refactor: core module export

refactor: inference plugin - deprecate function registering (#537)

* refactor: revamp inference plugin as class - deprecate function registering

* refactor: monitoring plugin - deprecate service registering (#538)

refactor: revamp inference plugin as class - deprecate function registering

chore: update import

refactor: plugin revamp - model management

chore: update build steps and remove experimental plugins

refactor: remove pluggable electron

chore: add sorting for conversations

chore: build plugins for testing

chore: consistent plugin directory name

chore: docs

chore: fix CI

chore: update conversation prefix
2023-11-06 13:46:01 +07:00

33 lines
1010 B
TypeScript

import { JanPlugin } from "../plugin";
import { Conversation } from "../types/index";
/**
* Abstract class for conversational plugins.
* @abstract
* @extends JanPlugin
*/
export abstract class ConversationalPlugin extends JanPlugin {
/**
* Returns a list of conversations.
* @abstract
* @returns {Promise<any[]>} A promise that resolves to an array of conversations.
*/
abstract getConversations(): Promise<any[]>;
/**
* Saves a conversation.
* @abstract
* @param {Conversation} conversation - The conversation to save.
* @returns {Promise<void>} A promise that resolves when the conversation is saved.
*/
abstract saveConversation(conversation: Conversation): Promise<void>;
/**
* Deletes a conversation.
* @abstract
* @param {string} conversationId - The ID of the conversation to delete.
* @returns {Promise<void>} A promise that resolves when the conversation is deleted.
*/
abstract deleteConversation(conversationId: string): Promise<void>;
}