表示来自 API 的完成响应对象。注意:流式响应和非流式响应对象具有相同的结构(与 chat 端点不同)。
参数
类型
描述
id
string
完成的唯一标识符
choices
array
模型为输入提示生成的完成选项列表
created
integer
创建完成的Unix时间戳(秒)
model
string
用于完成的模型
system_fingerprint
string
该指纹表示模型运行的后端配置
object
string
对象类型,总是 "text_completion"
usage
object
完成请求的使用统计信息
completion_tokens
integer
生成的完成中的标记数
prompt_tokens
integer
提示中的标记数
total_tokens
integer
请求中使用的标记总数(提示 + 完成)
{"id":"cmpl-uqkvlQyYK7bGYrRHQ0eXlWi7","object":"text_completion","created":1589478378,"model":"gpt-3.5-turbo","choices":[{"text":"\n\nThis is indeed a test","index":0,"logprobs":null,"finish_reason":"length"}],"usage":{"prompt_tokens":5,"completion_tokens":7,"total_tokens":12}}