|
...
|
...
|
@@ -113,6 +113,23 @@ class GeoQuestionRes extends Command |
|
|
|
}
|
|
|
|
// 命中文案
|
|
|
|
$hit_data[] = $result['text'];
|
|
|
|
if(!empty($taskInfo['expect_result'])){
|
|
|
|
$str = "客户提出的问题:{$question},客户得到的回复:{$result['text']},客户需要预期:{$taskInfo['expect_result']},请分析得到的回复和预期是否一致,仅回复我是或者否";
|
|
|
|
$data = $geo_service->getChatResult($str, 'gpt-4o-mini');
|
|
|
|
if(isset($data['text']) && !empty($data['text'])){
|
|
|
|
switch ($data['text']){
|
|
|
|
case '是':
|
|
|
|
$is_match = 1;
|
|
|
|
break;
|
|
|
|
case '否':
|
|
|
|
$is_match = 2;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
$is_match = 0;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(!empty($result['annotations'])){
|
|
|
|
$url = array_column(array_column($result['annotations'], 'url_citation'), 'url');
|
|
|
|
$title = array_column(array_column($result['annotations'], 'url_citation'), 'title');
|
|
...
|
...
|
@@ -144,6 +161,7 @@ class GeoQuestionRes extends Command |
|
|
|
'hit' => $hit ?? 0,
|
|
|
|
'keywords_num'=>$keyword_num ?? [],
|
|
|
|
'url_num'=>$url_num ?? [],
|
|
|
|
'is_match'=>$is_match ?? 0,
|
|
|
|
'created_at'=>date('Y-m-d H:i:s'),
|
|
|
|
'updated_at'=>date('Y-m-d H:i:s'),
|
|
|
|
];
|
...
|
...
|
|