|
...
|
...
|
@@ -328,15 +328,22 @@ class InquiryForwardLogic extends BaseLogic |
|
|
|
/**
|
|
|
|
* AI重写询盘文案
|
|
|
|
* @param $in_content
|
|
|
|
* @param $title
|
|
|
|
* @param $keywords
|
|
|
|
* @return array
|
|
|
|
* @throws \App\Exceptions\AsideGlobalException
|
|
|
|
* @throws \App\Exceptions\BsideGlobalException
|
|
|
|
* @author Akun
|
|
|
|
* @date 2025/02/27 10:40
|
|
|
|
*/
|
|
|
|
public function aiRewrite($in_content)
|
|
|
|
public function aiRewrite($in_content, $title = '', $keywords = '')
|
|
|
|
{
|
|
|
|
$ai_info = AiCommand::select(['ai', 'not_use_probability'])->where('key', 'inquiry_text_rewrite')->first();
|
|
|
|
if ($title && $keywords) {
|
|
|
|
$command_key = 'inquiry_text_rewrite_v2';
|
|
|
|
} else {
|
|
|
|
$command_key = 'inquiry_text_rewrite';
|
|
|
|
}
|
|
|
|
$ai_info = AiCommand::select(['ai', 'not_use_probability'])->where('key', $command_key)->first();
|
|
|
|
if (!$ai_info) {
|
|
|
|
$this->fail('AI重写指令未配置');
|
|
|
|
}
|
|
...
|
...
|
@@ -358,6 +365,10 @@ class InquiryForwardLogic extends BaseLogic |
|
|
|
$lang = 'en';
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($title && $keywords) {
|
|
|
|
$ai_command = str_replace('{title}', $title, $ai_command);
|
|
|
|
$ai_command = str_replace('{keywords}', $keywords, $ai_command);
|
|
|
|
}
|
|
|
|
$ai_command = str_replace('{incontent}', Arr::random(explode("\r\n", $in_content)), $ai_command);
|
|
|
|
|
|
|
|
$text = Gpt::instance()->openai_chat_qqs($ai_command);
|
...
|
...
|
|