core: refactor providerOptions function to accept Provider.Model for cleaner API

This commit is contained in:
Aiden Cline
2025-12-09 01:25:36 -06:00
parent 2206e10d92
commit f8bd4ff705
4 changed files with 8 additions and 9 deletions

View File

@@ -273,8 +273,8 @@ export namespace ProviderTransform {
return options
}
export function providerOptions(npm: string | undefined, providerID: string, options: { [x: string]: any }) {
switch (npm) {
export function providerOptions(model: Provider.Model, options: { [x: string]: any }) {
switch (model.api.npm) {
case "@ai-sdk/openai":
case "@ai-sdk/azure":
return {
@@ -302,7 +302,7 @@ export namespace ProviderTransform {
}
default:
return {
[providerID]: options,
[model.providerID]: options,
}
}
}