Download src/utils/common.py from jffh/yuanbao: direct link, hf CLI and curl.
- Browser
- Download file 521 Bytes
-
https://huggingface.co/spaces/jffh/yuanbao/resolve/main/src/utils/common.py
- Command line
-
hf download hf://spaces/jffh/yuanbao/src/utils/common.py
-
curl -L -o common.py https://huggingface.co/spaces/jffh/yuanbao/resolve/main/src/utils/common.py
521 Bytes
| from typing import Dict | |
| def generate_headers(request: dict, token: str) -> Dict[str, str]: | |
| return { | |
| "Cookie": f"hy_source={request['hy_source']}; hy_user={request['hy_user']}; hy_token={token}", | |
| "Origin": "https://yuanbao.tencent.com", | |
| "Referer": f"https://yuanbao.tencent.com/chat/{request['agent_id']}", | |
| "X-Agentid": request["agent_id"], | |
| "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36", | |
| } | |