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

Method with_config

crates/opencode-provider/src/azure.rs:35–88  ·  view source on GitHub ↗
(config: AzureConfig)

Source from the content-addressed store, hash-verified

33 }
34
35 pub fn with_config(config: AzureConfig) -> Self {
36 let models = vec![
37 ModelInfo {
38 id: "gpt-4o".to_string(),
39 name: "GPT-4o (Azure)".to_string(),
40 provider: "azure".to_string(),
41 context_window: 128000,
42 max_output_tokens: 16384,
43 supports_vision: true,
44 supports_tools: true,
45 cost_per_million_input: 2.5,
46 cost_per_million_output: 10.0,
47 },
48 ModelInfo {
49 id: "gpt-4o-mini".to_string(),
50 name: "GPT-4o Mini (Azure)".to_string(),
51 provider: "azure".to_string(),
52 context_window: 128000,
53 max_output_tokens: 16384,
54 supports_vision: true,
55 supports_tools: true,
56 cost_per_million_input: 0.15,
57 cost_per_million_output: 0.6,
58 },
59 ModelInfo {
60 id: "gpt-4-turbo".to_string(),
61 name: "GPT-4 Turbo (Azure)".to_string(),
62 provider: "azure".to_string(),
63 context_window: 128000,
64 max_output_tokens: 4096,
65 supports_vision: true,
66 supports_tools: true,
67 cost_per_million_input: 10.0,
68 cost_per_million_output: 30.0,
69 },
70 ModelInfo {
71 id: "gpt-35-turbo".to_string(),
72 name: "GPT-3.5 Turbo (Azure)".to_string(),
73 provider: "azure".to_string(),
74 context_window: 16384,
75 max_output_tokens: 4096,
76 supports_vision: false,
77 supports_tools: true,
78 cost_per_million_input: 0.5,
79 cost_per_million_output: 1.5,
80 },
81 ];
82
83 Self {
84 client: Client::new(),
85 config,
86 models,
87 }
88 }
89
90 fn build_url(&self, model: &str, stream: bool) -> String {
91 let deployment = self.config.deployment_name.as_deref().unwrap_or(model);

Callers

nothing calls this directly

Calls 1

newFunction · 0.85

Tested by

no test coverage detected