retort-js
Version:
Intuitive, production-ready prompt chaining in Javascript
15 lines (14 loc) • 489 B
TypeScript
import { RetortConversation } from "./conversation";
export interface Retort<T> {
_run: (...values: any[]) => RetortInProgress<T>;
retortId: string;
retortHash: string;
retortType: "retort";
}
export interface RetortInProgress<T> {
retortId: string;
$: RetortConversation;
completionPromise: Promise<T>;
}
export declare function retort<T>(chatFunction: ChatFunction<T>): Retort<T>;
export type ChatFunction<T> = ($: RetortConversation, ...values: any[]) => T;