Add Claude Opus 4.7 BYOK (#54077)
<img width="767" height="428" alt="Screenshot 2026-04-16 at 11 29 13 AM" src="https://github.com/user-attachments/assets/e8b450fa-aefc-4dec-a286-b211bd492011" /> Add Claude Opus 4.7 (`claude-opus-4-7`) to the anthropic, bedrock, and opencode provider crates. Key specs: - 1M token context window - 128k max output tokens - Adaptive thinking support - AWS Bedrock cross-region inference (global, US, EU, AU) Release Notes: - Added Claude Opus 4.7 as an available language model
This commit is contained in:
1 parent
9a5df9cea5
commit
3cc50f53b6
5 files changed
+96
-11
No files matched your search
@@ -21,6 +21,8 @@ pub enum ApiProtocol {
|
||||
#[derive(Clone, Debug, Default, Serialize, Deserialize, PartialEq, EnumIter)]
|
||||
pub enum Model {
|
||||
// -- Anthropic protocol models --
|
||||
#[serde(rename = "claude-opus-4-7")]
|
||||
ClaudeOpus4_7,
|
||||
#[serde(rename = "claude-opus-4-6")]
|
||||
ClaudeOpus4_6,
|
||||
#[serde(rename = "claude-opus-4-5")]
|
||||
@@ -117,6 +119,7 @@ impl Model {
|
||||
|
||||
pub fn id(&self) -> &str {
|
||||
match self {
|
||||
Self::ClaudeOpus4_7 => "claude-opus-4-7",
|
||||
Self::ClaudeOpus4_6 => "claude-opus-4-6",
|
||||
Self::ClaudeOpus4_5 => "claude-opus-4-5",
|
||||
Self::ClaudeOpus4_1 => "claude-opus-4-1",
|
||||
@@ -162,6 +165,7 @@ impl Model {
|
||||
|
||||
pub fn display_name(&self) -> &str {
|
||||
match self {
|
||||
Self::ClaudeOpus4_7 => "Claude Opus 4.7",
|
||||
Self::ClaudeOpus4_6 => "Claude Opus 4.6",
|
||||
Self::ClaudeOpus4_5 => "Claude Opus 4.5",
|
||||
Self::ClaudeOpus4_1 => "Claude Opus 4.1",
|
||||
@@ -209,7 +213,8 @@ impl Model {
|
||||
|
||||
pub fn protocol(&self) -> ApiProtocol {
|
||||
match self {
|
||||
Self::ClaudeOpus4_6
|
||||
Self::ClaudeOpus4_7
|
||||
| Self::ClaudeOpus4_6
|
||||
| Self::ClaudeOpus4_5
|
||||
| Self::ClaudeOpus4_1
|
||||
| Self::ClaudeSonnet4_6
|
||||
@@ -254,7 +259,7 @@ impl Model {
|
||||
pub fn max_token_count(&self) -> u64 {
|
||||
match self {
|
||||
// Anthropic models
|
||||
Self::ClaudeOpus4_6 | Self::ClaudeSonnet4_6 => 1_000_000,
|
||||
Self::ClaudeOpus4_7 | Self::ClaudeOpus4_6 | Self::ClaudeSonnet4_6 => 1_000_000,
|
||||
Self::ClaudeOpus4_5 | Self::ClaudeSonnet4_5 | Self::ClaudeSonnet4 => 200_000,
|
||||
Self::ClaudeOpus4_1 => 200_000,
|
||||
Self::ClaudeHaiku4_5 => 200_000,
|
||||
@@ -292,7 +297,7 @@ impl Model {
|
||||
pub fn max_output_tokens(&self) -> Option<u64> {
|
||||
match self {
|
||||
// Anthropic models
|
||||
Self::ClaudeOpus4_6 => Some(128_000),
|
||||
Self::ClaudeOpus4_7 | Self::ClaudeOpus4_6 => Some(128_000),
|
||||
Self::ClaudeSonnet4_6 => Some(64_000),
|
||||
Self::ClaudeOpus4_5
|
||||
| Self::ClaudeOpus4_1
|
||||
@@ -342,7 +347,8 @@ impl Model {
|
||||
pub fn supports_images(&self) -> bool {
|
||||
match self {
|
||||
// Anthropic models support images
|
||||
Self::ClaudeOpus4_6
|
||||
Self::ClaudeOpus4_7
|
||||
| Self::ClaudeOpus4_6
|
||||
| Self::ClaudeOpus4_5
|
||||
| Self::ClaudeOpus4_1
|
||||
| Self::ClaudeSonnet4_6
|
||||
|
||||
Reference in new issue
Block a user