文本编辑 /v1/edits
POST
/v1/edits请求参数
Body 参数application/json
model
enum<string> <string>
模型
枚举值:
text-davinci-edit-001code-davinci-edit-001
input
string <string>
需要修改的文本
instruction
string <string>
必需
你给 GPT 的指令,告诉 GPT 你希望它如何帮你修改内容
n
integer
可选
生成的结果,默认 1
temperature
number <float32>
可选
top_p
number <float32>
可选
示例
{
"model": "text-davinci-edit-001",
"input": "What day of the wek is it?",
"instruction": "Fix the spelling mistakes"
}
示例代码
返回响应
成功(200)
HTTP 状态码: 200
内容格式: JSONapplication/json
数据结构
object
string
必需
created
integer
必需
创建时间,10位时间戳
choices
array [object {2}]
必需
text
string
修改后的文本
index
integer
数组索引
usage
object
消耗
prompt_tokens
integer
输入 tokens
completion_tokens
integer
响应 tokens
total_tokens
integer
必需
总消耗 tokens
示例
{
"object": "edit",
"created": 1589478378,
"choices": [
{
"text": "What day of the week is it?",
"index": 0,
}
],
"usage": {
"prompt_tokens": 25,
"completion_tokens": 32,
"total_tokens": 57
}
}
最后修改时间: 2 年前