Spaces:
Paused
Paused
Z User
v5.8.8: fix thinking leak, anti-manipulation compliance, hallucination of server data
cde5d07 Download proxy_tmp_patch.py from TomatitoToho/zelin-bot: direct link, hf CLI and curl.
- Browser
- Download file 808 Bytes
-
https://huggingface.co/spaces/TomatitoToho/zelin-bot/resolve/main/proxy_tmp_patch.py
- Command line
-
hf download hf://spaces/TomatitoToho/zelin-bot/proxy_tmp_patch.py
-
curl -L -o proxy_tmp_patch.py https://huggingface.co/spaces/TomatitoToho/zelin-bot/resolve/main/proxy_tmp_patch.py
808 Bytes
| import re | |
| with open('proxy.js', 'r') as f: | |
| content = f.read() | |
| # Add temporary raw-config endpoint before the "Default" response | |
| patch = ''' | |
| // TEMPORARY - Read raw config (will be removed) | |
| if (url.pathname === '/raw-config') { | |
| try { | |
| const config = JSON.parse(readFileSync('/app/config.json', 'utf8')); | |
| res.writeHead(200, { 'Content-Type': 'application/json' }); | |
| res.end(JSON.stringify(config, null, 2)); | |
| } catch (e) { | |
| res.writeHead(500, { 'Content-Type': 'text/plain' }); | |
| res.end('Config error: ' + e.message); | |
| } | |
| return; | |
| } | |
| ''' | |
| # Insert before the "// Default" comment | |
| content = content.replace(" // Default\n", patch + " // Default\n") | |
| with open('proxy.js', 'w') as f: | |
| f.write(content) | |
| print("Patched proxy.js") | |