合并分支 'akun' 到 'master'
Akun 查看合并请求 !3346
正在显示
1 个修改的文件
包含
5 行增加
和
3 行删除
| @@ -35,13 +35,13 @@ class GeoWritingsTask extends Command | @@ -35,13 +35,13 @@ class GeoWritingsTask extends Command | ||
| 35 | 35 | ||
| 36 | public function handle(){ | 36 | public function handle(){ |
| 37 | while (true){ | 37 | while (true){ |
| 38 | - $geoWritingsTaskModel = new GeoWritingsTaskModel(); | ||
| 39 | $task_id = $this->getTaskId(); | 38 | $task_id = $this->getTaskId(); |
| 40 | if(empty($task_id)){ | 39 | if(empty($task_id)){ |
| 41 | sleep(60); | 40 | sleep(60); |
| 42 | continue; | 41 | continue; |
| 43 | } | 42 | } |
| 44 | echo date("Y-m-d H:i:s").',执行的任务id'.$task_id.PHP_EOL; | 43 | echo date("Y-m-d H:i:s").',执行的任务id'.$task_id.PHP_EOL; |
| 44 | + $geoWritingsTaskModel = new GeoWritingsTaskModel(); | ||
| 45 | $info = $geoWritingsTaskModel->read(['id'=>$task_id,'status'=>1]); | 45 | $info = $geoWritingsTaskModel->read(['id'=>$task_id,'status'=>1]); |
| 46 | if($info === false){ | 46 | if($info === false){ |
| 47 | echo date("Y-m-d H:i:s").',任务id数据不存在/或已被执行:'.$task_id.PHP_EOL; | 47 | echo date("Y-m-d H:i:s").',任务id数据不存在/或已被执行:'.$task_id.PHP_EOL; |
| @@ -51,11 +51,13 @@ class GeoWritingsTask extends Command | @@ -51,11 +51,13 @@ class GeoWritingsTask extends Command | ||
| 51 | $geoWritingsModel = new GeoWritings(); | 51 | $geoWritingsModel = new GeoWritings(); |
| 52 | $geoWritingsModel->edit(['status'=>$geoWritingsModel::STATUS_AI_RUNNING],['id'=>$info['writings_id']]); | 52 | $geoWritingsModel->edit(['status'=>$geoWritingsModel::STATUS_AI_RUNNING],['id'=>$info['writings_id']]); |
| 53 | //生成引言 | 53 | //生成引言 |
| 54 | - $aiCommand1 = "请根据这个文章标题:{$info['title']},并同时参考公司的介绍’{$info['description']}‘以及公司参与的事件内容’{$info['event_content']}‘,给我写一个英文Press Release前言内容,前言内容请参考并引用{$info['keyword']}行业的一些专业数据报告,只需要1个段落,大约150-200字,请一定要出现这个关键词“{$info['prefix']}{$info['keyword']}{$info['suffix']}”,所有内容一定要用英文, 只需要回复我引言内容,不需要别的内容(比如序号、你的提示、寒暄、解释、注释之类的)。"; | 54 | +// $aiCommand1 = "请根据这个文章标题:{$info['title']},并同时参考公司的介绍’{$info['description']}‘以及公司参与的事件内容’{$info['event_content']}‘,给我写一个英文Press Release前言内容,前言内容请参考并引用{$info['keyword']}行业的一些专业数据报告,只需要1个段落,大约150-200字,请一定要出现这个关键词“{$info['prefix']}{$info['keyword']}{$info['suffix']}”,所有内容一定要用英文, 只需要回复我引言内容,不需要别的内容(比如序号、你的提示、寒暄、解释、注释之类的)。"; |
| 55 | + $aiCommand1 = $info['command_introduction']; | ||
| 55 | $gptHelper = new Gpt(); | 56 | $gptHelper = new Gpt(); |
| 56 | $introduction = $gptHelper->openai_chat_qqs($aiCommand1); | 57 | $introduction = $gptHelper->openai_chat_qqs($aiCommand1); |
| 57 | //生成内容 | 58 | //生成内容 |
| 58 | - $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字左右,不需要别的内容(比如序号、你的提示、寒暄、解释、注释之类的)。"; | 59 | +// $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字左右,不需要别的内容(比如序号、你的提示、寒暄、解释、注释之类的)。"; |
| 60 | + $aiCommand2 = $info['command_main']; | ||
| 59 | $main = $gptHelper->openai_chat_qqs($aiCommand2); | 61 | $main = $gptHelper->openai_chat_qqs($aiCommand2); |
| 60 | $images = explode(',',$info['img']); | 62 | $images = explode(',',$info['img']); |
| 61 | //组装一条数据 | 63 | //组装一条数据 |
-
请 注册 或 登录 后发表评论