jihuaqiang 3 недель назад
Родитель
Сommit
f9c978f4cb
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      agents/store_agent/agent.py

+ 2 - 2
agents/store_agent/agent.py

@@ -71,12 +71,12 @@ def _upload_chunk(text: str, query: str, channel: str = "", max_retries: int = 3
         "text": text,
         "ext": json.dumps({"query": query, "channel": channel or ""}, ensure_ascii=False),
     }
-    headers = {"Content-Type": "application/json"}
+    headers = {"Content-Type": "application/json; charset=utf-8"}
 
     for attempt in range(max_retries):
         try:
             # 以 GET 方法发送,body 为 JSON 字符串
-            body = json.dumps(payload, ensure_ascii=False)
+            body = json.dumps(payload, ensure_ascii=False).encode('utf-8')
             resp = requests.get(CHUNK_API_URL, headers=headers, data=body, timeout=30)
             logger.info(f"上传chunk请求体: payload={payload}")
             try: