From b272fec78e30d1a10f3ab761684a119193391296 Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期二, 19 十一月 2024 17:08:57 +0800 Subject: [PATCH] 解决冲突 --- app/service/ragflow.py | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/app/service/ragflow.py b/app/service/ragflow.py index 6d6012d..769631d 100644 --- a/app/service/ragflow.py +++ b/app/service/ragflow.py @@ -146,12 +146,15 @@ } ] if data else [] - async def get_session_history(self, token: str, chat_id: str) -> list: + async def get_session_history(self, token: str, chat_id: str, is_all: int=0): url = f"{self.base_url}/v1/conversation/get?conversation_id={chat_id}" headers = {"Authorization": token} async with httpx.AsyncClient() as client: response = await client.get(url, headers=headers) data = self._handle_response(response) + # print("----------------data----------------------:", data) + if is_all: + return data return data.get("message", []) async def upload_and_parse(self, token: str, chat_id: str, filename: str, file: bytes) -> str: @@ -172,6 +175,7 @@ data = {"email": email, "user_id": user_id} async with httpx.AsyncClient(timeout=60) as client: response = await client.post(url, headers=headers, json=data) + print(response) if response.status_code != 200: raise Exception(f"Ragflow add user to tenant failed: {response.text}") -- Gitblit v1.8.0