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
9a822a4e
Commit
9a822a4e
authored
Mar 03, 2025
by
alex yao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:知识库超纲回复
parent
9acbfe59
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
298 additions
and
32 deletions
+298
-32
AgentApplicationInfoService.java
...nt_application/aggregate/AgentApplicationInfoService.java
+24
-18
AgentApplicationInfoServiceImpl.java
...ation/aggregate/impl/AgentApplicationInfoServiceImpl.java
+45
-6
AgentApplicationKnowledgeConstants.java
...lication/constant/AgentApplicationKnowledgeConstants.java
+15
-0
BizAgentApplicationInfoEntity.java
...ent_application/entity/BizAgentApplicationInfoEntity.java
+2
-2
KnowledgeContentResult.java
.../poc/agent_application/entity/KnowledgeContentResult.java
+1
-1
KnowledgeSuperclassProblemConfig.java
..._application/entity/KnowledgeSuperclassProblemConfig.java
+40
-0
CallAgentApplicationKnowledgeConfig.java
...ntity/call_agent/CallAgentApplicationKnowledgeConfig.java
+93
-0
CallAgentApplicationModelConfig.java
...on/entity/call_agent/CallAgentApplicationModelConfig.java
+60
-0
AgentApplicationInfoRestImpl.java
...t_application/rest/impl/AgentApplicationInfoRestImpl.java
+5
-1
AgentApplicationApiServiceImpl.java
...expose/aggregate/impl/AgentApplicationApiServiceImpl.java
+6
-1
AgentApplicationServiceImpl.java
...oc/expose/aggregate/impl/AgentApplicationServiceImpl.java
+5
-1
KnowledgeSearchTypeEnum.java
...resource/demand/ai/constants/KnowledgeSearchTypeEnum.java
+1
-1
LargeModelDemandResult.java
...e/demand/ai/entity/largemodel/LargeModelDemandResult.java
+1
-1
No files found.
src/main/java/cn/com/poc/agent_application/aggregate/AgentApplicationInfoService.java
View file @
9a822a4e
...
...
@@ -4,6 +4,9 @@ import cn.com.poc.agent_application.domain.FunctionResult;
import
cn.com.poc.agent_application.entity.AgentResultEntity
;
import
cn.com.poc.agent_application.entity.BizAgentApplicationInfoEntity
;
import
cn.com.poc.agent_application.entity.CreateAgentTitleAndDescEntity
;
import
cn.com.poc.agent_application.entity.KnowledgeSuperclassProblemConfig
;
import
cn.com.poc.agent_application.entity.call_agent.CallAgentApplicationKnowledgeConfig
;
import
cn.com.poc.agent_application.entity.call_agent.CallAgentApplicationModelConfig
;
import
cn.com.poc.thirdparty.resource.demand.ai.constants.KnowledgeSearchTypeEnum
;
import
cn.com.poc.thirdparty.resource.demand.ai.entity.dialogue.Message
;
import
cn.com.poc.thirdparty.resource.demand.ai.entity.dialogue.Tool
;
...
...
@@ -56,6 +59,7 @@ public interface AgentApplicationInfoService {
* @param topK 知识库参数topK
* @param knowledgeSearchType 知识库参数知识搜索类型
*/
@Deprecated
AgentResultEntity
callAgentApplication
(
String
agentId
,
String
identifier
,
String
largeModel
,
String
agentSystem
,
Integer
[]
knowledgeIds
,
Integer
communicationTurn
,
Float
topP
,
Float
temperature
,
List
<
Message
>
messages
,
List
<
Tool
>
tools
,
List
<
String
>
fileUrls
,
boolean
stream
,
List
<
String
>
imageUrls
,
...
...
@@ -81,11 +85,13 @@ public interface AgentApplicationInfoService {
* @param score 知识库参数score
* @param topK 知识库参数topK
* @param knowledgeSearchType 知识库参数知识搜索类型
* @param superclassProblemConfig 知识库参数超级类问题配置
*/
AgentResultEntity
callAgentApplication
(
String
agentId
,
String
identifier
,
String
largeModel
,
String
agentSystem
,
Integer
[]
knowledgeIds
,
Integer
communicationTurn
,
Float
topP
,
Float
temperature
,
List
<
Message
>
messages
,
List
<
Tool
>
tools
,
FunctionCallResult
functionCallResult
,
List
<
String
>
fileUrls
,
boolean
stream
,
List
<
String
>
imageUrls
,
Double
score
,
Integer
topK
,
KnowledgeSearchTypeEnum
knowledgeSearchType
,
HttpServletResponse
httpServletResponse
)
throws
Exception
;
Double
score
,
Integer
topK
,
KnowledgeSearchTypeEnum
knowledgeSearchType
,
KnowledgeSuperclassProblemConfig
superclassProblemConfig
,
HttpServletResponse
httpServletResponse
)
throws
Exception
;
/**
* 应用下架
...
...
src/main/java/cn/com/poc/agent_application/aggregate/impl/AgentApplicationInfoServiceImpl.java
View file @
9a822a4e
...
...
@@ -4,9 +4,12 @@ import cn.com.poc.agent_application.aggregate.AgentApplicationInfoService;
import
cn.com.poc.agent_application.constant.AgentApplicationConstants
;
import
cn.com.poc.agent_application.constant.AgentApplicationDialoguesRecordConstants
;
import
cn.com.poc.agent_application.constant.AgentApplicationGCConfigConstants
;
import
cn.com.poc.agent_application.constant.AgentApplicationKnowledgeConstants
;
import
cn.com.poc.agent_application.domain.FunctionResult
;
import
cn.com.poc.agent_application.
dto
.KnowledgeContentResult
;
import
cn.com.poc.agent_application.
entity
.KnowledgeContentResult
;
import
cn.com.poc.agent_application.entity.*
;
import
cn.com.poc.agent_application.entity.call_agent.CallAgentApplicationKnowledgeConfig
;
import
cn.com.poc.agent_application.entity.call_agent.CallAgentApplicationModelConfig
;
import
cn.com.poc.agent_application.query.DialogsIdsQueryByAgentIdQueryItem
;
import
cn.com.poc.agent_application.service.*
;
import
cn.com.poc.agent_application.utils.AgentApplicationTools
;
...
...
@@ -188,7 +191,7 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ
FunctionResult
functionResult
=
functionCall
(
dialogueId
,
messages
,
toolArray
,
agentId
,
fileUrls
,
imageUrls
);
List
<
KnowledgeContentResult
>
knowledgeResult
=
knowledge
(
kdIds
,
messages
,
topK
,
score
,
KnowledgeSearchTypeEnum
.
MIX
);
List
<
KnowledgeContentResult
>
knowledgeResult
=
knowledge
(
kdIds
,
messages
,
topK
,
score
,
knowledgeSearchType
);
String
promptTemplate
=
buildDialogsPrompt
(
functionResult
,
agentSystem
,
toolArray
,
dialogueId
,
agentId
,
knowledgeResult
);
...
...
@@ -198,16 +201,35 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ
}
@Override
public
AgentResultEntity
callAgentApplication
(
String
agentId
,
String
dialogueId
,
String
largeModel
,
String
agentSystem
,
Integer
[]
kdIds
,
Integer
communicationTurn
,
Float
topP
,
Float
temperature
,
List
<
Message
>
messages
,
List
<
Tool
>
tools
,
FunctionCallResult
functionCallResult
,
List
<
String
>
fileUrls
,
boolean
stream
,
List
<
String
>
imageUrls
,
Double
score
,
Integer
topK
,
KnowledgeSearchTypeEnum
knowledgeSearchType
,
HttpServletResponse
httpServletResponse
)
throws
Exception
{
public
AgentResultEntity
callAgentApplication
(
String
agentId
,
String
dialogueId
,
String
largeModel
,
String
agentSystem
,
Integer
[]
kdIds
,
Integer
communicationTurn
,
Float
topP
,
Float
temperature
,
List
<
Message
>
messages
,
List
<
Tool
>
tools
,
FunctionCallResult
functionCallResult
,
List
<
String
>
fileUrls
,
boolean
stream
,
List
<
String
>
imageUrls
,
Double
score
,
Integer
topK
,
KnowledgeSearchTypeEnum
knowledgeSearchType
,
KnowledgeSuperclassProblemConfig
superclassProblemConfig
,
HttpServletResponse
httpServletResponse
)
throws
Exception
{
String
model
=
modelConvert
(
largeModel
);
List
<
KnowledgeContentResult
>
knowledgeResult
=
knowledge
(
kdIds
,
messages
,
topK
,
score
,
knowledgeSearchType
);
if
(
superclassProblem
(
superclassProblemConfig
,
kdIds
,
knowledgeResult
))
{
String
mess
=
superclassProblemConfig
.
getKnowledgeCustomResponse
()[
0
];
logger
.
info
(
"触发知识库超纲回答,mess{}"
,
mess
);
if
(
stream
)
{
PrintWriter
writer
=
httpServletResponse
.
getWriter
();
LargeModelDemandResult
result
=
new
LargeModelDemandResult
();
result
.
setCode
(
"0"
);
result
.
setMessage
(
mess
);
writer
.
write
(
EVENT_STREAM_PREFIX
+
JsonUtils
.
serialize
(
result
)
+
"\n\n"
);
writer
.
write
(
EVENT_STREAM_PREFIX
+
"[DONE]"
+
"\n\n"
);
writer
.
flush
();
writer
.
close
();
}
AgentResultEntity
agentResultEntity
=
new
AgentResultEntity
();
agentResultEntity
.
setMessage
(
mess
);
return
agentResultEntity
;
}
Tool
[]
toolArray
=
tools
.
toArray
(
new
Tool
[
0
]);
FunctionResult
functionResult
=
functionCall
(
dialogueId
,
functionCallResult
,
agentId
);
List
<
KnowledgeContentResult
>
knowledgeResult
=
knowledge
(
kdIds
,
messages
,
topK
,
score
,
KnowledgeSearchTypeEnum
.
MIX
);
String
promptTemplate
=
buildDialogsPrompt
(
functionResult
,
agentSystem
,
toolArray
,
dialogueId
,
agentId
,
knowledgeResult
);
Message
[]
messageArray
=
buildMessages
(
messages
,
communicationTurn
,
promptTemplate
);
...
...
@@ -215,6 +237,7 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ
return
llmExecutorAndOutput
(
topP
,
stream
,
model
,
messageArray
,
functionResult
,
knowledgeResult
,
httpServletResponse
);
}
@Override
public
void
createAgentSystem
(
String
input
,
HttpServletResponse
httpServletResponse
)
throws
Exception
{
BizAgentApplicationGcConfigEntity
configEntity
=
bizAgentApplicationGcConfigService
.
getByConfigCode
(
AgentApplicationGCConfigConstants
.
AGENT_SYSTEM
);
...
...
@@ -549,6 +572,10 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ
result
.
setKnowledgeContentResult
(
knowledgeResult
);
writer
.
write
(
EVENT_STREAM_PREFIX
+
JsonUtils
.
serialize
(
result
)
+
"\n\n"
);
writer
.
flush
();
}
else
{
//todo 处理知识库超纲问题
}
if
(
ObjectUtil
.
isNotNull
(
functionResult
)
&&
StringUtils
.
isNotBlank
(
functionResult
.
getFunctionName
()))
{
LargeModelDemandResult
result
=
new
LargeModelDemandResult
();
...
...
@@ -1091,4 +1118,16 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ
MemoryVariableWriter
.
addItem
(
identifier
,
map
);
}
}
private
boolean
superclassProblem
(
KnowledgeSuperclassProblemConfig
superclassProblemConfig
,
Integer
[]
kdIds
,
List
<
KnowledgeContentResult
>
knowledgeContentResult
)
{
if
(
ArrayUtils
.
isNotEmpty
(
kdIds
)
&&
CollectionUtils
.
isEmpty
(
knowledgeContentResult
))
{
String
knowledgeResponseType
=
superclassProblemConfig
.
getKnowledgeResponseType
();
if
(
AgentApplicationKnowledgeConstants
.
SUPER_CLASS_PROBLEM_TYPE
.
CUSTOM
.
equals
(
knowledgeResponseType
)
&&
ArrayUtils
.
isNotEmpty
(
superclassProblemConfig
.
getKnowledgeCustomResponse
())
&&
StringUtils
.
isNotBlank
(
superclassProblemConfig
.
getKnowledgeCustomResponse
()[
0
]))
{
return
true
;
}
}
return
false
;
}
}
src/main/java/cn/com/poc/agent_application/constant/AgentApplicationKnowledgeConstants.java
0 → 100644
View file @
9a822a4e
package
cn
.
com
.
poc
.
agent_application
.
constant
;
/**
* @author alex.yao
* @date 2025/3/3
*/
public
interface
AgentApplicationKnowledgeConstants
{
interface
SUPER_CLASS_PROBLEM_TYPE
{
String
DEFAULT
=
"default"
;
String
CUSTOM
=
"custom"
;
}
}
src/main/java/cn/com/poc/agent_application/entity/BizAgentApplicationInfoEntity.java
View file @
9a822a4e
...
...
@@ -279,7 +279,7 @@ public class BizAgentApplicationInfoEntity {
/**
* knowledge_response_type
* 知识库回复类型
* 知识库
超纲
回复类型
* default-默认
* custom-自定义
*/
...
...
@@ -296,7 +296,7 @@ public class BizAgentApplicationInfoEntity {
/**
* knowledge_custom_response
* 知识库
自定义回复内容
* 知识库
超纲自定义回复内容-当knowledge_response_type为custom时生效
*/
private
String
[]
knowledgeCustomResponse
;
...
...
src/main/java/cn/com/poc/agent_application/
dto
/KnowledgeContentResult.java
→
src/main/java/cn/com/poc/agent_application/
entity
/KnowledgeContentResult.java
View file @
9a822a4e
package
cn
.
com
.
poc
.
agent_application
.
dto
;
package
cn
.
com
.
poc
.
agent_application
.
entity
;
/**
* @author alex.yao
...
...
src/main/java/cn/com/poc/agent_application/entity/KnowledgeSuperclassProblemConfig.java
0 → 100644
View file @
9a822a4e
package
cn
.
com
.
poc
.
agent_application
.
entity
;
/**
* @author alex.yao
* @date 2025/3/3
*/
public
class
KnowledgeSuperclassProblemConfig
{
/**
* knowledge_response_type
* 知识库超纲回复类型
* default-默认
* custom-自定义
*/
private
String
knowledgeResponseType
;
public
String
getKnowledgeResponseType
()
{
return
knowledgeResponseType
;
}
public
void
setKnowledgeResponseType
(
String
knowledgeResponseType
)
{
this
.
knowledgeResponseType
=
knowledgeResponseType
;
}
/**
* knowledge_custom_response
* 知识库超纲自定义回复内容-当knowledge_response_type为custom时生效
*/
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/call_agent/CallAgentApplicationKnowledgeConfig.java
0 → 100644
View file @
9a822a4e
package
cn
.
com
.
poc
.
agent_application
.
entity
.
call_agent
;
import
cn.com.poc.thirdparty.resource.demand.ai.constants.KnowledgeSearchTypeEnum
;
/**
* @author alex.yao
* @date 2025/2/28
*/
public
class
CallAgentApplicationKnowledgeConfig
{
/**
* 知识库ID数组
*/
private
Integer
[]
knowledgeIds
;
/**
* 知识库检索得分阈值
*/
private
Double
score
;
/**
* 知识库检索数量上限
*/
private
Integer
topK
;
/**
* 知识库检索类型
*/
private
KnowledgeSearchTypeEnum
searchTypeEnum
;
/**
* knowledge_response_type
* 知识库超纲回复类型
* default-默认
* custom-自定义
*/
private
String
knowledgeResponseType
;
/**
* knowledge_custom_response
* 知识库自定义回复内容
*/
private
String
[]
knowledgeCustomResponse
;
public
Integer
[]
getKnowledgeIds
()
{
return
knowledgeIds
;
}
public
void
setKnowledgeIds
(
Integer
[]
knowledgeIds
)
{
this
.
knowledgeIds
=
knowledgeIds
;
}
public
Double
getScore
()
{
return
score
;
}
public
void
setScore
(
Double
score
)
{
this
.
score
=
score
;
}
public
Integer
getTopK
()
{
return
topK
;
}
public
void
setTopK
(
Integer
topK
)
{
this
.
topK
=
topK
;
}
public
KnowledgeSearchTypeEnum
getSearchTypeEnum
()
{
return
searchTypeEnum
;
}
public
void
setSearchTypeEnum
(
KnowledgeSearchTypeEnum
searchTypeEnum
)
{
this
.
searchTypeEnum
=
searchTypeEnum
;
}
public
String
getKnowledgeResponseType
()
{
return
knowledgeResponseType
;
}
public
void
setKnowledgeResponseType
(
String
knowledgeResponseType
)
{
this
.
knowledgeResponseType
=
knowledgeResponseType
;
}
public
String
[]
getKnowledgeCustomResponse
()
{
return
knowledgeCustomResponse
;
}
public
void
setKnowledgeCustomResponse
(
String
[]
knowledgeCustomResponse
)
{
this
.
knowledgeCustomResponse
=
knowledgeCustomResponse
;
}
}
src/main/java/cn/com/poc/agent_application/entity/call_agent/CallAgentApplicationModelConfig.java
0 → 100644
View file @
9a822a4e
package
cn
.
com
.
poc
.
agent_application
.
entity
.
call_agent
;
/**
* @author alex.yao
* @date 2025/2/28
*/
public
class
CallAgentApplicationModelConfig
{
private
String
largeModel
;
private
String
agentSystem
;
private
Integer
communicationTurn
;
private
Float
topP
;
private
Float
temperature
;
private
Boolean
stream
;
public
String
getLargeModel
()
{
return
largeModel
;
}
public
void
setLargeModel
(
String
largeModel
)
{
this
.
largeModel
=
largeModel
;
}
public
String
getAgentSystem
()
{
return
agentSystem
;
}
public
void
setAgentSystem
(
String
agentSystem
)
{
this
.
agentSystem
=
agentSystem
;
}
public
Integer
getCommunicationTurn
()
{
return
communicationTurn
;
}
public
void
setCommunicationTurn
(
Integer
communicationTurn
)
{
this
.
communicationTurn
=
communicationTurn
;
}
public
Float
getTopP
()
{
return
topP
;
}
public
void
setTopP
(
Float
topP
)
{
this
.
topP
=
topP
;
}
public
Float
getTemperature
()
{
return
temperature
;
}
public
void
setTemperature
(
Float
temperature
)
{
this
.
temperature
=
temperature
;
}
}
src/main/java/cn/com/poc/agent_application/rest/impl/AgentApplicationInfoRestImpl.java
View file @
9a822a4e
...
...
@@ -249,6 +249,10 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest {
//获取知识库配置
List
<
Integer
>
kdIds
=
knowledgeService
.
getKdIdsByKnowledgeInfoIds
(
infoEntity
.
getKnowledgeIds
());
//知识库超纲问题配置
KnowledgeSuperclassProblemConfig
superclassProblemConfig
=
new
KnowledgeSuperclassProblemConfig
();
superclassProblemConfig
.
setKnowledgeResponseType
(
infoEntity
.
getKnowledgeResponseType
());
superclassProblemConfig
.
setKnowledgeCustomResponse
(
infoEntity
.
getKnowledgeCustomResponse
());
//配置对话function
List
<
Tool
>
tools
=
AgentApplicationTools
.
buildFunctionConfig
(
infoEntity
.
getVariableStructure
(),
infoEntity
.
getIsLongMemory
(),
dialogueId
,
agentId
,
infoEntity
.
getUnitIds
(),
infoEntity
.
getIsDocumentParsing
());
...
...
@@ -276,7 +280,7 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest {
agentSystem
,
kdIds
.
toArray
(
new
Integer
[
0
]),
communicationTurn
,
topP
,
temperature
,
dto
.
getMessages
(),
tools
,
checkPluginUseEntity
.
getFunctionCallResult
(),
dto
.
getFileUrls
(),
true
,
imageUrls
,
infoEntity
.
getKnowledgeSimilarity
(),
infoEntity
.
getKnowledgeNResult
(),
KnowledgeSearchTypeEnum
.
valueOf
(
infoEntity
.
getKnowledgeSearchType
()),
httpServletResponse
);
superclassProblemConfig
,
httpServletResponse
);
//数据采集
if
(
StringUtils
.
isBlank
(
dto
.
getChannel
()))
{
dto
.
setChannel
(
DataAnalyzeChannelEnum
.
preview
.
getChannel
());
...
...
src/main/java/cn/com/poc/expose/aggregate/impl/AgentApplicationApiServiceImpl.java
View file @
9a822a4e
...
...
@@ -138,6 +138,11 @@ public class AgentApplicationApiServiceImpl implements AgentApplicationApiServic
//获取知识库配置
List
<
Integer
>
kdIdList
=
knowledgeService
.
getKdIdsByKnowledgeInfoIds
(
infoEntity
.
getKnowledgeIds
());
//知识库超纲问题配置
KnowledgeSuperclassProblemConfig
superclassProblemConfig
=
new
KnowledgeSuperclassProblemConfig
();
superclassProblemConfig
.
setKnowledgeResponseType
(
infoEntity
.
getKnowledgeResponseType
());
superclassProblemConfig
.
setKnowledgeCustomResponse
(
infoEntity
.
getKnowledgeCustomResponse
());
// 构造对话参数
List
<
Message
>
messages
=
buildMessages
(
conversationId
,
agentId
,
profileEntity
.
getMemberId
(),
query
);
...
...
@@ -167,7 +172,7 @@ public class AgentApplicationApiServiceImpl implements AgentApplicationApiServic
infoEntity
.
getAgentSystem
(),
kdIdList
.
toArray
(
new
Integer
[
0
]),
infoEntity
.
getCommunicationTurn
(),
infoEntity
.
getTopP
(),
infoEntity
.
getTemperature
(),
messages
,
tools
,
checkPluginUseEntity
.
getFunctionCallResult
(),
fileUrls
,
stream
,
imageUrls
,
infoEntity
.
getKnowledgeSimilarity
(),
infoEntity
.
getKnowledgeNResult
(),
KnowledgeSearchTypeEnum
.
valueOf
(
infoEntity
.
getKnowledgeSearchType
()),
httpServletResponse
);
superclassProblemConfig
,
httpServletResponse
);
saveRecord
(
conversationId
,
query
,
agentId
,
profileEntity
,
inputTimestamp
,
infoEntity
,
agentResultEntity
.
getMessage
());
}
catch
(
Exception
e
)
{
memberEquityService
.
rollbackPoint
(
reduceSn
);
...
...
src/main/java/cn/com/poc/expose/aggregate/impl/AgentApplicationServiceImpl.java
View file @
9a822a4e
...
...
@@ -133,6 +133,10 @@ public class AgentApplicationServiceImpl implements AgentApplicationService {
//获取知识库配置
List
<
Integer
>
kdIdList
=
knowledgeService
.
getKdIdsByKnowledgeInfoIds
(
infoEntity
.
getKnowledgeIds
());
//知识库超纲问题配置
KnowledgeSuperclassProblemConfig
knowledgeSuperclassProblemConfig
=
new
KnowledgeSuperclassProblemConfig
();
knowledgeSuperclassProblemConfig
.
setKnowledgeResponseType
(
infoEntity
.
getKnowledgeResponseType
());
knowledgeSuperclassProblemConfig
.
setKnowledgeCustomResponse
(
infoEntity
.
getKnowledgeCustomResponse
());
// 构造对话参数
List
<
Message
>
messages
=
buildMessages
(
dialogsId
,
agentId
,
userBaseEntity
.
getUserId
(),
input
);
...
...
@@ -185,7 +189,7 @@ public class AgentApplicationServiceImpl implements AgentApplicationService {
infoEntity
.
getAgentSystem
(),
kdIdList
.
toArray
(
new
Integer
[
0
]),
infoEntity
.
getCommunicationTurn
(),
infoEntity
.
getTopP
(),
infoEntity
.
getTemperature
(),
messages
,
tools
,
checkPluginUseEntity
.
getFunctionCallResult
(),
fileUrls
,
true
,
imageUrls
,
infoEntity
.
getKnowledgeSimilarity
(),
infoEntity
.
getKnowledgeNResult
(),
KnowledgeSearchTypeEnum
.
valueOf
(
infoEntity
.
getKnowledgeSearchType
()),
httpServletResponse
);
knowledgeSuperclassProblemConfig
,
httpServletResponse
);
//保存对话记录
outputRecord
.
setContent
(
agentResultEntity
.
getMessage
());
...
...
src/main/java/cn/com/poc/thirdparty/resource/demand/ai/constants/KnowledgeSearchTypeEnum.java
View file @
9a822a4e
...
...
@@ -10,6 +10,6 @@ public enum KnowledgeSearchTypeEnum {
MIX
,
SEMANTIC
;
SEMANTIC
S
;
}
src/main/java/cn/com/poc/thirdparty/resource/demand/ai/entity/largemodel/LargeModelDemandResult.java
View file @
9a822a4e
package
cn
.
com
.
poc
.
thirdparty
.
resource
.
demand
.
ai
.
entity
.
largemodel
;
import
cn.com.poc.agent_application.
dto
.KnowledgeContentResult
;
import
cn.com.poc.agent_application.
entity
.KnowledgeContentResult
;
import
cn.com.poc.thirdparty.resource.demand.ai.entity.dialogue.Usage
;
import
cn.com.poc.thirdparty.resource.demand.dgTools.result.AbstractResult
;
import
cn.com.poc.thirdparty.resource.demand.ai.entity.dialogue.ToolFunction
;
...
...
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