> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Parse URL To Config • AI Agent SDK

> parse_url_to_config: Parse a URL string into a config object.

# parse\_url\_to\_config

<div className="flex items-center gap-2">
  <Badge color="teal">Function</Badge>
</div>

> This function is defined in the [**parse\_utils**](../modules/parse_utils) module.

Parse a URL string into a config object.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def parse_url_to_config(url: str, config_class: type, url_schemes: Dict[str, str]) -> Any
```

## Parameters

<ParamField query="url" type="str" required={true}>
  URL string (e.g., "postgresql://localhost/db")
</ParamField>

<ParamField query="config_class" type="type" required={true}>
  Config dataclass to instantiate
</ParamField>

<ParamField query="url_schemes" type="Dict" required={true}>
  Mapping of URL schemes to backend names
</ParamField>

### Returns

<ResponseField name="Returns" type="Any">
  Config instance with backend and url set
</ResponseField>

### Exceptions

<AccordionGroup>
  <Accordion title="ValueError">
    If URL scheme is not supported
  </Accordion>
</AccordionGroup>

## Uses

* `detect_url_scheme`
* `ValueError`
* `config_class`

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/config/parse_utils.py#L53">
  `praisonaiagents/config/parse_utils.py` at line 53
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Configuration Overview" icon="gear" href="/docs/configuration/index" />

  <Card title="Agent Config" icon="robot" href="/docs/configuration/agent-config" />
</CardGroup>
