fix
zhangqian
2024-10-17 4e8cecd4ca733ba9356ba0e8df4b8da31eee286c
fix
2个文件已修改
7 ■■■■ 已修改文件
app/api/chat.py 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/service/ragflow.py 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/api/chat.py
@@ -56,6 +56,11 @@
                                await websocket.send_json(result)
                                await websocket.close()
                                return
                        else:
                            chat_history.append({
                                "content": message["message"],
                                "role": "user"
                            })
                    async for rag_response in ragflow_service.chat(token, chat_id, chat_history):
                        try:
                            print(f"Received from ragflow: {rag_response}")
app/service/ragflow.py
@@ -59,7 +59,7 @@
        print(data)
        target_url = f"{self.base_url}/v1/conversation/completion"
        async with httpx.AsyncClient(timeout=10.0) as client:
        async with httpx.AsyncClient(timeout=300.0) as client:
            headers = {
                'Content-Type': 'application/json',
                'Authorization': token