UNPKG

polyfact

Version:

<h1 align="center">PolyFact</h1>

30 lines (29 loc) 914 B
import { GenerationSimpleOptions } from "../generate"; import { t } from ".."; declare const ActionAgent: t.TypeC<{ thought: t.Type<string, string, unknown>; action: t.TypeC<{ type: t.Type<string, string, unknown>; arg: t.Type<string, string, unknown>; }>; }>; export type ActionAgent = t.TypeOf<typeof ActionAgent>; export type Agent = { start: (question: string, progress?: (step: string, result: string) => void) => Promise<string>; stop: () => void; }; export type DefinitionAction = { name: string; callback: (arg: string) => Promise<string>; description: string; example: { question: string; process: { thought: string; action: string; observation: string; }[]; }; }; declare const useAgent: (actions: DefinitionAction[], options?: GenerationSimpleOptions) => Agent; export default useAgent;