fix(provider): pass apiKey to createUnified for Cloudflare AI Gateway (#32052)
Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com>
This commit is contained in:
co-authored by
Aiden Cline
parent
273efdeee7
commit
8fd5753f76
@@ -24,7 +24,7 @@ export const CloudflareAIGatewayPlugin = PluginV2.define({
|
|||||||
apiKey: config.apiKey,
|
apiKey: config.apiKey,
|
||||||
options: gatewayOptions(evt.options, metadata),
|
options: gatewayOptions(evt.options, metadata),
|
||||||
} as any)
|
} as any)
|
||||||
const unified = createUnified()
|
const unified = createUnified({ apiKey: config.apiKey })
|
||||||
evt.sdk = {
|
evt.sdk = {
|
||||||
languageModel(modelID: string) {
|
languageModel(modelID: string) {
|
||||||
return gateway(unified(modelID))
|
return gateway(unified(modelID))
|
||||||
|
|||||||
@@ -816,7 +816,7 @@ function custom(dep: CustomDep): Record<string, CustomLoader> {
|
|||||||
apiKey: apiToken,
|
apiKey: apiToken,
|
||||||
...(Object.values(opts).some((v) => v !== undefined) ? { options: opts } : {}),
|
...(Object.values(opts).some((v) => v !== undefined) ? { options: opts } : {}),
|
||||||
})
|
})
|
||||||
const unified = createUnified()
|
const unified = createUnified({ apiKey: apiToken })
|
||||||
|
|
||||||
return {
|
return {
|
||||||
autoload: true,
|
autoload: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user