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
30197cef
Commit
30197cef
authored
Nov 05, 2024
by
yangyw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feature: 增加DIFY扩展判断助手类型
parent
edd3398c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
4 deletions
+30
-4
AiPlatformExtensionService.java
...lleai/application/service/AiPlatformExtensionService.java
+17
-0
AiPlatformExtensionController.java
...i/controller/extension/AiPlatformExtensionController.java
+8
-4
QaAssistantResponseModel.java
...ain/sparring/model/response/QaAssistantResponseModel.java
+5
-0
No files found.
src/main/java/cn/breeze/elleai/application/service/AiPlatformExtensionService.java
View file @
30197cef
...
@@ -224,4 +224,21 @@ public class AiPlatformExtensionService {
...
@@ -224,4 +224,21 @@ public class AiPlatformExtensionService {
private
void
updateKbHitStat
(
List
<
VectorSegment
>
segments
)
{
private
void
updateKbHitStat
(
List
<
VectorSegment
>
segments
)
{
kbService
.
updateHotQuestion
(
CollUtil
.
map
(
segments
,
VectorSegment:
:
getId
,
true
));
kbService
.
updateHotQuestion
(
CollUtil
.
map
(
segments
,
VectorSegment:
:
getId
,
true
));
}
}
/**
* 判断是否可以使用外部知识
* @param assistantId
* @return
*/
public
String
canAnswerByLlm
(
Integer
assistantId
)
{
if
(
ObjectUtil
.
isNotNull
(
assistantId
))
{
QaAssistantResponseModel
qaAssistantResponseModel
=
chatCompletionService
.
qaAssistantDetail
(
assistantId
);
if
(
ObjectUtil
.
isNotNull
(
qaAssistantResponseModel
))
{
if
(
ObjectUtil
.
equals
(
qaAssistantResponseModel
.
getSearchScope
(),
1
))
{
return
"true"
;
}
}
}
return
"false"
;
}
}
}
src/main/java/cn/breeze/elleai/controller/extension/AiPlatformExtensionController.java
View file @
30197cef
...
@@ -4,10 +4,7 @@ import cn.breeze.elleai.application.service.AiPlatformExtensionService;
...
@@ -4,10 +4,7 @@ import cn.breeze.elleai.application.service.AiPlatformExtensionService;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
/**
/**
* @author yangyw
* @author yangyw
...
@@ -51,4 +48,11 @@ public class AiPlatformExtensionController {
...
@@ -51,4 +48,11 @@ public class AiPlatformExtensionController {
return
extensionService
.
vectorSearchWithRerank
(
query
,
assistantId
,
topK
,
score
,
rerankTopK
,
rerankScore
);
return
extensionService
.
vectorSearchWithRerank
(
query
,
assistantId
,
topK
,
score
,
rerankTopK
,
rerankScore
);
}
}
@Operation
(
summary
=
"判断是否可以使用外部知识"
)
@GetMapping
(
value
=
"/can_answer_by_llm"
)
public
String
canAnswerByLlm
(
@RequestParam
(
value
=
"assistant_id"
,
required
=
false
,
defaultValue
=
"0"
)
Integer
assistantId
)
{
return
extensionService
.
canAnswerByLlm
(
assistantId
);
}
}
}
src/main/java/cn/breeze/elleai/domain/sparring/model/response/QaAssistantResponseModel.java
View file @
30197cef
...
@@ -37,6 +37,11 @@ public class QaAssistantResponseModel implements Serializable {
...
@@ -37,6 +37,11 @@ public class QaAssistantResponseModel implements Serializable {
*/
*/
private
String
visibleRoleIds
;
private
String
visibleRoleIds
;
/**
* 检索范围(0内部知识库 1全网)
*/
private
Integer
searchScope
;
/**
/**
* 状态(0禁用 1启用)
* 状态(0禁用 1启用)
*/
*/
...
...
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