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

Method from_provider_id

crates/opencode-provider/src/transform.rs:27–42  ·  view source on GitHub ↗
(id: &str)

Source from the content-addressed store, hash-verified

25
26impl ProviderType {
27 pub fn from_provider_id(id: &str) -> Self {
28 let id_lower = id.to_lowercase();
29 if id_lower == "anthropic" || id_lower.contains("claude") {
30 ProviderType::Anthropic
31 } else if id_lower == "openrouter" {
32 ProviderType::OpenRouter
33 } else if id_lower == "bedrock" || id_lower.contains("bedrock") {
34 ProviderType::Bedrock
35 } else if id_lower == "gateway" {
36 ProviderType::Gateway
37 } else if id_lower == "openai" || id_lower == "azure" {
38 ProviderType::OpenAI
39 } else {
40 ProviderType::Other
41 }
42 }
43
44 pub fn supports_caching(&self) -> bool {
45 matches!(

Callers

nothing calls this directly

Calls 1

containsMethod · 0.80

Tested by

no test coverage detected