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

Function parse_model_ref

crates/opencode-agent/src/agent.rs:810–823  ·  view source on GitHub ↗
(raw: &str)

Source from the content-addressed store, hash-verified

808}
809
810fn parse_model_ref(raw: &str) -> Option<ModelRef> {
811 let raw = raw.trim();
812 if raw.is_empty() {
813 return None;
814 }
815 let (provider, model) = raw.split_once(':').or_else(|| raw.split_once('/'))?;
816 if provider.is_empty() || model.is_empty() {
817 return None;
818 }
819 Some(ModelRef {
820 provider_id: provider.to_string(),
821 model_id: model.to_string(),
822 })
823}
824
825fn merge_json_value(target: &mut serde_json::Value, source: serde_json::Value) {
826 match (target, source) {

Callers

nothing calls this directly

Calls 1

is_emptyMethod · 0.80

Tested by

no test coverage detected