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
d8462d72
Commit
d8462d72
authored
May 14, 2025
by
alex yao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:首页插件查询
parent
c4b4ee9b
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
246 additions
and
4 deletions
+246
-4
AgentApplicationIndexPluginQuery.sql
...nt_application/query/AgentApplicationIndexPluginQuery.sql
+9
-0
AgentApplicationIndexPluginQueryCondition.java
...tion/query/AgentApplicationIndexPluginQueryCondition.java
+23
-0
AgentApplicationIndexPluginQueryItem.java
...plication/query/AgentApplicationIndexPluginQueryItem.java
+74
-0
BizAgentApplicationIndexPluginService.java
...cation/service/BizAgentApplicationIndexPluginService.java
+18
-0
BizAgentApplicationIndexPluginServiceImpl.java
...rvice/impl/BizAgentApplicationIndexPluginServiceImpl.java
+22
-0
AgentApplicationExposeService.java
...m/poc/expose/aggregate/AgentApplicationExposeService.java
+9
-0
AgentApplicationExposeServiceImpl.java
...ose/aggregate/impl/AgentApplicationExposeServiceImpl.java
+13
-0
IndexPluginDto.java
src/main/java/cn/com/poc/expose/dto/IndexPluginDto.java
+49
-0
AgentApplicationRest.java
...ain/java/cn/com/poc/expose/rest/AgentApplicationRest.java
+8
-0
AgentApplicationRestImpl.java
...cn/com/poc/expose/rest/impl/AgentApplicationRestImpl.java
+17
-0
DocumentUnderstandIngFunction.java
...document_understanding/DocumentUnderstandIngFunction.java
+4
-4
No files found.
src/main/java/cn/com/poc/agent_application/query/AgentApplicationIndexPluginQuery.sql
0 → 100644
View file @
d8462d72
select
bgaa
.
agent_id
,
bgaa
.
agent_avatar
,
bgaa
.
agent_title
,
bgaa
.
agent_desc
from
biz_agent_application_publish
bgaa
join
biz_agent_application_index_plugin
baaip
on
bgaa
.
agent_id
=
baaip
.
agent_id
and
baaip
.
is_deleted
=
'N'
where
bgaa
.
is_deleted
=
'N'
<<
and
LOCATE
(:
search
,
bgaa
.
agent_title
)
>>
\ No newline at end of file
src/main/java/cn/com/poc/agent_application/query/AgentApplicationIndexPluginQueryCondition.java
0 → 100644
View file @
d8462d72
package
cn
.
com
.
poc
.
agent_application
.
query
;
import
java.io.Serializable
;
/**
* Query Condition class for AgentApplicationIndexPluginQuery
*/
public
class
AgentApplicationIndexPluginQueryCondition
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
java
.
lang
.
String
search
;
public
java
.
lang
.
String
getSearch
(){
return
this
.
search
;
}
public
void
setSearch
(
java
.
lang
.
String
search
){
this
.
search
=
search
;
}
}
\ No newline at end of file
src/main/java/cn/com/poc/agent_application/query/AgentApplicationIndexPluginQueryItem.java
0 → 100644
View file @
d8462d72
package
cn
.
com
.
poc
.
agent_application
.
query
;
import
java.io.Serializable
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
cn.com.yict.framemax.data.model.BaseItemClass
;
/**
* Query Item class for AgentApplicationIndexPluginQuery
*/
@Entity
public
class
AgentApplicationIndexPluginQueryItem
extends
BaseItemClass
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/** agent_id
*agent_id
*/
private
java
.
lang
.
String
agentId
;
@Column
(
name
=
"agent_id"
)
public
java
.
lang
.
String
getAgentId
(){
return
this
.
agentId
;
}
public
void
setAgentId
(
java
.
lang
.
String
agentId
){
this
.
agentId
=
agentId
;
}
/** agent_avatar
*agent_avatar
*/
private
java
.
lang
.
String
agentAvatar
;
@Column
(
name
=
"agent_avatar"
)
public
java
.
lang
.
String
getAgentAvatar
(){
return
this
.
agentAvatar
;
}
public
void
setAgentAvatar
(
java
.
lang
.
String
agentAvatar
){
this
.
agentAvatar
=
agentAvatar
;
}
/** agent_title
*agent_title
*/
private
java
.
lang
.
String
agentTitle
;
@Column
(
name
=
"agent_title"
)
public
java
.
lang
.
String
getAgentTitle
(){
return
this
.
agentTitle
;
}
public
void
setAgentTitle
(
java
.
lang
.
String
agentTitle
){
this
.
agentTitle
=
agentTitle
;
}
/** agent_desc
*agent_desc
*/
private
java
.
lang
.
String
agentDesc
;
@Column
(
name
=
"agent_desc"
)
public
java
.
lang
.
String
getAgentDesc
(){
return
this
.
agentDesc
;
}
public
void
setAgentDesc
(
java
.
lang
.
String
agentDesc
){
this
.
agentDesc
=
agentDesc
;
}
}
\ No newline at end of file
src/main/java/cn/com/poc/agent_application/service/BizAgentApplicationIndexPluginService.java
0 → 100644
View file @
d8462d72
package
cn
.
com
.
poc
.
agent_application
.
service
;
import
cn.com.poc.agent_application.query.AgentApplicationIndexPluginQueryCondition
;
import
cn.com.poc.agent_application.query.AgentApplicationIndexPluginQueryItem
;
import
cn.com.yict.framemax.core.service.BaseService
;
import
java.util.List
;
/**
* @author alex.yao
* @date 2025/5/14
*/
public
interface
BizAgentApplicationIndexPluginService
extends
BaseService
{
List
<
AgentApplicationIndexPluginQueryItem
>
agentApplicationIndexPluginQuery
(
AgentApplicationIndexPluginQueryCondition
condition
);
}
src/main/java/cn/com/poc/agent_application/service/impl/BizAgentApplicationIndexPluginServiceImpl.java
0 → 100644
View file @
d8462d72
package
cn
.
com
.
poc
.
agent_application
.
service
.
impl
;
import
cn.com.poc.agent_application.query.AgentApplicationIndexPluginQueryCondition
;
import
cn.com.poc.agent_application.query.AgentApplicationIndexPluginQueryItem
;
import
cn.com.poc.agent_application.service.BizAgentApplicationIndexPluginService
;
import
cn.com.yict.framemax.core.service.impl.BaseServiceImpl
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* @author alex.yao
* @date 2025/5/14
*/
@Service
public
class
BizAgentApplicationIndexPluginServiceImpl
extends
BaseServiceImpl
implements
BizAgentApplicationIndexPluginService
{
@Override
public
List
<
AgentApplicationIndexPluginQueryItem
>
agentApplicationIndexPluginQuery
(
AgentApplicationIndexPluginQueryCondition
condition
)
{
return
this
.
sqlDao
.
query
(
condition
,
AgentApplicationIndexPluginQueryItem
.
class
);
}
}
src/main/java/cn/com/poc/expose/aggregate/AgentApplicationExposeService.java
View file @
d8462d72
package
cn
.
com
.
poc
.
expose
.
aggregate
;
package
cn
.
com
.
poc
.
expose
.
aggregate
;
import
cn.com.poc.agent_application.entity.BizAgentApplicationApiProfileEntity
;
import
cn.com.poc.agent_application.entity.BizAgentApplicationApiProfileEntity
;
import
cn.com.poc.agent_application.query.AgentApplicationIndexPluginQueryItem
;
import
cn.com.poc.agent_application.query.MemberCollectQueryItem
;
import
cn.com.poc.agent_application.query.MemberCollectQueryItem
;
import
cn.com.yict.framemax.data.model.PagingInfo
;
import
cn.com.yict.framemax.data.model.PagingInfo
;
...
@@ -83,4 +84,12 @@ public interface AgentApplicationExposeService {
...
@@ -83,4 +84,12 @@ public interface AgentApplicationExposeService {
*/
*/
BizAgentApplicationApiProfileEntity
resetApiProfile
(
Long
memberId
)
throws
Exception
;
BizAgentApplicationApiProfileEntity
resetApiProfile
(
Long
memberId
)
throws
Exception
;
/**
* 获取首页插件
*
* @param search
* @return
*/
List
<
AgentApplicationIndexPluginQueryItem
>
getHomePlugins
(
String
search
);
}
}
src/main/java/cn/com/poc/expose/aggregate/impl/AgentApplicationExposeServiceImpl.java
View file @
d8462d72
...
@@ -4,6 +4,8 @@ import cn.com.poc.agent_application.aggregate.AgentApplicationService;
...
@@ -4,6 +4,8 @@ import cn.com.poc.agent_application.aggregate.AgentApplicationService;
import
cn.com.poc.agent_application.constant.AgentApplicationDialoguesRecordConstants
;
import
cn.com.poc.agent_application.constant.AgentApplicationDialoguesRecordConstants
;
import
cn.com.poc.agent_application.constant.AgentApplicationGCConfigConstants
;
import
cn.com.poc.agent_application.constant.AgentApplicationGCConfigConstants
;
import
cn.com.poc.agent_application.entity.*
;
import
cn.com.poc.agent_application.entity.*
;
import
cn.com.poc.agent_application.query.AgentApplicationIndexPluginQueryCondition
;
import
cn.com.poc.agent_application.query.AgentApplicationIndexPluginQueryItem
;
import
cn.com.poc.agent_application.query.MemberCollectQueryCondition
;
import
cn.com.poc.agent_application.query.MemberCollectQueryCondition
;
import
cn.com.poc.agent_application.query.MemberCollectQueryItem
;
import
cn.com.poc.agent_application.query.MemberCollectQueryItem
;
import
cn.com.poc.agent_application.service.*
;
import
cn.com.poc.agent_application.service.*
;
...
@@ -107,6 +109,9 @@ public class AgentApplicationExposeServiceImpl implements AgentApplicationExpose
...
@@ -107,6 +109,9 @@ public class AgentApplicationExposeServiceImpl implements AgentApplicationExpose
@Resource
@Resource
private
BizAgentApplicationApiProfileService
bizAgentApplicationApiProfileService
;
private
BizAgentApplicationApiProfileService
bizAgentApplicationApiProfileService
;
@Resource
private
BizAgentApplicationIndexPluginService
bizAgentApplicationIndexPluginService
;
@Override
@Override
public
void
callAgentApplication
(
String
agentId
,
String
dialogsId
,
String
input
,
List
<
String
>
fileUrls
,
String
channel
,
String
imageUrl
,
HttpServletResponse
httpServletResponse
)
throws
Exception
{
public
void
callAgentApplication
(
String
agentId
,
String
dialogsId
,
String
input
,
List
<
String
>
fileUrls
,
String
channel
,
String
imageUrl
,
HttpServletResponse
httpServletResponse
)
throws
Exception
{
...
@@ -375,6 +380,14 @@ public class AgentApplicationExposeServiceImpl implements AgentApplicationExpose
...
@@ -375,6 +380,14 @@ public class AgentApplicationExposeServiceImpl implements AgentApplicationExpose
return
bizAgentApplicationApiProfileService
.
resetProfile
(
memberId
);
return
bizAgentApplicationApiProfileService
.
resetProfile
(
memberId
);
}
}
@Override
public
List
<
AgentApplicationIndexPluginQueryItem
>
getHomePlugins
(
String
search
)
{
AgentApplicationIndexPluginQueryCondition
condition
=
new
AgentApplicationIndexPluginQueryCondition
();
condition
.
setSearch
(
search
);
return
bizAgentApplicationIndexPluginService
.
agentApplicationIndexPluginQuery
(
condition
);
}
private
void
createCNQuestion
()
{
private
void
createCNQuestion
()
{
Message
message
=
new
Message
();
Message
message
=
new
Message
();
message
.
setRole
(
LLMRoleEnum
.
USER
.
getRole
());
message
.
setRole
(
LLMRoleEnum
.
USER
.
getRole
());
...
...
src/main/java/cn/com/poc/expose/dto/IndexPluginDto.java
0 → 100644
View file @
d8462d72
package
cn
.
com
.
poc
.
expose
.
dto
;
/**
* @author alex.yao
* @date 2025/5/14
*/
public
class
IndexPluginDto
{
private
String
agentId
;
private
String
agentTitle
;
private
String
agentDesc
;
private
String
agentAvatar
;
public
String
getAgentId
()
{
return
agentId
;
}
public
void
setAgentId
(
String
agentId
)
{
this
.
agentId
=
agentId
;
}
public
String
getAgentTitle
()
{
return
agentTitle
;
}
public
void
setAgentTitle
(
String
agentTitle
)
{
this
.
agentTitle
=
agentTitle
;
}
public
String
getAgentDesc
()
{
return
agentDesc
;
}
public
void
setAgentDesc
(
String
agentDesc
)
{
this
.
agentDesc
=
agentDesc
;
}
public
String
getAgentAvatar
()
{
return
agentAvatar
;
}
public
void
setAgentAvatar
(
String
agentAvatar
)
{
this
.
agentAvatar
=
agentAvatar
;
}
}
src/main/java/cn/com/poc/expose/rest/AgentApplicationRest.java
View file @
d8462d72
...
@@ -115,4 +115,12 @@ public interface AgentApplicationRest extends BaseRest {
...
@@ -115,4 +115,12 @@ public interface AgentApplicationRest extends BaseRest {
* @return 应用API配置
* @return 应用API配置
*/
*/
AgentApplicationApiProfileDto
resetApiProfile
()
throws
Exception
;
AgentApplicationApiProfileDto
resetApiProfile
()
throws
Exception
;
/**
* 获取首页插件
*
* @param search 搜索关键字
*/
List
<
IndexPluginDto
>
getHomePlugins
(
@RequestParam
(
required
=
false
)
String
search
);
}
}
src/main/java/cn/com/poc/expose/rest/impl/AgentApplicationRestImpl.java
View file @
d8462d72
...
@@ -288,4 +288,21 @@ public class AgentApplicationRestImpl implements AgentApplicationRest {
...
@@ -288,4 +288,21 @@ public class AgentApplicationRestImpl implements AgentApplicationRest {
result
.
setApiSecret
(
apiProfileEntity
.
getApiSecret
());
result
.
setApiSecret
(
apiProfileEntity
.
getApiSecret
());
return
result
;
return
result
;
}
}
@Override
public
List
<
IndexPluginDto
>
getHomePlugins
(
String
search
)
{
List
<
AgentApplicationIndexPluginQueryItem
>
homePlugins
=
agentApplicationExposeService
.
getHomePlugins
(
search
);
List
<
IndexPluginDto
>
result
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
homePlugins
))
{
result
=
homePlugins
.
stream
().
map
(
item
->
{
IndexPluginDto
dto
=
new
IndexPluginDto
();
dto
.
setAgentId
(
item
.
getAgentId
());
dto
.
setAgentTitle
(
item
.
getAgentTitle
());
dto
.
setAgentDesc
(
item
.
getAgentDesc
());
dto
.
setAgentAvatar
(
item
.
getAgentAvatar
());
return
dto
;
}).
collect
(
Collectors
.
toList
());
}
return
result
;
}
}
}
src/main/java/cn/com/poc/thirdparty/resource/demand/ai/function/document_understanding/DocumentUnderstandIngFunction.java
View file @
d8462d72
...
@@ -54,7 +54,7 @@ public class DocumentUnderstandIngFunction extends AbstractLargeModelFunction {
...
@@ -54,7 +54,7 @@ public class DocumentUnderstandIngFunction extends AbstractLargeModelFunction {
return
result
;
return
result
;
}
}
JSONObject
jsonObject
=
JSON
.
parseObject
(
content
);
JSONObject
jsonObject
=
JSON
.
parseObject
(
content
);
if
(!
jsonObject
.
containsKey
(
"question"
)
||
!
jsonObject
.
containsKey
(
"file_url"
)){
if
(!
jsonObject
.
containsKey
(
"question"
)
||
!
jsonObject
.
containsKey
(
"file_url"
))
{
return
result
;
return
result
;
}
}
...
@@ -64,7 +64,7 @@ public class DocumentUnderstandIngFunction extends AbstractLargeModelFunction {
...
@@ -64,7 +64,7 @@ public class DocumentUnderstandIngFunction extends AbstractLargeModelFunction {
String
documentContent
;
String
documentContent
;
try
{
try
{
documentContent
=
DocumentLoad
.
documentToText
(
file
);
documentContent
=
DocumentLoad
.
documentToText
(
file
);
if
(
StringUtils
.
isBlank
(
documentContent
))
{
if
(
StringUtils
.
isBlank
(
documentContent
))
{
return
result
;
return
result
;
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
@@ -81,11 +81,11 @@ public class DocumentUnderstandIngFunction extends AbstractLargeModelFunction {
...
@@ -81,11 +81,11 @@ public class DocumentUnderstandIngFunction extends AbstractLargeModelFunction {
Message
message
=
new
Message
();
Message
message
=
new
Message
();
message
.
setRole
(
"user"
);
message
.
setRole
(
"user"
);
message
.
setContent
(
question
)
)
;
message
.
setContent
(
question
);
LargeModelResponse
largeModelResponse
=
new
LargeModelResponse
();
LargeModelResponse
largeModelResponse
=
new
LargeModelResponse
();
largeModelResponse
.
setModel
(
MODEL
);
largeModelResponse
.
setModel
(
MODEL
);
largeModelResponse
.
setMessages
(
new
Message
[]{
systemMessage
,
fileContentMessage
,
message
});
largeModelResponse
.
setMessages
(
new
Message
[]{
systemMessage
,
fileContentMessage
,
message
});
largeModelResponse
.
setStream
(
false
);
largeModelResponse
.
setStream
(
false
);
largeModelResponse
.
setUser
(
"Document_Understanding"
);
largeModelResponse
.
setUser
(
"Document_Understanding"
);
LargeModelDemandResult
largeModelDemandResult
=
llmService
.
chat
(
largeModelResponse
);
LargeModelDemandResult
largeModelDemandResult
=
llmService
.
chat
(
largeModelResponse
);
...
...
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