|
...
|
...
|
@@ -54,22 +54,30 @@ class GeoWritingsTask extends Command |
|
|
|
//生成内容
|
|
|
|
$aiCommand2 = "请根据这个文章标题:{$info['title']},并同时参考公司的介绍{$info['description']},以及公司参与的事件内容{$info['event_content']},给我写一篇英文Press Release内容正文(已经有前言内容了),内容请参考并引用“{$info['prefix']}{$info['keyword']}{$info['suffix']}”行业的一些专业数据报告,新闻内容需要 5-6 个大纲,每个大纲需要标题和 1-2 段内容,最后1-2个大纲主要介绍企业的核心优势、主营产品应用场景、主要客户案例,并最后附带内容{$info['footer']},最后只需要回复我新闻稿内容,整个新闻稿内容字数1000字左右,不需要别的内容(比如序号、你的提示、寒暄、解释、注释之类的)。";
|
|
|
|
$main = $gptHelper->openai_chat_qqs($aiCommand2);
|
|
|
|
$data = [
|
|
|
|
'introduction'=>$introduction,
|
|
|
|
'main'=>$main,
|
|
|
|
'status'=>2
|
|
|
|
];
|
|
|
|
$geoWritingsTaskModel->edit($data,['task_id'=>$task_id]);
|
|
|
|
$images = explode(',',$info['img']);
|
|
|
|
//组装一条数据
|
|
|
|
$geoWritingsModel = new GeoWritings();
|
|
|
|
$saveData = [
|
|
|
|
'project_id'=>$info['project_id'],
|
|
|
|
'type'=>$geoWritingsModel::TYPE_AI_CREATE,
|
|
|
|
'title'=>$info['title'],
|
|
|
|
'content'=>$introduction.PHP_EOL.$main,
|
|
|
|
'content_length'=>strlen($introduction.PHP_EOL.$main),
|
|
|
|
'uniqid'=>md5(uniqid().$task_id.$info['project_id']),
|
|
|
|
];
|
|
|
|
try {
|
|
|
|
$geoWritingsModel = new GeoWritings();
|
|
|
|
$saveData = [
|
|
|
|
'project_id'=>$info['project_id'],
|
|
|
|
'type'=>$geoWritingsModel::TYPE_AI_CREATE,
|
|
|
|
'title'=>$info['title'],
|
|
|
|
'content'=>$introduction.($images[0] ?? '').PHP_EOL.$main.($images[1] ?? ''),
|
|
|
|
'content_length'=>strlen($introduction.PHP_EOL.$main),
|
|
|
|
'uniqid'=>md5(uniqid().$task_id.$info['project_id']),
|
|
|
|
];
|
|
|
|
$id = $geoWritingsModel->addReturnId($saveData);
|
|
|
|
$data = [
|
|
|
|
'introduction'=>$introduction,
|
|
|
|
'main'=>$main,
|
|
|
|
'status'=>2,
|
|
|
|
'writings_id'=>$id,
|
|
|
|
];
|
|
|
|
$geoWritingsTaskModel->edit($data,['task_id'=>$task_id]);
|
|
|
|
}catch (\Exception $e){
|
|
|
|
echo date('Y-m-d H:i:s').'保存失败:'.$task_id.$e->getMessage().PHP_EOL;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
...
|
...
|
|