smartai/ts/abstract.classes.multimodal.ts

33 lines
676 B
TypeScript
Raw Normal View History

2024-04-04 00:47:44 +00:00
export abstract class MultiModalModel {
/**
* starts the model
*/
2024-03-31 00:32:37 +00:00
abstract start(): Promise<void>;
2024-04-04 00:47:44 +00:00
/**
* stops the model
*/
2024-03-31 00:32:37 +00:00
abstract stop(): Promise<void>;
2024-04-25 08:49:07 +00:00
public abstract chat(optionsArg: {
systemMessage: string,
userMessage: string,
messageHistory: {
role: 'assistant' | 'user';
content: string;
}[]
}): Promise<{
role: 'assistant';
message: string;
}>
2024-03-31 00:32:37 +00:00
2024-04-25 08:49:07 +00:00
/**
* Defines a streaming interface for chat interactions.
* The implementation will vary based on the specific AI model.
* @param input
*/
public abstract chatStream(input: ReadableStream<string>): Promise<ReadableStream<string>>;
2024-03-31 00:32:37 +00:00
}