Langchain-Chatchat
Langchain-Chatchat copied to clipboard
API版本能否提供WEBSOCKET的流式接口
webui 版本中,采用了WS的流式输出,整体感知反应很快 api版本中chat接口是get请求的,要等到内容全部响应完成才输出,等待时间过长
api.py中是有websocket接口的
api版本中chat接口是否可以返回回复
webui 版本中,采用了WS的流式输出,整体感知反应很快 api版本中chat接口是get请求的,要等到内容全部响应完成才输出,等待时间过长
api.py 有的,不过文档没有,我用postman试过 没有问题。你搜索stream_chat 就可以看到
请问postman的stream_chat如何测试?我这边一直报403错误
补充一下:测试用的url为:ws://3e78s46749.imdo.co:18101/stream-chat/motor_t700s,motor_t700s是我用接口上传的一个小的知识库
补充一下:测试用的url为:ws://3e78s46749.imdo.co:18101/stream-chat/motor_t700s,motor_t700s是我用接口上传的一个小的知识库
我看了一下接口应该是:/local_doc_qa/stream-chat/{knowledge_base_id}。
你打开postman新开一个ws的请求,然后链接填 {公网ip:端口}/local_doc_qa/stream-chat/test1 ,message选择JSON
have a similar question about the api request, https://github.com/imClumsyPanda/langchain-ChatGLM/issues/465
+1 报错 返回Status Code: 400 Bad Request
搞定了,postman里要在url前面显式的加一下wss:// url:port//local_doc_qa/stream-chat/{knowledge_base_id} 要不默认是http去请求。。。 脑残
@tomiezhang @imClumsyPanda @Ayo616 @ucas010
问一下,stream-chat函数能使用curl1调用吗? 我下面这样调用,为什么报错:
curl -X 'POST'
'http://127.0.0.1:8000/local_doc_qa/stream-chat/baoxian_FAISS_20230602_172352'
-H 'accept: application/json'
-H 'Content-Type: application/json'
-d '{
"question": "卡塔尔世界杯冠军是谁",
"history": [],
"knowledge_base_id": "baoxian_FAISS_20230602_172352",
}'
stream-chat流式调用应该用的是websocket吧? 所以应该是ws://ip:port/local_doc_qa/stream-chat/{knowledge_base_id}, 我认为应该是这样的,我还没测
@wufxgtihub123 大佬,问一下,启动api.py后,具体是怎么调用的呢?
测试结果不对: ws://172.168.705.72:861/local_doc_qa/stream-chat/100270 { "question": "向量数据库是什么?", "history": [], "knowledge_base_id": "100270" } 返回: { "detail": "Not Found" }
url里去掉knowledge_id之后是可行的吗
Lychee X @.***>于2023年6月9日 周五11:41写道:
测试结果不对: ws://172.168.705.72:861/local_doc_qa/stream-chat/100270 { "question": "向量数据库是什么?", "history": [], "knowledge_base_id": "100270" } 返回: { "detail": "Not Found" }
— Reply to this email directly, view it on GitHub https://github.com/imClumsyPanda/langchain-ChatGLM/issues/464#issuecomment-1583922143, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLH5EQE2AEIIVMWTD3EP63XKKLNTANCNFSM6AAAAAAYOFMSOY . You are receiving this because you were mentioned.Message ID: @.***>
No
@imClumsyPanda
前面的post选项换掉,建议使用postman进行测试,apifox好像暂时不支持websocket测试
发自我的iPhone
------------------ 原始邮件 ------------------ 发件人: Lychee X @.> 发送时间: 2023年6月9日 11:41 收件人: imClumsyPanda/langchain-ChatGLM @.> 抄送: Flylyy @.>, Mention @.> 主题: Re: [imClumsyPanda/langchain-ChatGLM] API版本能否提供WEBSOCKET的流式接口 (Issue #464)
测试结果不对: ws://172.168.705.72:861/local_doc_qa/stream-chat/100270 { "question": "向量数据库是什么?", "history": [], "knowledge_base_id": "100270" } 返回: { "detail": "Not Found" }
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>
post换成啥?我这就是postman
post换成啥?我这就是postman
这样试一下
我的url后面跟了knowledge-base-id是可以调通的,你加上knowledge-base-id试一下?
返回数据呢?
connected,,,
返回数据呢? connected,,,
connect后有没有点击发送?
点击send后断开链接了,,,
点击send后断开链接了,,,
看下后端服务有无报错信息?
OK了,感谢 @wufxgtihub123 @wufxgtihub123
OK了,感谢 @wufxgtihub123 @wufxgtihub123
请问下这个base-id是从哪里得到的?我的只有个base-name,另外ip地址设置的位置是那些地方?,我设置server_config.p里面的DEFAULT_BIND_HOST为0.0.0.0之后就报错了
我怎么搜索不到WEBSOCKET的接口,stream_chat还有吗,哪个分支