mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-21 17:54:23 +01:00
added AU inference for bedrock haiku 4.5 (#3206)
Co-authored-by: Matt Gillard <matt-github@gillard.biz>
This commit is contained in:
@@ -121,8 +121,11 @@ export namespace Provider {
|
|||||||
}
|
}
|
||||||
case "ap": {
|
case "ap": {
|
||||||
const isAustraliaRegion = ["ap-southeast-2", "ap-southeast-4"].includes(region)
|
const isAustraliaRegion = ["ap-southeast-2", "ap-southeast-4"].includes(region)
|
||||||
if (isAustraliaRegion && modelID.startsWith("anthropic.claude-sonnet-4-5")) {
|
if (isAustraliaRegion && ["anthropic.claude-sonnet-4-5", "anthropic.claude-haiku"].some((m) =>
|
||||||
modelID = `au.${modelID}`
|
modelID.includes(m),
|
||||||
|
)) {
|
||||||
|
regionPrefix = "au"
|
||||||
|
modelID = `${regionPrefix}.${modelID}`
|
||||||
} else {
|
} else {
|
||||||
const modelRequiresPrefix = ["claude", "nova-lite", "nova-micro", "nova-pro"].some((m) =>
|
const modelRequiresPrefix = ["claude", "nova-lite", "nova-micro", "nova-pro"].some((m) =>
|
||||||
modelID.includes(m),
|
modelID.includes(m),
|
||||||
@@ -270,31 +273,31 @@ export namespace Provider {
|
|||||||
cost:
|
cost:
|
||||||
!model.cost && !existing?.cost
|
!model.cost && !existing?.cost
|
||||||
? {
|
? {
|
||||||
input: 0,
|
input: 0,
|
||||||
output: 0,
|
output: 0,
|
||||||
cache_read: 0,
|
cache_read: 0,
|
||||||
cache_write: 0,
|
cache_write: 0,
|
||||||
}
|
}
|
||||||
: {
|
: {
|
||||||
cache_read: 0,
|
cache_read: 0,
|
||||||
cache_write: 0,
|
cache_write: 0,
|
||||||
...existing?.cost,
|
...existing?.cost,
|
||||||
...model.cost,
|
...model.cost,
|
||||||
},
|
},
|
||||||
options: {
|
options: {
|
||||||
...existing?.options,
|
...existing?.options,
|
||||||
...model.options,
|
...model.options,
|
||||||
},
|
},
|
||||||
limit: model.limit ??
|
limit: model.limit ??
|
||||||
existing?.limit ?? {
|
existing?.limit ?? {
|
||||||
context: 0,
|
context: 0,
|
||||||
output: 0,
|
output: 0,
|
||||||
},
|
},
|
||||||
modalities: model.modalities ??
|
modalities: model.modalities ??
|
||||||
existing?.modalities ?? {
|
existing?.modalities ?? {
|
||||||
input: ["text"],
|
input: ["text"],
|
||||||
output: ["text"],
|
output: ["text"],
|
||||||
},
|
},
|
||||||
provider: model.provider ?? existing?.provider,
|
provider: model.provider ?? existing?.provider,
|
||||||
}
|
}
|
||||||
if (model.id && model.id !== modelID) {
|
if (model.id && model.id !== modelID) {
|
||||||
|
|||||||
Reference in New Issue
Block a user