MCPcopy Index your code
hub / github.com/anomalyco/opencode / anthropicOpus47OrLater

Function anthropicOpus47OrLater

packages/opencode/src/provider/transform.ts:600–608  ·  view source on GitHub ↗
(apiId: string)

Source from the content-addressed store, hash-verified

598}
599
600function anthropicOpus47OrLater(apiId: string) {
601 // Matches "opus-4.7" (Anthropic/Bedrock/Vertex) and "claude-4.7-opus" (SAP AI Core inverted).
602 // Greedy \d+ correctly extends to multi-digit majors (e.g. "claude-10.0-opus") for forward compatibility.
603 const version = /opus-(\d+)[.-](\d+)(?:[.@-]|$)|claude-(\d+)[.-](\d+)-opus(?:[.@-]|$)/i.exec(apiId)
604 if (!version) return false
605 const major = Number(version[1] ?? version[3])
606 const minor = Number(version[2] ?? version[4])
607 return major > 4 || (major === 4 && minor >= 7)
608}
609
610function anthropicSonnet5OrLater(apiId: string) {
611 const version = /sonnet-(\d+)(?:[.@-]|$)|claude-(\d+)-sonnet(?:[.@-]|$)/i.exec(apiId)

Callers 2

anthropicAdaptiveEffortsFunction · 0.85
anthropicOmitsThinkingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected