language_models: Fetch Zed models from the server (#31316)
This PR updates the Zed LLM provider to fetch the available models from the server instead of hard-coding them in the binary. Release Notes: - Updated the Zed provider to fetch the list of available language models from the server.
This commit is contained in:
parent
172e0df2d8
commit
685933b5c8
7 changed files with 191 additions and 201 deletions
|
@ -244,25 +244,6 @@ pub trait LanguageModel: Send + Sync {
|
|||
|
||||
/// Returns whether this model supports "max mode";
|
||||
fn supports_max_mode(&self) -> bool {
|
||||
if self.provider_id().0 != ZED_CLOUD_PROVIDER_ID {
|
||||
return false;
|
||||
}
|
||||
|
||||
const MAX_MODE_CAPABLE_MODELS: &[CloudModel] = &[
|
||||
CloudModel::Anthropic(anthropic::Model::ClaudeOpus4),
|
||||
CloudModel::Anthropic(anthropic::Model::ClaudeOpus4Thinking),
|
||||
CloudModel::Anthropic(anthropic::Model::ClaudeSonnet4),
|
||||
CloudModel::Anthropic(anthropic::Model::ClaudeSonnet4Thinking),
|
||||
CloudModel::Anthropic(anthropic::Model::Claude3_7Sonnet),
|
||||
CloudModel::Anthropic(anthropic::Model::Claude3_7SonnetThinking),
|
||||
];
|
||||
|
||||
for model in MAX_MODE_CAPABLE_MODELS {
|
||||
if self.id().0 == model.id() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
false
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue