Create a chat model.
Uses init_chat_model for standard providers, or imports a custom
BaseChatModel subclass when the provider has a class_path in config.
Supports provider:model format (e.g., 'anthropic:claude-sonnet-4-5')
for explicit provider selection, or bare model names for auto-detection.
create_model(
model_spec: str | None = None,
*,
extra_kwargs: dict[str, Any] | None = None
) -> ModelResult| Name | Type | Description |
|---|---|---|
model_spec | str | None | Default: NoneModel specification in |
extra_kwargs | dict[str, Any] | None | Default: NoneAdditional kwargs to pass to the model constructor. These take highest priority, overriding values from the config file. |