move v1 to DEEPSEEK_API_URL

This commit is contained in:
雷电梅 2025-07-08 10:20:32 +08:00 committed by GitHub
parent d18c37354f
commit 60f6b4b962
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -9,7 +9,7 @@ use serde::{Deserialize, Serialize};
use serde_json::Value; use serde_json::Value;
use std::convert::TryFrom; 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)] #[derive(Clone, Copy, Serialize, Deserialize, Debug, Eq, PartialEq)]
#[serde(rename_all = "lowercase")] #[serde(rename_all = "lowercase")]
@ -263,7 +263,7 @@ pub async fn stream_completion(
api_key: &str, api_key: &str,
request: Request, request: Request,
) -> Result<BoxStream<'static, Result<StreamResponse>>> { ) -> 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() let request_builder = HttpRequest::builder()
.method(Method::POST) .method(Method::POST)
.uri(uri) .uri(uri)