Просмотр исходного кода

fix(provider): pass apiKey to createUnified for Cloudflare AI Gateway (#32052)

Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com>
Keefe Tang 2 месяцев назад
Родитель
Сommit
8fd5753f76

+ 1 - 1
packages/core/src/plugin/provider/cloudflare-ai-gateway.ts

@@ -24,7 +24,7 @@ export const CloudflareAIGatewayPlugin = PluginV2.define({
           apiKey: config.apiKey,
           options: gatewayOptions(evt.options, metadata),
         } as any)
-        const unified = createUnified()
+        const unified = createUnified({ apiKey: config.apiKey })
         evt.sdk = {
           languageModel(modelID: string) {
             return gateway(unified(modelID))

+ 1 - 1
packages/opencode/src/provider/provider.ts

@@ -816,7 +816,7 @@ function custom(dep: CustomDep): Record<string, CustomLoader> {
         apiKey: apiToken,
         ...(Object.values(opts).some((v) => v !== undefined) ? { options: opts } : {}),
       })
-      const unified = createUnified()
+      const unified = createUnified({ apiKey: apiToken })
 
       return {
         autoload: true,