Check whether a model instance already matches a string model spec.
Matching is performed in two ways: first by exact string equality between
spec and the model identifier, then by comparing only the model-name
portion of a provider:model spec against the identifier. For example,
"openai:gpt-5" matches a model with identifier "gpt-5".
Assumes the provider:model convention (single colon separator).
model_matches_spec(
model: BaseChatModel,
spec: str,
) -> bool| Name | Type | Description |
|---|---|---|
model* | BaseChatModel | Chat model instance to inspect. |
spec* | str | Model spec in |