Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Pangea-Agent
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
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
Gavin-Group
Pangea-Agent
Commits
11458434
Commit
11458434
authored
Dec 24, 2025
by
王舵
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init: rm applicaiton-dev.yml from git \n add schema-mysql.sql
parent
90b3874a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
397 additions
and
94 deletions
+397
-94
.gitignore
.gitignore
+2
-1
application-dev.yml
backend/src/main/resources/application-dev.yml
+0
-84
data.sql
backend/src/main/resources/data.sql
+13
-9
schema-mysql.sql
backend/src/main/resources/schema-mysql.sql
+382
-0
No files found.
.gitignore
View file @
11458434
...
@@ -214,4 +214,5 @@ Thumbs.db
...
@@ -214,4 +214,5 @@ Thumbs.db
.Trashes
.Trashes
ehthumbs.db
ehthumbs.db
Icon?
Icon?
*.icon?
*.icon?
\ No newline at end of file
backend/src/main/resources/application-dev.yml
\ No newline at end of file
backend/src/main/resources/application-dev.yml
deleted
100644 → 0
View file @
90b3874a
# 开发环境专用配置
spring
:
# 开发环境数据源配置
datasource
:
url
:
jdbc:h2:mem:hiagent_dev;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
driver-class-name
:
org.h2.Driver
username
:
sa
password
:
sa
# 开发环境JPA配置
jpa
:
hibernate
:
ddl-auto
:
create-drop
show-sql
:
true
properties
:
hibernate
:
format_sql
:
true
# 开启H2控制台
h2
:
console
:
enabled
:
true
path
:
/h2-console
# 开发环境Redis配置
data
:
redis
:
host
:
localhost
port
:
6379
# 开发环境详细日志配置
logging
:
level
:
root
:
INFO
pangea.hiagent
:
DEBUG
pangea.hiagent.websocket
:
TRACE
pangea.hiagent.service
:
DEBUG
pangea.hiagent.controller
:
DEBUG
pangea.hiagent.tools
:
DEBUG
org.springframework
:
INFO
org.springframework.web
:
INFO
org.springframework.security
:
INFO
org.springframework.web.socket
:
INFO
org.springframework.web.socket.handler
:
INFO
org.springframework.web.socket.messaging
:
INFO
org.hibernate.SQL
:
INFO
org.hibernate.type.descriptor.sql.BasicBinder
:
INFO
pattern
:
console
:
"
%d{yyyy-MM-dd
HH:mm:ss.SSS}
[%thread]
%-5level
%logger{36}
[%X{userId:-N/A}]
-
%msg%n"
# 开发环境服务器配置
server
:
port
:
8080
undertow
:
# 开发环境降低线程数
io-threads
:
2
worker-threads
:
10
accesslog
:
enabled
:
true
pattern
:
"
%t
%a
\"
%r
\"
%s
(%D
ms)"
dir
:
logs
prefix
:
access_log_dev_
# 开发环境应用配置
hiagent
:
jwt
:
secret
:
dev-secret-key-for-development-only-do-not-use-in-production
expiration
:
86400000
# 24小时
llm
:
providers
:
deepseek
:
default-api-key
:
${DEEPSEEK_API_KEY:your-dev-api-key-here}
openai
:
default-api-key
:
${OPENAI_API_KEY:your-dev-api-key-here}
# 开发环境ChatMemory配置
app
:
chat-memory
:
implementation
:
caffeine
caffeine
:
enabled
:
true
redis
:
enabled
:
false
\ No newline at end of file
backend/src/main/resources/data.sql
View file @
11458434
-- 插入默认数据
-- 插入默认数据
-- 插入默认用户数据
-- 插入默认用户数据
MERGE
INTO
sys_user
(
id
,
username
,
password
,
email
,
nickname
,
status
,
role
)
VALUES
INSERT
INTO
sys_user
(
id
,
username
,
password
,
email
,
nickname
,
status
,
role
)
VALUES
(
'user-001'
,
'admin'
,
'$2a$10$N.zmdr9k7uOCQb0bta/OauRxaOKSr.QhqyD2R5FKvMQjmHoLkm5Sy'
,
'admin@hiagent.com'
,
'Admin'
,
'active'
,
'admin'
);
(
'user-001'
,
'admin'
,
'$2a$10$N.zmdr9k7uOCQb0bta/OauRxaOKSr.QhqyD2R5FKvMQjmHoLkm5Sy'
,
'admin@hiagent.com'
,
'Admin'
,
'active'
,
'admin'
);
-- 插入默认LLM配置数据
-- 插入默认LLM配置数据
MERGE
INTO
llm_config
(
id
,
name
,
description
,
provider
,
model_name
,
api_key
,
base_url
,
temperature
,
max_tokens
,
top_p
,
enabled
,
owner
)
VALUES
INSERT
INTO
llm_config
(
id
,
name
,
description
,
provider
,
model_name
,
api_key
,
base_url
,
temperature
,
max_tokens
,
top_p
,
enabled
,
owner
)
VALUES
(
'deepseek-default'
,
'deepseek-default'
,
'DeepSeek默认配置'
,
'deepseek'
,
'deepseek-chat'
,
''
,
'https://api.deepseek.com'
,
0
.
7
,
4096
,
0
.
9
,
true
,
'user-001'
),
(
'deepseek-default'
,
'deepseek-default'
,
'DeepSeek默认配置'
,
'deepseek'
,
'deepseek-chat'
,
''
,
'https://api.deepseek.com'
,
0
.
7
,
4096
,
0
.
9
,
true
,
'user-001'
),
(
'openai-default'
,
'openai-default'
,
'OpenAI默认配置'
,
'openai'
,
'gpt-3.5-turbo'
,
''
,
'https://api.openai.com/v1'
,
0
.
7
,
4096
,
0
.
9
,
false
,
'user-001'
),
(
'openai-default'
,
'openai-default'
,
'OpenAI默认配置'
,
'openai'
,
'gpt-3.5-turbo'
,
''
,
'https://api.openai.com/v1'
,
0
.
7
,
4096
,
0
.
9
,
false
,
'user-001'
),
(
'ollama-default'
,
'ollama-default'
,
'Ollama默认配置'
,
'ollama'
,
'llama2'
,
''
,
'http://localhost:11434'
,
0
.
7
,
4096
,
0
.
9
,
true
,
'user-001'
),
(
'ollama-default'
,
'ollama-default'
,
'Ollama默认配置'
,
'ollama'
,
'llama2'
,
''
,
'http://localhost:11434'
,
0
.
7
,
4096
,
0
.
9
,
true
,
'user-001'
),
(
'hisense-default'
,
'hisense-default'
,
'Hisense默认配置'
,
'hisense'
,
'gpt-4-1'
,
''
,
'http://openai-proxy-v2-jt-higpt.cloudprd.hisense.com'
,
0
.
7
,
4096
,
0
.
9
,
true
,
'user-001'
);
(
'hisense-default'
,
'hisense-default'
,
'Hisense默认配置'
,
'hisense'
,
'gpt-4-1'
,
''
,
'http://openai-proxy-v2-jt-higpt.cloudprd.hisense.com'
,
0
.
7
,
4096
,
0
.
9
,
true
,
'user-001'
);
-- 插入默认Agent数据
-- 插入默认Agent数据
MERGE
INTO
agent
(
id
,
name
,
description
,
status
,
default_model
,
owner
,
system_prompt
,
enable_re_act
,
history_length
,
enable_rag
,
rag_collection_id
,
rag_top_k
,
rag_score_threshold
,
top_k
,
presence_penalty
,
frequency_penalty
,
prompt_template
,
rag_prompt_template
,
enable_streaming
)
VALUES
MERGE
INTO
agent
(
id
,
name
,
description
,
status
,
default_model
,
owner
,
system_prompt
,
enable_re_act
,
history_length
,
enable_rag
,
rag_collection_id
,
rag_top_k
,
rag_score_threshold
,
top_k
,
presence_penalty
,
frequency_penalty
,
prompt_template
,
rag_prompt_template
,
enable_streaming
)
VALUES
...
@@ -34,8 +34,10 @@ MERGE INTO agent_tool_relation (id, agent_id, tool_id) VALUES
...
@@ -34,8 +34,10 @@ MERGE INTO agent_tool_relation (id, agent_id, tool_id) VALUES
(
'relation-14'
,
'agent-5'
,
'tool-1'
),
(
'relation-14'
,
'agent-5'
,
'tool-1'
),
(
'relation-15'
,
'agent-5'
,
'tool-11'
),
(
'relation-15'
,
'agent-5'
,
'tool-11'
),
(
'relation-16'
,
'agent-5'
,
'tool-12'
);
(
'relation-16'
,
'agent-5'
,
'tool-12'
);
(
'relation-17'
,
'agent-1'
,
'tool-13'
);
-- 插入默认工具数据
-- 插入默认工具数据
MERGE
INTO
tool
(
id
,
name
,
display_name
,
description
,
category
,
status
,
bean_name
,
owner
,
timeout
,
http_method
,
parameters
,
return_type
,
return_schema
,
implementation
,
api_endpoint
,
headers
,
auth_type
,
auth_config
)
VALUES
MERGE
INTO
tool
(
id
,
name
,
display_name
,
description
,
category
,
status
,
bean_name
,
owner
,
timeout
,
http_method
,
parameters
,
return_type
,
return_schema
,
implementation
,
api_endpoint
,
headers
,
auth_type
,
auth_config
)
VALUES
(
'tool-1'
,
'search'
,
'搜索工具'
,
'进行网络搜索查询'
,
'API'
,
'active'
,
'searchTool'
,
'user-001'
,
30000
,
'GET'
,
'{}'
,
'object'
,
'{}'
,
''
,
''
,
'{}'
,
''
,
'{}'
),
(
'tool-1'
,
'search'
,
'搜索工具'
,
'进行网络搜索查询'
,
'API'
,
'active'
,
'searchTool'
,
'user-001'
,
30000
,
'GET'
,
'{}'
,
'object'
,
'{}'
,
''
,
''
,
'{}'
,
''
,
'{}'
),
(
'tool-2'
,
'calculator'
,
'计算器'
,
'进行数学计算'
,
'FUNCTION'
,
'active'
,
'calculatorTools'
,
'user-001'
,
5000
,
'POST'
,
'{}'
,
'number'
,
'{}'
,
''
,
''
,
'{}'
,
''
,
'{}'
),
(
'tool-2'
,
'calculator'
,
'计算器'
,
'进行数学计算'
,
'FUNCTION'
,
'active'
,
'calculatorTools'
,
'user-001'
,
5000
,
'POST'
,
'{}'
,
'number'
,
'{}'
,
''
,
''
,
'{}'
,
''
,
'{}'
),
...
@@ -49,8 +51,10 @@ MERGE INTO tool (id, name, display_name, description, category, status, bean_nam
...
@@ -49,8 +51,10 @@ MERGE INTO tool (id, name, display_name, description, category, status, bean_nam
(
'tool-10'
,
'documentTemplate'
,
'文档模板'
,
'提供各种类型的文档模板'
,
'FUNCTION'
,
'active'
,
'documentTemplateTool'
,
'user-001'
,
10000
,
'GET'
,
'{}'
,
'object'
,
'{}'
,
''
,
''
,
'{}'
,
''
,
'{}'
),
(
'tool-10'
,
'documentTemplate'
,
'文档模板'
,
'提供各种类型的文档模板'
,
'FUNCTION'
,
'active'
,
'documentTemplateTool'
,
'user-001'
,
10000
,
'GET'
,
'{}'
,
'object'
,
'{}'
,
''
,
''
,
'{}'
,
''
,
'{}'
),
(
'tool-11'
,
'studyPlanGeneration'
,
'学习计划制定'
,
'根据学习目标和时间安排制定个性化的学习计划'
,
'FUNCTION'
,
'active'
,
'studyPlanGenerationTool'
,
'user-001'
,
10000
,
'GET'
,
'{}'
,
'object'
,
'{}'
,
''
,
''
,
'{}'
,
''
,
'{}'
),
(
'tool-11'
,
'studyPlanGeneration'
,
'学习计划制定'
,
'根据学习目标和时间安排制定个性化的学习计划'
,
'FUNCTION'
,
'active'
,
'studyPlanGenerationTool'
,
'user-001'
,
10000
,
'GET'
,
'{}'
,
'object'
,
'{}'
,
''
,
''
,
'{}'
,
''
,
'{}'
),
(
'tool-12'
,
'courseMaterialRetrieval'
,
'课程资料检索'
,
'检索和查询相关课程资料'
,
'FUNCTION'
,
'active'
,
'courseMaterialRetrievalTool'
,
'user-001'
,
10000
,
'GET'
,
'{}'
,
'object'
,
'{}'
,
''
,
''
,
'{}'
,
''
,
'{}'
);
(
'tool-12'
,
'courseMaterialRetrieval'
,
'课程资料检索'
,
'检索和查询相关课程资料'
,
'FUNCTION'
,
'active'
,
'courseMaterialRetrievalTool'
,
'user-001'
,
10000
,
'GET'
,
'{}'
,
'object'
,
'{}'
,
''
,
''
,
'{}'
,
''
,
'{}'
);
(
'tool-13'
,
'HisenseSsoAuthTool'
,
'HisenseSSO认证工具'
,
'用于Hisense SSO认证的工具'
,
'FUNCTION'
,
'active'
,
'user-001'
,
10000
,
'GET'
,
'{}'
,
'object'
,
'{}'
,
''
,
''
,
'{}'
,
''
,
'{}'
);
-- 插入默认工具配置数据
-- 插入默认工具配置数据
MERGE
INTO
tool_configs
(
id
,
tool_name
,
param_name
,
param_value
,
description
,
default_value
,
type
,
required
,
group_name
)
VALUES
MERGE
INTO
tool_configs
(
id
,
tool_name
,
param_name
,
param_value
,
description
,
default_value
,
type
,
required
,
group_name
)
VALUES
(
'config-1'
,
'search'
,
'apiKey'
,
'test-key-123'
,
'搜索引擎API密钥'
,
''
,
'string'
,
1
,
'auth'
),
(
'config-1'
,
'search'
,
'apiKey'
,
'test-key-123'
,
'搜索引擎API密钥'
,
''
,
'string'
,
1
,
'auth'
),
(
'config-2'
,
'search'
,
'endpoint'
,
'https://api.search.com/v1/search'
,
'搜索引擎API端点'
,
'https://api.search.com/v1/search'
,
'string'
,
1
,
'connection'
);
(
'config-2'
,
'search'
,
'endpoint'
,
'https://api.search.com/v1/search'
,
'搜索引擎API端点'
,
'https://api.search.com/v1/search'
,
'string'
,
1
,
'connection'
);
\ No newline at end of file
backend/src/main/resources/schema-mysql.sql
0 → 100644
View file @
11458434
-- HiAgent MySQL 数据库表结构初始化脚本
-- 用户表
CREATE
TABLE
IF
NOT
EXISTS
sys_user
(
id
varchar
(
36
)
NOT
NULL
,
username
varchar
(
50
)
NOT
NULL
UNIQUE
,
password
varchar
(
255
)
NOT
NULL
,
email
varchar
(
100
),
nickname
varchar
(
100
),
status
varchar
(
20
)
DEFAULT
'active'
,
role
varchar
(
50
)
DEFAULT
'user'
,
avatar
varchar
(
255
),
last_login_time
bigint
,
api_key
varchar
(
255
),
created_at
timestamp
DEFAULT
CURRENT_TIMESTAMP
,
updated_at
timestamp
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
,
created_by
varchar
(
36
),
updated_by
varchar
(
36
),
deleted
int
DEFAULT
0
,
remark
text
,
PRIMARY
KEY
(
id
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
;
-- OAuth2 提供者配置表
CREATE
TABLE
IF
NOT
EXISTS
oauth2_provider
(
id
varchar
(
36
)
NOT
NULL
,
provider_name
varchar
(
50
)
NOT
NULL
UNIQUE
,
display_name
varchar
(
100
),
description
text
,
auth_type
varchar
(
50
)
NOT
NULL
DEFAULT
'authorization_code'
,
authorize_url
varchar
(
255
),
token_url
varchar
(
255
),
userinfo_url
varchar
(
255
),
client_id
varchar
(
255
),
client_secret
varchar
(
255
),
redirect_uri
varchar
(
255
),
scope
varchar
(
255
),
enabled
tinyint
DEFAULT
1
,
config_json
json
,
created_at
timestamp
DEFAULT
CURRENT_TIMESTAMP
,
updated_at
timestamp
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
,
created_by
varchar
(
36
),
updated_by
varchar
(
36
),
deleted
int
DEFAULT
0
,
remark
text
,
PRIMARY
KEY
(
id
),
UNIQUE
(
provider_name
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
;
-- OAuth2 账户关联表
CREATE
TABLE
IF
NOT
EXISTS
oauth2_account
(
id
varchar
(
36
)
NOT
NULL
,
user_id
varchar
(
36
)
NOT
NULL
,
provider_name
varchar
(
50
)
NOT
NULL
,
remote_user_id
varchar
(
255
)
NOT
NULL
,
remote_username
varchar
(
100
),
remote_email
varchar
(
100
),
access_token
varchar
(
1000
),
refresh_token
varchar
(
1000
),
token_expiry
timestamp
,
scope
varchar
(
255
),
profile_data
json
,
linked_at
timestamp
DEFAULT
CURRENT_TIMESTAMP
,
last_login_at
timestamp
,
created_at
timestamp
DEFAULT
CURRENT_TIMESTAMP
,
updated_at
timestamp
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
,
deleted
int
DEFAULT
0
,
PRIMARY
KEY
(
id
),
UNIQUE
(
provider_name
,
remote_user_id
),
UNIQUE
(
user_id
,
provider_name
),
FOREIGN
KEY
(
user_id
)
REFERENCES
sys_user
(
id
)
ON
DELETE
CASCADE
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
;
-- 登录模式配置表
CREATE
TABLE
IF
NOT
EXISTS
login_mode_config
(
id
varchar
(
36
)
NOT
NULL
,
mode_name
varchar
(
50
)
NOT
NULL
UNIQUE
,
mode_type
varchar
(
50
)
NOT
NULL
,
display_name
varchar
(
100
),
description
text
,
enabled
tinyint
DEFAULT
1
,
config_json
json
,
display_order
int
DEFAULT
0
,
created_at
timestamp
DEFAULT
CURRENT_TIMESTAMP
,
updated_at
timestamp
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
,
created_by
varchar
(
36
),
updated_by
varchar
(
36
),
deleted
int
DEFAULT
0
,
PRIMARY
KEY
(
id
),
UNIQUE
(
mode_name
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
;
-- LLM配置表
CREATE
TABLE
IF
NOT
EXISTS
llm_config
(
id
varchar
(
36
)
NOT
NULL
,
name
varchar
(
100
)
NOT
NULL
UNIQUE
,
description
text
,
provider
varchar
(
50
),
model_name
varchar
(
100
),
api_key
varchar
(
255
),
base_url
varchar
(
255
),
temperature
decimal
(
3
,
2
)
DEFAULT
0
.
7
,
max_tokens
int
DEFAULT
4096
,
top_p
decimal
(
3
,
2
)
DEFAULT
0
.
9
,
enabled
tinyint
DEFAULT
1
,
owner
varchar
(
36
),
created_at
timestamp
DEFAULT
CURRENT_TIMESTAMP
,
updated_at
timestamp
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
,
created_by
varchar
(
36
),
updated_by
varchar
(
36
),
deleted
int
DEFAULT
0
,
remark
text
,
PRIMARY
KEY
(
id
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
;
-- Agent表
CREATE
TABLE
IF
NOT
EXISTS
agent
(
id
varchar
(
36
)
NOT
NULL
,
name
varchar
(
100
)
NOT
NULL
,
description
text
,
status
varchar
(
20
)
DEFAULT
'active'
,
default_model
varchar
(
100
),
system_prompt
text
,
prompt_template
text
,
temperature
decimal
(
3
,
2
)
DEFAULT
0
.
7
,
max_tokens
int
DEFAULT
4096
,
top_p
decimal
(
3
,
2
)
DEFAULT
0
.
9
,
top_k
int
DEFAULT
50
,
presence_penalty
decimal
(
3
,
2
)
DEFAULT
0
,
frequency_penalty
decimal
(
3
,
2
)
DEFAULT
0
,
history_length
int
DEFAULT
10
,
rag_collection_id
varchar
(
36
),
rag_top_k
int
DEFAULT
5
,
rag_score_threshold
decimal
(
3
,
2
)
DEFAULT
0
.
8
,
rag_prompt_template
text
,
enable_rag
tinyint
DEFAULT
0
,
enable_re_act
tinyint
DEFAULT
0
,
enable_streaming
tinyint
DEFAULT
1
,
owner
varchar
(
36
),
created_at
timestamp
DEFAULT
CURRENT_TIMESTAMP
,
updated_at
timestamp
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
,
created_by
varchar
(
36
),
updated_by
varchar
(
36
),
deleted
int
DEFAULT
0
,
remark
text
,
PRIMARY
KEY
(
id
),
FOREIGN
KEY
(
default_model
)
REFERENCES
llm_config
(
name
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
;
-- 文档表
CREATE
TABLE
IF
NOT
EXISTS
document
(
id
varchar
(
36
)
NOT
NULL
,
name
varchar
(
255
)
NOT
NULL
,
type
varchar
(
20
),
size
bigint
,
status
varchar
(
20
)
DEFAULT
'uploading'
,
chunks
int
DEFAULT
0
,
collection_id
varchar
(
36
),
file_path
varchar
(
255
),
author
varchar
(
100
),
source
varchar
(
100
),
tags
json
,
metadata
json
,
embedding_model
varchar
(
100
),
error_message
text
,
owner
varchar
(
36
),
created_at
timestamp
DEFAULT
CURRENT_TIMESTAMP
,
updated_at
timestamp
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
,
created_by
varchar
(
36
),
updated_by
varchar
(
36
),
deleted
int
DEFAULT
0
,
remark
text
,
PRIMARY
KEY
(
id
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
;
-- 文档片段表
CREATE
TABLE
IF
NOT
EXISTS
document_chunk
(
id
varchar
(
36
)
NOT
NULL
,
document_id
varchar
(
36
)
NOT
NULL
,
content
longtext
,
page_number
int
,
score
decimal
(
3
,
2
),
sequence
int
,
vector_id
bigint
,
metadata
json
,
created_at
timestamp
DEFAULT
CURRENT_TIMESTAMP
,
updated_at
timestamp
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
,
created_by
varchar
(
36
),
updated_by
varchar
(
36
),
deleted
int
DEFAULT
0
,
remark
text
,
PRIMARY
KEY
(
id
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
;
-- Agent对话表
CREATE
TABLE
IF
NOT
EXISTS
agent_dialogue
(
id
varchar
(
36
)
NOT
NULL
,
agent_id
varchar
(
36
)
NOT
NULL
,
context_id
varchar
(
36
),
user_message
longtext
,
agent_response
longtext
,
prompt_tokens
int
,
completion_tokens
int
,
total_tokens
int
,
processing_time
bigint
,
finish_reason
varchar
(
50
),
tool_calls
json
,
user_id
varchar
(
36
),
created_at
timestamp
DEFAULT
CURRENT_TIMESTAMP
,
updated_at
timestamp
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
,
created_by
varchar
(
36
),
updated_by
varchar
(
36
),
deleted
int
DEFAULT
0
,
remark
text
,
PRIMARY
KEY
(
id
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
;
-- 系统日志表
CREATE
TABLE
IF
NOT
EXISTS
sys_log
(
id
varchar
(
36
)
NOT
NULL
,
operation_type
varchar
(
50
),
resource_type
varchar
(
50
),
resource_id
varchar
(
36
),
user_id
varchar
(
36
),
description
text
,
request_params
json
,
response_result
json
,
success
tinyint
DEFAULT
1
,
error_message
text
,
ip_address
varchar
(
50
),
execution_time
bigint
,
created_at
timestamp
DEFAULT
CURRENT_TIMESTAMP
,
updated_at
timestamp
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
,
created_by
varchar
(
36
),
updated_by
varchar
(
36
),
deleted
int
DEFAULT
0
,
remark
text
,
PRIMARY
KEY
(
id
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
;
-- 工具表
CREATE
TABLE
IF
NOT
EXISTS
tool
(
id
varchar
(
36
)
NOT
NULL
,
name
varchar
(
100
)
NOT
NULL
,
display_name
varchar
(
100
),
description
text
,
category
varchar
(
50
),
status
varchar
(
20
)
DEFAULT
'active'
,
bean_name
varchar
(
100
),
parameters
json
,
return_type
varchar
(
50
),
return_schema
json
,
implementation
text
,
timeout
bigint
,
api_endpoint
varchar
(
255
),
http_method
varchar
(
20
),
headers
json
,
auth_type
varchar
(
50
),
auth_config
json
,
owner
varchar
(
36
),
created_at
timestamp
DEFAULT
CURRENT_TIMESTAMP
,
updated_at
timestamp
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
,
created_by
varchar
(
36
),
updated_by
varchar
(
36
),
deleted
int
DEFAULT
0
,
remark
text
,
PRIMARY
KEY
(
id
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
;
CREATE
UNIQUE
INDEX
uk_tool_bean_name
ON
tool
(
bean_name
);
CREATE
INDEX
idx_tool_name
ON
tool
(
name
);
CREATE
INDEX
idx_tool_status
ON
tool
(
status
);
-- Agent和Tool的多对多关系表
CREATE
TABLE
IF
NOT
EXISTS
agent_tool_relation
(
id
varchar
(
36
)
NOT
NULL
,
agent_id
varchar
(
36
)
NOT
NULL
,
tool_id
varchar
(
36
)
NOT
NULL
,
created_at
timestamp
DEFAULT
CURRENT_TIMESTAMP
,
updated_at
timestamp
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
,
created_by
varchar
(
36
),
updated_by
varchar
(
36
),
deleted
int
DEFAULT
0
,
remark
text
,
PRIMARY
KEY
(
id
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
;
CREATE
INDEX
idx_agent_tool_agent_id
ON
agent_tool_relation
(
agent_id
);
CREATE
INDEX
idx_agent_tool_tool_id
ON
agent_tool_relation
(
tool_id
);
CREATE
UNIQUE
INDEX
uk_agent_tool_relation
ON
agent_tool_relation
(
agent_id
,
tool_id
);
-- 定时器配置表
CREATE
TABLE
IF
NOT
EXISTS
hiagent_timer_config
(
id
varchar
(
36
)
NOT
NULL
,
name
varchar
(
100
)
NOT
NULL
,
description
text
,
cron_expression
varchar
(
50
)
NOT
NULL
,
enabled
int
DEFAULT
0
,
agent_id
varchar
(
36
),
agent_name
varchar
(
100
),
prompt_template
text
,
params_json
json
,
last_execution_time
timestamp
,
next_execution_time
timestamp
,
created_at
timestamp
DEFAULT
CURRENT_TIMESTAMP
,
updated_at
timestamp
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
,
created_by
varchar
(
36
),
updated_by
varchar
(
36
),
deleted
int
DEFAULT
0
,
remark
varchar
(
255
),
PRIMARY
KEY
(
id
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
;
CREATE
INDEX
idx_timer_enabled
ON
hiagent_timer_config
(
enabled
);
CREATE
INDEX
idx_timer_created_by
ON
hiagent_timer_config
(
created_by
);
CREATE
INDEX
idx_timer_agent_id
ON
hiagent_timer_config
(
agent_id
);
-- 定时器执行历史表
CREATE
TABLE
IF
NOT
EXISTS
hiagent_timer_execution_history
(
id
bigint
NOT
NULL
AUTO_INCREMENT
,
timer_id
varchar
(
36
)
NOT
NULL
,
timer_name
varchar
(
100
)
NOT
NULL
,
execution_time
timestamp
DEFAULT
CURRENT_TIMESTAMP
,
success
int
DEFAULT
0
,
result
text
,
error_message
text
,
actual_prompt
text
,
execution_duration
bigint
,
created_at
timestamp
DEFAULT
CURRENT_TIMESTAMP
,
updated_at
timestamp
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
,
created_by
varchar
(
36
),
updated_by
varchar
(
36
),
deleted
int
DEFAULT
0
,
remark
text
,
PRIMARY
KEY
(
id
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
;
CREATE
INDEX
idx_timer_history_timer_id
ON
hiagent_timer_execution_history
(
timer_id
);
CREATE
INDEX
idx_timer_history_execution_time
ON
hiagent_timer_execution_history
(
execution_time
);
CREATE
INDEX
idx_timer_history_success
ON
hiagent_timer_execution_history
(
success
);
CREATE
INDEX
idx_timer_history_created_at
ON
hiagent_timer_execution_history
(
created_at
);
-- 提示词模板表
CREATE
TABLE
IF
NOT
EXISTS
hiagent_prompt_template
(
id
varchar
(
36
)
NOT
NULL
,
name
varchar
(
100
)
NOT
NULL
,
description
text
,
template_content
text
NOT
NULL
,
param_schema
json
,
template_type
varchar
(
50
)
DEFAULT
'system'
,
is_system
int
DEFAULT
0
,
created_at
timestamp
DEFAULT
CURRENT_TIMESTAMP
,
updated_at
timestamp
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
,
created_by
varchar
(
36
),
updated_by
varchar
(
36
),
deleted
int
DEFAULT
0
,
remark
text
,
PRIMARY
KEY
(
id
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
;
CREATE
INDEX
idx_prompt_template_type
ON
hiagent_prompt_template
(
template_type
);
CREATE
INDEX
idx_prompt_template_is_system
ON
hiagent_prompt_template
(
is_system
);
CREATE
INDEX
idx_prompt_template_created_by
ON
hiagent_prompt_template
(
created_by
);
-- 工具配置表
CREATE
TABLE
IF
NOT
EXISTS
tool_configs
(
id
varchar
(
36
)
NOT
NULL
,
tool_name
varchar
(
100
)
NOT
NULL
,
param_name
varchar
(
100
)
NOT
NULL
,
param_value
text
,
description
text
,
default_value
text
,
type
varchar
(
50
)
NOT
NULL
DEFAULT
'string'
,
required
tinyint
DEFAULT
0
,
group_name
varchar
(
100
)
DEFAULT
'default'
,
created_at
timestamp
DEFAULT
CURRENT_TIMESTAMP
,
updated_at
timestamp
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
,
created_by
varchar
(
36
),
updated_by
varchar
(
36
),
deleted
int
DEFAULT
0
,
remark
text
,
PRIMARY
KEY
(
id
),
UNIQUE
(
tool_name
,
param_name
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
;
CREATE
INDEX
idx_tool_configs_tool_name
ON
tool_configs
(
tool_name
);
CREATE
INDEX
idx_tool_configs_group_name
ON
tool_configs
(
group_name
);
CREATE
INDEX
idx_tool_configs_type
ON
tool_configs
(
type
);
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