Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
elleai
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
E
ellehuis-group
backend
elleai
Commits
b7ab069d
Commit
b7ab069d
authored
Oct 21, 2024
by
陈立彬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dify agent调用字段
parent
bd2da345
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
23 deletions
+29
-23
AiPlatformExtensionService.java
...lleai/application/service/AiPlatformExtensionService.java
+5
-6
AppExamineService.java
.../breeze/elleai/application/service/AppExamineService.java
+15
-0
AiPlatformExtensionController.java
...i/controller/extension/AiPlatformExtensionController.java
+1
-1
ExamineMobileController.java
...eeze/elleai/controller/front/ExamineMobileController.java
+7
-0
SingleJob.java
src/main/java/cn/breeze/elleai/job/SingleJob.java
+1
-16
No files found.
src/main/java/cn/breeze/elleai/application/service/AiPlatformExtensionService.java
View file @
b7ab069d
...
...
@@ -46,6 +46,7 @@ public class AiPlatformExtensionService {
inputs
.
put
(
"scene"
,
"single_evaluate"
);
inputs
.
put
(
"question"
,
question
);
inputs
.
put
(
"answer"
,
answer
);
inputs
.
put
(
"user_answer"
,
userAnswer
);
JSONObject
param
=
new
JSONObject
();
param
.
put
(
"query"
,
userAnswer
);
param
.
put
(
"inputs"
,
inputs
);
...
...
@@ -83,16 +84,14 @@ public class AiPlatformExtensionService {
* 考试总点评
* @param sessionId
* @param userId
* @param avgScore
* @param qaResultList
* @param businessNo
*/
public
String
run4TotalEvaluate
(
String
sessionId
,
String
userId
,
Float
avgScore
,
String
qaResultList
)
{
public
String
run4TotalEvaluate
(
String
sessionId
,
String
userId
,
String
businessNo
)
{
Map
<
String
,
Object
>
inputs
=
new
HashMap
<>();
inputs
.
put
(
"scene"
,
"total_evaluate"
);
inputs
.
put
(
"avg_score"
,
avgScore
);
inputs
.
put
(
"qa_result_list"
,
qaResultList
);
inputs
.
put
(
"business_no"
,
businessNo
);
JSONObject
param
=
new
JSONObject
();
param
.
put
(
"query"
,
"Not_Null"
);
param
.
put
(
"query"
,
businessNo
);
param
.
put
(
"inputs"
,
inputs
);
param
.
put
(
"response_mode"
,
"blocking"
);
param
.
put
(
"conversation_id"
,
""
);
...
...
src/main/java/cn/breeze/elleai/application/service/AppExamineService.java
View file @
b7ab069d
...
...
@@ -1287,6 +1287,21 @@ public class AppExamineService {
return
null
;
}
/**
* 获取考试详情
* @param businessNo 考试流水号
* @return
*/
public
ExamineRecordMobileDto
getExamineRecordDetail
(
String
businessNo
)
{
// 获取考试记录信息
ExamineRecordResponseModel
recordModel
=
examineService
.
examineRecordDetail
(
businessNo
);
if
(
Objects
.
nonNull
(
recordModel
))
{
Integer
recordId
=
recordModel
.
getId
();
return
this
.
examineRecordMobileDetail
(
recordId
);
}
return
null
;
}
/**
* 退出考试,清除考试记录
* @param userPrincipal
...
...
src/main/java/cn/breeze/elleai/controller/extension/AiPlatformExtensionController.java
View file @
b7ab069d
...
...
@@ -43,7 +43,7 @@ public class AiPlatformExtensionController {
String
userId
=
UUID
.
randomUUID
().
toString
();
String
sessionId
=
UUID
.
randomUUID
().
toString
();
extensionService
.
run4TotalEvaluate
(
sessionId
,
userId
,
null
,
null
);
extensionService
.
run4TotalEvaluate
(
sessionId
,
userId
,
null
);
return
ApiResponse
.
ok
(
"SUCCESS"
);
}
}
src/main/java/cn/breeze/elleai/controller/front/ExamineMobileController.java
View file @
b7ab069d
...
...
@@ -72,6 +72,13 @@ public class ExamineMobileController {
return
ApiResponse
.
ok
(
detail
);
}
@Operation
(
summary
=
"获取对练记录详情"
)
@GetMapping
(
"/record/detail"
)
public
ApiResponse
<
ExamineRecordMobileDto
>
recordDetail
(
@Schema
(
description
=
"对练流水号"
)
@RequestParam
(
"business_no"
)
String
businessNo
)
{
ExamineRecordMobileDto
detail
=
examineService
.
getExamineRecordDetail
(
businessNo
);
return
ApiResponse
.
ok
(
detail
);
}
@Operation
(
summary
=
"开始考试,并返回考试流水号&第一道题目"
)
@PostMapping
(
value
=
"/start_examine"
)
public
ApiResponse
<
ExamineStartResultDto
>
startExamine
(
@Parameter
(
hidden
=
true
)
UserPrincipal
userPrincipal
,
...
...
src/main/java/cn/breeze/elleai/job/SingleJob.java
View file @
b7ab069d
...
...
@@ -112,23 +112,8 @@ public class SingleJob extends QuartzJobBean {
double
totalScore
=
detailRecordList
.
stream
().
filter
(
v
->
Objects
.
nonNull
(
v
.
getScore
())).
mapToDouble
(
ExamineDetailRecordResponseModel:
:
getScore
).
sum
();
Double
avgScore
=
totalScore
/
detailRecordList
.
size
();
List
<
Integer
>
qaIdList
=
detailRecordList
.
stream
().
map
(
ExamineDetailRecordResponseModel:
:
getQaId
).
collect
(
Collectors
.
toList
());
List
<
ExamineQaResponseModel
>
examineQaList
=
examineService
.
examineQaList
(
qaIdList
);
Map
<
Integer
,
ExamineQaResponseModel
>
qaMap
=
examineQaList
.
stream
().
collect
(
toMap
(
ExamineQaResponseModel:
:
getId
,
Function
.
identity
()));
String
qaResultStr
=
""
;
for
(
int
i
=
0
;
i
<
detailRecordList
.
size
();
i
++)
{
ExamineDetailRecordResponseModel
detail
=
detailRecordList
.
get
(
i
);
ExamineQaResponseModel
qa
=
qaMap
.
get
(
detail
.
getQaId
());
qaResultStr
+=
"问题 "
+
(
i
+
1
)
+
": "
+
qa
.
getQuestion
()
+
"\n"
;
qaResultStr
+=
"得分:"
+
detail
.
getScore
()
+
"\n"
;
qaResultStr
+=
"评分说明:"
+
detail
.
getEvaluation
()
+
"\n"
;
qaResultStr
+=
"----------------------------------------\n"
;
}
// 执行综合点评
String
overallEvaluation
=
extensionService
.
run4TotalEvaluate
(
businessNo
,
job
.
getUserId
(),
avgScore
.
floatValue
(),
qaResultStr
);
String
overallEvaluation
=
extensionService
.
run4TotalEvaluate
(
businessNo
,
job
.
getUserId
(),
businessNo
);
if
(
StrUtil
.
isNotEmpty
(
overallEvaluation
))
{
// 更新
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment