> ## 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.

# Compute Config Revision • AI Agent SDK

> compute_config_revision: Return a stable, short revision id for a gateway config mapping.

# compute\_config\_revision

Function

> This function is defined in the [**protocols**](https://praison.ai/docs/sdk/reference/praisonaiagents/modules/protocols.md) module.

Return a stable, short revision id for a gateway config mapping.

Deterministic hash over the *canonical* form of `config` (keys sorted,
whitespace-insensitive) so the same logical config always yields the same
revision regardless of key ordering or formatting. Comparing the revision
of the running config against the revision of what is on disk gives a
first-class config-drift signal ("did my change take effect / is a restart
still owed?").

Pure and dependency-free (stdlib `json` + `hashlib`) so it lives in
core and is reused by both the SDK and the bot without divergence.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def compute_config_revision(config: Optional[Dict[str, Any]]) -> str
```

## Parameters

**config** `Optional` *required*

The parsed gateway config mapping (or `None`/empty).

### Returns

**Returns** `str`

A 12-character hex revision id; a stable sentinel for an empty config.

## Uses

* `json.dumps`
* `hexdigest`
* `hashlib.sha256`
* `canonical.encode`

## Source

> [card] [View on GitHub](https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/gateway/protocols.py#L1556)
>
> `praisonaiagents/gateway/protocols.py` at line 1556

***

## Related Documentation

> [card] [Configuration Overview](https://praison.ai/docs/docs/configuration/index)

> [card] [Agent Config](https://praison.ai/docs/docs/configuration/agent-config)

> [card] [Multimodal](https://praison.ai/docs/docs/features/multimodal)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.