From 2ab8a0e98c782a55c69a22d4b49bf294b8cfc2d9 Mon Sep 17 00:00:00 2001 From: xuyonghao <898441624@qq.com> Date: 星期一, 10 二月 2025 13:53:09 +0800 Subject: [PATCH] 报告生成代码同步完善 --- app/service/v2/app_driver/chat_base.py | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/service/v2/app_driver/chat_base.py b/app/service/v2/app_driver/chat_base.py index baacbc9..ccd6cbd 100644 --- a/app/service/v2/app_driver/chat_base.py +++ b/app/service/v2/app_driver/chat_base.py @@ -22,19 +22,20 @@ @staticmethod async def http_post(url, data, headers, timeout=300): async with httpx.AsyncClient(timeout=timeout) as client: - response = client.post(url, json=data, headers=headers) + response = await client.post(url, json=data, headers=headers) return response @staticmethod async def http_get(url, params, headers, timeout=300): async with httpx.AsyncClient(timeout=timeout) as client: - response = client.get(url, params=params, headers=headers) + response = await client.get(url, params=params, headers=headers) return response @staticmethod async def get_headers(token): - headers = { - # 'Content-Type': 'application/json', + return { + 'Content-Type': 'application/json', 'Authorization': f'Bearer {token}' } + -- Gitblit v1.8.0