Parse URL To Config • AI Agent SDK

parse_url_to_config: Parse a URL string into a config object.

parse_url_to_config

Function

</div>

This function is defined in the parse_utils module.

Parse a URL string into a config object.

Signature

python
def parse_url_to_config(url: str, config_class: type, url_schemes: Dict[str, str]) -> Any

Parameters

ParamField str

URL string (e.g., “postgresql://localhost/db”)

ParamField type

Config dataclass to instantiate

ParamField Dict

Mapping of URL schemes to backend names

Returns

ResponseField Any

Config instance with backend and url set

Exceptions

ValueError

If URL scheme is not supported

Uses

  • detect_url_scheme
  • ValueError
  • config_class

Source

View on GitHub

praisonaiagents/config/parse_utils.py at line 53


Related Documentation