workers-ai-provider
Version:
Workers AI Provider for the vercel AI SDK
1 lines • 1.1 kB
Source Map (JSON)
{"version":3,"file":"google.mjs","names":[],"sources":["../src/google.ts"],"sourcesContent":["import { createGoogleGenerativeAI } from \"@ai-sdk/google\";\nimport type { ProviderPlugin } from \"./gateway-delegate\";\n\n/**\n * Google (Gemini) provider plugin for the gateway delegate. Pass to\n * `createGatewayDelegate({ providers: [google] })` to handle `\"google/<model>\"`\n * (Google AI Studio) and `\"google-vertex/<model>\"` slugs.\n *\n * Requires `@ai-sdk/google` (an optional peer dependency — install it yourself).\n */\nexport const google: ProviderPlugin = {\n\twireFormat: \"google\",\n\tcreate: ({ modelId, fetch, baseURL }) =>\n\t\t// apiKey is a placeholder — the gateway handles auth (unified billing / BYOK)\n\t\t// and the delegate strips the x-goog-api-key header on the gateway path.\n\t\tcreateGoogleGenerativeAI({ apiKey: \"unused\", fetch, ...(baseURL ? { baseURL } : {}) })(\n\t\t\tmodelId,\n\t\t),\n};\n"],"mappings":";;;;;;;;;AAUA,MAAa,SAAyB;CACrC,YAAY;CACZ,SAAS,EAAE,SAAS,OAAO,cAG1B,yBAAyB;EAAE,QAAQ;EAAU;EAAO,GAAI,UAAU,EAAE,QAAQ,IAAI,CAAC;CAAG,CAAC,CAAC,CACrF,OACD;AACF"}