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
0f0d2481
Commit
0f0d2481
authored
Apr 11, 2025
by
alex yao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 优化角色指令生成
parent
2b741d07
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
5 deletions
+19
-5
AgentApplicationService.java
.../agent_application/aggregate/AgentApplicationService.java
+3
-2
AgentApplicationServiceImpl.java
...plication/aggregate/impl/AgentApplicationServiceImpl.java
+6
-2
AgentApplicationGCDto.java
.../com/poc/agent_application/dto/AgentApplicationGCDto.java
+9
-0
AgentApplicationInfoRestImpl.java
...t_application/rest/impl/AgentApplicationInfoRestImpl.java
+1
-1
No files found.
src/main/java/cn/com/poc/agent_application/aggregate/AgentApplicationService.java
View file @
0f0d2481
...
...
@@ -75,11 +75,12 @@ public interface AgentApplicationService {
/**
* 角色指令AI生成
*
* @param input 用户输入内容
* @param input 用户输入内容
* @param optimizationSuggestions 优化建议
* @param httpServletResponse
* @return
*/
void
createAgentSystem
(
String
input
,
HttpServletResponse
httpServletResponse
)
throws
Exception
;
void
createAgentSystem
(
String
input
,
String
optimizationSuggestions
,
HttpServletResponse
httpServletResponse
)
throws
Exception
;
/**
* 开场白AI生成
...
...
src/main/java/cn/com/poc/agent_application/aggregate/impl/AgentApplicationServiceImpl.java
View file @
0f0d2481
...
...
@@ -229,7 +229,7 @@ public class AgentApplicationServiceImpl implements AgentApplicationService {
@Override
public
void
createAgentSystem
(
String
input
,
HttpServletResponse
httpServletResponse
)
throws
Exception
{
public
void
createAgentSystem
(
String
input
,
String
optimizationSuggestions
,
HttpServletResponse
httpServletResponse
)
throws
Exception
{
BizAgentApplicationGcConfigEntity
configEntity
=
bizAgentApplicationGcConfigService
.
getByConfigCode
(
AgentApplicationGCConfigConstants
.
AGENT_SYSTEM
);
if
(
null
==
configEntity
||
StringUtils
.
isBlank
(
configEntity
.
getConfigSystem
()))
{
throw
new
I18nMessageException
(
"exception/create.[role.instruction].configuration.does.not.exist"
);
...
...
@@ -238,8 +238,12 @@ public class AgentApplicationServiceImpl implements AgentApplicationService {
systemMessage
.
setContent
(
configEntity
.
getConfigSystem
());
systemMessage
.
setRole
(
LLMRoleEnum
.
SYSTEM
.
getRole
());
String
content
=
"[\" + input + \"]"
;
if
(
StringUtils
.
isNotBlank
(
optimizationSuggestions
))
{
content
=
content
+
"\n 优化建议:["
+
optimizationSuggestions
+
"]"
;
}
Message
message
=
new
Message
();
message
.
setContent
(
"["
+
input
+
"]"
);
message
.
setContent
(
content
);
message
.
setRole
(
LLMRoleEnum
.
USER
.
getRole
());
List
<
Message
>
messages
=
new
ArrayList
<
Message
>()
{{
add
(
systemMessage
);
...
...
src/main/java/cn/com/poc/agent_application/dto/AgentApplicationGCDto.java
View file @
0f0d2481
...
...
@@ -12,6 +12,8 @@ public class AgentApplicationGCDto implements Serializable {
private
String
agentSystem
;
private
String
optimizationSuggestions
;
public
String
getInput
()
{
return
input
;
}
...
...
@@ -20,6 +22,13 @@ public class AgentApplicationGCDto implements Serializable {
this
.
input
=
input
;
}
public
String
getOptimizationSuggestions
()
{
return
optimizationSuggestions
;
}
public
void
setOptimizationSuggestions
(
String
optimizationSuggestions
)
{
this
.
optimizationSuggestions
=
optimizationSuggestions
;
}
public
String
getAgentTitle
()
{
return
agentTitle
;
...
...
src/main/java/cn/com/poc/agent_application/rest/impl/AgentApplicationInfoRestImpl.java
View file @
0f0d2481
...
...
@@ -411,7 +411,7 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest {
@Override
public
void
createAgentSystem
(
AgentApplicationGCDto
dto
,
HttpServletResponse
response
)
throws
Exception
{
Assert
.
notNull
(
dto
.
getInput
());
agentApplicationService
.
createAgentSystem
(
dto
.
getInput
(),
response
);
agentApplicationService
.
createAgentSystem
(
dto
.
getInput
(),
dto
.
getOptimizationSuggestions
(),
response
);
}
@Override
...
...
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