Add base_path field to custom provider config (#7558)

Signed-off-by: Dan Prince <dprince@redhat.com>
This commit is contained in:
Dan Prince
2026-02-27 19:47:08 -05:00
committed by GitHub
parent 6e4d6fe1f2
commit d1fe375f30
6 changed files with 29 additions and 4 deletions
+8 -4
View File
@@ -168,11 +168,15 @@ impl OpenAiProvider {
} else {
format!("{}://{}", url.scheme(), url.host_str().unwrap_or(""))
};
let base_path = url.path().trim_start_matches('/').to_string();
let base_path = if base_path.is_empty() || base_path == "v1" || base_path == "v1/" {
"v1/chat/completions".to_string()
let base_path = if let Some(ref explicit_path) = config.base_path {
explicit_path.trim_start_matches('/').to_string()
} else {
base_path
let url_path = url.path().trim_start_matches('/').to_string();
if url_path.is_empty() || url_path == "v1" || url_path == "v1/" {
"v1/chat/completions".to_string()
} else {
url_path
}
};
let timeout_secs = config.timeout_seconds.unwrap_or(600);