gushoubang 1 Minggu lalu
induk
melakukan
9a93cafd24
2 mengubah file dengan 2 tambahan dan 0 penghapusan
  1. TEMPAT SAMPAH
      app/services/__pycache__/chat_service.cpython-310.pyc
  2. 2 0
      app/services/chat_service.py

TEMPAT SAMPAH
app/services/__pycache__/chat_service.cpython-310.pyc


+ 2 - 0
app/services/chat_service.py

@@ -12,6 +12,7 @@ from app.common.word import target_word
 from app.common.res import res_success, res_error
 from app.utils.log_utils import logger
 import re
+from markdownify import markdownify
 
 
 # read_csv = pd.read_csv("E:\\siwei_ai\\poi.csv")
@@ -174,6 +175,7 @@ def create_chat(msg, type_ai):
         if match:
             think_content = match.group(1)
             think_content = think_content.replace("\n", "")
+            think_content = markdownify(think_content)  # 转换为 Markdown
             # print(think_content)
         else:
             print("没有找到<think>标签内容。")