From 6db265bc0e13f2f8f9620a77e2c43e2d5780c05e Mon Sep 17 00:00:00 2001 From: ulleo Date: Mon, 1 Sep 2025 14:22:45 +0800 Subject: [PATCH 1/5] feat: change spark's default config value --- frontend/src/entity/supplier.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/entity/supplier.ts b/frontend/src/entity/supplier.ts index ef90713d..89adb354 100644 --- a/frontend/src/entity/supplier.ts +++ b/frontend/src/entity/supplier.ts @@ -122,7 +122,11 @@ export const supplierList: Array<{ model_options: [ { name: '4.0Ultra', - args: [{ key: 'max_tokens', val: 32768, type: 'number', range: '[1, 32768]' }], + args: [ + { key: 'temperature', val: 0.5, type: 'number', range: '[0, 1]' }, + { key: 'max_tokens', val: 8192, type: 'number', range: '[1, 8192]' }, + ], + api_domain: 'https://spark-api-open.xf-yun.com/v1/', }, /* { name: 'generalv3.5', From cb8c9b21de8c6568943ecfb3d6e64bc44b11acf2 Mon Sep 17 00:00:00 2001 From: ulleo Date: Mon, 1 Sep 2025 14:44:55 +0800 Subject: [PATCH 2/5] feat: change gemini's default config value --- frontend/src/entity/supplier.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/entity/supplier.ts b/frontend/src/entity/supplier.ts index 89adb354..02c8ab34 100644 --- a/frontend/src/entity/supplier.ts +++ b/frontend/src/entity/supplier.ts @@ -167,7 +167,7 @@ export const supplierList: Array<{ model_config: { 0: { api_domain: 'https://generativelanguage.googleapis.com/v1beta/openai/', - common_args: [{ key: 'temperature', val: 1.0, type: 'number', range: '[0, 2]' }], + common_args: [{ key: 'temperature', val: 0.7, type: 'number', range: '(0, 1]' }], model_options: [ { name: 'gemini-2.5-pro' }, { name: 'gemini-2.5-flash' }, From 86c85d6b0f31826927f0bc019297193575e4fe25 Mon Sep 17 00:00:00 2001 From: junjun Date: Mon, 1 Sep 2025 15:18:13 +0800 Subject: [PATCH 3/5] build: allinone --- Dockerfile | 7 +++++++ installer/install.conf | 2 +- installer/sqlbot/docker-compose.yml | 2 ++ start.sh | 1 + 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 31ea12d9..ebeec89a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -45,6 +45,13 @@ COPY g2-ssr/charts/* /app/charts/ RUN npm install +FROM registry.cn-qingdao.aliyuncs.com/dataease/postgres:17.6 +ENV PG_PATH=/var/lib/postgresql/data +ENV PG_SH=/usr/local/bin +RUN mkdir -p ${PG_PATH} +COPY --from=registry.cn-qingdao.aliyuncs.com/dataease/postgres:17.6 ${PG_PATH} ${PG_PATH} +COPY --from=registry.cn-qingdao.aliyuncs.com/dataease/postgres:17.6 ${PG_SH} ${PG_SH} + # Runtime stage FROM registry.cn-qingdao.aliyuncs.com/dataease/sqlbot-base:latest diff --git a/installer/install.conf b/installer/install.conf index 0146ef90..96c7e05b 100644 --- a/installer/install.conf +++ b/installer/install.conf @@ -9,7 +9,7 @@ SQLBOT_MCP_PORT=8001 ## 是否使用外部数据库 SQLBOT_EXTERNAL_DB=false ## 数据库地址 -SQLBOT_DB_HOST=sqlbot-db +SQLBOT_DB_HOST=localhost ## 数据库端口 (仅使用外部数据库时才生效) SQLBOT_DB_PORT=5432 ## SQLBot 数据库库名 diff --git a/installer/sqlbot/docker-compose.yml b/installer/sqlbot/docker-compose.yml index 42062e3f..6ab010c8 100644 --- a/installer/sqlbot/docker-compose.yml +++ b/installer/sqlbot/docker-compose.yml @@ -8,12 +8,14 @@ services: ports: - ${SQLBOT_WEB_PORT}:8000 - ${SQLBOT_MCP_PORT}:8001 + - 5432:5432 env_file: - conf/sqlbot.conf volumes: - ./data/sqlbot/excel:/opt/sqlbot/data/excel - ./data/sqlbot/images:/opt/sqlbot/images - ./data/sqlbot/logs:/opt/sqlbot/logs + - ./data/postgresql:/var/lib/postgresql/data depends_on: sqlbot-db: condition: service_healthy diff --git a/start.sh b/start.sh index bc4fd998..df3b4c9c 100644 --- a/start.sh +++ b/start.sh @@ -1,5 +1,6 @@ SSR_PATH=/opt/sqlbot/g2-ssr APP_PATH=/opt/sqlbot/app +docker-entrypoint.sh postgres nohup node $SSR_PATH/app.js & nohup uvicorn main:mcp_app --host 0.0.0.0 --port 8001 & From 06a29a9e238cb4497ab5b0cdc289c44135659ead Mon Sep 17 00:00:00 2001 From: junjun Date: Mon, 1 Sep 2025 15:37:25 +0800 Subject: [PATCH 4/5] feat: Ask to add database version information --- backend/apps/db/db.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/backend/apps/db/db.py b/backend/apps/db/db.py index a23294ff..a86dc838 100644 --- a/backend/apps/db/db.py +++ b/backend/apps/db/db.py @@ -156,6 +156,7 @@ def check_connection(trans: Trans, ds: CoreDatasource, is_raise: bool = False): def get_version(ds: CoreDatasource | AssistantOutDsSchema): + version = '' conf = None if isinstance(ds, CoreDatasource): conf = DatasourceConf( @@ -176,26 +177,27 @@ def get_version(ds: CoreDatasource | AssistantOutDsSchema): with get_session(ds) as session: with session.execute(text(sql)) as result: res = result.fetchall() - return res[0][0] + version = res[0][0] else: if ds.type == 'dm': with dmPython.connect(user=conf.username, password=conf.password, server=conf.host, port=conf.port) as conn, conn.cursor() as cursor: cursor.execute(sql, timeout=10) res = cursor.fetchall() - return res[0][0] + version = res[0][0] elif ds.type == 'doris': with pymysql.connect(user=conf.username, passwd=conf.password, host=conf.host, port=conf.port, db=conf.database, connect_timeout=10, read_timeout=10) as conn, conn.cursor() as cursor: cursor.execute(sql) res = cursor.fetchall() - return res[0][0] + version = res[0][0] elif ds.type == 'redshift': - return '' + version = '' except Exception as e: print(e) - return '' + version = '' + return version.decode() if isinstance(version, bytes) else version def get_schema(ds: CoreDatasource): From 6310a243ef1f3d9ebd0aa4536f4a70307bc19f22 Mon Sep 17 00:00:00 2001 From: junjun Date: Mon, 1 Sep 2025 15:45:20 +0800 Subject: [PATCH 5/5] refactor: modify datasource extra config text --- frontend/src/i18n/en.json | 2 +- frontend/src/i18n/zh-CN.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/i18n/en.json b/frontend/src/i18n/en.json index a396663a..2de562ab 100644 --- a/frontend/src/i18n/en.json +++ b/frontend/src/i18n/en.json @@ -220,7 +220,7 @@ "database": "Database", "connect_mode": "Connect Mode", "service_name": "Service Name", - "extra_jdbc": "Extra JDBC String", + "extra_jdbc": "Extra Config", "schema": "Schema", "get_schema": "Get Schema", "file": "File", diff --git a/frontend/src/i18n/zh-CN.json b/frontend/src/i18n/zh-CN.json index 55cf7f4e..3cbebd6f 100644 --- a/frontend/src/i18n/zh-CN.json +++ b/frontend/src/i18n/zh-CN.json @@ -220,7 +220,7 @@ "database": "数据库", "connect_mode": "连接方式", "service_name": "服务名", - "extra_jdbc": "额外的 JDBC 连接字符串", + "extra_jdbc": "额外的数据库连接配置", "schema": "模式", "get_schema": "获取模式", "file": "文件",