完成对象
表示来自 API 的完成返回对象。留意:实时流返回和非流式式返回对象具有相同的结构(与 chat 端点不同)。
配置项
| 配置项 | 类型 | 说明 |
|---|---|---|
| id | string | 完成的唯一标识符 |
| choices | array | 模型为传入提示产出的完成选项列表 |
| created | integer | 新建完成的 Unix 时间戳(秒) |
| model | string | 用以完成的模型 |
| system_fingerprint | string | 该指纹表示模型运行的后端设定 |
| object | string | 对象类型,总是 "text_completion" |
| usage | object | 完成请求的使用统计信息 |
| usage.completion_tokens | integer | 产出的完成中的词元数 |
| usage.prompt_tokens | integer | 提示中的词元数 |
| usage.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
}
}