Просмотр исходного кода

fix(provider): add thinking presets for Google Vertex Anthropic (#9953)

Co-authored-by: Claude <[email protected]>
zerone0x 1 месяц назад
Родитель
Сommit
31094cd5a4
1 измененных файлов с 4 добавлено и 2 удалено
  1. 4 2
      packages/opencode/src/provider/transform.ts

+ 4 - 2
packages/opencode/src/provider/transform.ts

@@ -420,7 +420,9 @@ export namespace ProviderTransform {
         )
         )
 
 
       case "@ai-sdk/anthropic":
       case "@ai-sdk/anthropic":
-        // https://v5.ai-sdk.dev/providers/ai-sdk-providers/anthropic
+      // https://v5.ai-sdk.dev/providers/ai-sdk-providers/anthropic
+      case "@ai-sdk/google-vertex/anthropic":
+        // https://v5.ai-sdk.dev/providers/ai-sdk-providers/google-vertex#anthropic-provider
         return {
         return {
           high: {
           high: {
             thinking: {
             thinking: {
@@ -643,7 +645,7 @@ export namespace ProviderTransform {
     const modelCap = modelLimit || globalLimit
     const modelCap = modelLimit || globalLimit
     const standardLimit = Math.min(modelCap, globalLimit)
     const standardLimit = Math.min(modelCap, globalLimit)
 
 
-    if (npm === "@ai-sdk/anthropic") {
+    if (npm === "@ai-sdk/anthropic" || npm === "@ai-sdk/google-vertex/anthropic") {
       const thinking = options?.["thinking"]
       const thinking = options?.["thinking"]
       const budgetTokens = typeof thinking?.["budgetTokens"] === "number" ? thinking["budgetTokens"] : 0
       const budgetTokens = typeof thinking?.["budgetTokens"] === "number" ? thinking["budgetTokens"] : 0
       const enabled = thinking?.["type"] === "enabled"
       const enabled = thinking?.["type"] === "enabled"