export type GetApiApiV1AiEmbeddingsCountArgs = {site?: string | undefined, contentType?: string | undefined, indexName?: string | undefined, language?: string | undefined, identifier?: string | undefined, inode?: string | undefined, fieldVar?: string | undefined}; export type GetApiApiV1AiEmbeddingsCountOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * GET /api/v1/ai/embeddings/count */ export const getApiApiV1AiEmbeddingsCount = async (args: GetApiApiV1AiEmbeddingsCountArgs, options: GetApiApiV1AiEmbeddingsCountOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/json") if (args.site != null) query.append("site", String(args.site)) if (args.contentType != null) query.append("contentType", String(args.contentType)) if (args.indexName != null) query.append("indexName", String(args.indexName)) if (args.language != null) query.append("language", String(args.language)) if (args.identifier != null) query.append("identifier", String(args.identifier)) if (args.inode != null) query.append("inode", String(args.inode)) if (args.fieldVar != null) query.append("fieldVar", String(args.fieldVar)) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/ai/embeddings/count${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 (await res.json()) as unknown };