33 Commits
Author SHA1 Message Date
ulleo 337c75549b fix(chat): constrain SQL row-limit placement to outermost query in prompt templates (#1202)
The row-limit policy in query_limit/no_query_limit did not specify WHERE
the limit should be applied, so LLMs could put LIMIT/ROWNUM/TOP inside
subqueries, truncating the data feeding aggregation (limiting accessed
rows instead of the final result set).

- query_limit/no_query_limit: limit must be applied only to the outermost
  query; never inside subqueries, derived tables or CTEs; add conditional
  per-group top-N note (window functions where supported)
- process_check (template.yaml + Oracle override): step 4 now verifies
  limit placement
- sql_examples: add nested-aggregation bad/good examples for all 11
  engines showing the limit on the outer query only
- Oracle: fix invalid GROUP BY...WHERE ROWNUM example and wrong
  ROWNUM-before-ORDER BY few-shot answers (wrap with outer query)
2026-09-21 14:50:55 +08:00
ulleo 21961e2d03 feat(i18n): add Thai (th-TH) language support
Frontend:
- Add frontend/src/i18n/th-TH.json (913 keys, full parity with zh-CN)
- Register th-TH in i18n entry with native element-plus-secondary Thai locale
- Add Thai option to language selectors, legacy th_TH alias mapping,
  and browser locale detection (th* -> th-TH)
- Add common.thai label to all existing locale files

Backend:
- Add backend/locales/th-TH.json (177 keys)
- Accept th-TH in language whitelist, schema regex, and MCP question
- Map th* to Thai language name in LLM prompt language selection
- Apply question language to guess-question prompt template
2026-09-20 17:05:35 +08:00
ulleo 3fd6fa867d feat: implement LLM keyword extraction and fusion scoring for table matching
- Add extract_keywords() to LLMService with conversation context support,
  using process_stream + start_log/end_log for logging consistency
- Add expand_with_terminology() to expand keywords with synonym matching
- Add fusion scoring in calc_table_embedding(): α * vec_score + (1-α) * keyword_score
- Add calc_keyword_score() with multi-level matching:
  table name exact (1.0), comment exact (0.9), comment substring (0.7),
  table name partial (0.25-0.5), field comment exact (0.5),
  field comment substring (0.4), field name partial (0.3)
- Scoring considers keyword coverage rate to differentiate tables
  with different numbers of matched keywords
- Extracted keywords persisted to ChatRecord for reuse across endpoints
- get_terminology_template() supports comma-separated keyword input
  with per-keyword matching for higher precision
- Add TABLE_EMBEDDING_ALPHA and TABLE_EMBEDDING_KEYWORD_ENABLED config
2026-09-14 17:51:45 +08:00
ulleo 7c40afb436 fix: 将模板文件中的繁体字转换为简体字
#1319
2026-08-12 17:36:27 +08:00
ulleo afbb3d7981 feat: Support configure SQLBot name in chat template 2026-05-08 17:11:16 +08:00
yymandClaude Opus 4.6 348fd3850f feat: Add SQLite and Hive database support with sample data for AI
- Add SQLite support to data sources (file-based connection)
- Add Hive support to data sources
- Add SSL toggle option for MySQL and Doris databases
- Add sample data (3 rows JSON format) to help AI better understand table schema
- Fix SQLite schema table name issue (empty schema prefix)
- Add SQLite.yaml template for SQL generation
- Add Hive to haveSchema list in frontend

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-05-08 11:53:08 +08:00
ulleo 387731236e feat(Application): Application can configure specified model 2026-04-30 15:23:32 +08:00
ulleo bc984c0c26 feat(System): Language switch, supports Traditional Chinese. 2026-04-28 15:00:46 +08:00
ulleo 73282bb010 feat(System): Language switch, supports Traditional Chinese. 2026-04-27 18:08:50 +08:00
ulleo c292466d49 feat(System): Language switch, supports Traditional Chinese. 2026-04-27 17:12:42 +08:00
ulleo 9c1f4cf4c2 feat: improve generate sql quality 2026-04-09 16:57:16 +08:00
ulleo 882d0e6e89 feat: improve generate sql/chart quality 2026-04-08 16:57:10 +08:00
ulleo 594df91235 feat: improve generate sql quality 2026-04-07 19:06:17 +08:00
ulleo 32af7a11d7 feat: add dimension and metric field constraints to SQL generation templates 2026-02-04 15:21:56 +08:00
ulleo 29823e963e feat: improve sql generation template 2026-01-27 10:52:19 +08:00
ulleo 0dc289956b feat: improve chart field name matching with original table structure 2026-01-22 14:30:58 +08:00
ulleo da807a503b feat: support multiple metrics in line, column, and bar charts 2026-01-20 17:07:11 +08:00
ulleo 1cd7f743f2 feat: support multiple metrics in line, column, and bar charts 2026-01-08 16:27:12 +08:00
ulleo c6403fae78 feat: improve SQL template 2025-12-16 18:57:14 +08:00
ulleo 4d49819533 feat: improve regenerate SQL chat feature 2025-12-11 16:22:33 +08:00
Matt Lei 2f4042edd6 fix: correct syntax, format issues in template.yaml 2025-12-10 15:28:30 +08:00
ulleo 2b19f0b9e9 feat: improve template.yaml 2025-12-05 16:34:46 +08:00
ulleo 94f52e271a feat: improve template.yaml 2025-12-04 11:55:12 +08:00
ulleo 69819a58fa feat: improve template.yaml 2025-12-03 15:12:07 +08:00
wangjiahao 2b13dc7f93 refactor: Recommended questions display ten by default. 2025-12-01 16:52:41 +08:00
王嘉豪 e881b3ef47 feat:The generation of dialogue titles is intelligently generated by LLM (#494) 2025-11-26 10:37:44 +08:00
ulleo 7b3b45e374 perf: improve generate Oracle SQL 2025-11-25 15:52:51 +08:00
ulleo 85b19fb40b perf: improve generate Oracle SQL 2025-11-24 18:57:50 +08:00
ulleo 7cfca5a7a5 perf: improve generate SQL with row permission 2025-11-20 18:21:24 +08:00
ulleo 73778c67c6 fix: add default order in multi line chart
#364
2025-11-06 16:40:48 +08:00
ulleo 99ac3e96cc feat: improve generate sql template 2025-10-23 14:07:16 +08:00
ulleo 07b4d9ef3b feat: improve generate sql template 2025-10-23 13:56:28 +08:00
ulleo 55fb063f6e feat: improve generate sql template
1.Add parameter: GENERATE_SQL_QUERY_LIMIT_ENABLED (default value is True to control data return Limit 1000 rows)
2.Use different SQL example templates based on different data sources.
2025-10-15 18:34:47 +08:00