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

Method chat_completions_url

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

Source from the content-addressed store, hash-verified

556 }
557
558 fn chat_completions_url(base_url: Option<&str>) -> String {
559 match base_url {
560 None => OPENAI_API_URL.to_string(),
561 Some(base) => {
562 if base.ends_with("/chat/completions") {
563 return base.to_string();
564 }
565 if base.ends_with('/') {
566 format!("{base}chat/completions")
567 } else {
568 format!("{base}/chat/completions")
569 }
570 }
571 }
572 }
573
574 fn extract_responses_provider_options(
575 provider_options: Option<&HashMap<String, serde_json::Value>>,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected