import { z } from "zod";
export const ModelTypeSchema = z.enum([
"gpt-4o-search-preview",
"gpt-4o-mini-search-preview",
"gpt-5-search-api"
]);
export const UserLocationSchema = z.object({
type: z.literal("approximate").default("approximate").describe("Location type for web search results. Must be 'approximate'. This tells OpenAI to use approximate geolocation for search result personalization."),
country: z.string().optional().describe("Two-letter ISO country code (e.g., 'US', 'GB')"),
city: z.string().optional().describe("City name for localized results (e.g., 'London', 'Minneapolis')"),
region: z.string().optional().describe("State or region for localized results (e.g., 'California', 'Minnesota')"),
});
export const WebSearchToolParamsSchema = z.object({
input: z.string(),
model: ModelTypeSchema.optional(),
user_location: UserLocationSchema.optional(),
});
export type ModelType = z.infer<typeof ModelTypeSchema>;
export type UserLocation = z.infer<typeof UserLocationSchema>;
export type WebSearchToolParams = z.infer<typeof WebSearchToolParamsSchema>;