UNPKG

@arizeai/phoenix-client

Version:
52 lines 2.33 kB
import z from "zod"; export declare const textPartSchema: z.ZodObject<{ type: z.ZodLiteral<"text">; text: z.ZodString; }, z.core.$strip>; export type TextPart = z.infer<typeof textPartSchema>; export declare const toolCallPartSchema: 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; }, z.core.$strip>; }, z.core.$strip>; export type ToolCallPart = z.infer<typeof toolCallPartSchema>; export declare const toolResultPartSchema: z.ZodObject<{ type: z.ZodLiteral<"tool_result">; tool_call_id: z.ZodString; tool_result: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodArray<z.ZodUnknown>]>; }, z.core.$strip>; export type ToolResultPart = z.infer<typeof toolResultPartSchema>; export declare const phoenixContentPartSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ type: z.ZodLiteral<"text">; text: z.ZodString; }, z.core.$strip>, 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; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"tool_result">; tool_call_id: z.ZodString; tool_result: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodArray<z.ZodUnknown>]>; }, z.core.$strip>], "type">; export type PhoenixContentPart = z.infer<typeof phoenixContentPartSchema>; export declare const asTextPart: (maybePart: unknown) => TextPart | null; export declare const makeTextPart: (text?: string | null) => { type: "text"; text: string; } | null; export declare const asToolCallPart: (maybePart: unknown) => ToolCallPart | null; export declare const asToolResultPart: (maybePart: unknown) => ToolResultPart | null; export declare const makeToolResultPart: (toolCallId?: string | null, result?: unknown) => { type: "tool_result"; tool_call_id: string; tool_result: string | number | boolean | unknown[] | Record<string, unknown> | null; } | null; //# sourceMappingURL=messagePartSchemas.d.ts.map