Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

x_ai: Fix `Model::from_id` for Grok 4 (#38930)

Marshall Bowers94fe862fb6ec
diff --git a/crates/x_ai/src/x_ai.rs b/crates/x_ai/src/x_ai.rs
index 50f8681c31b..a0bfca6f774 100644
--- a/crates/x_ai/src/x_ai.rs
+++ b/crates/x_ai/src/x_ai.rs
@@ -18,7 +18,7 @@ pub enum Model {
Grok3Fast,
#[serde(rename = "grok-3-mini-fast-latest")]
Grok3MiniFast,
- #[serde(rename = "grok-4-latest")]
+ #[serde(rename = "grok-4", alias = "grok-4-latest")]
Grok4,
#[serde(rename = "grok-code-fast-1")]
GrokCodeFast1,
@@ -40,6 +40,7 @@ impl Model {
pub fn from_id(id: &str) -> Result<Self> {
match id {
+ "grok-4" => Ok(Self::Grok4),
"grok-2-vision" => Ok(Self::Grok2Vision),
"grok-3" => Ok(Self::Grok3),
"grok-3-mini" => Ok(Self::Grok3Mini),