@convo-lang/convo-lang
Version:
The language of AI
24 lines (23 loc) • 2.07 kB
TypeScript
import { ZodType, ZodTypeAny, z } from "zod";
import { ConversationOptions } from "./Conversation.js";
import { ConvoNodeGraphResult } from "./convo-node-graph-types.js";
import { ConvoCompletion, ConvoCompletionOptions, ConvoParsingResult, FlatConvoConversation, FlatConvoMessage } from "./convo-types.js";
import { ConvoNodeGraphCtrlOptions } from "./ConvoNodeGraphCtrl.js";
export declare const getConvoCompletionAsync: (messagesOrOptions: string | ConvoCompletionOptions, conversationOptions?: ConversationOptions) => Promise<ConvoCompletion>;
export declare const getConvoTextCompletionAsync: (messagesOrOptions: string | ConvoCompletionOptions, conversationOptions?: ConversationOptions) => Promise<string | undefined>;
export declare const getConvoUserMessageCompletionAsync: (userMessage: string, conversationOptions?: ConversationOptions) => Promise<string | undefined>;
export declare const getConvoJsonCompletionAsync: <T = any>(messagesOrOptions: string | ConvoCompletionOptions, conversationOptions?: ConversationOptions) => Promise<T | undefined>;
export declare const callConvoFunctionAsync: <T = any>(messagesOrOptions: string | ConvoCompletionOptions, conversationOptions?: ConversationOptions) => Promise<T>;
export declare const callConvoFunctionWithSchemeAsync: <Z extends ZodTypeAny = ZodType<any>, T = z.infer<Z>>(functionName: string, functionDescription: string, params: Z, messagesOrOptions: string | ConvoCompletionOptions, conversationOptions?: ConversationOptions) => Promise<T | undefined>;
export interface FlattenedConvoResult {
success: boolean;
flat?: FlatConvoConversation;
vars: Record<string, any>;
messages: FlatConvoMessage[];
parsingResult: ConvoParsingResult;
}
export declare const flattenConvoAsync: (code: string, options?: ConversationOptions) => Promise<FlattenedConvoResult>;
/**
* Executes Convo-Lang code as a node graph and returns the output of the last node.
*/
export declare const executeConvoGraphAsync: (code: string, options?: ConvoNodeGraphCtrlOptions) => Promise<ConvoNodeGraphResult>;