|
...
|
...
|
@@ -4,10 +4,8 @@ namespace App\Console\Commands\Tdk; |
|
|
|
|
|
|
|
use App\Exceptions\ValidateException;
|
|
|
|
use App\Helper\Arr;
|
|
|
|
use App\Helper\Common;
|
|
|
|
use App\Helper\Gpt;
|
|
|
|
use App\Models\Ai\AiCommand;
|
|
|
|
use App\Models\Ai\AiTdkErrorLog;
|
|
|
|
use App\Models\Com\NoticeLog;
|
|
|
|
use App\Models\Domain\DomainInfo;
|
|
|
|
use App\Models\Product\Keyword;
|
|
...
|
...
|
@@ -17,11 +15,8 @@ use App\Models\Project\DeployOptimize; |
|
|
|
use App\Models\Project\ProjectKeywordAiTask;
|
|
|
|
use App\Services\ProjectServer;
|
|
|
|
use Illuminate\Console\Command;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
use Illuminate\Support\Facades\Cache;
|
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
use Illuminate\Support\Facades\Redis;
|
|
|
|
use Illuminate\Support\Str;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 关键词聚合页AI生成内容
|
|
...
|
...
|
@@ -103,8 +98,8 @@ class KeywordPageAiContent extends Command |
|
|
|
{
|
|
|
|
//前后缀
|
|
|
|
$affix = AggregateKeywordAffix::where('project_id', $task->project_id)->first();
|
|
|
|
$prefix = empty($affix['prefix']) ? [] : array_map('strtolower', explode("\r\n", $affix['prefix']));
|
|
|
|
$suffix = empty($affix['suffix']) ? [] : array_map('strtolower', explode("\r\n", $affix['suffix']));
|
|
|
|
$prefix = empty($affix['prefix']) ? [] : explode("\r\n", $affix['prefix']);
|
|
|
|
$suffix = empty($affix['suffix']) ? [] : explode("\r\n", $affix['suffix']);
|
|
|
|
if (!$prefix || !$suffix) {
|
|
|
|
throw new ValidateException('扩展标题前后缀不存在');
|
|
|
|
}
|
|
...
|
...
|
@@ -203,7 +198,6 @@ class KeywordPageAiContent extends Command |
|
|
|
}
|
|
|
|
if (strpos($prompt, '{chart_type}') !== false) {
|
|
|
|
shuffle($this->chart_types);
|
|
|
|
dump($this->chart_types[0]);
|
|
|
|
$prompt = str_replace('{chart_type}', $this->chart_types[0], $prompt);
|
|
|
|
}
|
|
|
|
|
...
|
...
|
|