fix: provider option transforms (#3331)

This commit is contained in:
Aiden Cline
2025-10-21 11:08:21 -05:00
committed by GitHub
parent e9996342a7
commit ca0f3902b7
3 changed files with 22 additions and 10 deletions

View File

@@ -105,6 +105,24 @@ export namespace ProviderTransform {
return result
}
export function providerOptions(npm: string | undefined, providerID: string, options: { [x: string]: any }) {
switch (npm) {
case "@ai-sdk/openai":
case "@ai-sdk/azure":
return {
["openai" as string]: options,
}
case "@ai-sdk/anthropic":
return {
["anthropic" as string]: options,
}
default:
return {
[providerID]: options,
}
}
}
export function maxOutputTokens(
providerID: string,
options: Record<string, any>,