resolve • AI Agent SDK

resolve: Resolve a consolidated parameter following precedence rules:

resolve

Function

</div>

This function is defined in the param_resolver module.

Resolve a consolidated parameter following precedence rules: Instance &gt; Config &gt; Array &gt; Dict &gt; String &gt; Bool &gt; Default

Signature

python
def resolve(value: Any, param_name: str, config_class: Optional[Type], presets: Optional[Dict[str, Any]], default: Any, instance_check: Optional[Callable[[Any], bool]], url_schemes: Optional[Dict[str, str]], array_mode: Optional[str], string_mode: Optional[str]) -> Any

Parameters

ParamField Any

The parameter value

ParamField str

Name of the parameter (for error messages)

ParamField Optional[Type]

Expected config dataclass type

ParamField Optional

Dict mapping preset strings to config dicts or instances

ParamField Any

Default value if None/unset

ParamField Optional

Function to check if value is an instance

ParamField Optional

Dict mapping URL schemes to backend names

ParamField Optional[str]

How to handle array values (see ArrayMode)

ParamField Optional[str]

How to handle string values (“path_as_source”, etc.)

Returns

ResponseField Any

Resolved config object or value

Exceptions

ValueError

If value is invalid with helpful error message

Uses

  • instance_check
  • TypeError
  • config_class

Used By

Source

View on GitHub

praisonaiagents/config/param_resolver.py at line 45