retort-js
Version:
Intuitive, production-ready prompt chaining in Javascript
41 lines (40 loc) • 1.91 kB
TypeScript
import { RetortSettings } from "./agent";
import { RetortMessage, RetortValueArray } from "./message";
import { RetortExtendableFunction } from "./extendable-function";
import { Retort } from "./retort";
import { run } from "./run";
export interface RetortScriptImport<T> {
default: Retort<T>;
}
export declare class RetortConversation extends RetortExtendableFunction {
readonly id: string;
readonly chat: this;
readonly messagePromises: (RetortMessage | Promise<RetortMessage>)[];
protected get __wrappedFunction(): <T extends any[]>(value0: string | TemplateStringsArray, ...values: RetortValueArray<T>) => RetortMessage;
settings: RetortSettings;
run: typeof run;
get model(): string;
set model(value: string);
get temperature(): number;
set temperature(value: number);
get topP(): number;
set topP(value: number);
get messages(): RetortMessage[];
user: import("./agent").RetortAgent;
assistant: import("./agent").RetortAgent;
system: import("./agent").RetortAgent;
get input(): (inputSettings?: Partial<import("./agent").RetortInputSettings> | undefined) => import("./define-input").RetortInputPromise;
get generation(): (generationSettings?: Partial<RetortSettings> | undefined) => import("./define-generation").RetortMessagePromise;
get prompt(): <T extends any[]>(value0: string | TemplateStringsArray, ...values: RetortValueArray<T>) => RetortMessage;
toObject(messages?: RetortMessage[]): SerializableRetortConversation;
static fromObject(obj: SerializableRetortConversation): RetortConversation;
}
export interface RetortConversation {
(input: string): RetortMessage;
<T extends any[]>(templateStrings: TemplateStringsArray, ...values: RetortValueArray<T>): RetortMessage;
}
export interface SerializableRetortConversation {
id: string;
settings: RetortSettings;
messages: RetortMessage[];
}