mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-08 01:06:59 +08:00
Merge branch 'main' of https://github.com/dataease/SQLBot
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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',
|
||||
@@ -163,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' },
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -220,7 +220,7 @@
|
||||
"database": "数据库",
|
||||
"connect_mode": "连接方式",
|
||||
"service_name": "服务名",
|
||||
"extra_jdbc": "额外的 JDBC 连接字符串",
|
||||
"extra_jdbc": "额外的数据库连接配置",
|
||||
"schema": "模式",
|
||||
"get_schema": "获取模式",
|
||||
"file": "文件",
|
||||
|
||||
@@ -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 数据库库名
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user