UNPKG

mongodb-rag-core

Version:

Common elements used by MongoDB Chatbot Framework components.

137 lines (136 loc) 5.42 kB
import { z } from "zod"; /** Zod schema loosely based on the OpenAI.FunctionDefinition interface. Validates input tool definitions passed to generateResponse. */ export declare const ToolDefinitionSchema: z.ZodObject<{ name: z.ZodString; description: z.ZodOptional<z.ZodString>; parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>; strict: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>; }, "strip", z.ZodTypeAny, { name: string; description?: string | undefined; parameters?: Record<string, any> | undefined; strict?: boolean | null | undefined; }, { name: string; description?: string | undefined; parameters?: Record<string, any> | undefined; strict?: boolean | null | undefined; }>; export declare const ConversationEvalCaseSchema: z.ZodObject<{ name: z.ZodString; expectation: z.ZodOptional<z.ZodString>; messages: z.ZodArray<z.ZodObject<{ role: z.ZodEnum<["assistant", "user", "system"]>; content: z.ZodString; toolCallName: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { content: string; role: "system" | "assistant" | "user"; toolCallName?: string | undefined; }, { content: string; role: "system" | "assistant" | "user"; toolCallName?: string | undefined; }>, "many">; tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; skip: z.ZodOptional<z.ZodBoolean>; reject: z.ZodOptional<z.ZodBoolean>; expectedMessageDetail: z.ZodOptional<z.ZodArray<z.ZodObject<{ role: z.ZodEnum<["assistant", "assistant-tool", "tool", "user", "system"]>; toolCallName: z.ZodOptional<z.ZodString>; toolCallArgs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; }, "strip", z.ZodTypeAny, { role: "system" | "assistant" | "tool" | "user" | "assistant-tool"; toolCallName?: string | undefined; toolCallArgs?: Record<string, string> | undefined; }, { role: "system" | "assistant" | "tool" | "user" | "assistant-tool"; toolCallName?: string | undefined; toolCallArgs?: Record<string, string> | undefined; }>, "many">>; expectedPromptAdherence: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; expectedLinks: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; reference: z.ZodOptional<z.ZodString>; customSystemPrompt: z.ZodOptional<z.ZodString>; customTools: z.ZodOptional<z.ZodArray<z.ZodObject<{ name: z.ZodString; description: z.ZodOptional<z.ZodString>; parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>; strict: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>; }, "strip", z.ZodTypeAny, { name: string; description?: string | undefined; parameters?: Record<string, any> | undefined; strict?: boolean | null | undefined; }, { name: string; description?: string | undefined; parameters?: Record<string, any> | undefined; strict?: boolean | null | undefined; }>, "many">>; customData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>; }, "strip", z.ZodTypeAny, { name: string; messages: { content: string; role: "system" | "assistant" | "user"; toolCallName?: string | undefined; }[]; tags?: string[] | undefined; customData?: Record<string, unknown> | undefined; expectation?: string | undefined; skip?: boolean | undefined; reject?: boolean | undefined; expectedMessageDetail?: { role: "system" | "assistant" | "tool" | "user" | "assistant-tool"; toolCallName?: string | undefined; toolCallArgs?: Record<string, string> | undefined; }[] | undefined; expectedPromptAdherence?: string[] | undefined; expectedLinks?: string[] | undefined; reference?: string | undefined; customSystemPrompt?: string | undefined; customTools?: { name: string; description?: string | undefined; parameters?: Record<string, any> | undefined; strict?: boolean | null | undefined; }[] | undefined; }, { name: string; messages: { content: string; role: "system" | "assistant" | "user"; toolCallName?: string | undefined; }[]; tags?: string[] | undefined; customData?: Record<string, unknown> | undefined; expectation?: string | undefined; skip?: boolean | undefined; reject?: boolean | undefined; expectedMessageDetail?: { role: "system" | "assistant" | "tool" | "user" | "assistant-tool"; toolCallName?: string | undefined; toolCallArgs?: Record<string, string> | undefined; }[] | undefined; expectedPromptAdherence?: string[] | undefined; expectedLinks?: string[] | undefined; reference?: string | undefined; customSystemPrompt?: string | undefined; customTools?: { name: string; description?: string | undefined; parameters?: Record<string, any> | undefined; strict?: boolean | null | undefined; }[] | undefined; }>; export type ConversationEvalCase = z.infer<typeof ConversationEvalCaseSchema>; /** Get conversation eval cases from YAML file. Throws if the YAML is not correctly formatted. */ export declare function getConversationsEvalCasesFromYaml(yamlData: string): ConversationEvalCase[]; //# sourceMappingURL=getConversationEvalCasesFromYaml.d.ts.map