|
@@ -590,13 +590,15 @@ class RelayInquiry extends Command |
|
@@ -590,13 +590,15 @@ class RelayInquiry extends Command |
|
590
|
$lang = $translateSl['texts']['sl'] ?? 'en';
|
590
|
$lang = $translateSl['texts']['sl'] ?? 'en';
|
|
591
|
if ($lang == 'en' || Str::contains($lang, 'zh')) {
|
591
|
if ($lang == 'en' || Str::contains($lang, 'zh')) {
|
|
592
|
$language = '英文';
|
592
|
$language = '英文';
|
|
|
|
593
|
+ $lang = 'en';
|
|
593
|
}else{
|
594
|
}else{
|
|
594
|
$language = Translate::getTls($lang);
|
595
|
$language = Translate::getTls($lang);
|
|
595
|
}
|
596
|
}
|
|
596
|
$ai_command = str_replace('{mkeywords}', Arr::random(explode("\r\n", $ai_param['mkeywords'])), $ai_command);
|
597
|
$ai_command = str_replace('{mkeywords}', Arr::random(explode("\r\n", $ai_param['mkeywords'])), $ai_command);
|
|
597
|
$ai_command = str_replace('{incontent}', Arr::random(explode("\r\n", $incontent)), $ai_command);
|
598
|
$ai_command = str_replace('{incontent}', Arr::random(explode("\r\n", $incontent)), $ai_command);
|
|
598
|
$ai_command = str_replace('{characters}', Arr::random(explode("\r\n", $ai_param['characters'])), $ai_command);
|
599
|
$ai_command = str_replace('{characters}', Arr::random(explode("\r\n", $ai_param['characters'])), $ai_command);
|
|
599
|
- $ai_command = str_replace('{language}', Arr::random(explode("\r\n", $language)), $ai_command);
|
600
|
+// $ai_command = str_replace('{language}', Arr::random(explode("\r\n", $language)), $ai_command);
|
|
|
|
601
|
+ $ai_command = str_replace('{language}', '英语', $ai_command); //输出英文 后面再翻译
|
|
600
|
$ai_command = str_replace('{inkeywords}', Arr::random(explode("\r\n", $ai_param['inkeywords'])), $ai_command);
|
602
|
$ai_command = str_replace('{inkeywords}', Arr::random(explode("\r\n", $ai_param['inkeywords'])), $ai_command);
|
|
601
|
$ai_command = str_replace('{suoxie}', Arr::random(explode("\r\n", $ai_param['suoxie'])), $ai_command);
|
603
|
$ai_command = str_replace('{suoxie}', Arr::random(explode("\r\n", $ai_param['suoxie'])), $ai_command);
|
|
602
|
//中括号里的根据概率使用
|
604
|
//中括号里的根据概率使用
|
|
@@ -615,6 +617,7 @@ class RelayInquiry extends Command |
|
@@ -615,6 +617,7 @@ class RelayInquiry extends Command |
|
615
|
}
|
617
|
}
|
|
616
|
|
618
|
|
|
617
|
$text = Gpt::instance()->openai_chat_qqs($ai_command);
|
619
|
$text = Gpt::instance()->openai_chat_qqs($ai_command);
|
|
|
|
620
|
+ $text = Translate::tran($text, $lang); //再次翻译 避免AI回复的语种不准
|
|
618
|
$this->logChannel()->info("AI询盘文案", [$ai_command, $text]);
|
621
|
$this->logChannel()->info("AI询盘文案", [$ai_command, $text]);
|
|
619
|
$text = Common::deal_keywords($text);
|
622
|
$text = Common::deal_keywords($text);
|
|
620
|
return Common::deal_str($text);
|
623
|
return Common::deal_str($text);
|