{"version":3,"file":"cloudflare-ai-gateway.d.ts","sourceRoot":"","sources":["../../src/providers/cloudflare-ai-gateway.ts"],"names":[],"mappings":"AAGA,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AAK7D,KAAK,sBAAsB,GAAG,oBAAoB,GAAG,oBAAoB,GAAG,kBAAkB,CAAC;AAE/F,wBAAgB,2BAA2B,IAAI,QAAQ,CAAC,sBAAsB,CAAC,CAgB9E","sourcesContent":["import { anthropicMessagesApi } from \"../api/anthropic-messages.lazy.ts\";\nimport { openAICompletionsApi } from \"../api/openai-completions.lazy.ts\";\nimport { openAIResponsesApi } from \"../api/openai-responses.lazy.ts\";\nimport { createProvider, type Provider } from \"../models.ts\";\nimport { CLOUDFLARE_AI_GATEWAY_MODELS } from \"./cloudflare-ai-gateway.models.ts\";\nimport { cloudflareAIGatewayAuth } from \"./cloudflare-auth.ts\";\nimport { cloudflareStreams } from \"./cloudflare-stream.ts\";\n\ntype CloudflareAIGatewayApi = \"anthropic-messages\" | \"openai-completions\" | \"openai-responses\";\n\nexport function cloudflareAIGatewayProvider(): Provider<CloudflareAIGatewayApi> {\n\t// The api map is pinned to all three APIs: models.dev's gateway catalog drops and\n\t// restores `workers-ai/*` (openai-completions) entries over time, and inference from\n\t// `models` alone would otherwise reject the openai-completions entry whenever the\n\t// generated catalog happens to contain none.\n\treturn createProvider<CloudflareAIGatewayApi>({\n\t\tid: \"cloudflare-ai-gateway\",\n\t\tname: \"Cloudflare AI Gateway\",\n\t\tauth: { apiKey: cloudflareAIGatewayAuth() },\n\t\tmodels: Object.values(CLOUDFLARE_AI_GATEWAY_MODELS),\n\t\tapi: {\n\t\t\t\"anthropic-messages\": cloudflareStreams(anthropicMessagesApi()),\n\t\t\t\"openai-completions\": cloudflareStreams(openAICompletionsApi()),\n\t\t\t\"openai-responses\": cloudflareStreams(openAIResponsesApi()),\n\t\t},\n\t});\n}\n"]}