export type GetApiApiFurusatoRecommendArgs = {prefecture?: string | undefined, category?: string | undefined, subcategory?: string | undefined, budget_min_jpy?: number | undefined, budget_max_jpy?: number | undefined, notes?: string | undefined, limit?: number | undefined}; export type GetApiApiFurusatoRecommendOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * AI rerank 推薦 ($0.50 paid) * * GET /api/furusato/recommend */ export const getApiApiFurusatoRecommend = async (args: GetApiApiFurusatoRecommendArgs, options?: GetApiApiFurusatoRecommendOptions) => { const {baseUrl = "https://localgov.jp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.prefecture != null) query.append("prefecture", String(args.prefecture)) if (args.category != null) query.append("category", String(args.category)) if (args.subcategory != null) query.append("subcategory", String(args.subcategory)) if (args.budget_min_jpy != null) query.append("budget_min_jpy", String(args.budget_min_jpy)) if (args.budget_max_jpy != null) query.append("budget_max_jpy", String(args.budget_max_jpy)) if (args.notes != null) query.append("notes", String(args.notes)) if (args.limit != null) query.append("limit", String(args.limit)) const url = `${baseUrl.replace(/\/+$/, '')}/api/furusato/recommend${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };