Răsfoiți Sursa

added AU inference for bedrock haiku 4.5 (#3206)

Co-authored-by: Matt Gillard <[email protected]>
Matt Gillard 5 luni în urmă
părinte
comite
ddb2e6957c
1 a modificat fișierele cu 21 adăugiri și 18 ștergeri
  1. 21 18
      packages/opencode/src/provider/provider.ts

+ 21 - 18
packages/opencode/src/provider/provider.ts

@@ -121,8 +121,11 @@ export namespace Provider {
             }
             case "ap": {
               const isAustraliaRegion = ["ap-southeast-2", "ap-southeast-4"].includes(region)
-              if (isAustraliaRegion && modelID.startsWith("anthropic.claude-sonnet-4-5")) {
-                modelID = `au.${modelID}`
+              if (isAustraliaRegion && ["anthropic.claude-sonnet-4-5", "anthropic.claude-haiku"].some((m) =>
+                modelID.includes(m),
+              )) {
+                regionPrefix = "au"
+                modelID = `${regionPrefix}.${modelID}`
               } else {
                 const modelRequiresPrefix = ["claude", "nova-lite", "nova-micro", "nova-pro"].some((m) =>
                   modelID.includes(m),
@@ -270,31 +273,31 @@ export namespace Provider {
           cost:
             !model.cost && !existing?.cost
               ? {
-                  input: 0,
-                  output: 0,
-                  cache_read: 0,
-                  cache_write: 0,
-                }
+                input: 0,
+                output: 0,
+                cache_read: 0,
+                cache_write: 0,
+              }
               : {
-                  cache_read: 0,
-                  cache_write: 0,
-                  ...existing?.cost,
-                  ...model.cost,
-                },
+                cache_read: 0,
+                cache_write: 0,
+                ...existing?.cost,
+                ...model.cost,
+              },
           options: {
             ...existing?.options,
             ...model.options,
           },
           limit: model.limit ??
             existing?.limit ?? {
-              context: 0,
-              output: 0,
-            },
+            context: 0,
+            output: 0,
+          },
           modalities: model.modalities ??
             existing?.modalities ?? {
-              input: ["text"],
-              output: ["text"],
-            },
+            input: ["text"],
+            output: ["text"],
+          },
           provider: model.provider ?? existing?.provider,
         }
         if (model.id && model.id !== modelID) {