@arizeai/phoenix-client
Version:
A client for the Phoenix API
795 lines • 27.3 kB
TypeScript
import z from "zod";
/**
*
* Anthropic Message Schemas
*
*/
export declare const anthropicMessageRoleSchema: z.ZodEnum<["user", "assistant"]>;
export type AnthropicMessageRole = z.infer<typeof anthropicMessageRoleSchema>;
/**
* TODO: rewrite as discriminated union
*/
export declare const anthropicMessageSchema: 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.js").JSONLiteral, z.ZodTypeDef, import("../../jsonLiteralSchema.js").JSONLiteral>;
}, "strip", z.ZodTypeAny, {
type: "tool_use";
name: string;
id: string;
input: import("../../jsonLiteralSchema.js").JSONLiteral;
}, {
type: "tool_use";
name: string;
id: string;
input: import("../../jsonLiteralSchema.js").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.js").JSONLiteral, z.ZodTypeDef, import("../../jsonLiteralSchema.js").JSONLiteral>;
}, "strip", z.ZodTypeAny, {
type: "tool_use";
name: string;
id: string;
input: import("../../jsonLiteralSchema.js").JSONLiteral;
}, {
type: "tool_use";
name: string;
id: string;
input: import("../../jsonLiteralSchema.js").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.js").JSONLiteral, z.ZodTypeDef, import("../../jsonLiteralSchema.js").JSONLiteral>;
}, "strip", z.ZodTypeAny, {
type: "tool_use";
name: string;
id: string;
input: import("../../jsonLiteralSchema.js").JSONLiteral;
}, {
type: "tool_use";
name: string;
id: string;
input: import("../../jsonLiteralSchema.js").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">>;
export type AnthropicMessage = z.infer<typeof anthropicMessageSchema>;
export declare const anthropicMessagesSchema: z.ZodArray<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.js").JSONLiteral, z.ZodTypeDef, import("../../jsonLiteralSchema.js").JSONLiteral>;
}, "strip", z.ZodTypeAny, {
type: "tool_use";
name: string;
id: string;
input: import("../../jsonLiteralSchema.js").JSONLiteral;
}, {
type: "tool_use";
name: string;
id: string;
input: import("../../jsonLiteralSchema.js").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.js").JSONLiteral, z.ZodTypeDef, import("../../jsonLiteralSchema.js").JSONLiteral>;
}, "strip", z.ZodTypeAny, {
type: "tool_use";
name: string;
id: string;
input: import("../../jsonLiteralSchema.js").JSONLiteral;
}, {
type: "tool_use";
name: string;
id: string;
input: import("../../jsonLiteralSchema.js").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.js").JSONLiteral, z.ZodTypeDef, import("../../jsonLiteralSchema.js").JSONLiteral>;
}, "strip", z.ZodTypeAny, {
type: "tool_use";
name: string;
id: string;
input: import("../../jsonLiteralSchema.js").JSONLiteral;
}, {
type: "tool_use";
name: string;
id: string;
input: import("../../jsonLiteralSchema.js").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">>, "many">;
export declare const anthropicMessagesJSONSchema: import("zod-to-json-schema").JsonSchema7Type & {
$schema?: string | undefined;
definitions?: {
[key: string]: import("zod-to-json-schema").JsonSchema7Type;
} | undefined;
};
//# sourceMappingURL=messageSchemas.d.ts.map