DB-GPT icon indicating copy to clipboard operation
DB-GPT copied to clipboard

[Bug] [Chat_Data] use stream model return json without data

Open sun-timer opened this issue 1 year ago • 4 comments

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

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. image

What you expected to happen

Return streaming output results, just like non streaming output. image

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!

sun-timer avatar Nov 14 '24 11:11 sun-timer

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

Aries-ckt avatar Nov 14 '24 15:11 Aries-ckt

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 image image

sun-timer avatar Nov 15 '24 01:11 sun-timer

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?

Aries-ckt avatar Nov 15 '24 02:11 Aries-ckt

This issue has been marked as stale, because it has been over 30 days without any activity.

github-actions[bot] avatar Mar 15 '25 21:03 github-actions[bot]