|
...
|
...
|
@@ -35,13 +35,13 @@ class GeoWritingsTask extends Command |
|
|
|
|
|
|
|
public function handle(){
|
|
|
|
while (true){
|
|
|
|
$geoWritingsTaskModel = new GeoWritingsTaskModel();
|
|
|
|
$task_id = $this->getTaskId();
|
|
|
|
if(empty($task_id)){
|
|
|
|
sleep(60);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
echo date("Y-m-d H:i:s").',执行的任务id'.$task_id.PHP_EOL;
|
|
|
|
$geoWritingsTaskModel = new GeoWritingsTaskModel();
|
|
|
|
$info = $geoWritingsTaskModel->read(['id'=>$task_id,'status'=>1]);
|
|
|
|
if($info === false){
|
|
|
|
echo date("Y-m-d H:i:s").',任务id数据不存在/或已被执行:'.$task_id.PHP_EOL;
|
|
...
|
...
|
@@ -51,11 +51,13 @@ class GeoWritingsTask extends Command |
|
|
|
$geoWritingsModel = new GeoWritings();
|
|
|
|
$geoWritingsModel->edit(['status'=>$geoWritingsModel::STATUS_AI_RUNNING],['id'=>$info['writings_id']]);
|
|
|
|
//生成引言
|
|
|
|
$aiCommand1 = "请根据这个文章标题:{$info['title']},并同时参考公司的介绍’{$info['description']}‘以及公司参与的事件内容’{$info['event_content']}‘,给我写一个英文Press Release前言内容,前言内容请参考并引用{$info['keyword']}行业的一些专业数据报告,只需要1个段落,大约150-200字,请一定要出现这个关键词“{$info['prefix']}{$info['keyword']}{$info['suffix']}”,所有内容一定要用英文, 只需要回复我引言内容,不需要别的内容(比如序号、你的提示、寒暄、解释、注释之类的)。";
|
|
|
|
// $aiCommand1 = "请根据这个文章标题:{$info['title']},并同时参考公司的介绍’{$info['description']}‘以及公司参与的事件内容’{$info['event_content']}‘,给我写一个英文Press Release前言内容,前言内容请参考并引用{$info['keyword']}行业的一些专业数据报告,只需要1个段落,大约150-200字,请一定要出现这个关键词“{$info['prefix']}{$info['keyword']}{$info['suffix']}”,所有内容一定要用英文, 只需要回复我引言内容,不需要别的内容(比如序号、你的提示、寒暄、解释、注释之类的)。";
|
|
|
|
$aiCommand1 = $info['command_introduction'];
|
|
|
|
$gptHelper = new Gpt();
|
|
|
|
$introduction = $gptHelper->openai_chat_qqs($aiCommand1);
|
|
|
|
//生成内容
|
|
|
|
$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字左右,不需要别的内容(比如序号、你的提示、寒暄、解释、注释之类的)。";
|
|
|
|
// $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字左右,不需要别的内容(比如序号、你的提示、寒暄、解释、注释之类的)。";
|
|
|
|
$aiCommand2 = $info['command_main'];
|
|
|
|
$main = $gptHelper->openai_chat_qqs($aiCommand2);
|
|
|
|
$images = explode(',',$info['img']);
|
|
|
|
//组装一条数据
|
...
|
...
|
|