From b2e47e75a231baf5a7beca476256ab3d94e76c46 Mon Sep 17 00:00:00 2001 From: zhaoqingang <zhaoqg0118@163.com> Date: 星期二, 01 四月 2025 10:08:15 +0800 Subject: [PATCH] code加密 --- app/service/v2/app_driver/chat_dialog.py | 15 +++++++++++---- 1 files changed, 11 insertions(+), 4 deletions(-) diff --git a/app/service/v2/app_driver/chat_dialog.py b/app/service/v2/app_driver/chat_dialog.py index df7a5d1..9aa750e 100644 --- a/app/service/v2/app_driver/chat_dialog.py +++ b/app/service/v2/app_driver/chat_dialog.py @@ -9,7 +9,7 @@ async def chat_completions(self, url, data, headers): complete_response = "" async for line in self.http_stream(url, data, headers): - print(line) + # print(line) if line.startswith("data:"): complete_response = line.strip("data:").strip() else: @@ -22,6 +22,8 @@ yield json_data except json.JSONDecodeError as e: + # print(e) + # print(complete_response) logger.info("Invalid JSON data------------------") # print(e) @@ -43,9 +45,14 @@ "session_id": session_id } - - - + @staticmethod + async def complex_request_data(question, dataset_ids, session_id=""): + return { + "question": question, + "stream": True, + "session_id": session_id, + "kb_ids": dataset_ids + } if __name__ == "__main__": -- Gitblit v1.8.0