@arizeai/phoenix-client
Version:
A client for the Phoenix API
19 lines (16 loc) • 444 B
text/typescript
import z from "zod";
/**
* OpenAI's tool choice schema
*
* @see https://platform.openAI.com/docs/api-reference/chat/create#chat-create-tool_choice
*/
export const openAIToolChoiceSchema = z.union([
z.literal("auto"),
z.literal("none"),
z.literal("required"),
z.object({
type: z.literal("function"),
function: z.object({ name: z.string() }),
}),
]);
export type OpenaiToolChoice = z.infer<typeof openAIToolChoiceSchema>;