MCPcopy Create free account
hub / github.com/Dizzy-K/AutoPT / resolve_model

Function resolve_model

models/registry.py:49–58  ·  view source on GitHub ↗
(identifier: str, *, default_provider: str = "openai")

Source from the content-addressed store, hash-verified

47
48
49def resolve_model(identifier: str, *, default_provider: str = "openai") -> ModelSpec:
50 raw_identifier = identifier.strip()
51 if not raw_identifier:
52 raise ValueError("Model identifier cannot be empty.")
53
54 provider_candidate, separator, model_name = raw_identifier.partition(":")
55 if separator and provider_candidate.strip().lower() in SUPPORTED_PROVIDERS:
56 return build_model_spec(model_name, provider=provider_candidate)
57
58 return build_model_spec(raw_identifier, provider=default_provider)

Callers 2

build_task_requestsMethod · 0.90
_resolve_model_specFunction · 0.90

Calls 1

build_model_specFunction · 0.85

Tested by

no test coverage detected