Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src-tauri/src/ai_translator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ pub async fn translate_with_gpt(app: &AppHandle, original: &str) -> Result<Strin

let client = Client::new();

let request_body = if settings.model_type == "deepseek-R1" {
let request_body = if settings.model_type.to_lowercase().starts_with("deepseek-r1") ||
settings.custom_model.model_name.to_lowercase().starts_with("deepseek-r1") {
json!({
"model": model_config.model_name,
"messages": [
Expand Down Expand Up @@ -249,7 +250,7 @@ pub async fn translate_with_gpt(app: &AppHandle, original: &str) -> Result<Strin
"frequency_penalty": -0.3
})
};

let response = match client
.post(&model_config.api_url)
.header("Content-Type", "application/json")
Expand Down