1
This commit is contained in:
@@ -334,14 +334,19 @@ function freshContent($production_obj){
|
||||
|
||||
function pushGpt($content){
|
||||
// die;
|
||||
$url = 'https://api.openai.com/v1/edits';
|
||||
$url = 'https://api.openai.com/v1/chat/completions';
|
||||
$api_key = Env::get("gpt.api_key");
|
||||
// Request data
|
||||
$mes['role'] = "user";
|
||||
$mes['content'] = $content;
|
||||
$data = array(
|
||||
'model' => 'text-davinci-edit-001',
|
||||
'input' => $content,
|
||||
'instruction'=>"改正拼写错误;改正时态错误;改正书写格式错误;"
|
||||
);
|
||||
'model' => 'gpt-3.5-turbo',
|
||||
'messages' => [$mes],
|
||||
'temperature' => 0.2,
|
||||
'max_tokens' => 2048,
|
||||
'n' => 1,
|
||||
'stop' => ''
|
||||
);
|
||||
|
||||
$headers = array(
|
||||
'Content-Type: application/json',
|
||||
|
||||
Reference in New Issue
Block a user