Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

deepseek: Fix API URL (#33905)

雷电梅2790eb604a1d
diff --git a/assets/settings/default.json b/assets/settings/default.json
index 2aec3aa7b9d..623a4612d06 100644
--- a/assets/settings/default.json
+++ b/assets/settings/default.json
@@ -1776,7 +1776,7 @@
"api_url": "http://localhost:1234/api/v0"
},
"deepseek": {
- "api_url": "https://api.deepseek.com"
+ "api_url": "https://api.deepseek.com/v1"
},
"mistral": {
"api_url": "https://api.mistral.ai/v1"
diff --git a/crates/deepseek/src/deepseek.rs b/crates/deepseek/src/deepseek.rs
index c2554c67e93..e09a9e0f7a1 100644
--- a/crates/deepseek/src/deepseek.rs
+++ b/crates/deepseek/src/deepseek.rs
@@ -9,7 +9,7 @@ use serde::{Deserialize, Serialize};
use serde_json::Value;
use std::convert::TryFrom;
-pub const DEEPSEEK_API_URL: &str = "https://api.deepseek.com";
+pub const DEEPSEEK_API_URL: &str = "https://api.deepseek.com/v1";
#[derive(Clone, Copy, Serialize, Deserialize, Debug, Eq, PartialEq)]
#[serde(rename_all = "lowercase")]
@@ -263,7 +263,7 @@ pub async fn stream_completion(
api_key: &str,
request: Request,
) -> Result<BoxStream<'static, Result<StreamResponse>>> {
- let uri = format!("{api_url}/v1/chat/completions");
+ let uri = format!("{api_url}/chat/completions");
let request_builder = HttpRequest::builder()
.method(Method::POST)
.uri(uri)