|
@@ -767,6 +767,22 @@ class robot{
|
|
|
}
|
|
}
|
|
|
$output_format_text .= "}";
|
|
$output_format_text .= "}";
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ $output_format_text_two = "";
|
|
|
|
|
+ foreach($formatList as $ok =>$ov){
|
|
|
|
|
+ $describe = $ov['describe'];
|
|
|
|
|
+ if ($ov['selecttype'] == '必填字段') {
|
|
|
|
|
+ $describe .= " . 必填要求:所有情况必填";
|
|
|
|
|
+ } elseif ($ov['selecttype'] == '有条件必填'){
|
|
|
|
|
+ $requirements = $ov['requirements'];
|
|
|
|
|
+ $describe .= " . 必填要求:".$ov['selecttype']."(".$requirements.")";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $output_format_text_two .="-".$ov['name'].": ".$describe;
|
|
|
|
|
+ $output_format_text_two .=common::splicedLlineBreaks();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
$promptFormat = $this->getCompletePromptFormat();
|
|
$promptFormat = $this->getCompletePromptFormat();
|
|
|
$promptFormat = str_replace('<{professional_field}>', $configuration['character_name'], $promptFormat);
|
|
$promptFormat = str_replace('<{professional_field}>', $configuration['character_name'], $promptFormat);
|
|
|
$promptFormat = str_replace('<{character_name}>', $configuration['character_name'], $promptFormat);
|
|
$promptFormat = str_replace('<{character_name}>', $configuration['character_name'], $promptFormat);
|
|
@@ -776,7 +792,7 @@ class robot{
|
|
|
$promptFormat = str_replace('<{response_rule_configuration}>', $response_rule_text, $promptFormat);
|
|
$promptFormat = str_replace('<{response_rule_configuration}>', $response_rule_text, $promptFormat);
|
|
|
$promptFormat = str_replace('<{number}>', count($response_rule_configuration)+1, $promptFormat);
|
|
$promptFormat = str_replace('<{number}>', count($response_rule_configuration)+1, $promptFormat);
|
|
|
$promptFormat = str_replace('<{output_type}>', $formatListType, $promptFormat);
|
|
$promptFormat = str_replace('<{output_type}>', $formatListType, $promptFormat);
|
|
|
- $promptFormat = str_replace('<{output_format_configuration}>', $output_format_text, $promptFormat);
|
|
|
|
|
|
|
+ $promptFormat = str_replace('<{output_format_configuration}>', $output_format_text_two, $promptFormat);
|
|
|
|
|
|
|
|
return array("vuedata"=>array("tableData"=>$tableData,"stepData"=>$stepData,"formatList"=>$formatList,"formatListType"=>$formatListType),
|
|
return array("vuedata"=>array("tableData"=>$tableData,"stepData"=>$stepData,"formatList"=>$formatList,"formatListType"=>$formatListType),
|
|
|
"promptFormat" =>$promptFormat);
|
|
"promptFormat" =>$promptFormat);
|
|
@@ -824,8 +840,20 @@ class robot{
|
|
|
|
|
|
|
|
响应规则,请按以下步骤处理:
|
|
响应规则,请按以下步骤处理:
|
|
|
<{response_rule_configuration}>
|
|
<{response_rule_configuration}>
|
|
|
- <{number}>. 请用以下<{output_type}>格式回复:
|
|
|
|
|
- <{output_format_configuration}>";
|
|
|
|
|
|
|
+ <{number}>.请严格按照以下<{output_type}>格式返回,不要包含任何其他文字或说明:
|
|
|
|
|
+ {
|
|
|
|
|
+ \"can_query\": true,
|
|
|
|
|
+ \"query_type\": \"货物跟踪\",
|
|
|
|
|
+ \"reason\": \"分析原因\",
|
|
|
|
|
+ \"sql\": \"生成的SQL語句\",
|
|
|
|
|
+ \"reference\": \"Markdown格式的回复模板\",
|
|
|
|
|
+ \"response\": \"直接回答內容或空字符串\"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ 字段說明:
|
|
|
|
|
+ <{output_format_configuration}>
|
|
|
|
|
+
|
|
|
|
|
+ 重要:请只返回JSON对象,不要包含任何解释文字或代码块标记";
|
|
|
return $formatTpl;
|
|
return $formatTpl;
|
|
|
}
|
|
}
|
|
|
|
|
|