fix(ai): resolve request-scoped auth before provider calls
closes #6021
This commit is contained in:
@@ -184,7 +184,10 @@ class ImagesModelsImpl implements MutableImagesModels {
|
||||
throw new ModelsError("provider", `Unknown provider: ${model.provider}`);
|
||||
}
|
||||
|
||||
const resolution = await this.getAuth(model);
|
||||
const resolution = await resolveProviderAuth(provider, model, this.credentials, this.authContext, {
|
||||
apiKey: options?.apiKey,
|
||||
env: options?.env,
|
||||
});
|
||||
const auth = resolution?.auth;
|
||||
if (!auth) {
|
||||
return provider.generateImages(model, context, options);
|
||||
|
||||
Reference in New Issue
Block a user