Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ dependencies = [
"pyyaml (>=6.0.2,<7.0.0)",
"fastapi-mcp (>=0.3.4,<0.4.0)",
"tabulate>=0.9.0",
"sqlbot-xpack>=0.0.5.23,<0.0.6.0",
"sqlbot-xpack>=0.0.5.24,<0.0.6.0",
"fastapi-cache2>=0.2.2",
"sqlparse>=0.5.3",
"redis>=6.2.0",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"context_record_count": "Context Record Count",
"context_record_count_hint": "Number of user question rounds",
"model_thinking_process": "Expand Model Thinking Process",
"hide_model_thinking_process": "Hide Model Thinking Process",
"rows_of_data": "Limit 1000 Rows of Data",
"third_party_platform_settings": "Authentication Settings",
"by_third_party_platform": "Automatic User Creation",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/i18n/ko-KR.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"context_record_count": "컨텍스트 기록 수",
"context_record_count_hint": "사용자 질문 라운드 수",
"model_thinking_process": "모델 사고 프로세스 확장",
"hide_model_thinking_process": "모델 사고 과정 숨기기",
"rows_of_data": "데이터 1,000행 제한",
"third_party_platform_settings": "로그인 인증 설정",
"by_third_party_platform": "자동 사용자 생성",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/i18n/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"context_record_count": "上下文记录数",
"context_record_count_hint": "用户提问轮数",
"model_thinking_process": "展开模型思考过程",
"hide_model_thinking_process": "隐藏模型思考过程",
"rows_of_data": "限制 1000 行数据",
"third_party_platform_settings": "登录认证设置",
"by_third_party_platform": "自动创建用户",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/i18n/zh-TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"context_record_count": "上下文記錄數",
"context_record_count_hint": "使用者提問輪數",
"model_thinking_process": "展開模型思考過程",
"hide_model_thinking_process": "隱藏模型思考過程",
"rows_of_data": "限制 1000 列資料",
"third_party_platform_settings": "登入認證設定",
"by_third_party_platform": "自動建立使用者",
Expand Down
8 changes: 8 additions & 0 deletions frontend/src/stores/chatConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { formatArg } from '@/utils/utils.ts'
interface ChatConfig {
sqlbot_name: string
expand_thinking_block: boolean
hide_thinking_block: boolean
limit_rows: boolean
show_sql: boolean
show_log: boolean
Expand All @@ -16,6 +17,7 @@ export const chatConfigStore = defineStore('chatConfigStore', {
return {
sqlbot_name: 'SQLBot',
expand_thinking_block: false,
hide_thinking_block: false,
limit_rows: true,
show_sql: true,
show_log: true,
Expand All @@ -28,6 +30,9 @@ export const chatConfigStore = defineStore('chatConfigStore', {
getExpandThinkingBlock(): boolean {
return this.expand_thinking_block
},
getHideThinkingBlock(): boolean {
return this.hide_thinking_block
},
getShowSQL(): boolean {
return this.show_sql
},
Expand All @@ -43,6 +48,9 @@ export const chatConfigStore = defineStore('chatConfigStore', {
request.get('/system/parameter/chat').then((res: any) => {
if (res) {
res.forEach((item: any) => {
if (item.pkey === 'chat.hide_thinking_block') {
this.hide_thinking_block = formatArg(item.pval)
}
if (item.pkey === 'chat.expand_thinking_block') {
this.expand_thinking_block = formatArg(item.pval)
}
Expand Down
10 changes: 6 additions & 4 deletions frontend/src/views/chat/answer/BaseAnswer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,12 @@ const reasoningContent = computed<Array<string>>(() => {
})

const hasReasoning = computed<boolean>(() => {
if (reasoningContent.value.length > 0) {
for (let i = 0; i < reasoningContent.value.length; i++) {
if (reasoningContent.value[i] && reasoningContent.value[i].trim() !== '') {
return true
if (!chatConfig.getHideThinkingBlock) {
if (reasoningContent.value.length > 0) {
for (let i = 0; i < reasoningContent.value.length; i++) {
if (reasoningContent.value[i] && reasoningContent.value[i].trim() !== '') {
return true
}
}
}
}
Expand Down
21 changes: 13 additions & 8 deletions frontend/src/views/system/parameter/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const { t } = useI18n()
const state = reactive({
parameterForm: reactive<any>({
'chat.sqlbot_name': 'SQLBot',
'chat.hide_thinking_block': false,
'chat.expand_thinking_block': false,
'chat.limit_rows': false,
'chat.show_sql': false,
Expand Down Expand Up @@ -114,8 +115,16 @@ onMounted(() => {
</div>
</div>
</el-row>
<el-row>
<div style="display: grid; grid-template-columns: 1fr 1fr">
<div class="card-item">
<div class="label">
{{ t('parameter.hide_model_thinking_process') }}
</div>
<div class="value">
<el-switch v-model="state.parameterForm['chat.hide_thinking_block']" />
</div>
</div>
<div v-if="!state.parameterForm['chat.hide_thinking_block']" class="card-item">
<div class="label">
{{ t('parameter.model_thinking_process') }}

Expand All @@ -129,7 +138,7 @@ onMounted(() => {
<el-switch v-model="state.parameterForm['chat.expand_thinking_block']" />
</div>
</div>
<div class="card-item" style="margin-left: 16px">
<div class="card-item">
<div class="label">
{{ t('parameter.rows_of_data') }}
<el-tooltip
Expand All @@ -149,8 +158,6 @@ onMounted(() => {
/>
</div>
</div>
</el-row>
<el-row>
<div class="card-item">
<div class="label">
{{ t('parameter.show_sql') }}
Expand All @@ -159,16 +166,14 @@ onMounted(() => {
<el-switch v-model="state.parameterForm['chat.show_sql']" />
</div>
</div>
<div class="card-item" style="margin-left: 16px">
<div class="card-item">
<div class="label">
{{ t('parameter.show_log') }}
</div>
<div class="value">
<el-switch v-model="state.parameterForm['chat.show_log']" />
</div>
</div>
</el-row>
<el-row>
<div class="card-item">
<div class="label">
{{ t('parameter.context_record_count') }}
Expand All @@ -191,7 +196,7 @@ onMounted(() => {
/>
</div>
</div>
</el-row>
</div>
</div>

<platform-param />
Expand Down
Loading