Fix duplicate endpoint path in LLM URL
All checks were successful
BotServer CI/CD / build (push) Successful in 5m58s

This commit is contained in:
Rodrigo Rodriguez (Pragmatismo) 2026-04-09 22:51:32 -03:00
parent 13fee4d079
commit 2b2b386f5e

View file

@ -170,7 +170,12 @@ impl OpenAIClient {
let has_chat_path = !has_v1_path && trimmed_base.contains("/chat/completions");
let endpoint = if let Some(path) = endpoint_path {
path
// If endpoint path is already in base URL, use empty to avoid duplication
if trimmed_base.contains(&path) {
"".to_string()
} else {
path
}
} else if has_v1_path || (has_chat_path && !trimmed_base.contains("z.ai")) {
// Path already in base_url, use empty endpoint
"".to_string()