Ai 话术调整
This commit is contained in:
@@ -38,7 +38,7 @@ class OpenAi
|
||||
"discussion" => "[针对讨论进行简单总结,采用连贯的段落形式,注意内容不要和文章内容有严重重复,总字数超过450字]",
|
||||
"research_method" => "[针对研究方法进行简单总结,采用连贯的段落形式,注意内容不要和文章内容有严重重复,总字数超过300字]",
|
||||
"discussion" => "[针对讨论进行简单总结,采用连贯的段落形式,注意内容不要和文章内容有严重重复,总字数超过450字]",
|
||||
"conclusion" => "[针对结论进行简单总结,采用连贯的段落形式,注意内容不要和文章内容有严重重复,总字数超过450字]",
|
||||
"conclusion" => "[将结论直接翻译成中文,无需针对内容总结翻译]",
|
||||
],
|
||||
'review' => [
|
||||
"overview" => "按照学术规范翻译并提炼文章概述,整体内容应大于1200字,其中应包含文章背景(不少于400字),其他内容提炼更强调逻辑性、科学术语准确性和表达的严谨性,注意内容不要和文章内容有严重重复,采用连贯的段落形式",
|
||||
@@ -749,13 +749,19 @@ class OpenAi
|
||||
if (empty($aMessage)) {
|
||||
return json_encode(['status' => 2, 'msg' => 'AI Q&A content not obtained']);
|
||||
}
|
||||
|
||||
//判断是否执行
|
||||
$iIndex = empty($aParam['chunkIndex']) ? 0 : $aParam['chunkIndex'];
|
||||
$sRedisKey = 'queue_job:ai_create_article:'.$iId;
|
||||
$sChunkProgress = $this->oQueueRedis->getChunkProgress($sRedisKey, $iIndex);
|
||||
if(!empty($sChunkProgress)){
|
||||
return json_encode(['status' => 3, 'msg' => $sRedisKey.'_'.$iIndex.' Generated']);
|
||||
}
|
||||
//请求OPENAI
|
||||
$aParam['temperature'] = '0.6';
|
||||
$aParam['top_p'] = '0.8';
|
||||
$aResult = $this->curlOpenAIStream($aParam);
|
||||
//更新处理进度
|
||||
$iIndex = empty($aParam['chunkIndex']) ? 0 : $aParam['chunkIndex'];
|
||||
$sRedisKey = 'queue_job:ai_create_article:'.$iId;
|
||||
$sKeyName = empty($aParam['key_name']) ? 'queue_1_completed' : $aParam['key_name'];
|
||||
$iProgress = $this->oQueueRedis->updateQuestionProcessingProgress($sRedisKey,$sKeyName);
|
||||
//保存内容
|
||||
@@ -1135,14 +1141,19 @@ class OpenAi
|
||||
//问题等级
|
||||
$sQuestionLevel = empty($aParam['question_level']) ? '' : $aParam['question_level'];
|
||||
|
||||
//判断是否执行
|
||||
$iIndex = empty($aParam['chunkIndex']) ? 0 : $aParam['chunkIndex'];
|
||||
$sRedisKey = 'queue_job:review_chunk:'.$iArticleId.'_'.$iJournalId.'_'.$sFieldsName;
|
||||
$sChunkProgress = $this->oQueueRedis->getChunkProgress($sRedisKey, $iIndex);
|
||||
if(!empty($sChunkProgress)){
|
||||
return json_encode(['status' => 3, 'msg' => $sRedisKey.'_'.$iIndex.' AI Reviewed']);
|
||||
}
|
||||
//请求OPENAI
|
||||
$aParam['temperature'] = '0.1';
|
||||
$aParam['top_p'] = '0.9';
|
||||
$aResult = $this->curlOpenAIStream($aParam);
|
||||
|
||||
//更新处理进度
|
||||
$iIndex = empty($aParam['chunkIndex']) ? 0 : $aParam['chunkIndex'];
|
||||
$sRedisKey = 'queue_job:review_chunk:'.$iArticleId.'_'.$iJournalId.'_'.$sFieldsName;
|
||||
$sKeyName = empty($aParam['key_name']) ? 'queue_1_completed' : $aParam['key_name'];
|
||||
$iProgress = $this->oQueueRedis->updateQuestionProcessingProgress($sRedisKey,$sKeyName);
|
||||
//保存内容
|
||||
|
||||
Reference in New Issue
Block a user