| Name | Type | Description |
|---|---|---|
spec* | str | Model spec in Same shape accepted by |
kwargs | Mapping[str, Any] | None | Default: NoneCaller-supplied kwargs that override profile defaults on shared keys. Defaults to an empty mapping. |
run_pre_init | bool | Default: True |
Compose init_chat_model kwargs from the registered profile for spec.
deepagents.profiles exposes beta APIs that may receive minor changes in
future releases. Refer to the versioning documentation
for more details.
This is the recommended entry point for honoring ProviderProfile
registrations when building a chat model — it composes lookup, pre_init
invocation, and kwargs merging into a single call. get_provider_profile
only returns the registered object; pair it with this helper (or call
this helper directly) any time you intend to actually instantiate a
model. Used by resolve_model and intended for any harness that layers
config-file values on top of SDK defaults.
Looks up the profile via get_provider_profile, runs its pre_init hook
(unless suppressed), and returns a fresh dict combining init_kwargs,
init_kwargs_factory() output, and kwargs. Caller-supplied kwargs
take highest precedence — profile defaults sit beneath them — so
user-provided values from config files or explicit overrides are never
silently replaced.
When no profile is registered for spec, returns a copy of kwargs
unchanged. This keeps the helper safe to call unconditionally.
When True (default), invokes the profile's pre_init
hook before composing kwargs.
Set False to inspect the merged kwargs without firing
side effects (e.g. dry-run, validation).