Closed joykerl closed 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}]}
这是流式传输。如果想要返回一条,可以把参数stream设为false
True ✅
已解决,感谢
我让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}]}