@arizeai/phoenix-client
Version:
A client for the Phoenix API
733 lines • 22.4 kB
TypeScript
import z from "zod";
export declare const openAIMessageRoleSchema: z.ZodEnum<["system", "user", "assistant", "developer", "tool"]>;
export type OpenAIMessageRole = z.infer<typeof openAIMessageRoleSchema>;
export declare const openAIMessageSchema: 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">>]>;
export type OpenAIMessage = z.infer<typeof openAIMessageSchema>;
export declare const openAIMessagesSchema: z.ZodArray<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">>]>, "many">;
//# sourceMappingURL=messageSchemas.d.ts.map