Files
evo-ai/.venv/lib/python3.10/site-packages/litellm/router_utils/common_utils.py
2025-04-25 15:30:54 -03:00

15 lines
434 B
Python

import hashlib
import json
from litellm.types.router import CredentialLiteLLMParams
def get_litellm_params_sensitive_credential_hash(litellm_params: dict) -> str:
"""
Hash of the credential params, used for mapping the file id to the right model
"""
sensitive_params = CredentialLiteLLMParams(**litellm_params)
return hashlib.sha256(
json.dumps(sensitive_params.model_dump()).encode()
).hexdigest()