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

Method responses_url

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

Source from the content-addressed store, hash-verified

203 }
204
205 fn responses_url(base_url: Option<&str>, path: &str) -> String {
206 let path = path.trim_start_matches('/');
207 match base_url {
208 None => format!("https://api.githubcopilot.com/{}", path),
209 Some(base) => {
210 if base.ends_with("/chat/completions") {
211 return format!("{}/{}", base.trim_end_matches("/chat/completions"), path);
212 }
213 if base.ends_with('/') {
214 format!("{}{}", base, path)
215 } else {
216 format!("{}/{}", base, path)
217 }
218 }
219 }
220 }
221
222 fn extract_responses_provider_options(
223 provider_options: Option<&HashMap<String, serde_json::Value>>,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected