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
6a719e97
Commit
6a719e97
authored
Oct 22, 2024
by
alex yao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: Agent应用,模型配置添加temperature字段
parent
46c7bd0c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
350 additions
and
168 deletions
+350
-168
AgentApplicationInfoService.java
...nt_application/aggregate/AgentApplicationInfoService.java
+1
-1
AgentApplicationInfoServiceImpl.java
...ation/aggregate/impl/AgentApplicationInfoServiceImpl.java
+1
-1
AgentApplicationInfoConvert.java
...gent_application/convert/AgentApplicationInfoConvert.java
+5
-0
BizAgentApplicationPublishConvert.java
...pplication/convert/BizAgentApplicationPublishConvert.java
+4
-0
AgentApplicationCommModelConfig.java
...t_application/domain/AgentApplicationCommModelConfig.java
+14
-0
BizAgentApplicationInfoEntity.java
...ent_application/entity/BizAgentApplicationInfoEntity.java
+222
-158
BizAgentApplicationPublishEntity.java
..._application/entity/BizAgentApplicationPublishEntity.java
+19
-1
BizAgentApplicationInfoModel.java
...agent_application/model/BizAgentApplicationInfoModel.java
+21
-2
BizAgentApplicationPublishModel.java
...nt_application/model/BizAgentApplicationPublishModel.java
+19
-2
AgentApplicationInfoQuery.sql
...poc/agent_application/query/AgentApplicationInfoQuery.sql
+1
-0
AgentApplicationInfoQueryItem.java
...gent_application/query/AgentApplicationInfoQueryItem.java
+17
-0
AgentApplicationInfoRestImpl.java
...t_application/rest/impl/AgentApplicationInfoRestImpl.java
+1
-1
BizAgentApplicationInfoServiceImpl.java
...tion/service/impl/BizAgentApplicationInfoServiceImpl.java
+4
-0
AgentApplicationServiceImpl.java
...oc/expose/aggregate/impl/AgentApplicationServiceImpl.java
+1
-2
AgentApplicationInfoTest.java
src/test/java/cn/com/poc/AgentApplicationInfoTest.java
+20
-0
No files found.
src/main/java/cn/com/poc/agent_application/aggregate/AgentApplicationInfoService.java
View file @
6a719e97
...
@@ -19,7 +19,7 @@ public interface AgentApplicationInfoService {
...
@@ -19,7 +19,7 @@ public interface AgentApplicationInfoService {
* 应用预览
* 应用预览
*/
*/
String
callAgentApplication
(
String
identifier
,
String
largeModel
,
String
[]
unitIds
,
String
agentSystem
,
String
callAgentApplication
(
String
identifier
,
String
largeModel
,
String
[]
unitIds
,
String
agentSystem
,
Integer
[]
knowledgeIds
,
Integer
communicationTurn
,
Float
topP
,
Integer
[]
knowledgeIds
,
Integer
communicationTurn
,
Float
topP
,
Float
temperature
,
List
<
Message
>
messages
,
List
<
Tool
>
tools
,
HttpServletResponse
httpServletResponse
)
throws
Exception
;
List
<
Message
>
messages
,
List
<
Tool
>
tools
,
HttpServletResponse
httpServletResponse
)
throws
Exception
;
/**
/**
...
...
src/main/java/cn/com/poc/agent_application/aggregate/impl/AgentApplicationInfoServiceImpl.java
View file @
6a719e97
...
@@ -102,7 +102,7 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ
...
@@ -102,7 +102,7 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ
}
}
@Override
@Override
public
String
callAgentApplication
(
String
identifier
,
String
largeModel
,
String
[]
unitIds
,
String
agentSystem
,
Integer
[]
kdIds
,
Integer
communicationTurn
,
Float
topP
,
List
<
Message
>
messages
,
List
<
Tool
>
tools
,
HttpServletResponse
httpServletResponse
)
throws
Exception
{
public
String
callAgentApplication
(
String
identifier
,
String
largeModel
,
String
[]
unitIds
,
String
agentSystem
,
Integer
[]
kdIds
,
Integer
communicationTurn
,
Float
topP
,
Float
temperature
,
List
<
Message
>
messages
,
List
<
Tool
>
tools
,
HttpServletResponse
httpServletResponse
)
throws
Exception
{
logger
.
info
(
"--------- Call Agent Application large model:{},unitIds:{},agentSystem:{},knowledgeIds:{}"
+
" communicationTurn:{},topP:{},messages:{}--------------"
,
largeModel
,
unitIds
,
agentSystem
,
kdIds
,
communicationTurn
,
topP
,
messages
);
logger
.
info
(
"--------- Call Agent Application large model:{},unitIds:{},agentSystem:{},knowledgeIds:{}"
+
" communicationTurn:{},topP:{},messages:{}--------------"
,
largeModel
,
unitIds
,
agentSystem
,
kdIds
,
communicationTurn
,
topP
,
messages
);
String
model
=
modelConvert
(
largeModel
);
String
model
=
modelConvert
(
largeModel
);
...
...
src/main/java/cn/com/poc/agent_application/convert/AgentApplicationInfoConvert.java
View file @
6a719e97
...
@@ -58,6 +58,7 @@ public class AgentApplicationInfoConvert {
...
@@ -58,6 +58,7 @@ public class AgentApplicationInfoConvert {
}
}
entity
.
setLargeModel
(
model
.
getLargeModel
());
entity
.
setLargeModel
(
model
.
getLargeModel
());
entity
.
setTopP
(
model
.
getTopP
());
entity
.
setTopP
(
model
.
getTopP
());
entity
.
setTemperature
(
model
.
getTemperature
());
if
(
StringUtils
.
isNotBlank
(
model
.
getUnitIds
()))
{
if
(
StringUtils
.
isNotBlank
(
model
.
getUnitIds
()))
{
entity
.
setUnitIds
(
JsonUtils
.
deSerialize
(
model
.
getUnitIds
(),
String
[].
class
));
entity
.
setUnitIds
(
JsonUtils
.
deSerialize
(
model
.
getUnitIds
(),
String
[].
class
));
}
}
...
@@ -98,6 +99,7 @@ public class AgentApplicationInfoConvert {
...
@@ -98,6 +99,7 @@ public class AgentApplicationInfoConvert {
}
}
model
.
setLargeModel
(
entity
.
getLargeModel
());
model
.
setLargeModel
(
entity
.
getLargeModel
());
model
.
setTopP
(
entity
.
getTopP
());
model
.
setTopP
(
entity
.
getTopP
());
model
.
setTemperature
(
entity
.
getTemperature
());
if
(
ArrayUtils
.
isNotEmpty
(
entity
.
getUnitIds
()))
{
if
(
ArrayUtils
.
isNotEmpty
(
entity
.
getUnitIds
()))
{
model
.
setUnitIds
(
JsonUtil
.
toJson
(
entity
.
getUnitIds
()));
model
.
setUnitIds
(
JsonUtil
.
toJson
(
entity
.
getUnitIds
()));
}
}
...
@@ -137,6 +139,7 @@ public class AgentApplicationInfoConvert {
...
@@ -137,6 +139,7 @@ public class AgentApplicationInfoConvert {
AgentApplicationCommModelConfig
commModelConfig
=
new
AgentApplicationCommModelConfig
();
AgentApplicationCommModelConfig
commModelConfig
=
new
AgentApplicationCommModelConfig
();
commModelConfig
.
setLargeModel
(
entity
.
getLargeModel
());
commModelConfig
.
setLargeModel
(
entity
.
getLargeModel
());
commModelConfig
.
setTopP
(
entity
.
getTopP
());
commModelConfig
.
setTopP
(
entity
.
getTopP
());
commModelConfig
.
setTemperature
(
entity
.
getTemperature
());
commModelConfig
.
setCommunicationTurn
(
entity
.
getCommunicationTurn
());
commModelConfig
.
setCommunicationTurn
(
entity
.
getCommunicationTurn
());
AgentApplicationInfoDto
dto
=
new
AgentApplicationInfoDto
();
AgentApplicationInfoDto
dto
=
new
AgentApplicationInfoDto
();
...
@@ -184,6 +187,7 @@ public class AgentApplicationInfoConvert {
...
@@ -184,6 +187,7 @@ public class AgentApplicationInfoConvert {
if
(
ObjectUtil
.
isNotEmpty
(
dto
.
getCommModelConfig
()))
{
if
(
ObjectUtil
.
isNotEmpty
(
dto
.
getCommModelConfig
()))
{
entity
.
setLargeModel
(
dto
.
getCommModelConfig
().
getLargeModel
());
entity
.
setLargeModel
(
dto
.
getCommModelConfig
().
getLargeModel
());
entity
.
setTopP
(
dto
.
getCommModelConfig
().
getTopP
());
entity
.
setTopP
(
dto
.
getCommModelConfig
().
getTopP
());
entity
.
setTemperature
(
dto
.
getCommModelConfig
().
getTemperature
());
entity
.
setCommunicationTurn
(
dto
.
getCommModelConfig
().
getCommunicationTurn
());
entity
.
setCommunicationTurn
(
dto
.
getCommModelConfig
().
getCommunicationTurn
());
}
}
...
@@ -225,6 +229,7 @@ public class AgentApplicationInfoConvert {
...
@@ -225,6 +229,7 @@ public class AgentApplicationInfoConvert {
}
}
entity
.
setLargeModel
(
infoQueryItem
.
getLargeModel
());
entity
.
setLargeModel
(
infoQueryItem
.
getLargeModel
());
entity
.
setTopP
(
infoQueryItem
.
getTopP
());
entity
.
setTopP
(
infoQueryItem
.
getTopP
());
entity
.
setTemperature
(
infoQueryItem
.
getTemperature
());
if
(
StringUtils
.
isNotBlank
(
infoQueryItem
.
getUnitIds
()))
{
if
(
StringUtils
.
isNotBlank
(
infoQueryItem
.
getUnitIds
()))
{
entity
.
setUnitIds
(
JsonUtils
.
deSerialize
(
infoQueryItem
.
getUnitIds
(),
String
[].
class
));
entity
.
setUnitIds
(
JsonUtils
.
deSerialize
(
infoQueryItem
.
getUnitIds
(),
String
[].
class
));
}
}
...
...
src/main/java/cn/com/poc/agent_application/convert/BizAgentApplicationPublishConvert.java
View file @
6a719e97
...
@@ -46,6 +46,7 @@ public class BizAgentApplicationPublishConvert {
...
@@ -46,6 +46,7 @@ public class BizAgentApplicationPublishConvert {
}
}
entity
.
setLargeModel
(
model
.
getLargeModel
());
entity
.
setLargeModel
(
model
.
getLargeModel
());
entity
.
setTopP
(
model
.
getTopP
());
entity
.
setTopP
(
model
.
getTopP
());
entity
.
setTemperature
(
model
.
getTemperature
());
if
(
StringUtils
.
isNotBlank
(
model
.
getUnitIds
()))
{
if
(
StringUtils
.
isNotBlank
(
model
.
getUnitIds
()))
{
entity
.
setUnitIds
(
JsonUtils
.
deSerialize
(
model
.
getUnitIds
(),
String
[].
class
));
entity
.
setUnitIds
(
JsonUtils
.
deSerialize
(
model
.
getUnitIds
(),
String
[].
class
));
}
}
...
@@ -84,6 +85,7 @@ public class BizAgentApplicationPublishConvert {
...
@@ -84,6 +85,7 @@ public class BizAgentApplicationPublishConvert {
}
}
model
.
setLargeModel
(
entity
.
getLargeModel
());
model
.
setLargeModel
(
entity
.
getLargeModel
());
model
.
setTopP
(
entity
.
getTopP
());
model
.
setTopP
(
entity
.
getTopP
());
model
.
setTemperature
(
entity
.
getTemperature
());
if
(
ArrayUtils
.
isNotEmpty
(
entity
.
getUnitIds
()))
{
if
(
ArrayUtils
.
isNotEmpty
(
entity
.
getUnitIds
()))
{
model
.
setUnitIds
(
JsonUtil
.
toJson
(
entity
.
getUnitIds
()));
model
.
setUnitIds
(
JsonUtil
.
toJson
(
entity
.
getUnitIds
()));
}
}
...
@@ -123,6 +125,7 @@ public class BizAgentApplicationPublishConvert {
...
@@ -123,6 +125,7 @@ public class BizAgentApplicationPublishConvert {
AgentApplicationCommModelConfig
commModelConfig
=
new
AgentApplicationCommModelConfig
();
AgentApplicationCommModelConfig
commModelConfig
=
new
AgentApplicationCommModelConfig
();
commModelConfig
.
setLargeModel
(
entity
.
getLargeModel
());
commModelConfig
.
setLargeModel
(
entity
.
getLargeModel
());
commModelConfig
.
setTopP
(
entity
.
getTopP
());
commModelConfig
.
setTopP
(
entity
.
getTopP
());
commModelConfig
.
setTemperature
(
entity
.
getTemperature
());
commModelConfig
.
setCommunicationTurn
(
entity
.
getCommunicationTurn
());
commModelConfig
.
setCommunicationTurn
(
entity
.
getCommunicationTurn
());
dto
.
setBaseInfo
(
baseInfo
);
dto
.
setBaseInfo
(
baseInfo
);
...
@@ -170,6 +173,7 @@ public class BizAgentApplicationPublishConvert {
...
@@ -170,6 +173,7 @@ public class BizAgentApplicationPublishConvert {
if
(
ObjectUtil
.
isNotEmpty
(
dto
.
getCommModelConfig
()))
{
if
(
ObjectUtil
.
isNotEmpty
(
dto
.
getCommModelConfig
()))
{
entity
.
setLargeModel
(
dto
.
getCommModelConfig
().
getLargeModel
());
entity
.
setLargeModel
(
dto
.
getCommModelConfig
().
getLargeModel
());
entity
.
setTopP
(
dto
.
getCommModelConfig
().
getTopP
());
entity
.
setTopP
(
dto
.
getCommModelConfig
().
getTopP
());
entity
.
setTemperature
(
dto
.
getCommModelConfig
().
getTemperature
());
}
}
entity
.
setUnitIds
(
dto
.
getUnitIds
());
entity
.
setUnitIds
(
dto
.
getUnitIds
());
...
...
src/main/java/cn/com/poc/agent_application/domain/AgentApplicationCommModelConfig.java
View file @
6a719e97
...
@@ -33,6 +33,20 @@ public class AgentApplicationCommModelConfig {
...
@@ -33,6 +33,20 @@ public class AgentApplicationCommModelConfig {
this
.
topP
=
topP
;
this
.
topP
=
topP
;
}
}
/**
* temperature
* 对话模型温度配置 (0-1.0]
*/
private
Float
temperature
;
public
Float
getTemperature
()
{
return
temperature
;
}
public
void
setTemperature
(
Float
temperature
)
{
this
.
temperature
=
temperature
;
}
/**
/**
* communication_turn
* communication_turn
* 对话上下文保存轮次
* 对话上下文保存轮次
...
...
src/main/java/cn/com/poc/agent_application/entity/BizAgentApplicationInfoEntity.java
View file @
6a719e97
This diff is collapsed.
Click to expand it.
src/main/java/cn/com/poc/agent_application/entity/BizAgentApplicationPublishEntity.java
View file @
6a719e97
package
cn
.
com
.
poc
.
agent_application
.
entity
;
package
cn
.
com
.
poc
.
agent_application
.
entity
;
import
javax.persistence.Column
;
public
class
BizAgentApplicationPublishEntity
{
public
class
BizAgentApplicationPublishEntity
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
...
@@ -234,6 +236,22 @@ public class BizAgentApplicationPublishEntity {
...
@@ -234,6 +236,22 @@ public class BizAgentApplicationPublishEntity {
public
void
setTopP
(
java
.
lang
.
Float
topP
){
public
void
setTopP
(
java
.
lang
.
Float
topP
){
this
.
topP
=
topP
;
this
.
topP
=
topP
;
}
}
/** temperature
*对话模型 温度 [0-1.00]
*/
private
java
.
lang
.
Float
temperature
;
public
java
.
lang
.
Float
getTemperature
(){
return
this
.
temperature
;
}
public
void
setTemperature
(
java
.
lang
.
Float
temperature
){
this
.
temperature
=
temperature
;
}
/** unit_ids
/** unit_ids
*组件ID
*组件ID
*/
*/
...
...
src/main/java/cn/com/poc/agent_application/model/BizAgentApplicationInfoModel.java
View file @
6a719e97
...
@@ -312,8 +312,27 @@ public class BizAgentApplicationInfoModel extends BaseModelClass implements Seri
...
@@ -312,8 +312,27 @@ public class BizAgentApplicationInfoModel extends BaseModelClass implements Seri
this
.
topP
=
topP
;
this
.
topP
=
topP
;
super
.
addValidField
(
"topP"
);
super
.
addValidField
(
"topP"
);
}
}
/** temperature
*对话模型 温度 [0-1.00]
*/
private
java
.
lang
.
Float
temperature
;
@Column
(
name
=
"temperature"
,
length
=
12
)
public
java
.
lang
.
Float
getTemperature
(){
return
this
.
temperature
;
}
public
void
setTemperature
(
java
.
lang
.
Float
temperature
){
this
.
temperature
=
temperature
;
super
.
addValidField
(
"temperature"
);
}
/** unit_ids
/** unit_ids
*组件ID
*组件ID
*/
*/
...
...
src/main/java/cn/com/poc/agent_application/model/BizAgentApplicationPublishModel.java
View file @
6a719e97
...
@@ -295,8 +295,25 @@ public class BizAgentApplicationPublishModel extends BaseModelClass implements S
...
@@ -295,8 +295,25 @@ public class BizAgentApplicationPublishModel extends BaseModelClass implements S
this
.
topP
=
topP
;
this
.
topP
=
topP
;
super
.
addValidField
(
"topP"
);
super
.
addValidField
(
"topP"
);
}
}
/** temperature
*对话模型 温度 [0-1.00]
*/
private
java
.
lang
.
Float
temperature
;
@Column
(
name
=
"temperature"
,
length
=
12
)
public
java
.
lang
.
Float
getTemperature
(){
return
this
.
temperature
;
}
public
void
setTemperature
(
java
.
lang
.
Float
temperature
){
this
.
temperature
=
temperature
;
super
.
addValidField
(
"temperature"
);
}
/** unit_ids
/** unit_ids
*组件ID
*组件ID
*/
*/
...
...
src/main/java/cn/com/poc/agent_application/query/AgentApplicationInfoQuery.sql
View file @
6a719e97
...
@@ -17,6 +17,7 @@ select distinct
...
@@ -17,6 +17,7 @@ select distinct
knowledge_ids
,
knowledge_ids
,
large_model
,
large_model
,
top_p
,
top_p
,
temperature
,
unit_ids
,
unit_ids
,
variable_structure
,
variable_structure
,
is_long_memory
,
is_long_memory
,
...
...
src/main/java/cn/com/poc/agent_application/query/AgentApplicationInfoQueryItem.java
View file @
6a719e97
...
@@ -284,6 +284,23 @@ public class AgentApplicationInfoQueryItem extends BaseItemClass implements Seri
...
@@ -284,6 +284,23 @@ public class AgentApplicationInfoQueryItem extends BaseItemClass implements Seri
this
.
topP
=
topP
;
this
.
topP
=
topP
;
}
}
/** temperature
*对话模型 温度 [0-1.00]
*/
private
java
.
lang
.
Float
temperature
;
@Column
(
name
=
"temperature"
)
public
java
.
lang
.
Float
getTemperature
(){
return
this
.
temperature
;
}
public
void
setTemperature
(
java
.
lang
.
Float
temperature
){
this
.
temperature
=
temperature
;
}
/**
/**
* unit_ids
* unit_ids
* unit_ids
* unit_ids
...
...
src/main/java/cn/com/poc/agent_application/rest/impl/AgentApplicationInfoRestImpl.java
View file @
6a719e97
...
@@ -164,7 +164,7 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest {
...
@@ -164,7 +164,7 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest {
//调用应用服务
//调用应用服务
agentApplicationInfoService
.
callAgentApplication
(
agentId
,
infoEntity
.
getLargeModel
(),
infoEntity
.
getUnitIds
()
agentApplicationInfoService
.
callAgentApplication
(
agentId
,
infoEntity
.
getLargeModel
(),
infoEntity
.
getUnitIds
()
,
infoEntity
.
getAgentSystem
(),
kdIds
.
toArray
(
new
Integer
[
0
]),
infoEntity
.
getCommunicationTurn
(),
infoEntity
.
getTopP
()
,
infoEntity
.
getAgentSystem
(),
kdIds
.
toArray
(
new
Integer
[
0
]),
infoEntity
.
getCommunicationTurn
(),
infoEntity
.
getTopP
()
,
infoEntity
.
getTemperature
()
,
dto
.
getMessages
(),
tools
,
httpServletResponse
);
,
dto
.
getMessages
(),
tools
,
httpServletResponse
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
httpServletResponse
.
setContentType
(
"text/event-stream"
);
httpServletResponse
.
setContentType
(
"text/event-stream"
);
...
...
src/main/java/cn/com/poc/agent_application/service/impl/BizAgentApplicationInfoServiceImpl.java
View file @
6a719e97
...
@@ -189,6 +189,10 @@ public class BizAgentApplicationInfoServiceImpl extends BaseServiceImpl
...
@@ -189,6 +189,10 @@ public class BizAgentApplicationInfoServiceImpl extends BaseServiceImpl
if
(
entity
.
getTopP
()
!=
null
)
{
if
(
entity
.
getTopP
()
!=
null
)
{
Assert
.
isTrue
(
entity
.
getTopP
()
>=
0
&&
entity
.
getTopP
()
<=
1.00
,
"top p is error,must more than 0 and less than 1.0"
);
Assert
.
isTrue
(
entity
.
getTopP
()
>=
0
&&
entity
.
getTopP
()
<=
1.00
,
"top p is error,must more than 0 and less than 1.0"
);
}
}
if
(
entity
.
getTemperature
()
!=
null
)
{
Assert
.
isTrue
(
entity
.
getTemperature
()
>
0
&&
entity
.
getTemperature
()
<=
1.0
,
"temperature is error,must greater than 0, less than or equal to 1.9"
);
}
model
.
setTemperature
(
entity
.
getTemperature
());
model
.
setTopP
(
entity
.
getTopP
());
model
.
setTopP
(
entity
.
getTopP
());
model
.
setContinuousQuestionStatus
(
entity
.
getContinuousQuestionStatus
());
model
.
setContinuousQuestionStatus
(
entity
.
getContinuousQuestionStatus
());
model
.
setContinuousQuestionSystem
(
entity
.
getContinuousQuestionSystem
());
model
.
setContinuousQuestionSystem
(
entity
.
getContinuousQuestionSystem
());
...
...
src/main/java/cn/com/poc/expose/aggregate/impl/AgentApplicationServiceImpl.java
View file @
6a719e97
...
@@ -40,7 +40,6 @@ import java.util.HashSet;
...
@@ -40,7 +40,6 @@ import java.util.HashSet;
import
java.util.List
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.Set
;
import
java.util.concurrent.*
;
import
java.util.concurrent.*
;
import
java.util.concurrent.atomic.AtomicInteger
;
@Service
@Service
public
class
AgentApplicationServiceImpl
implements
AgentApplicationService
{
public
class
AgentApplicationServiceImpl
implements
AgentApplicationService
{
...
@@ -114,7 +113,7 @@ public class AgentApplicationServiceImpl implements AgentApplicationService {
...
@@ -114,7 +113,7 @@ public class AgentApplicationServiceImpl implements AgentApplicationService {
String
output
=
agentApplicationInfoService
.
callAgentApplication
(
dialogsId
,
infoEntity
.
getLargeModel
(),
String
output
=
agentApplicationInfoService
.
callAgentApplication
(
dialogsId
,
infoEntity
.
getLargeModel
(),
infoEntity
.
getUnitIds
(),
infoEntity
.
getAgentSystem
(),
kdIdList
.
toArray
(
new
Integer
[
0
]),
infoEntity
.
getCommunicationTurn
(),
infoEntity
.
getUnitIds
(),
infoEntity
.
getAgentSystem
(),
kdIdList
.
toArray
(
new
Integer
[
0
]),
infoEntity
.
getCommunicationTurn
(),
infoEntity
.
getTopP
(),
messages
,
tools
,
httpServletResponse
);
infoEntity
.
getTopP
(),
infoEntity
.
getTemperature
(),
messages
,
tools
,
httpServletResponse
);
//保存对话记录
//保存对话记录
...
...
src/test/java/cn/com/poc/AgentApplicationInfoTest.java
View file @
6a719e97
...
@@ -2,6 +2,8 @@ package cn.com.poc;
...
@@ -2,6 +2,8 @@ package cn.com.poc;
import
cn.com.poc.agent_application.aggregate.AgentApplicationInfoService
;
import
cn.com.poc.agent_application.aggregate.AgentApplicationInfoService
;
import
cn.com.poc.common.service.RedisService
;
import
cn.com.poc.expose.aggregate.AgentApplicationService
;
import
cn.com.poc.thirdparty.resource.demand.ai.aggregate.DemandKnowledgeService
;
import
cn.com.poc.thirdparty.resource.demand.ai.aggregate.DemandKnowledgeService
;
import
cn.com.yict.framemax.core.spring.SingleContextInitializer
;
import
cn.com.yict.framemax.core.spring.SingleContextInitializer
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
...
@@ -30,6 +32,9 @@ public class AgentApplicationInfoTest {
...
@@ -30,6 +32,9 @@ public class AgentApplicationInfoTest {
@Resource
@Resource
private
DemandKnowledgeService
demandKnowledgeService
;
private
DemandKnowledgeService
demandKnowledgeService
;
@Resource
private
RedisService
redisService
;
/**
/**
* Agent 应用标题,描述生成
* Agent 应用标题,描述生成
*/
*/
...
@@ -46,4 +51,19 @@ public class AgentApplicationInfoTest {
...
@@ -46,4 +51,19 @@ public class AgentApplicationInfoTest {
System
.
out
.
println
(
list
.
toString
());
System
.
out
.
println
(
list
.
toString
());
}
}
@Test
public
void
test
()
{
List
<
Object
>
list
=
Lists
.
newArrayList
(
"1"
,
"2"
,
"3"
,
"4"
,
"5"
,
"6"
,
"7"
,
"8"
,
"9"
,
"1"
);
redisService
.
lSet
(
"key"
,
list
);
}
@Resource
private
AgentApplicationService
agentApplicationService
;
@Test
public
void
test2
()
throws
InterruptedException
{
agentApplicationService
.
createRecommendQuestion
();
}
}
}
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