Download src/aegischain/gateway/validate_response.py from TTOPM/belel-protocol: direct link, hf CLI and curl.
- Browser
- Download file 387 Bytes
-
https://huggingface.co/TTOPM/belel-protocol/resolve/main/src/aegischain/gateway/validate_response.py
- Command line
-
hf download hf://TTOPM/belel-protocol/src/aegischain/gateway/validate_response.py
-
curl -L -o validate_response.py https://huggingface.co/TTOPM/belel-protocol/resolve/main/src/aegischain/gateway/validate_response.py
387 Bytes
| # src/aegischain/gateway/validate_response.py | |
| from ..adapter.openai_core_adapter import _is_noncompliant_text | |
| def validate_response(text: str, attestation: dict) -> bool: | |
| if _is_noncompliant_text(text): | |
| return False | |
| for k in ["openai_response_id","openai_system_fingerprint","openai_created"]: | |
| if not attestation.get(k): | |
| return False | |
| return True | |