Fix duplicate endpoint path in LLM URL
All checks were successful
BotServer CI/CD / build (push) Successful in 5m58s
All checks were successful
BotServer CI/CD / build (push) Successful in 5m58s
This commit is contained in:
parent
13fee4d079
commit
2b2b386f5e
1 changed files with 6 additions and 1 deletions
|
|
@ -170,7 +170,12 @@ impl OpenAIClient {
|
||||||
let has_chat_path = !has_v1_path && trimmed_base.contains("/chat/completions");
|
let has_chat_path = !has_v1_path && trimmed_base.contains("/chat/completions");
|
||||||
|
|
||||||
let endpoint = if let Some(path) = endpoint_path {
|
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")) {
|
} else if has_v1_path || (has_chat_path && !trimmed_base.contains("z.ai")) {
|
||||||
// Path already in base_url, use empty endpoint
|
// Path already in base_url, use empty endpoint
|
||||||
"".to_string()
|
"".to_string()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue