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
05a09c72
Commit
05a09c72
authored
Oct 24, 2024
by
alex yao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
style: 大模型content 多模态
parent
6fc892b9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
3 deletions
+14
-3
AgentApplicationInfoServiceImpl.java
...ation/aggregate/impl/AgentApplicationInfoServiceImpl.java
+14
-3
No files found.
src/main/java/cn/com/poc/agent_application/aggregate/impl/AgentApplicationInfoServiceImpl.java
View file @
05a09c72
...
@@ -596,7 +596,7 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ
...
@@ -596,7 +596,7 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ
* @param promptTemplate
* @param promptTemplate
* @return
* @return
*/
*/
private
static
Message
[]
buildMessages
(
List
<
Message
>
messages
,
Integer
communicationTurn
,
String
promptTemplate
)
{
private
Message
[]
buildMessages
(
List
<
Message
>
messages
,
Integer
communicationTurn
,
String
promptTemplate
)
{
int
messLength
=
messages
.
size
()
-
1
;
int
messLength
=
messages
.
size
()
-
1
;
int
skip
=
communicationTurn
*
2
;
int
skip
=
communicationTurn
*
2
;
if
(
skip
<
messLength
)
{
if
(
skip
<
messLength
)
{
...
@@ -609,9 +609,20 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ
...
@@ -609,9 +609,20 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ
systemMessage
.
setContent
(
promptTemplate
);
systemMessage
.
setContent
(
promptTemplate
);
messages
.
add
(
0
,
systemMessage
);
messages
.
add
(
0
,
systemMessage
);
}
}
return
messages
.
toArray
(
new
Message
[
0
]);
// 转换消息体
Message
[]
messageArray
=
new
Message
[
messages
.
size
()];
int
index
=
0
;
for
(
Message
message
:
messages
)
{
if
(
message
.
getContent
()
instanceof
List
)
{
List
<
HashMap
<
String
,
Object
>>
content
=
(
List
<
HashMap
<
String
,
Object
>>)
message
.
getContent
();
if
(
content
.
get
(
0
).
get
(
"type"
).
equals
(
"text"
))
{
message
.
setContent
(
content
.
get
(
0
).
get
(
"text"
).
toString
());
}
}
messageArray
[
index
++]
=
message
;
}
return
messageArray
;
}
}
/**
/**
* 获取模型
* 获取模型
...
...
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