UNPKG

retort-js

Version:

Intuitive, production-ready prompt chaining in Javascript

16 lines (15 loc) 493 B
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>; type ChatFunction<T> = ($: RetortConversation, ...values: any[]) => T; export {};