This commit is contained in:
Aiden Cline 2025-12-28 17:42:39 -06:00
commit 7539cbeea2

View file

@ -253,12 +253,20 @@ export namespace ProviderTransform {
reasoning: { effort: thinking.effort }, reasoning: { effort: thinking.effort },
} }
// TODO: YOU CANNOT SET max_tokens if this is set!!!
case "@ai-sdk/gateway":
return {
reasoningEffort: thinking.effort,
}
case "@ai-sdk/cerebras":
// https://v5.ai-sdk.dev/providers/ai-sdk-providers/cerebras
case "@ai-sdk/togetherai":
// https://v5.ai-sdk.dev/providers/ai-sdk-providers/togetherai
case "@ai-sdk/xai": case "@ai-sdk/xai":
// https://v5.ai-sdk.dev/providers/ai-sdk-providers/xai // https://v5.ai-sdk.dev/providers/ai-sdk-providers/xai
case "@ai-sdk/deepinfra": case "@ai-sdk/deepinfra":
// https://v5.ai-sdk.dev/providers/ai-sdk-providers/deepinfra // https://v5.ai-sdk.dev/providers/ai-sdk-providers/deepinfra
case "@ai-sdk/azure":
// https://v5.ai-sdk.dev/providers/ai-sdk-providers/azure
case "@ai-sdk/openai-compatible": case "@ai-sdk/openai-compatible":
const result: Record<string, any> = { const result: Record<string, any> = {
reasoningEffort: thinking.effort, reasoningEffort: thinking.effort,
@ -270,6 +278,8 @@ export namespace ProviderTransform {
return result return result
case "@ai-sdk/azure":
// https://v5.ai-sdk.dev/providers/ai-sdk-providers/azure
case "@ai-sdk/openai": case "@ai-sdk/openai":
return { return {
reasoningEffort: thinking.effort, reasoningEffort: thinking.effort,
@ -282,25 +292,38 @@ export namespace ProviderTransform {
return {} return {}
case "@ai-sdk/amazon-bedrock": case "@ai-sdk/amazon-bedrock":
// TODO: implement bedrock thinking options // https://v5.ai-sdk.dev/providers/ai-sdk-providers/amazon-bedrock
return {} return {
case "@ai-sdk/google": reasoningConfig: {
// TODO: implement google thinking options type: "enabled",
return {} maxReasoningEffort: thinking.effort,
},
}
case "@ai-sdk/google-vertex": case "@ai-sdk/google-vertex":
// TODO: implement google-vertex thinking options // https://v5.ai-sdk.dev/providers/ai-sdk-providers/google-vertex
return {} case "@ai-sdk/google":
case "@ai-sdk/gateway": // https://v5.ai-sdk.dev/providers/ai-sdk-providers/google-generative-ai
// TODO: implement gateway thinking options if (model.id.includes("2.5")) {
return {} return {
thinkingConfig: {
includeThoughts: true,
thinkingBudget: thinking.effort === "medium" ? 8192 : 24576,
},
}
}
return {
thinkingConfig: {
includeThoughts: true,
thinkingLevel: thinking.effort,
},
}
case "@ai-sdk/mistral": case "@ai-sdk/mistral":
// TODO: implement mistral thinking options // TODO: implement mistral thinking options
// https://v5.ai-sdk.dev/providers/ai-sdk-providers/mistral // https://v5.ai-sdk.dev/providers/ai-sdk-providers/mistral
return {} return {}
case "@ai-sdk/cerebras":
// TODO: implement cerebras thinking options
return {}
case "@ai-sdk/cohere": case "@ai-sdk/cohere":
// TODO: implement cohere thinking options // TODO: implement cohere thinking options
// https://v5.ai-sdk.dev/providers/ai-sdk-providers/cohere // https://v5.ai-sdk.dev/providers/ai-sdk-providers/cohere
@ -316,10 +339,6 @@ export namespace ProviderTransform {
case "@ai-sdk/perplexity": case "@ai-sdk/perplexity":
// https://v5.ai-sdk.dev/providers/ai-sdk-providers/perplexity // https://v5.ai-sdk.dev/providers/ai-sdk-providers/perplexity
return {} return {}
case "@ai-sdk/togetherai":
// https://v5.ai-sdk.dev/providers/ai-sdk-providers/togetherai
return {}
} }
return {} return {}
} }
@ -416,6 +435,7 @@ export namespace ProviderTransform {
return { return {
["anthropic" as string]: options, ["anthropic" as string]: options,
} }
case "@ai-sdk/google-vertex":
case "@ai-sdk/google": case "@ai-sdk/google":
return { return {
["google" as string]: options, ["google" as string]: options,