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

Function variants_for_model

crates/opencode-server/src/routes.rs:2260–2270  ·  view source on GitHub ↗
(
    lookup: &HashMap<String, HashMap<String, Vec<String>>>,
    provider_id: &str,
    model_id: &str,
)

Source from the content-addressed store, hash-verified

2258}
2259
2260fn variants_for_model(
2261 lookup: &HashMap<String, HashMap<String, Vec<String>>>,
2262 provider_id: &str,
2263 model_id: &str,
2264) -> Vec<String> {
2265 lookup
2266 .get(provider_id)
2267 .and_then(|models| models.get(model_id))
2268 .cloned()
2269 .unwrap_or_default()
2270}
2271
2272async fn list_providers(State(state): State<Arc<ServerState>>) -> Json<ProviderListResponse> {
2273 let variant_lookup = get_model_variant_lookup().await;

Callers 2

list_providersFunction · 0.85
get_config_providersFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected