大家有玩 orhanerday/open-ai这个包吗?请教个问题
使用text-davinci-003模型时内容太长只回答了一半,怎么让他回答剩下的内容。
$complete = $open_ai->completion([
'model' => 'text-davinci-003',
'prompt' => '讲个故事',
'temperature' => 0.9,
'max_tokens' => 150,
'frequency_penalty' => 0,
'presence_penalty' => 0.6,
]);
返回值
array:6 [▼
"id" => "cmpl-6NjdEvfnMUybsOn8Bj9iHtoaOH5cf"
"object" => "text_completion"
"created" => 1671114972
"model" => "text-davinci-003"
"choices" => array:1 [▼
0 => array:4 [▼
"text" => """
当我们还是孩子的时候,有一位叫做米妮的女孩住在一个小村庄里。米妮很喜欢冒险,常常到四周围的山脉中去探险。她在山林中探索,寻找不同的礼物:新鲜的
"""
"index" => 0
"logprobs" => null
"finish_reason" => "length"
]
]
"usage" => array:3 [▼
"prompt_tokens" => 22
"completion_tokens" => 150
"total_tokens" => 172
]
]
故事只讲了一半
推荐文章: