UNPKG

retort-js

Version:

Intuitive, production-ready prompt chaining in Javascript

57 lines (56 loc) 2.42 kB
import { RetortModel, 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; /** * @deprecated */ readonly chat: this; protected get __wrappedFunction(): <T extends any[]>(value0: string | TemplateStringsArray, ...values: RetortValueArray<T>) => RetortMessage<string>; settings: RetortSettings; run: typeof run; get model(): RetortModel; set model(value: RetortModel); get temperature(): number; set temperature(value: number); get topP(): number; set topP(value: number); readonly messages: RetortMessage[]; /** * Use the promise property of each message to get an array of promises * @deprecated */ get messagePromises(): import("./message").RetortMessagePromise<string>[]; user: import("./agent").RetortAgent; assistant: import("./agent").RetortAgent; system: import("./agent").RetortAgent; get input(): (inputSettings?: Partial<import("./agent").RetortInputSettings> | undefined) => Promise<string>; get generation(): <T extends import("src/tooling").RetortObjectSchema | undefined = undefined>(generationSettings?: Partial<RetortSettings> | (Partial<RetortSettings> & import("./define-generation").RetortParamaterization<T>) | undefined) => import("./message").RetortMessagePromise<T extends import("src/tooling").RetortObjectSchema ? import("src/tooling").RetortSchemaToType<T> : string>; private get prompt(); /** * Use the toJSON method * @deprecated */ toObject(messages?: RetortMessage[]): SerializableRetortConversation; toJSON(): SerializableRetortConversation; /** * If you need this create a fromJSON method * @deprecated */ 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[]; }