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

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

> This function is defined in the [**protocols**](../modules/protocols) 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

<ParamField query="config" type="Optional" required={true}>
  The parsed gateway config mapping (or `None`/empty).
</ParamField>

### Returns

<ResponseField name="Returns" type="str">
  A 12-character hex revision id; a stable sentinel for an empty config.
</ResponseField>

## Uses

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

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/gateway/protocols.py#L1156">
  `praisonaiagents/gateway/protocols.py` at line 1156
</Card>

***

## Related Documentation

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

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

  <Card title="Multimodal" icon="eye" href="/docs/docs/features/multimodal" />
</CardGroup>
