chatgpt4o api流式输出如何计算消耗的tokens数量?
如何不是流式输出会输出总的消耗token数量,那么流式模式下呢?
这是非流式模式下输出tokens数量:
{
"id": "chatcmpl-123",
"object": "chat.completion",
"created": 1677652288,
"choices": [{
"index": 0,
"message": {
"role": "assistant",
"content": "\n\nHello there, how may I assist you today?",
},
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 9,
"completion_tokens": 12,
"total_tokens": 21
}
}流式模式下api接口没有统计消耗的tokens{
"id":"chatcmpl76y3gsGmxYfioodOWIFgxxxxxV",
"object":"chat.completion.chunk",
"created":1681895111,
"model":"gpt-3.5-turbo-0301",
"choices":[
{
"delta":{"content":"xx""},
"index":0,
"finish_reason":null
}
]
}网友回复
seedance2如何根据一张九宫格分镜头图片生成ai视频短剧?
www.gstatic.com打开报错net::ERR_TUNNEL_CONNECTION_FAILED
果蝇大脑神经在计算机中复原意味人脑神经和意识也可在计算机中复原?
cosyvoice-v3.5声音克隆报错:Error during speech synthesis: start speech synthesizer failed within 5s.
html如何实现二进制程序转成汇编代码?
python如何通过音色描述和说话内容生成语音?
python如何通过api调用Seedance 2.0 模型生成视频?
如何使用grok imagine免费生成10分钟ai短片?
ai能破解exe文件重写源代码吗?
浏览器除了于Chromium内核还有其他的不用于Chromium内核的浏览器吗?


