language_models: Remove language-models
feature flag (#29416)
This PR removes the `language-models` feature flag. This feature is already generally available, so we no longer need the feature flag. Release Notes: - N/A
This commit is contained in:
parent
357e38b471
commit
9be7bf72a4
2 changed files with 5 additions and 26 deletions
|
@ -64,11 +64,6 @@ impl FeatureFlag for PredictEditsRateCompletionsFeatureFlag {
|
|||
const NAME: &'static str = "predict-edits-rate-completions";
|
||||
}
|
||||
|
||||
pub struct LanguageModelsFeatureFlag {}
|
||||
impl FeatureFlag for LanguageModelsFeatureFlag {
|
||||
const NAME: &'static str = "language-models";
|
||||
}
|
||||
|
||||
pub struct LlmClosedBetaFeatureFlag {}
|
||||
impl FeatureFlag for LlmClosedBetaFeatureFlag {
|
||||
const NAME: &'static str = "llm-closed-beta";
|
||||
|
|
|
@ -3,7 +3,7 @@ use std::sync::Arc;
|
|||
use client::{Client, UserStore};
|
||||
use fs::Fs;
|
||||
use gpui::{App, Context, Entity};
|
||||
use language_model::{LanguageModelProviderId, LanguageModelRegistry, ZED_CLOUD_PROVIDER_ID};
|
||||
use language_model::LanguageModelRegistry;
|
||||
use provider::deepseek::DeepSeekLanguageModelProvider;
|
||||
|
||||
pub mod provider;
|
||||
|
@ -35,7 +35,10 @@ fn register_language_model_providers(
|
|||
client: Arc<Client>,
|
||||
cx: &mut Context<LanguageModelRegistry>,
|
||||
) {
|
||||
use feature_flags::FeatureFlagAppExt;
|
||||
registry.register_provider(
|
||||
CloudLanguageModelProvider::new(user_store.clone(), client.clone(), cx),
|
||||
cx,
|
||||
);
|
||||
|
||||
registry.register_provider(
|
||||
AnthropicLanguageModelProvider::new(client.http_client(), cx),
|
||||
|
@ -70,23 +73,4 @@ fn register_language_model_providers(
|
|||
cx,
|
||||
);
|
||||
registry.register_provider(CopilotChatLanguageModelProvider::new(cx), cx);
|
||||
|
||||
cx.observe_flag::<feature_flags::LanguageModelsFeatureFlag, _>(move |enabled, cx| {
|
||||
let user_store = user_store.clone();
|
||||
let client = client.clone();
|
||||
LanguageModelRegistry::global(cx).update(cx, move |registry, cx| {
|
||||
if enabled {
|
||||
registry.register_provider(
|
||||
CloudLanguageModelProvider::new(user_store.clone(), client.clone(), cx),
|
||||
cx,
|
||||
);
|
||||
} else {
|
||||
registry.unregister_provider(
|
||||
LanguageModelProviderId::from(ZED_CLOUD_PROVIDER_ID.to_string()),
|
||||
cx,
|
||||
);
|
||||
}
|
||||
});
|
||||
})
|
||||
.detach();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue