DB-GPT
DB-GPT copied to clipboard
[Bug] [Chat_Data] use stream model return json without data
Search before asking
- [X] I had searched in the issues and found no similar issues.
Operating system information
Linux
Python version information
3.10
DB-GPT version
latest release
Related scenes
- [X] Chat Data
- [ ] Chat Excel
- [ ] Chat DB
- [ ] Chat Knowledge
- [ ] Model Management
- [ ] Dashboard
- [ ] Plugins
Installation Information
-
[ ] AutoDL Image
-
[ ] Other
Device information
x86_64 NVIDIA GeForce GTX 1080
Models information
LLM: iFlytekSpark-13B Embedding model:text2vec-large-chinese
What happened
When I call the streaming answer mode with the API, the answer result is only JSON characters, without data.
What you expected to happen
Return streaming output results, just like non streaming output.
How to reproduce
curl -X POST "http://localhost:5670/api/v2/chat/completions"
-H "Authorization: Bearer dbgpt"
-H "accept: application/json"
-H "Content-Type: application/json"
-d "{"messages":"Hello","model":"chatgpt_proxyllm", "stream": true}"
Additional context
nothing
Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
curl -X POST "http://localhost:5670/api/v2/chat/completions"
-H "Authorization: Bearer dbgpt"
-H "accept: application/json"
-H "Content-Type: application/json"
-d "{"messages":"Hello","model":"chatgpt_proxyllm", "stream": true}"
it is a normal chat, you can set your mode like
DBGPT_API_KEY=dbgpt
DB_NAME="{your_db_name}"
curl -X POST "http://localhost:5670/api/v2/chat/completions" \
-H "Authorization: Bearer $DBGPT_API_KEY" \
-H "accept: application/json" \
-H "Content-Type: application/json" \
-d "{\"messages\":\"show space datas limit 5\",\"model\":\"chatgpt_proxyllm\", \"chat_mode\": \"chat_data\", \"chat_param\": \"$DB_NAME\"}"
reference: http://docs.dbgpt.cn/docs/api/datasource
thank u for answer. What I mean is that it returned an incorrect response, which is that the streaming output did not output the complete table at the end. I use Source Code Deployment, where shall I modify to fix it
it looks like web chat data app not correct , can you show the whole complete chat data screen shot? did you specify your db name?
This issue has been marked as stale, because it has been over 30 days without any activity.