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
d60ce0d1
Commit
d60ce0d1
authored
Feb 27, 2025
by
alex yao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:记录对话的模型推理内容
parent
7ccfc95c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
8 deletions
+12
-8
AgentApplicationInfoServiceImpl.java
...ation/aggregate/impl/AgentApplicationInfoServiceImpl.java
+4
-2
KnowledgeService.java
...java/cn/com/poc/knowledge/aggregate/KnowledgeService.java
+2
-1
KnowledgeServiceImpl.java
...om/poc/knowledge/aggregate/impl/KnowledgeServiceImpl.java
+2
-2
KnowledgeRest.java
src/main/java/cn/com/poc/knowledge/rest/KnowledgeRest.java
+2
-1
KnowledgeRestImpl.java
...ava/cn/com/poc/knowledge/rest/impl/KnowledgeRestImpl.java
+2
-2
No files found.
src/main/java/cn/com/poc/agent_application/aggregate/impl/AgentApplicationInfoServiceImpl.java
View file @
d60ce0d1
...
@@ -171,8 +171,8 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ
...
@@ -171,8 +171,8 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ
@Override
@Override
public
AgentResultEntity
callAgentApplication
(
String
agentId
,
String
dialogueId
,
String
largeModel
,
public
AgentResultEntity
callAgentApplication
(
String
agentId
,
String
dialogueId
,
String
largeModel
,
String
agentSystem
,
Integer
[]
kdIds
,
Integer
communicationTurn
,
Float
topP
,
Float
temperature
,
String
agentSystem
,
Integer
[]
kdIds
,
Integer
communicationTurn
,
Float
topP
,
Float
temperature
,
List
<
Message
>
messages
,
List
<
Tool
>
tools
,
List
<
String
>
fileUrls
,
boolean
stream
,
List
<
String
>
imageUrls
,
HttpServletResponse
httpServletResponse
)
throws
Exception
{
List
<
Message
>
messages
,
List
<
Tool
>
tools
,
List
<
String
>
fileUrls
,
boolean
stream
,
List
<
String
>
imageUrls
,
HttpServletResponse
httpServletResponse
)
throws
Exception
{
logger
.
info
(
"Call Agent Application, agentId:{}, dialogueId:{},largeModel:{},agentSystem:{},kdIds:{},communicationTurn:{},topP:{},temperature:{},messages:{}, tools:{}"
logger
.
info
(
"Call Agent Application, agentId:{}, dialogueId:{},largeModel:{},agentSystem:{},kdIds:{},communicationTurn:{},topP:{},temperature:{},messages:{}, tools:{}"
,
agentId
,
dialogueId
,
largeModel
,
agentSystem
,
kdIds
,
communicationTurn
,
topP
,
temperature
,
messages
,
tools
);
,
agentId
,
dialogueId
,
largeModel
,
agentSystem
,
kdIds
,
communicationTurn
,
topP
,
temperature
,
messages
,
tools
);
...
@@ -800,6 +800,8 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ
...
@@ -800,6 +800,8 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ
}
}
if
(
StringUtils
.
isNotBlank
(
result
.
getMessage
()))
{
if
(
StringUtils
.
isNotBlank
(
result
.
getMessage
()))
{
output
.
append
(
result
.
getMessage
());
output
.
append
(
result
.
getMessage
());
}
if
(
StringUtils
.
isNotBlank
(
result
.
getReasoningContent
()))
{
reasoningContent
.
append
(
result
.
getReasoningContent
());
reasoningContent
.
append
(
result
.
getReasoningContent
());
}
}
writer
.
write
(
EVENT_STREAM_PREFIX
+
res
+
"\n\n"
);
writer
.
write
(
EVENT_STREAM_PREFIX
+
res
+
"\n\n"
);
...
...
src/main/java/cn/com/poc/knowledge/aggregate/KnowledgeService.java
View file @
d60ce0d1
...
@@ -15,9 +15,10 @@ public interface KnowledgeService {
...
@@ -15,9 +15,10 @@ public interface KnowledgeService {
* 上传文档
* 上传文档
*
*
* @param documentFiles 文档
* @param documentFiles 文档
* @param knowledgeType 知识库类型
* @return 是否成功
* @return 是否成功
*/
*/
List
<
BizKnowledgeDocumentEntity
>
uploadDocument
(
MultipartFile
[]
documentFiles
)
throws
Exception
;
List
<
BizKnowledgeDocumentEntity
>
uploadDocument
(
MultipartFile
[]
documentFiles
,
String
knowledgeType
)
throws
Exception
;
/**
/**
* 删除文档
* 删除文档
...
...
src/main/java/cn/com/poc/knowledge/aggregate/impl/KnowledgeServiceImpl.java
View file @
d60ce0d1
...
@@ -67,7 +67,7 @@ public class KnowledgeServiceImpl implements KnowledgeService {
...
@@ -67,7 +67,7 @@ public class KnowledgeServiceImpl implements KnowledgeService {
private
BosConfigService
bosConfigService
;
private
BosConfigService
bosConfigService
;
@Override
@Override
public
List
<
BizKnowledgeDocumentEntity
>
uploadDocument
(
MultipartFile
[]
documentFiles
)
throws
Exception
{
public
List
<
BizKnowledgeDocumentEntity
>
uploadDocument
(
MultipartFile
[]
documentFiles
,
String
knowledgeType
)
throws
Exception
{
//获取用户类型
//获取用户类型
UserBaseEntity
userBaseEntity
=
BlContext
.
getCurrentUserNotException
();
UserBaseEntity
userBaseEntity
=
BlContext
.
getCurrentUserNotException
();
String
memberId
=
userBaseEntity
.
getUserId
().
toString
();
String
memberId
=
userBaseEntity
.
getUserId
().
toString
();
...
@@ -109,7 +109,7 @@ public class KnowledgeServiceImpl implements KnowledgeService {
...
@@ -109,7 +109,7 @@ public class KnowledgeServiceImpl implements KnowledgeService {
//保存记录
//保存记录
BizKnowledgeDocumentEntity
bizKnowledgeDocumentEntity
=
new
BizKnowledgeDocumentEntity
();
BizKnowledgeDocumentEntity
bizKnowledgeDocumentEntity
=
new
BizKnowledgeDocumentEntity
();
bizKnowledgeDocumentEntity
.
setOwner
(
KnowledgeConstant
.
Owner
.
USER
);
bizKnowledgeDocumentEntity
.
setOwner
(
KnowledgeConstant
.
Owner
.
USER
);
bizKnowledgeDocumentEntity
.
setKnowledgeType
(
KnowledgeConstant
.
KnowledgeType
.
BASE
);
bizKnowledgeDocumentEntity
.
setKnowledgeType
(
knowledgeType
);
bizKnowledgeDocumentEntity
.
setDocumentName
(
documentName
);
bizKnowledgeDocumentEntity
.
setDocumentName
(
documentName
);
bizKnowledgeDocumentEntity
.
setDocumentUrl
(
documentUrl
);
bizKnowledgeDocumentEntity
.
setDocumentUrl
(
documentUrl
);
bizKnowledgeDocumentEntity
.
setDocumentSize
(
fileSizeInBytes
);
bizKnowledgeDocumentEntity
.
setDocumentSize
(
fileSizeInBytes
);
...
...
src/main/java/cn/com/poc/knowledge/rest/KnowledgeRest.java
View file @
d60ce0d1
...
@@ -19,9 +19,10 @@ public interface KnowledgeRest extends BaseRest {
...
@@ -19,9 +19,10 @@ public interface KnowledgeRest extends BaseRest {
* 上传文档
* 上传文档
*
*
* @param documentFiles 文档
* @param documentFiles 文档
* @param knowledgeType 知识库类型
* @return 是否成功
* @return 是否成功
*/
*/
List
<
BizKnowledgeDocumentDto
>
uploadDocument
(
@RequestParam
(
"documentFiles"
)
MultipartFile
[]
documentFiles
)
throws
Exception
;
List
<
BizKnowledgeDocumentDto
>
uploadDocument
(
@RequestParam
(
"documentFiles"
)
MultipartFile
[]
documentFiles
,
@RequestParam
(
required
=
false
)
String
knowledgeType
)
throws
Exception
;
/**
/**
* 删除文档
* 删除文档
...
...
src/main/java/cn/com/poc/knowledge/rest/impl/KnowledgeRestImpl.java
View file @
d60ce0d1
...
@@ -48,7 +48,7 @@ public class KnowledgeRestImpl implements KnowledgeRest {
...
@@ -48,7 +48,7 @@ public class KnowledgeRestImpl implements KnowledgeRest {
private
MemberEquityService
memberEquityService
;
private
MemberEquityService
memberEquityService
;
@Override
@Override
public
List
<
BizKnowledgeDocumentDto
>
uploadDocument
(
MultipartFile
[]
documentFiles
)
throws
Exception
{
public
List
<
BizKnowledgeDocumentDto
>
uploadDocument
(
MultipartFile
[]
documentFiles
,
String
knowledgeType
)
throws
Exception
{
Assert
.
notEmpty
(
documentFiles
);
Assert
.
notEmpty
(
documentFiles
);
Assert
.
isTrue
(
documentFiles
.
length
<=
5
);
Assert
.
isTrue
(
documentFiles
.
length
<=
5
);
UserBaseEntity
userBaseEntity
=
BlContext
.
getCurrentUserNotException
();
UserBaseEntity
userBaseEntity
=
BlContext
.
getCurrentUserNotException
();
...
@@ -60,7 +60,7 @@ public class KnowledgeRestImpl implements KnowledgeRest {
...
@@ -60,7 +60,7 @@ public class KnowledgeRestImpl implements KnowledgeRest {
if
((
documentFiles
.
length
+
equityInfo
.
getUsedKnowledgeNum
())
>
knowledgeNum
)
{
if
((
documentFiles
.
length
+
equityInfo
.
getUsedKnowledgeNum
())
>
knowledgeNum
)
{
throw
new
I18nMessageException
(
"exception/create.num.limit"
);
throw
new
I18nMessageException
(
"exception/create.num.limit"
);
}
}
List
<
BizKnowledgeDocumentEntity
>
entities
=
knowledgeService
.
uploadDocument
(
documentFiles
);
List
<
BizKnowledgeDocumentEntity
>
entities
=
knowledgeService
.
uploadDocument
(
documentFiles
,
knowledgeType
);
return
entities
.
stream
().
map
(
entity
->
{
return
entities
.
stream
().
map
(
entity
->
{
BizKnowledgeDocumentDto
dto
=
new
BizKnowledgeDocumentDto
();
BizKnowledgeDocumentDto
dto
=
new
BizKnowledgeDocumentDto
();
BeanUtil
.
copyProperties
(
entity
,
dto
);
BeanUtil
.
copyProperties
(
entity
,
dto
);
...
...
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