feat(agent): 接入Agent调试与RAG召回链路
This commit is contained in:
35
script/sql/agent_definition.sql
Normal file
35
script/sql/agent_definition.sql
Normal file
@@ -0,0 +1,35 @@
|
||||
DROP TABLE IF EXISTS agent_definition;
|
||||
|
||||
CREATE TABLE agent_definition (
|
||||
id BIGSERIAL PRIMARY KEY,
|
||||
agent_code VARCHAR(100) NOT NULL,
|
||||
agent_name VARCHAR(200) NOT NULL,
|
||||
system_prompt TEXT,
|
||||
store_id BIGINT NOT NULL,
|
||||
status VARCHAR(50) NOT NULL DEFAULT 'ENABLED',
|
||||
version INTEGER NOT NULL DEFAULT 1,
|
||||
create_time TIMESTAMP,
|
||||
update_time TIMESTAMP,
|
||||
remark VARCHAR(500) DEFAULT '',
|
||||
create_by VARCHAR(64),
|
||||
update_by VARCHAR(64),
|
||||
CONSTRAINT uk_agent_definition_code UNIQUE (agent_code),
|
||||
CONSTRAINT fk_agent_definition_store_id FOREIGN KEY (store_id) REFERENCES rag_store (id)
|
||||
);
|
||||
|
||||
CREATE INDEX idx_agent_definition_store_id ON agent_definition (store_id);
|
||||
CREATE INDEX idx_agent_definition_status ON agent_definition (status);
|
||||
|
||||
COMMENT ON TABLE agent_definition IS 'Agent定义表';
|
||||
COMMENT ON COLUMN agent_definition.id IS 'ID';
|
||||
COMMENT ON COLUMN agent_definition.agent_code IS 'Agent编码';
|
||||
COMMENT ON COLUMN agent_definition.agent_name IS 'Agent名称';
|
||||
COMMENT ON COLUMN agent_definition.system_prompt IS '系统提示词';
|
||||
COMMENT ON COLUMN agent_definition.store_id IS '绑定知识库ID';
|
||||
COMMENT ON COLUMN agent_definition.status IS '状态';
|
||||
COMMENT ON COLUMN agent_definition.version IS '版本';
|
||||
COMMENT ON COLUMN agent_definition.create_time IS '创建时间';
|
||||
COMMENT ON COLUMN agent_definition.update_time IS '更新时间';
|
||||
COMMENT ON COLUMN agent_definition.remark IS '备注';
|
||||
COMMENT ON COLUMN agent_definition.create_by IS '创建者';
|
||||
COMMENT ON COLUMN agent_definition.update_by IS '更新者';
|
||||
20
script/sql/model_call_log_patch.sql
Normal file
20
script/sql/model_call_log_patch.sql
Normal file
@@ -0,0 +1,20 @@
|
||||
-- model_call_log 补丁脚本
|
||||
-- 目的:对齐 BaseEntity 字段,避免 MyBatis 查询 create_by / update_by / update_time / version 报错
|
||||
|
||||
ALTER TABLE model_call_log
|
||||
ADD COLUMN IF NOT EXISTS create_by VARCHAR(64);
|
||||
|
||||
ALTER TABLE model_call_log
|
||||
ADD COLUMN IF NOT EXISTS update_by VARCHAR(64);
|
||||
|
||||
ALTER TABLE model_call_log
|
||||
ADD COLUMN IF NOT EXISTS update_time TIMESTAMP;
|
||||
|
||||
ALTER TABLE model_call_log
|
||||
ADD COLUMN IF NOT EXISTS version INTEGER NOT NULL DEFAULT 1;
|
||||
|
||||
COMMENT ON COLUMN model_call_log.create_by IS '创建者';
|
||||
COMMENT ON COLUMN model_call_log.update_by IS '更新者';
|
||||
COMMENT ON COLUMN model_call_log.update_time IS '更新时间';
|
||||
COMMENT ON COLUMN model_call_log.version IS '版本';
|
||||
|
||||
Reference in New Issue
Block a user