Spaces:
Running
Running
File size: 577 Bytes
8a8fe1d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
import {Stream} from "stream";
export interface ChatOptions {
}
export interface Response {
text: string | null;
other?: any;
}
export interface ResponseStream {
text: Stream;
other?: any;
}
export interface Request {
prompt: string;
options?: any;
}
export abstract class Chat {
protected options: ChatOptions | undefined;
protected constructor(options?: ChatOptions) {
this.options = options;
}
public abstract ask(req: Request): Promise<Response>
public abstract askStream(req: Request): Promise<ResponseStream>
}
|