Add DeepSeek support (#23551)
- Added support for DeepSeek as a new language model provider in Zed Assistant - Implemented streaming API support for real-time responses from DeepSeek models. - Added a configuration UI for DeepSeek API key management and settings. - Updated documentation with detailed setup instructions for DeepSeek integration. - Added DeepSeek-specific icons and model definitions for seamless integration into the Zed UI. - Integrated DeepSeek into the language model registry, making it available alongside other providers like OpenAI and Anthropic. Release Notes: - Added support for DeepSeek to the Assistant. --------- Co-authored-by: Marshall Bowers <git@maxdeviant.com>
This commit is contained in:
parent
f096a28a19
commit
29bfb56739
19 changed files with 1090 additions and 1 deletions
|
@ -13,6 +13,7 @@ use crate::provider::{
|
|||
anthropic::AnthropicSettings,
|
||||
cloud::{self, ZedDotDevSettings},
|
||||
copilot_chat::CopilotChatSettings,
|
||||
deepseek::DeepSeekSettings,
|
||||
google::GoogleSettings,
|
||||
lmstudio::LmStudioSettings,
|
||||
ollama::OllamaSettings,
|
||||
|
@ -61,6 +62,7 @@ pub struct AllLanguageModelSettings {
|
|||
pub google: GoogleSettings,
|
||||
pub copilot_chat: CopilotChatSettings,
|
||||
pub lmstudio: LmStudioSettings,
|
||||
pub deepseek: DeepSeekSettings,
|
||||
}
|
||||
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize, PartialEq, JsonSchema)]
|
||||
|
@ -72,6 +74,7 @@ pub struct AllLanguageModelSettingsContent {
|
|||
#[serde(rename = "zed.dev")]
|
||||
pub zed_dot_dev: Option<ZedDotDevSettingsContent>,
|
||||
pub google: Option<GoogleSettingsContent>,
|
||||
pub deepseek: Option<DeepseekSettingsContent>,
|
||||
pub copilot_chat: Option<CopilotChatSettingsContent>,
|
||||
}
|
||||
|
||||
|
@ -162,6 +165,12 @@ pub struct LmStudioSettingsContent {
|
|||
pub available_models: Option<Vec<provider::lmstudio::AvailableModel>>,
|
||||
}
|
||||
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize, PartialEq, JsonSchema)]
|
||||
pub struct DeepseekSettingsContent {
|
||||
pub api_url: Option<String>,
|
||||
pub available_models: Option<Vec<provider::deepseek::AvailableModel>>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, JsonSchema)]
|
||||
#[serde(untagged)]
|
||||
pub enum OpenAiSettingsContent {
|
||||
|
@ -299,6 +308,18 @@ impl settings::Settings for AllLanguageModelSettings {
|
|||
lmstudio.as_ref().and_then(|s| s.available_models.clone()),
|
||||
);
|
||||
|
||||
// DeepSeek
|
||||
let deepseek = value.deepseek.clone();
|
||||
|
||||
merge(
|
||||
&mut settings.deepseek.api_url,
|
||||
value.deepseek.as_ref().and_then(|s| s.api_url.clone()),
|
||||
);
|
||||
merge(
|
||||
&mut settings.deepseek.available_models,
|
||||
deepseek.as_ref().and_then(|s| s.available_models.clone()),
|
||||
);
|
||||
|
||||
// OpenAI
|
||||
let (openai, upgraded) = match value.openai.clone().map(|s| s.upgrade()) {
|
||||
Some((content, upgraded)) => (Some(content), upgraded),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue