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

Method with_config

crates/opencode-provider/src/gitlab.rs:34–76  ·  view source on GitHub ↗
(config: GitLabConfig)

Source from the content-addressed store, hash-verified

32 }
33
34 pub fn with_config(config: GitLabConfig) -> Self {
35 let models = vec![
36 ModelInfo {
37 id: "claude-3-5-sonnet-20241022".to_string(),
38 name: "Claude 3.5 Sonnet (GitLab Duo)".to_string(),
39 provider: "gitlab".to_string(),
40 context_window: 200000,
41 max_output_tokens: 8192,
42 supports_vision: true,
43 supports_tools: true,
44 cost_per_million_input: 0.0,
45 cost_per_million_output: 0.0,
46 },
47 ModelInfo {
48 id: "claude-3-5-haiku-20241022".to_string(),
49 name: "Claude 3.5 Haiku (GitLab Duo)".to_string(),
50 provider: "gitlab".to_string(),
51 context_window: 200000,
52 max_output_tokens: 8192,
53 supports_vision: true,
54 supports_tools: true,
55 cost_per_million_input: 0.0,
56 cost_per_million_output: 0.0,
57 },
58 ModelInfo {
59 id: "code-suggestions".to_string(),
60 name: "Code Suggestions (GitLab Duo)".to_string(),
61 provider: "gitlab".to_string(),
62 context_window: 8192,
63 max_output_tokens: 2048,
64 supports_vision: false,
65 supports_tools: false,
66 cost_per_million_input: 0.0,
67 cost_per_million_output: 0.0,
68 },
69 ];
70
71 Self {
72 client: Client::new(),
73 config,
74 models,
75 }
76 }
77
78 fn get_api_url(&self) -> String {
79 self.config

Callers

nothing calls this directly

Calls 1

newFunction · 0.85

Tested by

no test coverage detected