Feature/model data embedding for chat and support status for metric and dimension (#311)

* (improvement)(semantic) add offline status for metric and dimension

* (improvement)(chat) add metric recall

---------

Co-authored-by: jolunoluo
This commit is contained in:
LXW
2023-11-02 18:44:58 +08:00
committed by GitHub
parent f4e3922f47
commit ad20380283
89 changed files with 1572 additions and 896 deletions

View File

@@ -119,6 +119,8 @@ CREATE TABLE IF NOT EXISTS `s2_model` (
`biz_name` varchar(255) DEFAULT NULL , -- internal name
`domain_id` INT DEFAULT '0' , -- parent domain ID
`alias` varchar(255) DEFAULT NULL , -- internal name
`status` INT DEFAULT NULL,
`description` varchar(500) DEFAULT NULL ,
`created_at` TIMESTAMP DEFAULT NULL ,
`created_by` varchar(100) DEFAULT NULL ,
`updated_at` TIMESTAMP DEFAULT NULL ,
@@ -160,6 +162,7 @@ CREATE TABLE IF NOT EXISTS `s2_datasource` (
`description` varchar(500) DEFAULT NULL ,
`database_id` INT NOT NULL ,
`datasource_detail` LONGVARCHAR NOT NULL ,
`status` int(11) DEFAULT NULL ,
`depends` varchar(500) DEFAULT NULL ,
`created_at` TIMESTAMP NOT NULL ,
`created_by` varchar(100) NOT NULL ,
@@ -182,7 +185,7 @@ CREATE TABLE IF NOT EXISTS `s2_metric` (
`name` varchar(255) NOT NULL ,
`biz_name` varchar(255) NOT NULL ,
`description` varchar(500) DEFAULT NULL ,
`status` INT NOT NULL , -- status, 0 is normal, 1 is off the shelf, 2 is deleted
`status` INT NOT NULL , -- status, 0 is off the shelf, 1 is normal
`sensitive_level` INT NOT NULL ,
`type` varchar(50) NOT NULL , -- type proxy,expr
`type_params` LONGVARCHAR DEFAULT NULL ,
@@ -207,7 +210,7 @@ CREATE TABLE IF NOT EXISTS `s2_dimension` (
`name` varchar(255) NOT NULL ,
`biz_name` varchar(255) NOT NULL ,
`description` varchar(500) NOT NULL ,
`status` INT NOT NULL , -- status, 0 is normal, 1 is off the shelf, 2 is deleted
`status` INT NOT NULL , -- status, 0 is off the shelf, 1 is normal
`sensitive_level` INT DEFAULT NULL ,
`data_type` varchar(50) DEFAULT NULL , -- type date,array,varchar
`type` varchar(50) NOT NULL , -- type categorical,time

View File

@@ -141,6 +141,7 @@ CREATE TABLE `s2_datasource` (
`description` varchar(500) DEFAULT NULL COMMENT '数据源描述',
`database_id` bigint(20) NOT NULL COMMENT '数据库实例ID',
`datasource_detail` mediumtext NOT NULL COMMENT '数据源配置',
`status` int(11) DEFAULT NULL ,
`depends` text DEFAULT NULL COMMENT '上游依赖标识',
`created_at` datetime NOT NULL COMMENT '创建时间',
`created_by` varchar(100) NOT NULL COMMENT '创建人',
@@ -202,7 +203,7 @@ CREATE TABLE `s2_dimension` (
`name` varchar(255) NOT NULL COMMENT '维度名称',
`biz_name` varchar(255) NOT NULL COMMENT '字段名称',
`description` varchar(500) NOT NULL COMMENT '描述',
`status` int(10) NOT NULL COMMENT '维度状态,0正常,1下架,2删除',
`status` int(10) NOT NULL COMMENT '维度状态,0正常,1下架',
`sensitive_level` int(10) DEFAULT NULL COMMENT '敏感级别',
`type` varchar(50) NOT NULL COMMENT '维度类型 categorical,time',
`type_params` text COMMENT '类型参数',
@@ -245,9 +246,9 @@ CREATE TABLE `s2_metric` (
`name` varchar(255) NOT NULL COMMENT '指标名称',
`biz_name` varchar(255) NOT NULL COMMENT '字段名称',
`description` varchar(500) DEFAULT NULL COMMENT '描述',
`status` int(10) NOT NULL COMMENT '指标状态,0正常,1下架,2删除',
`status` int(10) NOT NULL COMMENT '指标状态,0未启用,1启用',
`sensitive_level` int(10) NOT NULL COMMENT '敏感级别',
`type` varchar(50) NOT NULL COMMENT '指标类型 proxy,expr',
`type` varchar(50) NOT NULL COMMENT '指标类型',
`type_params` text NOT NULL COMMENT '类型参数',
`created_at` datetime NOT NULL COMMENT '创建时间',
`created_by` varchar(100) NOT NULL COMMENT '创建人',
@@ -268,6 +269,8 @@ CREATE TABLE `s2_model` (
`biz_name` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
`domain_id` bigint(20) DEFAULT NULL,
`alias` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL,
`status` int(11) DEFAULT NULL,
`description` varchar(500) DEFAULT NULL,
`viewer` varchar(500) COLLATE utf8_unicode_ci DEFAULT NULL,
`view_org` varchar(500) COLLATE utf8_unicode_ci DEFAULT NULL,
`admin` varchar(500) COLLATE utf8_unicode_ci DEFAULT NULL,

View File

@@ -68,3 +68,12 @@ alter table s2_datasource add column depends text COMMENT '上游依赖标识' a
--20231018
UPDATE `s2_agent` SET `config` = replace (`config`,'DSL','LLM_S2QL') WHERE `config` LIKE '%DSL%';
--20231023
alter table s2_model add column status int null after alias;
alter table s2_model add column description varchar(500) null after status;
alter table s2_datasource add column status int null after database_id;
update s2_model set status = 1;
update s2_datasource set status = 1;
update s2_metric set status = 1;
update s2_dimension set status = 1;