Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
poc-api
Project
Project
Details
Activity
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
poc
poc-api
Commits
f078bbeb
Commit
f078bbeb
authored
Feb 20, 2025
by
alex yao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:Agent应用-知识库高级配置
parent
1c96127b
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
574 additions
and
4 deletions
+574
-4
AgentApplicationInfoServiceImpl.java
...ation/aggregate/impl/AgentApplicationInfoServiceImpl.java
+4
-3
AgentApplicationConstants.java
...agent_application/constant/AgentApplicationConstants.java
+9
-0
AgentApplicationInfoConvert.java
...gent_application/convert/AgentApplicationInfoConvert.java
+29
-0
BizAgentApplicationPublishConvert.java
...pplication/convert/BizAgentApplicationPublishConvert.java
+22
-0
AgentApplicationKnowledgeConfig.java
...t_application/domain/AgentApplicationKnowledgeConfig.java
+76
-0
BizAgentApplicationInfoEntity.java
...ent_application/entity/BizAgentApplicationInfoEntity.java
+75
-1
BizAgentApplicationPublishEntity.java
..._application/entity/BizAgentApplicationPublishEntity.java
+76
-0
BizAgentApplicationInfoModel.java
...agent_application/model/BizAgentApplicationInfoModel.java
+86
-0
BizAgentApplicationPublishModel.java
...nt_application/model/BizAgentApplicationPublishModel.java
+86
-0
AgentApplicationInfoQuery.sql
...poc/agent_application/query/AgentApplicationInfoQuery.sql
+5
-0
AgentApplicationInfoQueryItem.java
...gent_application/query/AgentApplicationInfoQueryItem.java
+79
-0
BizAgentApplicationInfoServiceImpl.java
...tion/service/impl/BizAgentApplicationInfoServiceImpl.java
+14
-0
BizAgentApplicationPublishServiceImpl.java
...n/service/impl/BizAgentApplicationPublishServiceImpl.java
+13
-0
No files found.
src/main/java/cn/com/poc/agent_application/aggregate/impl/AgentApplicationInfoServiceImpl.java
View file @
f078bbeb
...
...
@@ -19,6 +19,7 @@ import cn.com.poc.knowledge.service.BizKnowledgeDocumentService;
import
cn.com.poc.support.security.oauth.entity.UserBaseEntity
;
import
cn.com.poc.thirdparty.resource.demand.ai.aggregate.AICreateImageService
;
import
cn.com.poc.thirdparty.resource.demand.ai.aggregate.DemandKnowledgeService
;
import
cn.com.poc.thirdparty.resource.demand.ai.constants.KnowledgeSearchTypeEnum
;
import
cn.com.poc.thirdparty.resource.demand.ai.constants.LLMRoleEnum
;
import
cn.com.poc.thirdparty.resource.demand.ai.entity.dialogue.Message
;
import
cn.com.poc.thirdparty.resource.demand.ai.entity.dialogue.MultiContent
;
...
...
@@ -599,7 +600,7 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ
// 应用角色指令
promptTemplate
=
promptTemplate
.
replace
(
"${agentSystem}"
,
StringUtils
.
isNotBlank
(
agentSystem
)
?
agentSystem
:
StringUtils
.
EMPTY
);
// 调用知识库
promptTemplate
=
buildKnowledgePrompt
(
messages
,
kdIds
,
promptTemplate
);
promptTemplate
=
buildKnowledgePrompt
(
messages
,
kdIds
,
promptTemplate
,
null
);
// 记忆
promptTemplate
=
buildMemoryPrompt
(
promptTemplate
,
tools
,
dialogueId
,
agentId
);
// 函数调用
...
...
@@ -615,7 +616,7 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ
* @param promptTemplate
* @return
*/
private
String
buildKnowledgePrompt
(
List
<
Message
>
messages
,
Integer
[]
kdIds
,
String
promptTemplate
)
{
private
String
buildKnowledgePrompt
(
List
<
Message
>
messages
,
Integer
[]
kdIds
,
String
promptTemplate
,
KnowledgeSearchTypeEnum
searchTypeEnum
)
{
if
(
ArrayUtils
.
isNotEmpty
(
kdIds
))
{
List
<
String
>
knowledgeIds
=
new
ArrayList
<>();
for
(
Integer
kdId
:
kdIds
)
{
...
...
@@ -633,7 +634,7 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ
}
else
{
query
=
content
.
toString
();
}
List
<
String
>
knowledgeResults
=
demandKnowledgeService
.
searchKnowledge
(
query
,
knowledgeIds
,
3
);
List
<
String
>
knowledgeResults
=
demandKnowledgeService
.
searchKnowledge
(
query
,
knowledgeIds
,
3
,
searchTypeEnum
);
StringBuilder
knowledgeResultsBuilder
=
new
StringBuilder
();
if
(
CollectionUtils
.
isNotEmpty
(
knowledgeResults
))
{
for
(
int
i
=
1
;
i
<=
knowledgeResults
.
size
();
i
++)
{
...
...
src/main/java/cn/com/poc/agent_application/constant/AgentApplicationConstants.java
View file @
f078bbeb
...
...
@@ -26,5 +26,14 @@ public interface AgentApplicationConstants {
}
}
interface
KNOWLEDGE_RESPONSE_TYPE
{
String
DEFAULT
=
"default"
;
//ai回复
String
CUSTOM
=
"custom"
;
//自定义护肤
static
boolean
isResponseType
(
String
status
)
{
return
DEFAULT
.
equals
(
status
)
||
CUSTOM
.
equals
(
status
);
}
}
}
src/main/java/cn/com/poc/agent_application/convert/AgentApplicationInfoConvert.java
View file @
f078bbeb
...
...
@@ -64,6 +64,12 @@ public class AgentApplicationInfoConvert {
if
(
StringUtils
.
isNotBlank
(
model
.
getKnowledgeIds
()))
{
entity
.
setKnowledgeIds
(
JsonUtils
.
deSerialize
(
model
.
getKnowledgeIds
(),
Integer
[].
class
));
}
entity
.
setKnowledgeSearchType
(
model
.
getKnowledgeSearchType
());
entity
.
setKnowledgeSimilarity
(
model
.
getKnowledgeSimilarity
());
entity
.
setKnowledgeNResult
(
model
.
getKnowledgeNResult
());
entity
.
setKnowledgeResponseType
(
model
.
getKnowledgeResponseType
());
entity
.
setKnowledgeCustomResponse
(
StringUtils
.
isNotBlank
(
model
.
getKnowledgeCustomResponse
())
?
JsonUtils
.
deSerialize
(
model
.
getKnowledgeCustomResponse
(),
String
[].
class
)
:
null
);
entity
.
setIsDocumentParsing
(
model
.
getIsDocumentParsing
());
entity
.
setLargeModel
(
model
.
getLargeModel
());
entity
.
setTopP
(
model
.
getTopP
());
...
...
@@ -111,6 +117,12 @@ public class AgentApplicationInfoConvert {
if
(
ArrayUtils
.
isNotEmpty
(
entity
.
getKnowledgeIds
()))
{
model
.
setKnowledgeIds
(
JsonUtils
.
serialize
(
entity
.
getKnowledgeIds
()));
}
model
.
setKnowledgeSearchType
(
entity
.
getKnowledgeSearchType
());
model
.
setKnowledgeSimilarity
(
entity
.
getKnowledgeSimilarity
());
model
.
setKnowledgeNResult
(
entity
.
getKnowledgeNResult
());
model
.
setKnowledgeResponseType
(
entity
.
getKnowledgeResponseType
());
model
.
setKnowledgeCustomResponse
(
ArrayUtils
.
isNotEmpty
(
entity
.
getKnowledgeCustomResponse
())
?
JsonUtils
.
serialize
(
entity
.
getKnowledgeCustomResponse
())
:
null
);
model
.
setLargeModel
(
entity
.
getLargeModel
());
model
.
setTopP
(
entity
.
getTopP
());
model
.
setTemperature
(
entity
.
getTemperature
());
...
...
@@ -153,6 +165,11 @@ public class AgentApplicationInfoConvert {
AgentApplicationKnowledgeConfig
knowledgeConfig
=
new
AgentApplicationKnowledgeConfig
();
knowledgeConfig
.
setKnowledgeIds
(
entity
.
getKnowledgeIds
());
knowledgeConfig
.
setIsDocumentParsing
(
entity
.
getIsDocumentParsing
());
knowledgeConfig
.
setKnowledgeSearchType
(
entity
.
getKnowledgeSearchType
());
knowledgeConfig
.
setKnowledgeSimilarity
(
entity
.
getKnowledgeSimilarity
());
knowledgeConfig
.
setKnowledgeNResult
(
entity
.
getKnowledgeNResult
());
knowledgeConfig
.
setKnowledgeResponseType
(
entity
.
getKnowledgeResponseType
());
knowledgeConfig
.
setKnowledgeCustomResponse
(
entity
.
getKnowledgeCustomResponse
());
AgentApplicationCommModelConfig
commModelConfig
=
new
AgentApplicationCommModelConfig
();
commModelConfig
.
setLargeModel
(
entity
.
getLargeModel
());
...
...
@@ -211,6 +228,11 @@ public class AgentApplicationInfoConvert {
if
(
ObjectUtil
.
isNotEmpty
(
dto
.
getKnowledgeConfig
()))
{
entity
.
setKnowledgeIds
(
dto
.
getKnowledgeConfig
().
getKnowledgeIds
());
entity
.
setIsDocumentParsing
(
dto
.
getKnowledgeConfig
().
getIsDocumentParsing
());
entity
.
setKnowledgeSearchType
(
dto
.
getKnowledgeConfig
().
getKnowledgeSearchType
());
entity
.
setKnowledgeSimilarity
(
dto
.
getKnowledgeConfig
().
getKnowledgeSimilarity
());
entity
.
setKnowledgeNResult
(
dto
.
getKnowledgeConfig
().
getKnowledgeNResult
());
entity
.
setKnowledgeResponseType
(
dto
.
getKnowledgeConfig
().
getKnowledgeResponseType
());
entity
.
setKnowledgeCustomResponse
(
dto
.
getKnowledgeConfig
().
getKnowledgeCustomResponse
());
}
if
(
ObjectUtil
.
isNotEmpty
(
dto
.
getCommModelConfig
()))
{
...
...
@@ -268,6 +290,13 @@ public class AgentApplicationInfoConvert {
if
(
StringUtils
.
isNotBlank
(
infoQueryItem
.
getKnowledgeIds
()))
{
entity
.
setKnowledgeIds
(
JsonUtils
.
deSerialize
(
infoQueryItem
.
getKnowledgeIds
(),
Integer
[].
class
));
}
entity
.
setKnowledgeSearchType
(
infoQueryItem
.
getKnowledgeSearchType
());
entity
.
setKnowledgeSimilarity
(
infoQueryItem
.
getKnowledgeSimilarity
());
entity
.
setKnowledgeNResult
(
infoQueryItem
.
getKnowledgeNResult
());
entity
.
setKnowledgeResponseType
(
infoQueryItem
.
getKnowledgeResponseType
());
if
(
StringUtils
.
isNotBlank
(
infoQueryItem
.
getKnowledgeCustomResponse
()))
{
entity
.
setKnowledgeCustomResponse
(
JsonUtils
.
deSerialize
(
infoQueryItem
.
getKnowledgeCustomResponse
(),
String
[].
class
));
}
entity
.
setLargeModel
(
infoQueryItem
.
getLargeModel
());
entity
.
setTopP
(
infoQueryItem
.
getTopP
());
entity
.
setTemperature
(
infoQueryItem
.
getTemperature
());
...
...
src/main/java/cn/com/poc/agent_application/convert/BizAgentApplicationPublishConvert.java
View file @
f078bbeb
...
...
@@ -51,6 +51,12 @@ public class BizAgentApplicationPublishConvert {
if
(
StringUtils
.
isNotBlank
(
model
.
getKnowledgeIds
()))
{
entity
.
setKnowledgeIds
(
JsonUtils
.
deSerialize
(
model
.
getKnowledgeIds
(),
Integer
[].
class
));
}
entity
.
setKnowledgeSearchType
(
model
.
getKnowledgeSearchType
());
entity
.
setKnowledgeSimilarity
(
model
.
getKnowledgeSimilarity
());
entity
.
setKnowledgeNResult
(
model
.
getKnowledgeNResult
());
entity
.
setKnowledgeResponseType
(
model
.
getKnowledgeResponseType
());
entity
.
setKnowledgeCustomResponse
(
StringUtils
.
isNotBlank
(
model
.
getKnowledgeCustomResponse
())
?
JsonUtils
.
deSerialize
(
model
.
getKnowledgeCustomResponse
(),
String
[].
class
)
:
null
);
entity
.
setLargeModel
(
model
.
getLargeModel
());
entity
.
setTopP
(
model
.
getTopP
());
entity
.
setTemperature
(
model
.
getTemperature
());
...
...
@@ -94,6 +100,12 @@ public class BizAgentApplicationPublishConvert {
if
(
ArrayUtils
.
isNotEmpty
(
entity
.
getKnowledgeIds
()))
{
model
.
setKnowledgeIds
(
JsonUtils
.
serialize
(
entity
.
getKnowledgeIds
()));
}
model
.
setKnowledgeSearchType
(
entity
.
getKnowledgeSearchType
());
model
.
setKnowledgeSimilarity
(
entity
.
getKnowledgeSimilarity
());
model
.
setKnowledgeNResult
(
entity
.
getKnowledgeNResult
());
model
.
setKnowledgeResponseType
(
entity
.
getKnowledgeResponseType
());
model
.
setKnowledgeCustomResponse
(
ArrayUtils
.
isNotEmpty
(
entity
.
getKnowledgeCustomResponse
())
?
JsonUtils
.
serialize
(
entity
.
getKnowledgeCustomResponse
())
:
null
);
model
.
setLargeModel
(
entity
.
getLargeModel
());
model
.
setTopP
(
entity
.
getTopP
());
model
.
setTemperature
(
entity
.
getTemperature
());
...
...
@@ -139,6 +151,11 @@ public class BizAgentApplicationPublishConvert {
AgentApplicationKnowledgeConfig
knowledgeConfig
=
new
AgentApplicationKnowledgeConfig
();
knowledgeConfig
.
setKnowledgeIds
(
entity
.
getKnowledgeIds
());
knowledgeConfig
.
setIsDocumentParsing
(
entity
.
getIsDocumentParsing
());
knowledgeConfig
.
setKnowledgeSearchType
(
entity
.
getKnowledgeSearchType
());
knowledgeConfig
.
setKnowledgeSimilarity
(
entity
.
getKnowledgeSimilarity
());
knowledgeConfig
.
setKnowledgeNResult
(
entity
.
getKnowledgeNResult
());
knowledgeConfig
.
setKnowledgeResponseType
(
entity
.
getKnowledgeResponseType
());
knowledgeConfig
.
setKnowledgeCustomResponse
(
entity
.
getKnowledgeCustomResponse
());
AgentApplicationCommModelConfig
commModelConfig
=
new
AgentApplicationCommModelConfig
();
commModelConfig
.
setLargeModel
(
entity
.
getLargeModel
());
...
...
@@ -198,6 +215,11 @@ public class BizAgentApplicationPublishConvert {
if
(
ObjectUtil
.
isNotEmpty
(
dto
.
getKnowledgeConfig
()))
{
entity
.
setKnowledgeIds
(
dto
.
getKnowledgeConfig
().
getKnowledgeIds
());
entity
.
setIsDocumentParsing
(
dto
.
getKnowledgeConfig
().
getIsDocumentParsing
());
entity
.
setKnowledgeSearchType
(
dto
.
getKnowledgeConfig
().
getKnowledgeSearchType
());
entity
.
setKnowledgeSimilarity
(
dto
.
getKnowledgeConfig
().
getKnowledgeSimilarity
());
entity
.
setKnowledgeNResult
(
dto
.
getKnowledgeConfig
().
getKnowledgeNResult
());
entity
.
setKnowledgeResponseType
(
dto
.
getKnowledgeConfig
().
getKnowledgeResponseType
());
entity
.
setKnowledgeCustomResponse
(
dto
.
getKnowledgeConfig
().
getKnowledgeCustomResponse
());
}
if
(
ObjectUtil
.
isNotEmpty
(
dto
.
getCommModelConfig
()))
{
...
...
src/main/java/cn/com/poc/agent_application/domain/AgentApplicationKnowledgeConfig.java
View file @
f078bbeb
...
...
@@ -32,4 +32,80 @@ public class AgentApplicationKnowledgeConfig {
public
void
setIsDocumentParsing
(
java
.
lang
.
String
isDocumentParsing
)
{
this
.
isDocumentParsing
=
isDocumentParsing
;
}
/**
* 知识库检索方式
* 1、混合检索 - MIX
* 2、语义检索 - SEMANTIC
* 3. 关键词检索 - KEY_WORD
*/
private
java
.
lang
.
String
knowledgeSearchType
;
public
String
getKnowledgeSearchType
()
{
return
knowledgeSearchType
;
}
public
void
setKnowledgeSearchType
(
String
knowledgeSearchType
)
{
this
.
knowledgeSearchType
=
knowledgeSearchType
;
}
/**
* 知识库相似度阈值
*/
private
Double
knowledgeSimilarity
;
public
Double
getKnowledgeSimilarity
()
{
return
knowledgeSimilarity
;
}
public
void
setKnowledgeSimilarity
(
Double
knowledgeSimilarity
)
{
this
.
knowledgeSimilarity
=
knowledgeSimilarity
;
}
/**
* 知识库检索结果数量
*/
private
Integer
knowledgeNResult
;
public
Integer
getKnowledgeNResult
()
{
return
knowledgeNResult
;
}
public
void
setKnowledgeNResult
(
Integer
knowledgeNResult
)
{
this
.
knowledgeNResult
=
knowledgeNResult
;
}
/**
* knowledge_response_type
* 知识库回复类型
* default-默认
* custom-自定义
*/
private
String
knowledgeResponseType
;
public
String
getKnowledgeResponseType
()
{
return
knowledgeResponseType
;
}
public
void
setKnowledgeResponseType
(
String
knowledgeResponseType
)
{
this
.
knowledgeResponseType
=
knowledgeResponseType
;
}
/**
* knowledge_custom_response
* 知识库自定义回复内容
*/
private
String
[]
knowledgeCustomResponse
;
public
String
[]
getKnowledgeCustomResponse
()
{
return
knowledgeCustomResponse
;
}
public
void
setKnowledgeCustomResponse
(
String
[]
knowledgeCustomResponse
)
{
this
.
knowledgeCustomResponse
=
knowledgeCustomResponse
;
}
}
src/main/java/cn/com/poc/agent_application/entity/BizAgentApplicationInfoEntity.java
View file @
f078bbeb
...
...
@@ -233,6 +233,81 @@ public class BizAgentApplicationInfoEntity {
this
.
knowledgeIds
=
knowledgeIds
;
}
/**
* 知识库检索方式
* 1、混合检索 - MIX
* 2、语义检索 - SEMANTIC
* 3. 关键词检索 - KEY_WORD
*/
private
java
.
lang
.
String
knowledgeSearchType
;
public
String
getKnowledgeSearchType
()
{
return
knowledgeSearchType
;
}
public
void
setKnowledgeSearchType
(
String
knowledgeSearchType
)
{
this
.
knowledgeSearchType
=
knowledgeSearchType
;
}
/**
* 知识库相似度阈值
*/
private
Double
knowledgeSimilarity
;
public
Double
getKnowledgeSimilarity
()
{
return
knowledgeSimilarity
;
}
public
void
setKnowledgeSimilarity
(
Double
knowledgeSimilarity
)
{
this
.
knowledgeSimilarity
=
knowledgeSimilarity
;
}
/**
* 知识库检索结果数量
*/
private
Integer
knowledgeNResult
;
public
Integer
getKnowledgeNResult
()
{
return
knowledgeNResult
;
}
public
void
setKnowledgeNResult
(
Integer
knowledgeNResult
)
{
this
.
knowledgeNResult
=
knowledgeNResult
;
}
/**
* knowledge_response_type
* 知识库回复类型
* default-默认
* custom-自定义
*/
private
String
knowledgeResponseType
;
public
String
getKnowledgeResponseType
()
{
return
knowledgeResponseType
;
}
public
void
setKnowledgeResponseType
(
String
knowledgeResponseType
)
{
this
.
knowledgeResponseType
=
knowledgeResponseType
;
}
/**
* knowledge_custom_response
* 知识库自定义回复内容
*/
private
String
[]
knowledgeCustomResponse
;
public
String
[]
getKnowledgeCustomResponse
()
{
return
knowledgeCustomResponse
;
}
public
void
setKnowledgeCustomResponse
(
String
[]
knowledgeCustomResponse
)
{
this
.
knowledgeCustomResponse
=
knowledgeCustomResponse
;
}
/**
* large_model
* 问答模型
...
...
@@ -332,7 +407,6 @@ public class BizAgentApplicationInfoEntity {
}
/**
* voice_config
* 声音配置 defaultOpen- 是否默认开启 timbreId-音色
...
...
src/main/java/cn/com/poc/agent_application/entity/BizAgentApplicationPublishEntity.java
View file @
f078bbeb
...
...
@@ -245,6 +245,82 @@ public class BizAgentApplicationPublishEntity {
this
.
knowledgeIds
=
knowledgeIds
;
}
/**
* 知识库检索方式
* 1、混合检索 - MIX
* 2、语义检索 - SEMANTIC
* 3. 关键词检索 - KEY_WORD
*/
private
java
.
lang
.
String
knowledgeSearchType
;
public
String
getKnowledgeSearchType
()
{
return
knowledgeSearchType
;
}
public
void
setKnowledgeSearchType
(
String
knowledgeSearchType
)
{
this
.
knowledgeSearchType
=
knowledgeSearchType
;
}
/**
* 知识库相似度阈值
*/
private
Double
knowledgeSimilarity
;
public
Double
getKnowledgeSimilarity
()
{
return
knowledgeSimilarity
;
}
public
void
setKnowledgeSimilarity
(
Double
knowledgeSimilarity
)
{
this
.
knowledgeSimilarity
=
knowledgeSimilarity
;
}
/**
* 知识库检索结果数量
*/
private
Integer
knowledgeNResult
;
public
Integer
getKnowledgeNResult
()
{
return
knowledgeNResult
;
}
public
void
setKnowledgeNResult
(
Integer
knowledgeNResult
)
{
this
.
knowledgeNResult
=
knowledgeNResult
;
}
/**
* knowledge_response_type
* 知识库回复类型
* default-默认
* custom-自定义
*/
private
String
knowledgeResponseType
;
public
String
getKnowledgeResponseType
()
{
return
knowledgeResponseType
;
}
public
void
setKnowledgeResponseType
(
String
knowledgeResponseType
)
{
this
.
knowledgeResponseType
=
knowledgeResponseType
;
}
/**
* knowledge_custom_response
* 知识库自定义回复内容
*/
private
String
[]
knowledgeCustomResponse
;
public
String
[]
getKnowledgeCustomResponse
()
{
return
knowledgeCustomResponse
;
}
public
void
setKnowledgeCustomResponse
(
String
[]
knowledgeCustomResponse
)
{
this
.
knowledgeCustomResponse
=
knowledgeCustomResponse
;
}
/**
* large_model
* 问答模型
...
...
src/main/java/cn/com/poc/agent_application/model/BizAgentApplicationInfoModel.java
View file @
f078bbeb
...
...
@@ -302,6 +302,92 @@ public class BizAgentApplicationInfoModel extends BaseModelClass implements Seri
super
.
addValidField
(
"knowledgeIds"
);
}
/**
* knowledge_search_type
* 知识库检索方式
* 1、混合检索 - MIX
* 2、语义检索 - SEMANTIC
* 3. 关键词检索 - KEY_WORD
*/
private
java
.
lang
.
String
knowledgeSearchType
;
@Column
(
name
=
"knowledge_search_type"
,
length
=
10
)
public
String
getKnowledgeSearchType
()
{
return
knowledgeSearchType
;
}
public
void
setKnowledgeSearchType
(
String
knowledgeSearchType
)
{
this
.
knowledgeSearchType
=
knowledgeSearchType
;
super
.
addValidField
(
"knowledgeSearchType"
);
}
/**
* knowledge_similarity
* 知识库相似度阈值
*/
private
Double
knowledgeSimilarity
;
@Column
(
name
=
"knowledge_similarity"
,
length
=
12
)
public
Double
getKnowledgeSimilarity
()
{
return
knowledgeSimilarity
;
}
public
void
setKnowledgeSimilarity
(
Double
knowledgeSimilarity
)
{
this
.
knowledgeSimilarity
=
knowledgeSimilarity
;
super
.
addValidField
(
"knowledgeSimilarity"
);
}
/**
* knowledge_n_result
* 知识库检索结果数量
*/
private
Integer
knowledgeNResult
;
@Column
(
name
=
"knowledge_n_result"
,
length
=
10
)
public
Integer
getKnowledgeNResult
()
{
return
knowledgeNResult
;
}
public
void
setKnowledgeNResult
(
Integer
knowledgeNResult
)
{
this
.
knowledgeNResult
=
knowledgeNResult
;
super
.
addValidField
(
"knowledgeNResult"
);
}
/**
* knowledge_response_type
* 知识库回复类型
* default-默认
* custom-自定义
*/
private
String
knowledgeResponseType
;
@Column
(
name
=
"knowledge_response_type"
,
length
=
10
)
public
String
getKnowledgeResponseType
()
{
return
knowledgeResponseType
;
}
public
void
setKnowledgeResponseType
(
String
knowledgeResponseType
)
{
this
.
knowledgeResponseType
=
knowledgeResponseType
;
super
.
addValidField
(
"knowledgeResponseType"
);
}
/**
* knowledge_custom_response
* 知识库自定义回复内容
*/
private
String
knowledgeCustomResponse
;
@Column
(
name
=
"knowledge_custom_response"
,
length
=
2147483647
)
public
String
getKnowledgeCustomResponse
()
{
return
knowledgeCustomResponse
;
}
public
void
setKnowledgeCustomResponse
(
String
knowledgeCustomResponse
)
{
this
.
knowledgeCustomResponse
=
knowledgeCustomResponse
;
super
.
addValidField
(
"knowledgeCustomResponse"
);
}
/**
* large_model
...
...
src/main/java/cn/com/poc/agent_application/model/BizAgentApplicationPublishModel.java
View file @
f078bbeb
...
...
@@ -284,6 +284,92 @@ public class BizAgentApplicationPublishModel extends BaseModelClass implements S
super
.
addValidField
(
"knowledgeIds"
);
}
/**
* knowledge_search_type
* 知识库检索方式
* 1、混合检索 - MIX
* 2、语义检索 - SEMANTIC
* 3. 关键词检索 - KEY_WORD
*/
private
java
.
lang
.
String
knowledgeSearchType
;
@Column
(
name
=
"knowledge_search_type"
,
length
=
10
)
public
String
getKnowledgeSearchType
()
{
return
knowledgeSearchType
;
}
public
void
setKnowledgeSearchType
(
String
knowledgeSearchType
)
{
this
.
knowledgeSearchType
=
knowledgeSearchType
;
super
.
addValidField
(
"knowledgeSearchType"
);
}
/**
* knowledge_similarity
* 知识库相似度阈值
*/
private
Double
knowledgeSimilarity
;
@Column
(
name
=
"knowledge_similarity"
,
length
=
12
)
public
Double
getKnowledgeSimilarity
()
{
return
knowledgeSimilarity
;
}
public
void
setKnowledgeSimilarity
(
Double
knowledgeSimilarity
)
{
this
.
knowledgeSimilarity
=
knowledgeSimilarity
;
super
.
addValidField
(
"knowledgeSimilarity"
);
}
/**
* knowledge_n_result
* 知识库检索结果数量
*/
private
Integer
knowledgeNResult
;
@Column
(
name
=
"knowledge_n_result"
,
length
=
10
)
public
Integer
getKnowledgeNResult
()
{
return
knowledgeNResult
;
}
public
void
setKnowledgeNResult
(
Integer
knowledgeNResult
)
{
this
.
knowledgeNResult
=
knowledgeNResult
;
super
.
addValidField
(
"knowledgeNResult"
);
}
/**
* knowledge_response_type
* 知识库回复类型
* default-默认
* custom-自定义
*/
private
String
knowledgeResponseType
;
@Column
(
name
=
"knowledge_response_type"
,
length
=
10
)
public
String
getKnowledgeResponseType
()
{
return
knowledgeResponseType
;
}
public
void
setKnowledgeResponseType
(
String
knowledgeResponseType
)
{
this
.
knowledgeResponseType
=
knowledgeResponseType
;
super
.
addValidField
(
"knowledgeResponseType"
);
}
/**
* knowledge_custom_response
* 知识库自定义回复内容
*/
private
String
knowledgeCustomResponse
;
@Column
(
name
=
"knowledge_custom_response"
,
length
=
2147483647
)
public
String
getKnowledgeCustomResponse
()
{
return
knowledgeCustomResponse
;
}
public
void
setKnowledgeCustomResponse
(
String
knowledgeCustomResponse
)
{
this
.
knowledgeCustomResponse
=
knowledgeCustomResponse
;
super
.
addValidField
(
"knowledgeCustomResponse"
);
}
/**
* large_model
...
...
src/main/java/cn/com/poc/agent_application/query/AgentApplicationInfoQuery.sql
View file @
f078bbeb
...
...
@@ -15,6 +15,11 @@ select distinct
continuous_question_system
,
continuous_question_turn
,
knowledge_ids
,
knowledge_search_type
,
knowledge_similarity
,
knowledge_n_result
,
knowledge_response_type
,
knowledge_custom_response
,
large_model
,
top_p
,
temperature
,
...
...
src/main/java/cn/com/poc/agent_application/query/AgentApplicationInfoQueryItem.java
View file @
f078bbeb
...
...
@@ -254,6 +254,85 @@ public class AgentApplicationInfoQueryItem extends BaseItemClass implements Seri
this
.
knowledgeIds
=
knowledgeIds
;
}
/**
* knowledge_search_type
* 知识库检索方式
* 1、混合检索 - MIX
* 2、语义检索 - SEMANTIC
* 3. 关键词检索 - KEY_WORD
*/
private
java
.
lang
.
String
knowledgeSearchType
;
@Column
(
name
=
"knowledge_search_type"
)
public
String
getKnowledgeSearchType
()
{
return
knowledgeSearchType
;
}
public
void
setKnowledgeSearchType
(
String
knowledgeSearchType
)
{
this
.
knowledgeSearchType
=
knowledgeSearchType
;
}
/**
* knowledge_similarity
* 知识库相似度阈值
*/
private
Double
knowledgeSimilarity
;
@Column
(
name
=
"knowledge_similarity"
)
public
Double
getKnowledgeSimilarity
()
{
return
knowledgeSimilarity
;
}
public
void
setKnowledgeSimilarity
(
Double
knowledgeSimilarity
)
{
this
.
knowledgeSimilarity
=
knowledgeSimilarity
;
}
/**
* knowledge_n_result
* 知识库检索结果数量
*/
private
Integer
knowledgeNResult
;
@Column
(
name
=
"knowledge_n_result"
)
public
Integer
getKnowledgeNResult
()
{
return
knowledgeNResult
;
}
public
void
setKnowledgeNResult
(
Integer
knowledgeNResult
)
{
this
.
knowledgeNResult
=
knowledgeNResult
;
}
/**
* knowledge_response_type
* 知识库回复类型
*/
private
String
knowledgeResponseType
;
@Column
(
name
=
"knowledge_response_type"
)
public
String
getKnowledgeResponseType
()
{
return
knowledgeResponseType
;
}
public
void
setKnowledgeResponseType
(
String
knowledgeResponseType
)
{
this
.
knowledgeResponseType
=
knowledgeResponseType
;
}
/**
* knowledge_custom_response
* 知识库自定义回复
*/
private
String
knowledgeCustomResponse
;
@Column
(
name
=
"knowledge_custom_response"
)
public
String
getKnowledgeCustomResponse
()
{
return
knowledgeCustomResponse
;
}
public
void
setKnowledgeCustomResponse
(
String
knowledgeCustomResponse
)
{
this
.
knowledgeCustomResponse
=
knowledgeCustomResponse
;
}
/**
* large_model
* large_model
...
...
src/main/java/cn/com/poc/agent_application/service/impl/BizAgentApplicationInfoServiceImpl.java
View file @
f078bbeb
...
...
@@ -15,6 +15,7 @@ import cn.com.poc.agent_application.entity.BizAgentApplicationInfoEntity;
import
cn.com.poc.agent_application.convert.AgentApplicationInfoConvert
;
import
cn.com.poc.agent_application.repository.BizAgentApplicationInfoRepository
;
import
cn.com.yict.framemax.data.model.PagingInfo
;
import
org.apache.commons.lang3.ArrayUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.stereotype.Service
;
...
...
@@ -225,6 +226,19 @@ public class BizAgentApplicationInfoServiceImpl extends BaseServiceImpl
model
.
setContinuousQuestionStatus
(
entity
.
getContinuousQuestionStatus
());
model
.
setContinuousQuestionSystem
(
entity
.
getContinuousQuestionSystem
());
model
.
setKnowledgeIds
(
JsonUtils
.
serialize
(
entity
.
getKnowledgeIds
()));
if
(
StringUtils
.
isNotBlank
(
entity
.
getKnowledgeSearchType
()))
{
model
.
setKnowledgeSearchType
(
entity
.
getKnowledgeSearchType
());
}
if
(
entity
.
getKnowledgeSimilarity
()
!=
null
)
{
model
.
setKnowledgeSimilarity
(
entity
.
getKnowledgeSimilarity
());
}
if
(
entity
.
getKnowledgeNResult
()
!=
null
)
{
model
.
setKnowledgeNResult
(
entity
.
getKnowledgeNResult
());
}
model
.
setKnowledgeResponseType
(
entity
.
getKnowledgeResponseType
());
if
(
ArrayUtils
.
isNotEmpty
(
entity
.
getKnowledgeCustomResponse
()))
{
model
.
setKnowledgeCustomResponse
(
ArrayUtils
.
isNotEmpty
(
entity
.
getKnowledgeCustomResponse
())
?
JsonUtils
.
serialize
(
entity
.
getKnowledgeCustomResponse
())
:
null
);
}
model
.
setVariableStructure
(
JsonUtils
.
serialize
(
entity
.
getVariableStructure
()));
model
.
setLargeModel
(
entity
.
getLargeModel
());
model
.
setUnitIds
(
JsonUtils
.
serialize
(
entity
.
getUnitIds
()));
...
...
src/main/java/cn/com/poc/agent_application/service/impl/BizAgentApplicationPublishServiceImpl.java
View file @
f078bbeb
...
...
@@ -182,6 +182,19 @@ public class BizAgentApplicationPublishServiceImpl extends BaseServiceImpl
if
(
ArrayUtils
.
isNotEmpty
(
entity
.
getKnowledgeIds
()))
{
model
.
setKnowledgeIds
(
JsonUtils
.
serialize
(
entity
.
getKnowledgeIds
()));
}
if
(
StringUtils
.
isNotBlank
(
entity
.
getKnowledgeSearchType
()))
{
model
.
setKnowledgeSearchType
(
entity
.
getKnowledgeSearchType
());
}
if
(
entity
.
getKnowledgeSimilarity
()
!=
null
)
{
model
.
setKnowledgeSimilarity
(
entity
.
getKnowledgeSimilarity
());
}
if
(
entity
.
getKnowledgeNResult
()
!=
null
)
{
model
.
setKnowledgeNResult
(
entity
.
getKnowledgeNResult
());
}
model
.
setKnowledgeResponseType
(
entity
.
getKnowledgeResponseType
());
if
(
ArrayUtils
.
isNotEmpty
(
entity
.
getKnowledgeCustomResponse
()))
{
model
.
setKnowledgeCustomResponse
(
ArrayUtils
.
isNotEmpty
(
entity
.
getKnowledgeCustomResponse
())
?
JsonUtils
.
serialize
(
entity
.
getKnowledgeCustomResponse
())
:
null
);
}
if
(
StringUtils
.
isNotBlank
(
entity
.
getLargeModel
()))
{
model
.
setLargeModel
(
entity
.
getLargeModel
());
}
...
...
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