missuo / FreeGPT35

Utilize the unlimited free GPT-3.5-Turbo API service provided by the login-free ChatGPT Web.
GNU Affero General Public License v3.0
3.34k stars 1.03k forks source link

你好,返回结果为什么是分多个数组元素 #27

Closed joykerl closed 7 months ago

joykerl commented 7 months ago

我让GPT总结一篇文章,然后每个字都分一条data,这样取值比较麻烦,为什么是这样返回的?是我请求不对吗

data: {"id":"chatcmpl-bjKI588Q3ykpHOEE33fcsW05hSfZ","created":1712407975839,"object":"chat.completion.chunk","model":"gpt-3.5-turbo","choices":[{"delta":{"content":"阿"},"index":0,"finish_reason":null}]}

data: {"id":"chatcmpl-bjKI588Q3ykpHOEE33fcsW05hSfZ","created":1712407975839,"object":"chat.completion.chunk","model":"gpt-3.5-turbo","choices":[{"delta":{"content":"尔"},"index":0,"finish_reason":null}]}

data: {"id":"chatcmpl-bjKI588Q3ykpHOEE33fcsW05hSfZ","created":1712407975839,"object":"chat.completion.chunk","model":"gpt-3.5-turbo","choices":[{"delta":{"content":"玛"},"index":0,"finish_reason":null}]}

data: {"id":"chatcmpl-bjKI588Q3ykpHOEE33fcsW05hSfZ","created":1712407975839,"object":"chat.completion.chunk","model":"gpt-3.5-turbo","choices":[{"delta":{"content":"・"},"index":0,"finish_reason":null}]}

data: {"id":"chatcmpl-bjKI588Q3ykpHOEE33fcsW05hSfZ","created":1712407975839,"object":"chat.completion.chunk","model":"gpt-3.5-turbo","choices":[{"delta":{"content":"卡"},"index":0,"finish_reason":null}]}

data: {"id":"chatcmpl-bjKI588Q3ykpHOEE33fcsW05hSfZ","created":1712407975839,"object":"chat.completion.chunk","model":"gpt-3.5-turbo","choices":[{"delta":{"content":"瑞"},"index":0,"finish_reason":null}]}

data: {"id":"chatcmpl-bjKI588Q3ykpHOEE33fcsW05hSfZ","created":1712407975839,"object":"chat.completion.chunk","model":"gpt-3.5-turbo","choices":[{"delta":{"content":","},"index":0,"finish_reason":null}]}

yushangxiao commented 7 months ago

这是流式传输。如果想要返回一条,可以把参数stream设为false

missuo commented 7 months ago

这是流式传输。如果想要返回一条,可以把参数stream设为false

True ✅

joykerl commented 7 months ago

已解决,感谢