From 673f474822f639f19ef51b3d914be2b98d92a1eb Mon Sep 17 00:00:00 2001 From: Clivia <132346501+Yanyutin753@users.noreply.github.com> Date: Fri, 9 Feb 2024 15:24:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=AF=B7=E6=B1=82=E5=A4=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/main.py b/main.py index 22e2e5f..2e9ee1d 100644 --- a/main.py +++ b/main.py @@ -319,11 +319,9 @@ def generate_gpts_payload(model, messages): # PANDORA_UPLOAD_URL = 'files.pandoranext.com' -VERSION = '0.7.6' +VERSION = '0.7.7' # VERSION = 'test' -UPDATE_INFO = '支持proxy参数' - - +# UPDATE_INFO = '增加Arkose请求头' # UPDATE_INFO = '【仅供临时测试使用】 ' # 解析响应中的信息 @@ -577,7 +575,7 @@ def upload_file(file_content, mime_type, api_key): try: width, height = get_image_dimensions(file_content) except Exception as e: - logger.error(f"图片信息获取异常, 切换为text/plain: {e}") + logger.error(f"图片信息获取异常, 自动切换图片大小: {e}") mime_type = 'text/plain' # logger.debug(f"文件内容: {file_content}") @@ -927,6 +925,9 @@ def send_text_prompt_and_get_response(messages, api_key, stream, model): if CUSTOM_ARKOSE: token = get_token() payload["arkose_token"] = token + # 在headers中添加新字段 + headers["Openai-Sentinel-Arkose-Token"] = token + logger.debug(f"headers: {headers}") logger.debug(f"payload: {payload}") response = requests.post(url, headers=headers, json=payload, stream=True) # print(response)