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

Method parse_model_string

crates/opencode-session/src/prompt.rs:1702–1719  ·  view source on GitHub ↗
(raw: &str)

Source from the content-addressed store, hash-verified

1700 }
1701
1702 fn parse_model_string(raw: &str) -> ModelRef {
1703 if let Some((provider_id, model_id)) = raw.split_once(':').or_else(|| raw.split_once('/')) {
1704 return ModelRef {
1705 provider_id: provider_id.to_string(),
1706 model_id: model_id.to_string(),
1707 };
1708 }
1709 if raw.is_empty() {
1710 return ModelRef {
1711 provider_id: "default".to_string(),
1712 model_id: "default".to_string(),
1713 };
1714 }
1715 ModelRef {
1716 provider_id: "default".to_string(),
1717 model_id: raw.to_string(),
1718 }
1719 }
1720
1721 fn compose_subsession_prompt(history: &[PersistedSubsessionTurn], prompt: &str) -> String {
1722 if history.is_empty() {

Callers 1

Calls 1

is_emptyMethod · 0.80

Tested by

no test coverage detected