mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-02 15:13:46 +00:00
fix: provider option transforms (#3331)
This commit is contained in:
@@ -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>,
|
||||
|
||||
Reference in New Issue
Block a user