MCPcopy Index your code
hub / github.com/ChrisFeldmeier/OpenCodeRust / build_url

Method build_url

crates/opencode-provider/src/azure.rs:90–111  ·  view source on GitHub ↗
(&self, model: &str, stream: bool)

Source from the content-addressed store, hash-verified

88 }
89
90 fn build_url(&self, model: &str, stream: bool) -> String {
91 let deployment = self.config.deployment_name.as_deref().unwrap_or(model);
92 let api_version = self
93 .config
94 .api_version
95 .as_deref()
96 .unwrap_or("2024-02-15-preview");
97
98 let endpoint = self.config.endpoint.trim_end_matches('/');
99
100 if stream {
101 format!(
102 "{}/openai/deployments/{}/chat/completions?api-version={}",
103 endpoint, deployment, api_version
104 )
105 } else {
106 format!(
107 "{}/openai/deployments/{}/chat/completions?api-version={}",
108 endpoint, deployment, api_version
109 )
110 }
111 }
112
113 fn build_request_body(request: &ChatRequest) -> Result<Value, ProviderError> {
114 let mut value = serde_json::to_value(request)

Callers 2

chatMethod · 0.45
chat_streamMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected