This commit is contained in:
沈瑗杰 2025-08-27 00:39:17 +08:00 committed by GitHub
commit a20814771a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 15 additions and 15 deletions

View file

@ -48,10 +48,10 @@ impl From<Role> for String {
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
#[derive(Clone, Debug, Default, Serialize, Deserialize, PartialEq)]
pub enum Model {
#[serde(rename = "deepseek-chat")]
#[serde(rename = "deepseek-v3.1")]
#[default]
Chat,
#[serde(rename = "deepseek-reasoner")]
#[serde(rename = "deepseek-v3.1(think)")]
Reasoner,
#[serde(rename = "custom")]
Custom {
@ -70,24 +70,24 @@ impl Model {
pub fn from_id(id: &str) -> Result<Self> {
match id {
"deepseek-chat" => Ok(Self::Chat),
"deepseek-reasoner" => Ok(Self::Reasoner),
"deepseek-v3.1" => Ok(Self::Chat),
"deepseek-v3.1(think)" => Ok(Self::Reasoner),
_ => anyhow::bail!("invalid model id {id}"),
}
}
pub fn id(&self) -> &str {
match self {
Self::Chat => "deepseek-chat",
Self::Reasoner => "deepseek-reasoner",
Self::Chat => "deepseek-v3.1",
Self::Reasoner => "deepseek-v3.1(think)",
Self::Custom { name, .. } => name,
}
}
pub fn display_name(&self) -> &str {
match self {
Self::Chat => "DeepSeek Chat",
Self::Reasoner => "DeepSeek Reasoner",
Self::Chat => "DeepSeek V3.1",
Self::Reasoner => "DeepSeek V3.1 (think)",
Self::Custom {
name, display_name, ..
} => display_name.as_ref().unwrap_or(name).as_str(),
@ -96,7 +96,7 @@ impl Model {
pub fn max_token_count(&self) -> u64 {
match self {
Self::Chat | Self::Reasoner => 64_000,
Self::Chat | Self::Reasoner => 128_000,
Self::Custom { max_tokens, .. } => *max_tokens,
}
}

View file

@ -196,8 +196,8 @@ impl LanguageModelProvider for DeepSeekLanguageModelProvider {
fn provided_models(&self, cx: &App) -> Vec<Arc<dyn LanguageModel>> {
let mut models = BTreeMap::default();
models.insert("deepseek-chat", deepseek::Model::Chat);
models.insert("deepseek-reasoner", deepseek::Model::Reasoner);
models.insert("deepseek-v3.1", deepseek::Model::Chat);
models.insert("deepseek-v3.1(think)", deepseek::Model::Reasoner);
for available_model in AllLanguageModelSettings::get_global(cx)
.deepseek

View file

@ -183,13 +183,13 @@ If you wish to use alternate models or customize the API endpoint, you can do so
"api_url": "https://api.deepseek.com",
"available_models": [
{
"name": "deepseek-chat",
"display_name": "DeepSeek Chat",
"name": "deepseek-v3.1",
"display_name": "DeepSeek V3.1",
"max_tokens": 64000
},
{
"name": "deepseek-reasoner",
"display_name": "DeepSeek Reasoner",
"name": "deepseek-v3.1(think)",
"display_name": "DeepSeek V3.1(think)",
"max_tokens": 64000,
"max_output_tokens": 4096
}