UNPKG

@arizeai/phoenix-client

Version:

A client for the Phoenix API

1,471 lines 134 kB
import z from "zod"; /** * Union of all message formats */ export declare const llmProviderMessageSchema: z.ZodUnion<[z.ZodDiscriminatedUnion<"role", [z.ZodObject<{ role: z.ZodLiteral<"assistant">; content: z.ZodUnion<[z.ZodArray<z.ZodObject<{ type: z.ZodLiteral<"text">; text: z.ZodString; }, "strip", z.ZodTypeAny, { text: string; type: "text"; }, { text: string; type: "text"; }>, "many">, z.ZodString]>; name: z.ZodOptional<z.ZodString>; tool_call_id: z.ZodOptional<z.ZodString>; tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{ type: z.ZodEffects<z.ZodOptional<z.ZodLiteral<"function">>, "function", "function" | undefined>; id: z.ZodString; function: z.ZodObject<{ name: z.ZodString; arguments: z.ZodString; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ name: z.ZodString; arguments: z.ZodString; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ name: z.ZodString; arguments: z.ZodString; }, z.ZodTypeAny, "passthrough">>; }, "strip", z.ZodTypeAny, { function: { name: string; arguments: string; } & { [k: string]: unknown; }; type: "function"; id: string; }, { function: { name: string; arguments: string; } & { [k: string]: unknown; }; id: string; type?: "function" | undefined; }>, "many">>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ role: z.ZodLiteral<"assistant">; content: z.ZodUnion<[z.ZodArray<z.ZodObject<{ type: z.ZodLiteral<"text">; text: z.ZodString; }, "strip", z.ZodTypeAny, { text: string; type: "text"; }, { text: string; type: "text"; }>, "many">, z.ZodString]>; name: z.ZodOptional<z.ZodString>; tool_call_id: z.ZodOptional<z.ZodString>; tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{ type: z.ZodEffects<z.ZodOptional<z.ZodLiteral<"function">>, "function", "function" | undefined>; id: z.ZodString; function: z.ZodObject<{ name: z.ZodString; arguments: z.ZodString; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ name: z.ZodString; arguments: z.ZodString; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ name: z.ZodString; arguments: z.ZodString; }, z.ZodTypeAny, "passthrough">>; }, "strip", z.ZodTypeAny, { function: { name: string; arguments: string; } & { [k: string]: unknown; }; type: "function"; id: string; }, { function: { name: string; arguments: string; } & { [k: string]: unknown; }; id: string; type?: "function" | undefined; }>, "many">>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ role: z.ZodLiteral<"assistant">; content: z.ZodUnion<[z.ZodArray<z.ZodObject<{ type: z.ZodLiteral<"text">; text: z.ZodString; }, "strip", z.ZodTypeAny, { text: string; type: "text"; }, { text: string; type: "text"; }>, "many">, z.ZodString]>; name: z.ZodOptional<z.ZodString>; tool_call_id: z.ZodOptional<z.ZodString>; tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{ type: z.ZodEffects<z.ZodOptional<z.ZodLiteral<"function">>, "function", "function" | undefined>; id: z.ZodString; function: z.ZodObject<{ name: z.ZodString; arguments: z.ZodString; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ name: z.ZodString; arguments: z.ZodString; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ name: z.ZodString; arguments: z.ZodString; }, z.ZodTypeAny, "passthrough">>; }, "strip", z.ZodTypeAny, { function: { name: string; arguments: string; } & { [k: string]: unknown; }; type: "function"; id: string; }, { function: { name: string; arguments: string; } & { [k: string]: unknown; }; id: string; type?: "function" | undefined; }>, "many">>; }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ role: z.ZodLiteral<"tool">; content: z.ZodUnion<[z.ZodArray<z.ZodObject<{ type: z.ZodLiteral<"text">; text: z.ZodString; }, "strip", z.ZodTypeAny, { text: string; type: "text"; }, { text: string; type: "text"; }>, "many">, z.ZodString]>; tool_call_id: z.ZodString; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ role: z.ZodLiteral<"tool">; content: z.ZodUnion<[z.ZodArray<z.ZodObject<{ type: z.ZodLiteral<"text">; text: z.ZodString; }, "strip", z.ZodTypeAny, { text: string; type: "text"; }, { text: string; type: "text"; }>, "many">, z.ZodString]>; tool_call_id: z.ZodString; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ role: z.ZodLiteral<"tool">; content: z.ZodUnion<[z.ZodArray<z.ZodObject<{ type: z.ZodLiteral<"text">; text: z.ZodString; }, "strip", z.ZodTypeAny, { text: string; type: "text"; }, { text: string; type: "text"; }>, "many">, z.ZodString]>; tool_call_id: z.ZodString; }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ role: z.ZodLiteral<"function">; content: z.ZodNullable<z.ZodString>; name: z.ZodString; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ role: z.ZodLiteral<"function">; content: z.ZodNullable<z.ZodString>; name: z.ZodString; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ role: z.ZodLiteral<"function">; content: z.ZodNullable<z.ZodString>; name: z.ZodString; }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ role: z.ZodLiteral<"user">; content: z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodObject<{ type: z.ZodLiteral<"text">; text: z.ZodString; }, "strip", z.ZodTypeAny, { text: string; type: "text"; }, { text: string; type: "text"; }>, z.ZodObject<{ type: z.ZodLiteral<"image_url">; image_url: z.ZodObject<{ url: z.ZodString; }, "strip", z.ZodTypeAny, { url: string; }, { url: string; }>; }, "strip", z.ZodTypeAny, { type: "image_url"; image_url: { url: string; }; }, { type: "image_url"; image_url: { url: string; }; }>]>, "many">, z.ZodString]>; name: z.ZodOptional<z.ZodString>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ role: z.ZodLiteral<"user">; content: z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodObject<{ type: z.ZodLiteral<"text">; text: z.ZodString; }, "strip", z.ZodTypeAny, { text: string; type: "text"; }, { text: string; type: "text"; }>, z.ZodObject<{ type: z.ZodLiteral<"image_url">; image_url: z.ZodObject<{ url: z.ZodString; }, "strip", z.ZodTypeAny, { url: string; }, { url: string; }>; }, "strip", z.ZodTypeAny, { type: "image_url"; image_url: { url: string; }; }, { type: "image_url"; image_url: { url: string; }; }>]>, "many">, z.ZodString]>; name: z.ZodOptional<z.ZodString>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ role: z.ZodLiteral<"user">; content: z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodObject<{ type: z.ZodLiteral<"text">; text: z.ZodString; }, "strip", z.ZodTypeAny, { text: string; type: "text"; }, { text: string; type: "text"; }>, z.ZodObject<{ type: z.ZodLiteral<"image_url">; image_url: z.ZodObject<{ url: z.ZodString; }, "strip", z.ZodTypeAny, { url: string; }, { url: string; }>; }, "strip", z.ZodTypeAny, { type: "image_url"; image_url: { url: string; }; }, { type: "image_url"; image_url: { url: string; }; }>]>, "many">, z.ZodString]>; name: z.ZodOptional<z.ZodString>; }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ role: z.ZodLiteral<"system">; content: z.ZodUnion<[z.ZodArray<z.ZodObject<{ type: z.ZodLiteral<"text">; text: z.ZodString; }, "strip", z.ZodTypeAny, { text: string; type: "text"; }, { text: string; type: "text"; }>, "many">, z.ZodString]>; name: z.ZodOptional<z.ZodString>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ role: z.ZodLiteral<"system">; content: z.ZodUnion<[z.ZodArray<z.ZodObject<{ type: z.ZodLiteral<"text">; text: z.ZodString; }, "strip", z.ZodTypeAny, { text: string; type: "text"; }, { text: string; type: "text"; }>, "many">, z.ZodString]>; name: z.ZodOptional<z.ZodString>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ role: z.ZodLiteral<"system">; content: z.ZodUnion<[z.ZodArray<z.ZodObject<{ type: z.ZodLiteral<"text">; text: z.ZodString; }, "strip", z.ZodTypeAny, { text: string; type: "text"; }, { text: string; type: "text"; }>, "many">, z.ZodString]>; name: z.ZodOptional<z.ZodString>; }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ role: z.ZodLiteral<"developer">; content: z.ZodUnion<[z.ZodArray<z.ZodObject<{ type: z.ZodLiteral<"text">; text: z.ZodString; }, "strip", z.ZodTypeAny, { text: string; type: "text"; }, { text: string; type: "text"; }>, "many">, z.ZodString]>; name: z.ZodOptional<z.ZodString>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ role: z.ZodLiteral<"developer">; content: z.ZodUnion<[z.ZodArray<z.ZodObject<{ type: z.ZodLiteral<"text">; text: z.ZodString; }, "strip", z.ZodTypeAny, { text: string; type: "text"; }, { text: string; type: "text"; }>, "many">, z.ZodString]>; name: z.ZodOptional<z.ZodString>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ role: z.ZodLiteral<"developer">; content: z.ZodUnion<[z.ZodArray<z.ZodObject<{ type: z.ZodLiteral<"text">; text: z.ZodString; }, "strip", z.ZodTypeAny, { text: string; type: "text"; }, { text: string; type: "text"; }>, "many">, z.ZodString]>; name: z.ZodOptional<z.ZodString>; }, z.ZodTypeAny, "passthrough">>]>, z.ZodObject<{ role: z.ZodEnum<["user", "assistant"]>; content: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{ type: z.ZodLiteral<"text">; text: z.ZodString; }, "strip", z.ZodTypeAny, { text: string; type: "text"; }, { text: string; type: "text"; }>, z.ZodObject<{ type: z.ZodLiteral<"image">; source: z.ZodObject<{ data: z.ZodString; media_type: z.ZodEnum<["image/jpeg", "image/png", "image/gif", "image/webp"]>; type: z.ZodLiteral<"base64">; }, "strip", z.ZodTypeAny, { type: "base64"; data: string; media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp"; }, { type: "base64"; data: string; media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp"; }>; }, "strip", z.ZodTypeAny, { type: "image"; source: { type: "base64"; data: string; media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp"; }; }, { type: "image"; source: { type: "base64"; data: string; media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp"; }; }>, z.ZodObject<{ id: z.ZodString; type: z.ZodLiteral<"tool_use">; name: z.ZodString; input: z.ZodType<import("../jsonLiteralSchema").JSONLiteral, z.ZodTypeDef, import("../jsonLiteralSchema").JSONLiteral>; }, "strip", z.ZodTypeAny, { type: "tool_use"; name: string; id: string; input: import("../jsonLiteralSchema").JSONLiteral; }, { type: "tool_use"; name: string; id: string; input: import("../jsonLiteralSchema").JSONLiteral; }>, z.ZodObject<{ type: z.ZodLiteral<"tool_result">; tool_use_id: z.ZodString; content: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodUnion<[z.ZodObject<{ type: z.ZodLiteral<"text">; text: z.ZodString; }, "strip", z.ZodTypeAny, { text: string; type: "text"; }, { text: string; type: "text"; }>, z.ZodObject<{ type: z.ZodLiteral<"image">; source: z.ZodObject<{ data: z.ZodString; media_type: z.ZodEnum<["image/jpeg", "image/png", "image/gif", "image/webp"]>; type: z.ZodLiteral<"base64">; }, "strip", z.ZodTypeAny, { type: "base64"; data: string; media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp"; }, { type: "base64"; data: string; media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp"; }>; }, "strip", z.ZodTypeAny, { type: "image"; source: { type: "base64"; data: string; media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp"; }; }, { type: "image"; source: { type: "base64"; data: string; media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp"; }; }>]>, "many">]>; is_error: z.ZodOptional<z.ZodBoolean>; }, "strip", z.ZodTypeAny, { type: "tool_result"; content: string | ({ text: string; type: "text"; } | { type: "image"; source: { type: "base64"; data: string; media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp"; }; })[]; tool_use_id: string; is_error?: boolean | undefined; }, { type: "tool_result"; content: string | ({ text: string; type: "text"; } | { type: "image"; source: { type: "base64"; data: string; media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp"; }; })[]; tool_use_id: string; is_error?: boolean | undefined; }>]>, "many">]>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ role: z.ZodEnum<["user", "assistant"]>; content: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{ type: z.ZodLiteral<"text">; text: z.ZodString; }, "strip", z.ZodTypeAny, { text: string; type: "text"; }, { text: string; type: "text"; }>, z.ZodObject<{ type: z.ZodLiteral<"image">; source: z.ZodObject<{ data: z.ZodString; media_type: z.ZodEnum<["image/jpeg", "image/png", "image/gif", "image/webp"]>; type: z.ZodLiteral<"base64">; }, "strip", z.ZodTypeAny, { type: "base64"; data: string; media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp"; }, { type: "base64"; data: string; media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp"; }>; }, "strip", z.ZodTypeAny, { type: "image"; source: { type: "base64"; data: string; media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp"; }; }, { type: "image"; source: { type: "base64"; data: string; media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp"; }; }>, z.ZodObject<{ id: z.ZodString; type: z.ZodLiteral<"tool_use">; name: z.ZodString; input: z.ZodType<import("../jsonLiteralSchema").JSONLiteral, z.ZodTypeDef, import("../jsonLiteralSchema").JSONLiteral>; }, "strip", z.ZodTypeAny, { type: "tool_use"; name: string; id: string; input: import("../jsonLiteralSchema").JSONLiteral; }, { type: "tool_use"; name: string; id: string; input: import("../jsonLiteralSchema").JSONLiteral; }>, z.ZodObject<{ type: z.ZodLiteral<"tool_result">; tool_use_id: z.ZodString; content: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodUnion<[z.ZodObject<{ type: z.ZodLiteral<"text">; text: z.ZodString; }, "strip", z.ZodTypeAny, { text: string; type: "text"; }, { text: string; type: "text"; }>, z.ZodObject<{ type: z.ZodLiteral<"image">; source: z.ZodObject<{ data: z.ZodString; media_type: z.ZodEnum<["image/jpeg", "image/png", "image/gif", "image/webp"]>; type: z.ZodLiteral<"base64">; }, "strip", z.ZodTypeAny, { type: "base64"; data: string; media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp"; }, { type: "base64"; data: string; media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp"; }>; }, "strip", z.ZodTypeAny, { type: "image"; source: { type: "base64"; data: string; media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp"; }; }, { type: "image"; source: { type: "base64"; data: string; media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp"; }; }>]>, "many">]>; is_error: z.ZodOptional<z.ZodBoolean>; }, "strip", z.ZodTypeAny, { type: "tool_result"; content: string | ({ text: string; type: "text"; } | { type: "image"; source: { type: "base64"; data: string; media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp"; }; })[]; tool_use_id: string; is_error?: boolean | undefined; }, { type: "tool_result"; content: string | ({ text: string; type: "text"; } | { type: "image"; source: { type: "base64"; data: string; media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp"; }; })[]; tool_use_id: string; is_error?: boolean | undefined; }>]>, "many">]>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ role: z.ZodEnum<["user", "assistant"]>; content: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{ type: z.ZodLiteral<"text">; text: z.ZodString; }, "strip", z.ZodTypeAny, { text: string; type: "text"; }, { text: string; type: "text"; }>, z.ZodObject<{ type: z.ZodLiteral<"image">; source: z.ZodObject<{ data: z.ZodString; media_type: z.ZodEnum<["image/jpeg", "image/png", "image/gif", "image/webp"]>; type: z.ZodLiteral<"base64">; }, "strip", z.ZodTypeAny, { type: "base64"; data: string; media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp"; }, { type: "base64"; data: string; media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp"; }>; }, "strip", z.ZodTypeAny, { type: "image"; source: { type: "base64"; data: string; media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp"; }; }, { type: "image"; source: { type: "base64"; data: string; media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp"; }; }>, z.ZodObject<{ id: z.ZodString; type: z.ZodLiteral<"tool_use">; name: z.ZodString; input: z.ZodType<import("../jsonLiteralSchema").JSONLiteral, z.ZodTypeDef, import("../jsonLiteralSchema").JSONLiteral>; }, "strip", z.ZodTypeAny, { type: "tool_use"; name: string; id: string; input: import("../jsonLiteralSchema").JSONLiteral; }, { type: "tool_use"; name: string; id: string; input: import("../jsonLiteralSchema").JSONLiteral; }>, z.ZodObject<{ type: z.ZodLiteral<"tool_result">; tool_use_id: z.ZodString; content: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodUnion<[z.ZodObject<{ type: z.ZodLiteral<"text">; text: z.ZodString; }, "strip", z.ZodTypeAny, { text: string; type: "text"; }, { text: string; type: "text"; }>, z.ZodObject<{ type: z.ZodLiteral<"image">; source: z.ZodObject<{ data: z.ZodString; media_type: z.ZodEnum<["image/jpeg", "image/png", "image/gif", "image/webp"]>; type: z.ZodLiteral<"base64">; }, "strip", z.ZodTypeAny, { type: "base64"; data: string; media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp"; }, { type: "base64"; data: string; media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp"; }>; }, "strip", z.ZodTypeAny, { type: "image"; source: { type: "base64"; data: string; media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp"; }; }, { type: "image"; source: { type: "base64"; data: string; media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp"; }; }>]>, "many">]>; is_error: z.ZodOptional<z.ZodBoolean>; }, "strip", z.ZodTypeAny, { type: "tool_result"; content: string | ({ text: string; type: "text"; } | { type: "image"; source: { type: "base64"; data: string; media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp"; }; })[]; tool_use_id: string; is_error?: boolean | undefined; }, { type: "tool_result"; content: string | ({ text: string; type: "text"; } | { type: "image"; source: { type: "base64"; data: string; media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp"; }; })[]; tool_use_id: string; is_error?: boolean | undefined; }>]>, "many">]>; }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ role: z.ZodEnum<["system", "developer", "user", "assistant", "model", "ai", "tool"]>; content: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{ type: z.ZodLiteral<"text">; text: z.ZodString; }, "strip", z.ZodTypeAny, { text: string; type: "text"; }, { text: string; type: "text"; }>, z.ZodObject<{ type: z.ZodLiteral<"tool_call">; tool_call_id: z.ZodString; tool_call: z.ZodObject<{ type: z.ZodLiteral<"function">; name: z.ZodString; arguments: z.ZodString; }, "strip", z.ZodTypeAny, { type: "function"; name: string; arguments: string; }, { type: "function"; name: string; arguments: string; }>; }, "strip", z.ZodTypeAny, { tool_call: { type: "function"; name: string; arguments: string; }; type: "tool_call"; tool_call_id: string; }, { tool_call: { type: "function"; name: string; arguments: string; }; type: "tool_call"; tool_call_id: string; }>, z.ZodObject<{ type: z.ZodLiteral<"tool_result">; tool_call_id: z.ZodString; tool_result: z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodArray<z.ZodUnknown, "many">]>; }, "strip", z.ZodTypeAny, { tool_result: string | number | boolean | unknown[] | Record<string, unknown> | null; type: "tool_result"; tool_call_id: string; }, { tool_result: string | number | boolean | unknown[] | Record<string, unknown> | null; type: "tool_result"; tool_call_id: string; }>]>, "many">]>; }, "strip", z.ZodTypeAny, { content: string | ({ text: string; type: "text"; } | { tool_call: { type: "function"; name: string; arguments: string; }; type: "tool_call"; tool_call_id: string; } | { tool_result: string | number | boolean | unknown[] | Record<string, unknown> | null; type: "tool_result"; tool_call_id: string; })[]; role: "user" | "assistant" | "model" | "ai" | "tool" | "system" | "developer"; }, { content: string | ({ text: string; type: "text"; } | { tool_call: { type: "function"; name: string; arguments: string; }; type: "tool_call"; tool_call_id: string; } | { tool_result: string | number | boolean | unknown[] | Record<string, unknown> | null; type: "tool_result"; tool_call_id: string; })[]; role: "user" | "assistant" | "model" | "ai" | "tool" | "system" | "developer"; }>, z.ZodDiscriminatedUnion<"role", [z.ZodObject<{ role: z.ZodLiteral<"system">; content: z.ZodString; }, "strip", z.ZodTypeAny, { content: string; role: "system"; }, { content: string; role: "system"; }>, z.ZodObject<{ role: z.ZodLiteral<"user">; content: z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodObject<{ type: z.ZodLiteral<"text">; text: z.ZodString; }, "strip", z.ZodTypeAny, { text: string; type: "text"; }, { text: string; type: "text"; }>, z.ZodObject<{ type: z.ZodLiteral<"image">; image: z.ZodString; mimeType: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { type: "image"; image: string; mimeType?: string | undefined; }, { type: "image"; image: string; mimeType?: string | undefined; }>]>, "many">, z.ZodString]>; }, "strip", z.ZodTypeAny, { content: string | ({ text: string; type: "text"; } | { type: "image"; image: string; mimeType?: string | undefined; })[]; role: "user"; }, { content: string | ({ text: string; type: "text"; } | { type: "image"; image: string; mimeType?: string | undefined; })[]; role: "user"; }>, z.ZodObject<{ role: z.ZodLiteral<"assistant">; content: z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodObject<{ type: z.ZodLiteral<"text">; text: z.ZodString; }, "strip", z.ZodTypeAny, { text: string; type: "text"; }, { text: string; type: "text"; }>, z.ZodObject<{ type: z.ZodLiteral<"tool-call">; toolCallId: z.ZodString; toolName: z.ZodString; input: z.ZodType<import("../jsonLiteralSchema").JSONLiteral, z.ZodTypeDef, import("../jsonLiteralSchema").JSONLiteral>; }, "strip", z.ZodTypeAny, { type: "tool-call"; input: import("../jsonLiteralSchema").JSONLiteral; toolCallId: string; toolName: string; }, { type: "tool-call"; input: import("../jsonLiteralSchema").JSONLiteral; toolCallId: string; toolName: string; }>]>, "many">, z.ZodString]>; }, "strip", z.ZodTypeAny, { content: string | ({ text: string; type: "text"; } | { type: "tool-call"; input: import("../jsonLiteralSchema").JSONLiteral; toolCallId: string; toolName: string; })[]; role: "assistant"; }, { content: string | ({ text: string; type: "text"; } | { type: "tool-call"; input: import("../jsonLiteralSchema").JSONLiteral; toolCallId: string; toolName: string; })[]; role: "assistant"; }>, z.ZodObject<{ role: z.ZodLiteral<"tool">; content: z.ZodArray<z.ZodObject<{ type: z.ZodLiteral<"tool-result">; toolCallId: z.ZodString; toolName: z.ZodString; output: z.ZodObject<{ type: z.ZodLiteral<"text">; value: z.ZodString; }, "strip", z.ZodTypeAny, { value: string; type: "text"; }, { value: string; type: "text"; }>; }, "strip", z.ZodTypeAny, { type: "tool-result"; output: { value: string; type: "text"; }; toolCallId: string; toolName: string; }, { type: "tool-result"; output: { value: string; type: "text"; }; toolCallId: string; toolName: string; }>, "many">; }, "strip", z.ZodTypeAny, { content: { type: "tool-result"; output: { value: string; type: "text"; }; toolCallId: string; toolName: string; }[]; role: "tool"; }, { content: { type: "tool-result"; output: { value: string; type: "text"; }; toolCallId: string; toolName: string; }[]; role: "tool"; }>]>]>; export type LlmProviderMessage = z.infer<typeof llmProviderMessageSchema>; /** * Union of all tool call formats * * This is useful for functions that need to accept any tool call format */ export declare const llmProviderToolCallSchema: z.ZodUnion<[z.ZodObject<{ type: z.ZodEffects<z.ZodOptional<z.ZodLiteral<"function">>, "function", "function" | undefined>; id: z.ZodString; function: z.ZodObject<{ name: z.ZodString; arguments: z.ZodString; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ name: z.ZodString; arguments: z.ZodString; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ name: z.ZodString; arguments: z.ZodString; }, z.ZodTypeAny, "passthrough">>; }, "strip", z.ZodTypeAny, { function: { name: string; arguments: string; } & { [k: string]: unknown; }; type: "function"; id: string; }, { function: { name: string; arguments: string; } & { [k: string]: unknown; }; id: string; type?: "function" | undefined; }>, z.ZodObject<{ id: z.ZodString; type: z.ZodLiteral<"tool_use">; name: z.ZodString; input: z.ZodType<import("../jsonLiteralSchema").JSONLiteral, z.ZodTypeDef, import("../jsonLiteralSchema").JSONLiteral>; }, "strip", z.ZodTypeAny, { type: "tool_use"; name: string; id: string; input: import("../jsonLiteralSchema").JSONLiteral; }, { type: "tool_use"; name: string; id: string; input: import("../jsonLiteralSchema").JSONLiteral; }>, z.ZodObject<{ type: z.ZodLiteral<"tool_call">; tool_call_id: z.ZodString; tool_call: z.ZodObject<{ type: z.ZodLiteral<"function">; name: z.ZodString; arguments: z.ZodString; }, "strip", z.ZodTypeAny, { type: "function"; name: string; arguments: string; }, { type: "function"; name: string; arguments: string; }>; }, "strip", z.ZodTypeAny, { tool_call: { type: "function"; name: string; arguments: string; }; type: "tool_call"; tool_call_id: string; }, { tool_call: { type: "function"; name: string; arguments: string; }; type: "tool_call"; tool_call_id: string; }>, z.ZodObject<{ type: z.ZodLiteral<"tool-call">; toolCallId: z.ZodString; toolName: z.ZodString; input: z.ZodType<import("../jsonLiteralSchema").JSONLiteral, z.ZodTypeDef, import("../jsonLiteralSchema").JSONLiteral>; }, "strip", z.ZodTypeAny, { type: "tool-call"; input: import("../jsonLiteralSchema").JSONLiteral; toolCallId: string; toolName: string; }, { type: "tool-call"; input: import("../jsonLiteralSchema").JSONLiteral; toolCallId: string; toolName: string; }>]>; export type LlmProviderToolCall = z.infer<typeof llmProviderToolCallSchema>; /** * A union of all the lists of tool call formats * * This is useful for parsing all of the tool calls in a message */ export declare const llmProviderToolCallsSchema: z.ZodArray<z.ZodUnion<[z.ZodObject<{ type: z.ZodEffects<z.ZodOptional<z.ZodLiteral<"function">>, "function", "function" | undefined>; id: z.ZodString; function: z.ZodObject<{ name: z.ZodString; arguments: z.ZodString; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ name: z.ZodString; arguments: z.ZodString; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ name: z.ZodString; arguments: z.ZodString; }, z.ZodTypeAny, "passthrough">>; }, "strip", z.ZodTypeAny, { function: { name: string; arguments: string; } & { [k: string]: unknown; }; type: "function"; id: string; }, { function: { name: string; arguments: string; } & { [k: string]: unknown; }; id: string; type?: "function" | undefined; }>, z.ZodObject<{ id: z.ZodString; type: z.ZodLiteral<"tool_use">; name: z.ZodString; input: z.ZodType<import("../jsonLiteralSchema").JSONLiteral, z.ZodTypeDef, import("../jsonLiteralSchema").JSONLiteral>; }, "strip", z.ZodTypeAny, { type: "tool_use"; name: string; id: string; input: import("../jsonLiteralSchema").JSONLiteral; }, { type: "tool_use"; name: string; id: string; input: import("../jsonLiteralSchema").JSONLiteral; }>, z.ZodObject<{ type: z.ZodLiteral<"tool_call">; tool_call_id: z.ZodString; tool_call: z.ZodObject<{ type: z.ZodLiteral<"function">; name: z.ZodString; arguments: z.ZodString; }, "strip", z.ZodTypeAny, { type: "function"; name: string; arguments: string; }, { type: "function"; name: string; arguments: string; }>; }, "strip", z.ZodTypeAny, { tool_call: { type: "function"; name: string; arguments: string; }; type: "tool_call"; tool_call_id: string; }, { tool_call: { type: "function"; name: string; arguments: string; }; type: "tool_call"; tool_call_id: string; }>, z.ZodObject<{ type: z.ZodLiteral<"tool-call">; toolCallId: z.ZodString; toolName: z.ZodString; input: z.ZodType<import("../jsonLiteralSchema").JSONLiteral, z.ZodTypeDef, import("../jsonLiteralSchema").JSONLiteral>; }, "strip", z.ZodTypeAny, { type: "tool-call"; input: import("../jsonLiteralSchema").JSONLiteral; toolCallId: string; toolName: string; }, { type: "tool-call"; input: import("../jsonLiteralSchema").JSONLiteral; toolCallId: string; toolName: string; }>]>, "many">; export type LlmProviderToolCalls = z.infer<typeof llmProviderToolCallsSchema>; /** * A schema for a tool call that is not in the first class supported format * * This is used to heuristically find the id, name, and arguments of a tool call * based on common patterns in tool calls, allowing us to poke around in an unknown tool call * and extract the id, name, and arguments */ export declare const toolCallHeuristicSchema: z.ZodObject<{ id: z.ZodOptional<z.ZodString>; name: z.ZodOptional<z.ZodString>; arguments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>; function: z.ZodOptional<z.ZodObject<{ name: z.ZodOptional<z.ZodString>; arguments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>; }, "strip", z.ZodTypeAny, { name?: string | undefined; arguments?: Record<string, unknown> | undefined; }, { name?: string | undefined; arguments?: Record<string, unknown> | undefined; }>>; }, "strip", z.ZodTypeAny, { function?: { name?: string | undefined; arguments?: Record<string, unknown> | undefined; } | undefined; name?: string | undefined; id?: string | undefined; arguments?: Record<string, unknown> | undefined; }, { function?: { name?: string | undefined; arguments?: Record<string, unknown> | undefined; } | undefined; name?: string | undefined; id?: string | undefined; arguments?: Record<string, unknown> | undefined; }>; export declare const llmProviderToolChoiceSchema: z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodLiteral<"none">, z.ZodLiteral<"required">, z.ZodObject<{ type: z.ZodLiteral<"function">; function: z.ZodObject<{ name: z.ZodString; }, "strip", z.ZodTypeAny, { name: string; }, { name: string; }>; }, "strip", z.ZodTypeAny, { function: { name: string; }; type: "function"; }, { function: { name: string; }; type: "function"; }>]>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{ type: z.ZodLiteral<"tool">; name: z.ZodString; }, "strip", z.ZodTypeAny, { type: "tool"; name: string; }, { type: "tool"; name: string; }>, z.ZodObject<{ type: z.ZodLiteral<"auto">; }, "strip", z.ZodTypeAny, { type: "auto"; }, { type: "auto"; }>, z.ZodObject<{ type: z.ZodLiteral<"any">; }, "strip", z.ZodTypeAny, { type: "any"; }, { type: "any"; }>]>, z.ZodUnion<[z.ZodObject<{ type: z.ZodLiteral<"none">; }, "strip", z.ZodTypeAny, { type: "none"; }, { type: "none"; }>, z.ZodObject<{ type: z.ZodLiteral<"zero_or_more">; }, "strip", z.ZodTypeAny, { type: "zero_or_more"; }, { type: "zero_or_more"; }>, z.ZodObject<{ type: z.ZodLiteral<"one_or_more">; }, "strip", z.ZodTypeAny, { type: "one_or_more"; }, { type: "one_or_more"; }>, z.ZodObject<{ type: z.ZodLiteral<"specific_function">; function_name: z.ZodString; }, "strip", z.ZodTypeAny, { type: "specific_function"; function_name: string; }, { type: "specific_function"; function_name: string; }>]>, z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodLiteral<"none">, z.ZodLiteral<"required">, z.ZodObject<{ type: z.ZodLiteral<"tool">; toolName: z.ZodString; }, "strip", z.ZodTypeAny, { type: "tool"; toolName: string; }, { type: "tool"; toolName: string; }>]>]>; export type LlmProviderToolChoice = z.infer<typeof llmProviderToolChoiceSchema>; /** * Union of all tool call formats * * This is useful for functions that need to accept any tool definition format */ export declare const llmProviderToolDefinitionSchema: z.ZodUnion<[z.ZodObject<{ type: z.ZodLiteral<"function">; function: z.ZodObject<{ name: z.ZodString; description: z.ZodOptional<z.ZodString>; parameters: z.ZodObject<{ type: z.ZodLiteral<"object">; properties: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{ type: z.ZodEnum<["string", "number", "boolean", "object", "array", "null", "integer"]>; description: z.ZodOptional<z.ZodString>; enum: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ type: z.ZodEnum<["string", "number", "boolean", "object", "array", "null", "integer"]>; description: z.ZodOptional<z.ZodString>; enum: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ type: z.ZodEnum<["string", "number", "boolean", "object", "array", "null", "integer"]>; description: z.ZodOptional<z.ZodString>; enum: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ anyOf: z.ZodArray<z.ZodObject<{ type: z.ZodEnum<["string", "number", "boolean", "object", "array", "null", "integer"]>; description: z.ZodOptional<z.ZodString>; enum: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ type: z.ZodEnum<["string", "number", "boolean", "object", "array", "null", "integer"]>; description: z.ZodOptional<z.ZodString>; enum: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ type: z.ZodEnum<["string", "number", "boolean", "object", "array", "null", "integer"]>; description: z.ZodOptional<z.ZodString>; enum: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, z.ZodTypeAny, "passthrough">>, "many">; }, "strip", z.ZodTypeAny, { anyOf: z.objectOutputType<{ type: z.ZodEnum<["string", "number", "boolean", "object", "array", "null", "integer"]>; description: z.ZodOptional<z.ZodString>; enum: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, z.ZodTypeAny, "passthrough">[]; }, { anyOf: z.objectInputType<{ type: z.ZodEnum<["string", "number", "boolean", "object", "array", "null", "integer"]>; description: z.ZodOptional<z.ZodString>; enum: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, z.ZodTypeAny, "passthrough">[]; }>]>>; required: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; additionalProperties: z.ZodOptional<z.ZodBoolean>; } & { strict: z.ZodOptional<z.ZodBoolean>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ type: z.ZodLiteral<"object">; properties: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{ type: z.ZodEnum<["string", "number", "boolean", "object", "array", "null", "integer"]>; description: z.ZodOptional<z.ZodString>; enum: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ type: z.ZodEnum<["string", "number", "boolean", "object", "array", "null", "integer"]>; description: z.ZodOptional<z.ZodString>; enum: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ type: z.ZodEnum<["string", "number", "boolean", "object", "array", "null", "integer"]>; description: z.ZodOptional<z.ZodString>; enum: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ anyOf: z.ZodArray<z.ZodObject<{ type: z.ZodEnum<["string", "number", "boolean", "object", "array", "null", "integer"]>; description: z.ZodOptional<z.ZodString>; enum: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ type: z.ZodEnum<["string", "number", "boolean", "object", "array", "null", "integer"]>; description: z.ZodOptional<z.ZodString>; enum: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ type: z.ZodEnum<["string", "number", "boolean", "object", "array", "null", "integer"]>; description: z.ZodOptional<z.ZodString>; enum: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, z.ZodTypeAny, "passthrough">>, "many">; }, "strip", z.ZodTypeAny, { anyOf: z.objectOutputType<{ type: z.ZodEnum<["string", "number", "boolean", "object", "array", "null", "integer"]>; description: z.ZodOptional<z.ZodString>; enum: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, z.ZodTypeAny, "passthrough">[]; }, { anyOf: z.objectInputType<{ type: z.ZodEnum<["string", "number", "boolean", "object", "array", "null", "integer"]>; description: z.ZodOptional<z.ZodString>; enum: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, z.ZodTypeAny, "passthrough">[]; }>]>>; required: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; additionalProperties: z.ZodOptional<z.ZodBoolean>; } & { strict: z.ZodOptional<z.ZodBoolean>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ type: z.ZodLiteral<"object">; properties: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{ type: z.ZodEnum<["string", "number", "boolean", "object", "array", "null", "integer"]>; description: z.ZodOptional<z.ZodString>; enum: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ type: z.ZodEnum<["string", "number", "boolean", "object", "array", "null", "integer"]>; description: z.ZodOptional<z.ZodString>; enum: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ type: z.ZodEnum<["string", "number", "boolean", "object", "array", "null", "integer"]>; description: z.ZodOptional<z.ZodString>; enum: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{ anyOf: z.ZodArray<z.ZodObject<{ type: z.ZodEnum<["string", "number", "boolean", "object", "array", "null", "integer"]>; description: z.ZodOptional<z.ZodString>; enum: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ type: z.ZodEnum<["string", "number", "boolean", "object", "array", "null", "integer"]>; description: z.ZodOptional<z.ZodString>; enum: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ type: z.ZodEnum<["string", "number", "boolean", "object", "array", "null", "integer"]>; description: z.ZodOptional<z.ZodString>; enum: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, z.ZodTypeAny, "passthrough">>, "many">; }, "strip", z.ZodTypeAny, { anyOf: z.objectOutputType<{ type: z.ZodEnum<["string", "number", "boolean", "object", "array", "null", "integer"]>; description: z.ZodOptional<z.ZodString>; enum: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, z.ZodTypeAny, "passthrough">[]; }, { anyOf: z.objectInputType<{ type: z.ZodEnum<["string", "number", "boolean", "object", "array", "null", "integer"]>; description: z.ZodOptional<z.ZodString>; enum: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, z.ZodTypeAny, "passthrough">[]; }>]>>; required: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; additionalProperties: z.ZodOptional<z.ZodBoolean>; } & { strict: z.ZodOptional<z.ZodBoolean>; }, z.ZodTypeAny, "passthrough">>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ name: z.ZodString; description: z.ZodOptional<z.ZodString>; param