Automate settings registration (#42238)
Release Notes: - N/A --------- Co-authored-by: Nia <nia@zed.dev>
This commit is contained in:
@@ -28,7 +28,6 @@ use crate::provider::x_ai::XAiLanguageModelProvider;
|
||||
pub use crate::settings::*;
|
||||
|
||||
pub fn init(user_store: Entity<UserStore>, client: Arc<Client>, cx: &mut App) {
|
||||
crate::settings::init_settings(cx);
|
||||
let registry = LanguageModelRegistry::global(cx);
|
||||
registry.update(cx, |registry, cx| {
|
||||
register_language_model_providers(registry, user_store, client.clone(), cx);
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use collections::HashMap;
|
||||
use gpui::App;
|
||||
use settings::Settings;
|
||||
use settings::RegisterSetting;
|
||||
|
||||
use crate::provider::{
|
||||
anthropic::AnthropicSettings, bedrock::AmazonBedrockSettings, cloud::ZedDotDevSettings,
|
||||
@@ -12,11 +11,7 @@ use crate::provider::{
|
||||
vercel::VercelSettings, x_ai::XAiSettings,
|
||||
};
|
||||
|
||||
/// Initializes the language model settings.
|
||||
pub fn init_settings(cx: &mut App) {
|
||||
AllLanguageModelSettings::register(cx);
|
||||
}
|
||||
|
||||
#[derive(Debug, RegisterSetting)]
|
||||
pub struct AllLanguageModelSettings {
|
||||
pub anthropic: AnthropicSettings,
|
||||
pub bedrock: AmazonBedrockSettings,
|
||||
|
||||
Reference in New Issue
Block a user