作者 赵彬吉

update

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