@arizeai/phoenix-client
Version:
A client for the Phoenix API
256 lines • 9.5 kB
TypeScript
export declare const phoenixMessagePartToOpenAI: import("zod").ZodPipe<import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
type: import("zod").ZodLiteral<"text">;
text: import("zod").ZodString;
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
type: import("zod").ZodLiteral<"tool_call">;
tool_call_id: import("zod").ZodString;
tool_call: import("zod").ZodObject<{
type: import("zod").ZodLiteral<"function">;
name: import("zod").ZodString;
arguments: import("zod").ZodString;
}, import("zod/v4/core").$strip>;
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
type: import("zod").ZodLiteral<"tool_result">;
tool_call_id: import("zod").ZodString;
tool_result: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber, import("zod").ZodBoolean, import("zod").ZodNull, import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>, import("zod").ZodArray<import("zod").ZodUnknown>]>;
}, import("zod/v4/core").$strip>], "type">, import("zod").ZodTransform<{
type: "text";
text: string;
} | null, {
type: "text";
text: string;
} | {
type: "tool_call";
tool_call_id: string;
tool_call: {
type: "function";
name: string;
arguments: string;
};
} | {
type: "tool_result";
tool_call_id: string;
tool_result: string | number | boolean | unknown[] | Record<string, unknown> | null;
}>>;
/**
* Spoke → Hub: Convert a Prompt message to OpenAI format
*/
export declare const phoenixMessageToOpenAI: import("zod").ZodPipe<import("zod").ZodObject<{
role: import("zod").ZodEnum<{
user: "user";
assistant: "assistant";
model: "model";
ai: "ai";
tool: "tool";
system: "system";
developer: "developer";
}>;
content: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodArray<import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
type: import("zod").ZodLiteral<"text">;
text: import("zod").ZodString;
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
type: import("zod").ZodLiteral<"tool_call">;
tool_call_id: import("zod").ZodString;
tool_call: import("zod").ZodObject<{
type: import("zod").ZodLiteral<"function">;
name: import("zod").ZodString;
arguments: import("zod").ZodString;
}, import("zod/v4/core").$strip>;
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
type: import("zod").ZodLiteral<"tool_result">;
tool_call_id: import("zod").ZodString;
tool_result: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber, import("zod").ZodBoolean, import("zod").ZodNull, import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>, import("zod").ZodArray<import("zod").ZodUnknown>]>;
}, import("zod/v4/core").$strip>], "type">>]>;
}, import("zod/v4/core").$strip>, import("zod").ZodTransform<{
role: "tool";
content: string;
tool_call_id: string;
tool_calls?: undefined;
} | {
role: "system";
content: {
type: "text";
text: string;
}[];
tool_call_id?: undefined;
tool_calls?: undefined;
} | {
role: "user";
content: {
type: "text";
text: string;
}[];
tool_call_id?: undefined;
tool_calls?: undefined;
} | {
role: "assistant";
content: {
type: "text";
text: string;
}[];
tool_calls: {
type: "function";
id: string;
function: {
[x: string]: unknown;
name: string;
arguments: string;
};
}[] | undefined;
tool_call_id?: undefined;
}, {
role: "user" | "assistant" | "model" | "ai" | "tool" | "system" | "developer";
content: string | ({
type: "text";
text: string;
} | {
type: "tool_call";
tool_call_id: string;
tool_call: {
type: "function";
name: string;
arguments: string;
};
} | {
type: "tool_result";
tool_call_id: string;
tool_result: string | number | boolean | unknown[] | Record<string, unknown> | null;
})[];
}>>;
export declare const phoenixResponseFormatToOpenAI: import("zod").ZodPipe<import("zod").ZodObject<{
type: import("zod").ZodLiteral<"json_schema">;
json_schema: import("zod").ZodObject<{
name: import("zod").ZodString;
description: import("zod").ZodOptional<import("zod").ZodString>;
schema: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
strict: import("zod").ZodOptional<import("zod").ZodBoolean>;
}, import("zod/v4/core").$strip>;
}, import("zod/v4/core").$strip>, import("zod").ZodTransform<{
type: "json_schema";
json_schema: {
name: string;
schema: {
[x: string]: unknown;
type: "object";
properties: Record<string, {
[x: string]: unknown;
type: "string" | "number" | "boolean" | "object" | "null" | "array" | "integer";
description?: string | undefined;
enum?: string[] | undefined;
} | {
anyOf: {
[x: string]: unknown;
type: "string" | "number" | "boolean" | "object" | "null" | "array" | "integer";
description?: string | undefined;
enum?: string[] | undefined;
}[];
}>;
required?: string[] | undefined;
additionalProperties?: boolean | undefined;
};
description?: string | undefined;
};
}, {
type: "json_schema";
json_schema: {
name: string;
description?: string | undefined;
schema?: Record<string, unknown> | undefined;
strict?: boolean | undefined;
};
}>>;
export declare const phoenixToolCallToOpenAI: import("zod").ZodPipe<import("zod").ZodObject<{
type: import("zod").ZodLiteral<"tool_call">;
tool_call_id: import("zod").ZodString;
tool_call: import("zod").ZodObject<{
type: import("zod").ZodLiteral<"function">;
name: import("zod").ZodString;
arguments: import("zod").ZodString;
}, import("zod/v4/core").$strip>;
}, import("zod/v4/core").$strip>, import("zod").ZodTransform<{
type: "function";
id: string;
function: {
[x: string]: unknown;
name: string;
arguments: string;
};
}, {
type: "tool_call";
tool_call_id: string;
tool_call: {
type: "function";
name: string;
arguments: string;
};
}>>;
export declare const phoenixToolDefinitionToOpenAI: import("zod").ZodPipe<import("zod").ZodObject<{
type: import("zod").ZodLiteral<"function">;
function: import("zod").ZodObject<{
name: import("zod").ZodString;
description: import("zod").ZodOptional<import("zod").ZodString>;
parameters: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
strict: import("zod").ZodOptional<import("zod").ZodBoolean>;
}, import("zod/v4/core").$strip>;
}, import("zod/v4/core").$strip>, import("zod").ZodTransform<{
[x: string]: unknown;
type: "function";
function: {
[x: string]: unknown;
name: string;
parameters: {
[x: string]: unknown;
type: "object";
properties: Record<string, {
[x: string]: unknown;
type: "string" | "number" | "boolean" | "object" | "null" | "array" | "integer";
description?: string | undefined;
enum?: string[] | undefined;
} | {
anyOf: {
[x: string]: unknown;
type: "string" | "number" | "boolean" | "object" | "null" | "array" | "integer";
description?: string | undefined;
enum?: string[] | undefined;
}[];
}>;
required?: string[] | undefined;
additionalProperties?: boolean | undefined;
strict?: boolean | undefined;
};
description?: string | undefined;
};
}, {
type: "function";
function: {
name: string;
description?: string | undefined;
parameters?: Record<string, unknown> | undefined;
strict?: boolean | undefined;
};
}>>;
export declare const phoenixToolChoiceToOpenAI: import("zod").ZodPipe<import("zod").ZodUnion<readonly [import("zod").ZodObject<{
type: import("zod").ZodLiteral<"none">;
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
type: import("zod").ZodLiteral<"zero_or_more">;
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
type: import("zod").ZodLiteral<"one_or_more">;
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
type: import("zod").ZodLiteral<"specific_function">;
function_name: import("zod").ZodString;
}, import("zod/v4/core").$strip>]>, import("zod").ZodTransform<"none" | "auto" | "required" | {
type: "function";
function: {
name: string;
};
}, {
type: "none";
} | {
type: "zero_or_more";
} | {
type: "one_or_more";
} | {
type: "specific_function";
function_name: string;
}>>;
//# sourceMappingURL=converters.d.ts.map