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

Function parse_model

crates/opencode-provider/src/bootstrap.rs:1741–1753  ·  view source on GitHub ↗

Parse a "provider/model" format string.

(model_str: &str)

Source from the content-addressed store, hash-verified

1739
1740/// Parse a "provider/model" format string.
1741pub fn parse_model(model_str: &str) -> ParsedModel {
1742 if let Some(pos) = model_str.find('/') {
1743 ParsedModel {
1744 provider_id: model_str[..pos].to_string(),
1745 model_id: model_str[pos + 1..].to_string(),
1746 }
1747 } else {
1748 ParsedModel {
1749 provider_id: model_str.to_string(),
1750 model_id: String::new(),
1751 }
1752 }
1753}
1754
1755// ---------------------------------------------------------------------------
1756// ProviderPatch - partial update for ProviderState

Callers 2

get_small_modelMethod · 0.85
default_modelMethod · 0.85

Calls 2

newFunction · 0.85
findMethod · 0.80

Tested by

no test coverage detected