MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / responses_url

Method responses_url

crates/opencode-provider/src/openai.rs:538–556  ·  view source on GitHub ↗
(base_url: Option<&str>, path: &str)

Source from the content-addressed store, hash-verified

536 }
537
538 fn responses_url(base_url: Option<&str>, path: &str) -> String {
539 let path = path.trim_start_matches('/');
540 match base_url {
541 None => format!("https://api.openai.com/v1/{}", path),
542 Some(base) => {
543 if base.ends_with("/chat/completions") {
544 return format!("{}/{}", base.trim_end_matches("/chat/completions"), path);
545 }
546 if base.ends_with("/v1") {
547 return format!("{}/{}", base.trim_end_matches('/'), path);
548 }
549 if base.ends_with('/') {
550 format!("{}{}", base, path)
551 } else {
552 format!("{}/{}", base, path)
553 }
554 }
555 }
556 }
557
558 fn chat_completions_url(base_url: Option<&str>) -> String {
559 match base_url {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected