452 Commits

Author SHA1 Message Date
lexluo09
f60c1675cd [improvement](chat) udpate EmbeddingConfig embeddingStorePersistentPath and if the persistentPath directory does not exist, create the directory. (#550) 2023-12-19 16:12:11 +08:00
lexluo09
1d9b6d6877 [improvement](chat) optimize functionCall result format (#549) 2023-12-19 15:46:17 +08:00
LXW
d8930e8906 (improvement)(chat) Optimize the conditions for chatDemo loading (#548)
Co-authored-by: jolunoluo
2023-12-19 14:57:30 +08:00
lexluo09
c68df24375 [improvement](chat) Fix get metrics error in queryReqConverter (#547) 2023-12-19 14:29:18 +08:00
lexluo09
bb1001677d [improvement](chat) Fix the issue of having empty elements in addFieldsToSelect. (#545) 2023-12-19 11:54:28 +08:00
lexluo09
7a1cfbcef8 (improvement)(build) moveToRuntime checks if the tar.gz file exists, and if it doesn't, no operation is performed. (#544) 2023-12-19 11:02:35 +08:00
lexluo09
67b9c4bf79 (improvement)(chat) update description in s2SQLParameter (#543) 2023-12-18 23:18:05 +08:00
LXW
7cb7697353 (improvement)(chat) Modify the order of demo loaders (#542)
Co-authored-by: jolunoluo
2023-12-18 23:15:23 +08:00
lexluo09
3e18655c69 (improvement)(chat) add description to sqlGenerationMode (#541) 2023-12-18 22:51:21 +08:00
LXW
e7d52f87f0 (improvement)(python) run.py read files in utf-8 format (#540)
Co-authored-by: jolunoluo
2023-12-18 22:07:27 +08:00
lexluo09
2cd8f8022b [improvement](chat) fix SqlGeneration format issues (#539) 2023-12-18 22:05:43 +08:00
lexluo09
e08435902a [improvement](chat) fix SqlGeneration format issues (#538) 2023-12-18 22:04:40 +08:00
lexluo09
b44fa2bf3c [improvement](chat) fix unit test not right (#537) 2023-12-18 21:27:12 +08:00
LXW
d7f1f06daf (improvement)(chat) Remove candidateParses in ParseResp (#536)
Co-authored-by: jolunoluo
2023-12-18 21:10:53 +08:00
lexluo09
4c26e0c972 [improvement](project) update mvn version to 0.8.2 and update changelog (#535) 2023-12-18 20:51:55 +08:00
LXW
d7fafa361d (improvement)(chat) Switching metric supports default aggregation method of metric (#534)
Co-authored-by: jolunoluo
2023-12-18 18:51:21 +08:00
Scott
0c69651ef3 (fix):remove parantheses in generated sql (#532) 2023-12-18 17:57:06 +08:00
tristanliu
b5fdbfbbf6 [improvement][semantic-fe] Changing the line type for canvas connections. (#531)
* [improvement][semantic-fe] Add model alias setting & Add view permission restrictions to the model permission management tab.
[improvement][semantic-fe] Add permission control to the action buttons for the main domain; apply high sensitivity filtering to the authorization of metrics/dimensions.
[improvement][semantic-fe] Optimize the editing mode in the dimension/metric/datasource components to use the modelId stored in the database for data, instead of relying on the data from the state manager.

* [improvement][semantic-fe] Add time granularity setting in the data source configuration.

* [improvement][semantic-fe] Dictionary import for dimension values supported in Q&A visibility

* [improvement][semantic-fe] Modification of data source creation prompt wording"

* [improvement][semantic-fe] metric market experience optimization

* [improvement][semantic-fe] enhance the analysis of metric trends

* [improvement][semantic-fe] optimize the presentation of metric trend permissions

* [improvement][semantic-fe] add metric trend download functionality

* [improvement][semantic-fe] fix the dimension initialization issue in metric correlation

* [improvement][semantic-fe] Fix the issue of database changes not taking effect when creating based on an SQL data source.

* [improvement][semantic-fe] Optimizing pagination logic and some CSS styles

* [improvement][semantic-fe] Fixing the API for the indicator list by changing "current" to "pageNum"

* [improvement][semantic-fe] Fixing the default value setting for the indicator list

* [improvement][semantic-fe] Adding batch operations for indicators/dimensions/models

* [improvement][semantic-fe] Replacing the single status update API for indicators/dimensions with a batch update API

* [improvement][semantic-fe] Redesigning the indicator homepage to incorporate trend charts and table functionality for indicators

* [improvement][semantic-fe] Optimizing the logic for setting dimension values and editing data sources, and adding system settings functionality

* [improvement][semantic-fe] Upgrading antd version to 5.x, extracting the batch operation button component, optimizing the interaction for system settings, and expanding the configuration generation types for list-to-select component.

* [improvement][semantic-fe] Adding the ability to filter dimensions based on whether they are tags or not.

* [improvement][semantic-fe] Adding the ability to edit relationships between models in the canvas.

* [improvement][semantic-fe] Updating the datePicker component to use dayjs instead.

* [improvement][semantic-fe] Fixing the issue with passing the model ID for dimensions in the indicator market.

* [improvement][semantic-fe] Fixing the abnormal state of the popup when creating a model.

* [improvement][semantic-fe] Adding permission logic for bulk operations in the indicator market.

* [improvement][semantic-fe] Adding the ability to download and transpose data.

* [improvement][semantic-fe] Fixing the initialization issue with the date selection component in the indicator details page when switching time granularity.

* [improvement][semantic-fe] Fixing the logic error in the dimension value setting.

* [improvement][semantic-fe] Fixing the synchronization issue with the question and answer settings information.

* [improvement][semantic-fe] Optimizing the canvas functionality for better performance and user experience.

* [improvement][semantic-fe] Optimizing the update process for drawing model relationship edges in the canvas.

* [improvement][semantic-fe] Changing the line type for canvas connections.
2023-12-18 16:37:53 +08:00
LXW
33a2688e77 (improvement)(semantic) Add default canvas display data (#530)
Co-authored-by: jolunoluo
2023-12-18 15:45:16 +08:00
LXW
6bd97cd8af (improvement)(script) Update bat script (#529)
Co-authored-by: jolunoluo
2023-12-18 14:07:30 +08:00
LXW
64615cbef9 (improvement)(semantic) Querying dimension values supports models without time dimensions (#528)
Co-authored-by: jolunoluo
2023-12-18 13:18:18 +08:00
tristanliu
dfb3b59984 [improvement][semantic-fe] Optimizing the update process for drawing model relationship edges in the canvas. (#527)
* [improvement][semantic-fe] Add model alias setting & Add view permission restrictions to the model permission management tab.
[improvement][semantic-fe] Add permission control to the action buttons for the main domain; apply high sensitivity filtering to the authorization of metrics/dimensions.
[improvement][semantic-fe] Optimize the editing mode in the dimension/metric/datasource components to use the modelId stored in the database for data, instead of relying on the data from the state manager.

* [improvement][semantic-fe] Add time granularity setting in the data source configuration.

* [improvement][semantic-fe] Dictionary import for dimension values supported in Q&A visibility

* [improvement][semantic-fe] Modification of data source creation prompt wording"

* [improvement][semantic-fe] metric market experience optimization

* [improvement][semantic-fe] enhance the analysis of metric trends

* [improvement][semantic-fe] optimize the presentation of metric trend permissions

* [improvement][semantic-fe] add metric trend download functionality

* [improvement][semantic-fe] fix the dimension initialization issue in metric correlation

* [improvement][semantic-fe] Fix the issue of database changes not taking effect when creating based on an SQL data source.

* [improvement][semantic-fe] Optimizing pagination logic and some CSS styles

* [improvement][semantic-fe] Fixing the API for the indicator list by changing "current" to "pageNum"

* [improvement][semantic-fe] Fixing the default value setting for the indicator list

* [improvement][semantic-fe] Adding batch operations for indicators/dimensions/models

* [improvement][semantic-fe] Replacing the single status update API for indicators/dimensions with a batch update API

* [improvement][semantic-fe] Redesigning the indicator homepage to incorporate trend charts and table functionality for indicators

* [improvement][semantic-fe] Optimizing the logic for setting dimension values and editing data sources, and adding system settings functionality

* [improvement][semantic-fe] Upgrading antd version to 5.x, extracting the batch operation button component, optimizing the interaction for system settings, and expanding the configuration generation types for list-to-select component.

* [improvement][semantic-fe] Adding the ability to filter dimensions based on whether they are tags or not.

* [improvement][semantic-fe] Adding the ability to edit relationships between models in the canvas.

* [improvement][semantic-fe] Updating the datePicker component to use dayjs instead.

* [improvement][semantic-fe] Fixing the issue with passing the model ID for dimensions in the indicator market.

* [improvement][semantic-fe] Fixing the abnormal state of the popup when creating a model.

* [improvement][semantic-fe] Adding permission logic for bulk operations in the indicator market.

* [improvement][semantic-fe] Adding the ability to download and transpose data.

* [improvement][semantic-fe] Fixing the initialization issue with the date selection component in the indicator details page when switching time granularity.

* [improvement][semantic-fe] Fixing the logic error in the dimension value setting.

* [improvement][semantic-fe] Fixing the synchronization issue with the question and answer settings information.

* [improvement][semantic-fe] Optimizing the canvas functionality for better performance and user experience.

* [improvement][semantic-fe] Optimizing the update process for drawing model relationship edges in the canvas.
2023-12-18 10:53:42 +08:00
LXW
61641ecb00 (improvement)(chat) The history record only retains the query result of the first parse (#526)
Co-authored-by: jolunoluo
2023-12-18 10:20:50 +08:00
lexluo09
5016881ce3 [improvement](chat) Add EmbeddingPersistentTask to Persist and reload InMemoryS2EmbeddingStore (#525) 2023-12-17 21:53:21 +08:00
lexluo09
fe75b3e393 [improvement](chat) Add persistence to InMemoryEmbeddingStore, fix the issue of PythonServiceS2EmbeddingStore being empty. (#524) 2023-12-17 11:04:29 +08:00
jerryjzhang
3db443f9b1 [improvement][docs]Revise certain descriptions in README 2023-12-16 22:12:36 +08:00
lexluo09
59c21ea19a [improvement](chat) support filterCondition in InMemoryS2EmbeddingStore (#523) 2023-12-16 20:04:01 +08:00
lexluo09
95334441b1 [improvement](build) Support building pyllm separately. (#522) 2023-12-16 18:44:34 +08:00
lexluo09
276b224c13 [improvement](chat) Support sqlGenerationMode in python interface (#521) 2023-12-16 17:24:24 +08:00
lexluo09
f03da53d6f [improvement](chat) Support frontend configuration for S2SQL generation method. (#520) 2023-12-16 17:10:34 +08:00
lexluo09
9201550027 [improvement](chat) Support new four methods of generating SQL using SqlGeneration large models. (#519) 2023-12-16 14:44:56 +08:00
jipeli
c86cd9f901 [improvement][semantic] refactor zipper source type (#518)
Co-authored-by: jipengli <jipengli@tencent.com>
2023-12-15 21:47:35 +08:00
tristanliu
ef8caea9d2 [improvement][semantic-fe] Optimizing the canvas functionality for better performance and user experience. (#517)
* [improvement][semantic-fe] Add model alias setting & Add view permission restrictions to the model permission management tab.
[improvement][semantic-fe] Add permission control to the action buttons for the main domain; apply high sensitivity filtering to the authorization of metrics/dimensions.
[improvement][semantic-fe] Optimize the editing mode in the dimension/metric/datasource components to use the modelId stored in the database for data, instead of relying on the data from the state manager.

* [improvement][semantic-fe] Add time granularity setting in the data source configuration.

* [improvement][semantic-fe] Dictionary import for dimension values supported in Q&A visibility

* [improvement][semantic-fe] Modification of data source creation prompt wording"

* [improvement][semantic-fe] metric market experience optimization

* [improvement][semantic-fe] enhance the analysis of metric trends

* [improvement][semantic-fe] optimize the presentation of metric trend permissions

* [improvement][semantic-fe] add metric trend download functionality

* [improvement][semantic-fe] fix the dimension initialization issue in metric correlation

* [improvement][semantic-fe] Fix the issue of database changes not taking effect when creating based on an SQL data source.

* [improvement][semantic-fe] Optimizing pagination logic and some CSS styles

* [improvement][semantic-fe] Fixing the API for the indicator list by changing "current" to "pageNum"

* [improvement][semantic-fe] Fixing the default value setting for the indicator list

* [improvement][semantic-fe] Adding batch operations for indicators/dimensions/models

* [improvement][semantic-fe] Replacing the single status update API for indicators/dimensions with a batch update API

* [improvement][semantic-fe] Redesigning the indicator homepage to incorporate trend charts and table functionality for indicators

* [improvement][semantic-fe] Optimizing the logic for setting dimension values and editing data sources, and adding system settings functionality

* [improvement][semantic-fe] Upgrading antd version to 5.x, extracting the batch operation button component, optimizing the interaction for system settings, and expanding the configuration generation types for list-to-select component.

* [improvement][semantic-fe] Adding the ability to filter dimensions based on whether they are tags or not.

* [improvement][semantic-fe] Adding the ability to edit relationships between models in the canvas.

* [improvement][semantic-fe] Updating the datePicker component to use dayjs instead.

* [improvement][semantic-fe] Fixing the issue with passing the model ID for dimensions in the indicator market.

* [improvement][semantic-fe] Fixing the abnormal state of the popup when creating a model.

* [improvement][semantic-fe] Adding permission logic for bulk operations in the indicator market.

* [improvement][semantic-fe] Adding the ability to download and transpose data.

* [improvement][semantic-fe] Fixing the initialization issue with the date selection component in the indicator details page when switching time granularity.

* [improvement][semantic-fe] Fixing the logic error in the dimension value setting.

* [improvement][semantic-fe] Fixing the synchronization issue with the question and answer settings information.

* [improvement][semantic-fe] Optimizing the canvas functionality for better performance and user experience.
2023-12-15 19:12:34 +08:00
williamhliu
6daaff8c30 (feature)(chat-sdk) show showcase button in mobile mode (#516) 2023-12-15 18:19:57 +08:00
williamhliu
4b00c16eb7 (feature)(chat-sdk) modify the method for obtaining similar questions and recommended drill-down dimensions; do not display assistant button when there is only one assistant (#514) 2023-12-15 17:41:35 +08:00
LXW
4dae84034e (improvement)(chat) Rename SimilarMetricProcessor, SimilarQueryProcessor to MetricRecommendProcessor, QueryRecommendProcessor (#513)
Co-authored-by: jolunoluo
2023-12-15 14:56:44 +08:00
LXW
e6eac03ec6 (improvement)(chat) Rename DrillDownDimensionProcessor to DimensionRecommendProcessor (#512)
Co-authored-by: jolunoluo
2023-12-15 11:48:41 +08:00
LXW
e9a479e2df (improvement)(chat) Add DrillDownDimensionProcessor and SimilarQueryProcessor to obtain recommended dimensions and similar queries (#511)
Co-authored-by: jolunoluo
2023-12-15 10:27:33 +08:00
lexluo09
7db1cc270e [improvement](chat) fix InProcess config (#509) 2023-12-14 17:10:27 +08:00
tristanliu
3bf5b86535 [improvement][semantic-fe] Fixing the synchronization issue with the question and answer settings information. (#508)
* [improvement][semantic-fe] Add model alias setting & Add view permission restrictions to the model permission management tab.
[improvement][semantic-fe] Add permission control to the action buttons for the main domain; apply high sensitivity filtering to the authorization of metrics/dimensions.
[improvement][semantic-fe] Optimize the editing mode in the dimension/metric/datasource components to use the modelId stored in the database for data, instead of relying on the data from the state manager.

* [improvement][semantic-fe] Add time granularity setting in the data source configuration.

* [improvement][semantic-fe] Dictionary import for dimension values supported in Q&A visibility

* [improvement][semantic-fe] Modification of data source creation prompt wording"

* [improvement][semantic-fe] metric market experience optimization

* [improvement][semantic-fe] enhance the analysis of metric trends

* [improvement][semantic-fe] optimize the presentation of metric trend permissions

* [improvement][semantic-fe] add metric trend download functionality

* [improvement][semantic-fe] fix the dimension initialization issue in metric correlation

* [improvement][semantic-fe] Fix the issue of database changes not taking effect when creating based on an SQL data source.

* [improvement][semantic-fe] Optimizing pagination logic and some CSS styles

* [improvement][semantic-fe] Fixing the API for the indicator list by changing "current" to "pageNum"

* [improvement][semantic-fe] Fixing the default value setting for the indicator list

* [improvement][semantic-fe] Adding batch operations for indicators/dimensions/models

* [improvement][semantic-fe] Replacing the single status update API for indicators/dimensions with a batch update API

* [improvement][semantic-fe] Redesigning the indicator homepage to incorporate trend charts and table functionality for indicators

* [improvement][semantic-fe] Optimizing the logic for setting dimension values and editing data sources, and adding system settings functionality

* [improvement][semantic-fe] Upgrading antd version to 5.x, extracting the batch operation button component, optimizing the interaction for system settings, and expanding the configuration generation types for list-to-select component.

* [improvement][semantic-fe] Adding the ability to filter dimensions based on whether they are tags or not.

* [improvement][semantic-fe] Adding the ability to edit relationships between models in the canvas.

* [improvement][semantic-fe] Updating the datePicker component to use dayjs instead.

* [improvement][semantic-fe] Fixing the issue with passing the model ID for dimensions in the indicator market.

* [improvement][semantic-fe] Fixing the abnormal state of the popup when creating a model.

* [improvement][semantic-fe] Adding permission logic for bulk operations in the indicator market.

* [improvement][semantic-fe] Adding the ability to download and transpose data.

* [improvement][semantic-fe] Fixing the initialization issue with the date selection component in the indicator details page when switching time granularity.

* [improvement][semantic-fe] Fixing the logic error in the dimension value setting.

* [improvement][semantic-fe] Fixing the synchronization issue with the question and answer settings information.
2023-12-14 16:37:19 +08:00
lexluo09
3d30632b41 [improvement](python) Remove unused Python-related files (#507) 2023-12-14 15:19:52 +08:00
lexluo09
287a6561ff [improvement](chat) Add an in_process provider and support offline loading of local embedding models. (#505) 2023-12-14 14:16:03 +08:00
jerryjzhang
169262cc62 [improvement][doc]Compile new project description 2023-12-14 13:11:39 +08:00
LXW
fda5a577d6 (improvement)(chat) rename QueryResponder to ExecuteResultProcessor and add ResultProcessor (#504)
Co-authored-by: jolunoluo
2023-12-13 22:16:42 +08:00
LXW
f89be48e98 (improvement)(semantic) save metric default query config (#503)
Co-authored-by: jolunoluo
2023-12-13 21:29:15 +08:00
LXW
2c7afd0d55 (improvement)(common) add sys parameter description (#502)
Co-authored-by: jolunoluo
2023-12-13 21:02:56 +08:00
lexluo09
2ad0553f6c [improvement](chat) fix concurrentModificationException in a multi-threaded environment. (#501) 2023-12-13 13:26:01 +08:00
lexluo09
340cb2c835 [improvement](chat) Resolve the issue of an empty result in schemaLinkParse. (#500) 2023-12-13 11:18:15 +08:00
tristanliu
caefa501f2 [improvement][semantic-fe] Fixing the logic error in the dimension value setting. (#499)
* [improvement][semantic-fe] Add model alias setting & Add view permission restrictions to the model permission management tab.
[improvement][semantic-fe] Add permission control to the action buttons for the main domain; apply high sensitivity filtering to the authorization of metrics/dimensions.
[improvement][semantic-fe] Optimize the editing mode in the dimension/metric/datasource components to use the modelId stored in the database for data, instead of relying on the data from the state manager.

* [improvement][semantic-fe] Add time granularity setting in the data source configuration.

* [improvement][semantic-fe] Dictionary import for dimension values supported in Q&A visibility

* [improvement][semantic-fe] Modification of data source creation prompt wording"

* [improvement][semantic-fe] metric market experience optimization

* [improvement][semantic-fe] enhance the analysis of metric trends

* [improvement][semantic-fe] optimize the presentation of metric trend permissions

* [improvement][semantic-fe] add metric trend download functionality

* [improvement][semantic-fe] fix the dimension initialization issue in metric correlation

* [improvement][semantic-fe] Fix the issue of database changes not taking effect when creating based on an SQL data source.

* [improvement][semantic-fe] Optimizing pagination logic and some CSS styles

* [improvement][semantic-fe] Fixing the API for the indicator list by changing "current" to "pageNum"

* [improvement][semantic-fe] Fixing the default value setting for the indicator list

* [improvement][semantic-fe] Adding batch operations for indicators/dimensions/models

* [improvement][semantic-fe] Replacing the single status update API for indicators/dimensions with a batch update API

* [improvement][semantic-fe] Redesigning the indicator homepage to incorporate trend charts and table functionality for indicators

* [improvement][semantic-fe] Optimizing the logic for setting dimension values and editing data sources, and adding system settings functionality

* [improvement][semantic-fe] Upgrading antd version to 5.x, extracting the batch operation button component, optimizing the interaction for system settings, and expanding the configuration generation types for list-to-select component.

* [improvement][semantic-fe] Adding the ability to filter dimensions based on whether they are tags or not.

* [improvement][semantic-fe] Adding the ability to edit relationships between models in the canvas.

* [improvement][semantic-fe] Updating the datePicker component to use dayjs instead.

* [improvement][semantic-fe] Fixing the issue with passing the model ID for dimensions in the indicator market.

* [improvement][semantic-fe] Fixing the abnormal state of the popup when creating a model.

* [improvement][semantic-fe] Adding permission logic for bulk operations in the indicator market.

* [improvement][semantic-fe] Adding the ability to download and transpose data.

* [improvement][semantic-fe] Fixing the initialization issue with the date selection component in the indicator details page when switching time granularity.

* [improvement][semantic-fe] Fixing the logic error in the dimension value setting.
2023-12-12 19:40:24 +08:00
lexluo09
5c96d75d39 [improvement](project) If there are any failed operations during the build process, stop subsequent operations and issue a unified 'stop' command. (#498) 2023-12-12 17:13:57 +08:00
jerryjzhang
86c2f96942 [improvement][fix]Fix codestyle 2023-12-12 15:57:37 +08:00
lexluo09
73899e3174 [improvement](chat) Change llmparser to pyllm, retrieve LLMProxy from environment variables, defaulting to JavaLLMProxy. (#497) 2023-12-12 14:29:35 +08:00
Scott
49bb2c6d8b fix:use correct sql generated mode in java code (#496) 2023-12-11 21:46:57 +08:00
williamhliu
9223a4f856 (feature)(webapp) change sql text (#495) 2023-12-11 19:56:53 +08:00
Scott
f3f60af231 (fix):fix python service interact (#494) 2023-12-11 19:31:36 +08:00
jerryjzhang
3cdfcae01c [improvement][chat]Add javadoc to Mapper related classes 2023-12-11 18:07:26 +08:00
lexluo09
0c6efada43 [improvement](chat) Merge HanlpDictMapper and FuzzyNameMapper into KeywordMapper. (#493)
Co-authored-by: lexluo <lexluo@tencent.com>
2023-12-11 17:22:57 +08:00
codescracker
d79f73eab6 add auto-CoT feature (#483)
* 1.refactor the retrieval module. 2.refactor the http service module. 3.upgrade text2sql output format the parse for absolute time related expression in query.

* fix bug.

* upgrade the config module, now support config llm suppoted by langchain.

* fix conflicts.

* update text2sql config reload to be compitable with new config format.

* modify default config.

* 1.add self-consistency feature for text2sql. 2.upgrade llm api call from sync to async. 3.refactor text2sql module. 4. refactor semantical retriever modules.

* merege with upstream master

* add general retrieve service.

* add api service for sql_agent for crud opereations of few-shots examples.

* modify requirements

* add auto-cot feature

---------

Co-authored-by: shaoweigong <shaoweigong@tencent.com>
2023-12-11 16:07:49 +08:00
lexluo09
3ae720ef30 [improvement](chat) add log4j-api in pom (#492) 2023-12-11 12:26:32 +08:00
jerryjzhang
221e88de0f [improvement][common]Replace QueryType.OTHER with ID 2023-12-11 11:47:50 +08:00
lexluo09
23d926f195 [improvement](chat) remove ModelProvider and in_memory (#491) 2023-12-11 11:17:30 +08:00
lexluo09
97b11ec244 [improvement](chat) default use AllMiniLmL6V2EmbeddingModel (#490) 2023-12-11 11:01:47 +08:00
lexluo09
899047dbd1 [improvement](chat) Adjust related packages, add other SqlGeneration implementations, and rename EmbedLLMProxy to JavaLLMProxy. (#489) 2023-12-11 10:24:22 +08:00
Scott
cb4b91878f fix:add base url (#488) 2023-12-10 20:55:47 +08:00
lexluo09
6af661459c Add SqlGeneration abstraction and implementation, optimize LLMSqlParser skip. (#487) 2023-12-10 11:34:48 +08:00
lexluo09
0e0ba51750 [improvement](chat) Resolving jtokkit JAR package conflicts. (#486) 2023-12-09 00:43:30 +08:00
lexluo09
a5c32ac064 [improvement](chat) Remove unnecessary pom imports, optimize code, and adapt the test project. (#485) 2023-12-08 20:03:42 +08:00
lexluo09
abbe8c84a1 [improvement](python) LLM related services support Java service invocation (#484) 2023-12-08 19:24:58 +08:00
tristanliu
6c0f88d8b5 [improvement][semantic-fe] Fixing the initialization issue with the date selection component in the indicator details page when switching time granularity. (#482)
* [improvement][semantic-fe] Add model alias setting & Add view permission restrictions to the model permission management tab.
[improvement][semantic-fe] Add permission control to the action buttons for the main domain; apply high sensitivity filtering to the authorization of metrics/dimensions.
[improvement][semantic-fe] Optimize the editing mode in the dimension/metric/datasource components to use the modelId stored in the database for data, instead of relying on the data from the state manager.

* [improvement][semantic-fe] Add time granularity setting in the data source configuration.

* [improvement][semantic-fe] Dictionary import for dimension values supported in Q&A visibility

* [improvement][semantic-fe] Modification of data source creation prompt wording"

* [improvement][semantic-fe] metric market experience optimization

* [improvement][semantic-fe] enhance the analysis of metric trends

* [improvement][semantic-fe] optimize the presentation of metric trend permissions

* [improvement][semantic-fe] add metric trend download functionality

* [improvement][semantic-fe] fix the dimension initialization issue in metric correlation

* [improvement][semantic-fe] Fix the issue of database changes not taking effect when creating based on an SQL data source.

* [improvement][semantic-fe] Optimizing pagination logic and some CSS styles

* [improvement][semantic-fe] Fixing the API for the indicator list by changing "current" to "pageNum"

* [improvement][semantic-fe] Fixing the default value setting for the indicator list

* [improvement][semantic-fe] Adding batch operations for indicators/dimensions/models

* [improvement][semantic-fe] Replacing the single status update API for indicators/dimensions with a batch update API

* [improvement][semantic-fe] Redesigning the indicator homepage to incorporate trend charts and table functionality for indicators

* [improvement][semantic-fe] Optimizing the logic for setting dimension values and editing data sources, and adding system settings functionality

* [improvement][semantic-fe] Upgrading antd version to 5.x, extracting the batch operation button component, optimizing the interaction for system settings, and expanding the configuration generation types for list-to-select component.

* [improvement][semantic-fe] Adding the ability to filter dimensions based on whether they are tags or not.

* [improvement][semantic-fe] Adding the ability to edit relationships between models in the canvas.

* [improvement][semantic-fe] Updating the datePicker component to use dayjs instead.

* [improvement][semantic-fe] Fixing the issue with passing the model ID for dimensions in the indicator market.

* [improvement][semantic-fe] Fixing the abnormal state of the popup when creating a model.

* [improvement][semantic-fe] Adding permission logic for bulk operations in the indicator market.

* [improvement][semantic-fe] Adding the ability to download and transpose data.

* [improvement][semantic-fe] Fixing the initialization issue with the date selection component in the indicator details page when switching time granularity.
2023-12-08 15:08:12 +08:00
LXW
68ada561ac (fix)(test) fix test compile error (#481)
Co-authored-by: jolunoluo
2023-12-08 13:34:12 +08:00
LXW
18b52ec742 (improvement)(semantic) Metric homepage download supports choosing whether to transform (#480)
Co-authored-by: jolunoluo
2023-12-08 13:20:27 +08:00
lexluo09
ca8d7d89c1 (improvement)(build) When remove runtimeDir in the build script, add prefix deletion handling. (#479) 2023-12-07 10:27:02 +08:00
williamhliu
e6ab7cb5ff (fix)(chat-sdk) fix date change bug and hide recommend metrics tip when no metrics (#478) 2023-12-06 20:54:31 +08:00
LXW
9679169e6f (improvement)(semantic) Metric homepage download supports choosing whether to transform (#477)
Co-authored-by: jolunoluo
2023-12-06 18:02:20 +08:00
lexluo09
ed0f856438 [improvement](chat) Unified vector-related interfaces to go through EmbeddingUtils. (#476) 2023-12-06 14:50:57 +08:00
Scott
9aa5c93d9d fix:consider alias of metric when correct group sql (#475) 2023-12-06 14:10:37 +08:00
tristanliu
b45592c009 [improvement][semantic-fe] Adding the ability to download and transpose data. (#474)
* [improvement][semantic-fe] Add model alias setting & Add view permission restrictions to the model permission management tab.
[improvement][semantic-fe] Add permission control to the action buttons for the main domain; apply high sensitivity filtering to the authorization of metrics/dimensions.
[improvement][semantic-fe] Optimize the editing mode in the dimension/metric/datasource components to use the modelId stored in the database for data, instead of relying on the data from the state manager.

* [improvement][semantic-fe] Add time granularity setting in the data source configuration.

* [improvement][semantic-fe] Dictionary import for dimension values supported in Q&A visibility

* [improvement][semantic-fe] Modification of data source creation prompt wording"

* [improvement][semantic-fe] metric market experience optimization

* [improvement][semantic-fe] enhance the analysis of metric trends

* [improvement][semantic-fe] optimize the presentation of metric trend permissions

* [improvement][semantic-fe] add metric trend download functionality

* [improvement][semantic-fe] fix the dimension initialization issue in metric correlation

* [improvement][semantic-fe] Fix the issue of database changes not taking effect when creating based on an SQL data source.

* [improvement][semantic-fe] Optimizing pagination logic and some CSS styles

* [improvement][semantic-fe] Fixing the API for the indicator list by changing "current" to "pageNum"

* [improvement][semantic-fe] Fixing the default value setting for the indicator list

* [improvement][semantic-fe] Adding batch operations for indicators/dimensions/models

* [improvement][semantic-fe] Replacing the single status update API for indicators/dimensions with a batch update API

* [improvement][semantic-fe] Redesigning the indicator homepage to incorporate trend charts and table functionality for indicators

* [improvement][semantic-fe] Optimizing the logic for setting dimension values and editing data sources, and adding system settings functionality

* [improvement][semantic-fe] Upgrading antd version to 5.x, extracting the batch operation button component, optimizing the interaction for system settings, and expanding the configuration generation types for list-to-select component.

* [improvement][semantic-fe] Adding the ability to filter dimensions based on whether they are tags or not.

* [improvement][semantic-fe] Adding the ability to edit relationships between models in the canvas.

* [improvement][semantic-fe] Updating the datePicker component to use dayjs instead.

* [improvement][semantic-fe] Fixing the issue with passing the model ID for dimensions in the indicator market.

* [improvement][semantic-fe] Fixing the abnormal state of the popup when creating a model.

* [improvement][semantic-fe] Adding permission logic for bulk operations in the indicator market.

* [improvement][semantic-fe] Adding the ability to download and transpose data.
2023-12-06 11:34:51 +08:00
tristanliu
6e0fa95e6f [improvement][semantic-fe] Adding permission logic for bulk operations in the indicator market. (#471)
* [improvement][semantic-fe] Add model alias setting & Add view permission restrictions to the model permission management tab.
[improvement][semantic-fe] Add permission control to the action buttons for the main domain; apply high sensitivity filtering to the authorization of metrics/dimensions.
[improvement][semantic-fe] Optimize the editing mode in the dimension/metric/datasource components to use the modelId stored in the database for data, instead of relying on the data from the state manager.

* [improvement][semantic-fe] Add time granularity setting in the data source configuration.

* [improvement][semantic-fe] Dictionary import for dimension values supported in Q&A visibility

* [improvement][semantic-fe] Modification of data source creation prompt wording"

* [improvement][semantic-fe] metric market experience optimization

* [improvement][semantic-fe] enhance the analysis of metric trends

* [improvement][semantic-fe] optimize the presentation of metric trend permissions

* [improvement][semantic-fe] add metric trend download functionality

* [improvement][semantic-fe] fix the dimension initialization issue in metric correlation

* [improvement][semantic-fe] Fix the issue of database changes not taking effect when creating based on an SQL data source.

* [improvement][semantic-fe] Optimizing pagination logic and some CSS styles

* [improvement][semantic-fe] Fixing the API for the indicator list by changing "current" to "pageNum"

* [improvement][semantic-fe] Fixing the default value setting for the indicator list

* [improvement][semantic-fe] Adding batch operations for indicators/dimensions/models

* [improvement][semantic-fe] Replacing the single status update API for indicators/dimensions with a batch update API

* [improvement][semantic-fe] Redesigning the indicator homepage to incorporate trend charts and table functionality for indicators

* [improvement][semantic-fe] Optimizing the logic for setting dimension values and editing data sources, and adding system settings functionality

* [improvement][semantic-fe] Upgrading antd version to 5.x, extracting the batch operation button component, optimizing the interaction for system settings, and expanding the configuration generation types for list-to-select component.

* [improvement][semantic-fe] Adding the ability to filter dimensions based on whether they are tags or not.

* [improvement][semantic-fe] Adding the ability to edit relationships between models in the canvas.

* [improvement][semantic-fe] Updating the datePicker component to use dayjs instead.

* [improvement][semantic-fe] Fixing the issue with passing the model ID for dimensions in the indicator market.

* [improvement][semantic-fe] Fixing the abnormal state of the popup when creating a model.

* [improvement][semantic-fe] Adding permission logic for bulk operations in the indicator market.
2023-12-04 20:18:36 +08:00
lexluo09
94f310d17f (improvement)(chat) fix compilation style issues. (#467) 2023-12-04 10:59:31 +08:00
mainmain
2bc29d64a4 (improvement)(chat) rewrite datediff logic and perfect sql style (#461) 2023-12-04 10:41:41 +08:00
Scott
c220ca69c2 fix:convert name or alias to schema element (#465) 2023-12-03 20:22:02 +08:00
LXW
4280aad0a7 (improvement)(semantic) Supply and compatible with mysql demo data (#464)
Co-authored-by: jolunoluo
2023-12-02 23:17:27 +08:00
lexluo09
c98d15059b [improvement][chat]Consider Chinese date fields in MetricCheckProcessor for data (#460) 2023-12-01 11:30:23 +08:00
LXW
a862a83272 (improvement)(chat) SemanticParseInfo removes elements whose model is empty (#459)
* (improvement)(chat) Update spi in test profile

* (improvement)(chat) SemanticParseInfo removes elements whose model is empty

* (improvement)(chat) MetricCheckProcessor compatible time dimension chName

---------

Co-authored-by: jolunoluo
2023-12-01 11:27:07 +08:00
williamhliu
c6d59701db (feature)(webapp) change model name to model names tag (#455) 2023-11-30 21:36:09 +08:00
williamhliu
39a85dc4ed (feature)(webapp) change agent tool enum value (#454) 2023-11-30 21:14:07 +08:00
LXW
507c02a8fd (improvement)(chat) Remove redundant maven dependencies and classes (#453)
Co-authored-by: jolunoluo
2023-11-30 19:36:18 +08:00
tristanliu
380597f0c3 [improvement][semantic-fe] Fixing the abnormal state of the popup when creating a model. (#452)
* [improvement][semantic-fe] Add model alias setting & Add view permission restrictions to the model permission management tab.
[improvement][semantic-fe] Add permission control to the action buttons for the main domain; apply high sensitivity filtering to the authorization of metrics/dimensions.
[improvement][semantic-fe] Optimize the editing mode in the dimension/metric/datasource components to use the modelId stored in the database for data, instead of relying on the data from the state manager.

* [improvement][semantic-fe] Add time granularity setting in the data source configuration.

* [improvement][semantic-fe] Dictionary import for dimension values supported in Q&A visibility

* [improvement][semantic-fe] Modification of data source creation prompt wording"

* [improvement][semantic-fe] metric market experience optimization

* [improvement][semantic-fe] enhance the analysis of metric trends

* [improvement][semantic-fe] optimize the presentation of metric trend permissions

* [improvement][semantic-fe] add metric trend download functionality

* [improvement][semantic-fe] fix the dimension initialization issue in metric correlation

* [improvement][semantic-fe] Fix the issue of database changes not taking effect when creating based on an SQL data source.

* [improvement][semantic-fe] Optimizing pagination logic and some CSS styles

* [improvement][semantic-fe] Fixing the API for the indicator list by changing "current" to "pageNum"

* [improvement][semantic-fe] Fixing the default value setting for the indicator list

* [improvement][semantic-fe] Adding batch operations for indicators/dimensions/models

* [improvement][semantic-fe] Replacing the single status update API for indicators/dimensions with a batch update API

* [improvement][semantic-fe] Redesigning the indicator homepage to incorporate trend charts and table functionality for indicators

* [improvement][semantic-fe] Optimizing the logic for setting dimension values and editing data sources, and adding system settings functionality

* [improvement][semantic-fe] Upgrading antd version to 5.x, extracting the batch operation button component, optimizing the interaction for system settings, and expanding the configuration generation types for list-to-select component.

* [improvement][semantic-fe] Adding the ability to filter dimensions based on whether they are tags or not.

* [improvement][semantic-fe] Adding the ability to edit relationships between models in the canvas.

* [improvement][semantic-fe] Updating the datePicker component to use dayjs instead.

* [improvement][semantic-fe] Fixing the issue with passing the model ID for dimensions in the indicator market.

* [improvement][semantic-fe] Fixing the abnormal state of the popup when creating a model.
2023-11-30 18:48:41 +08:00
mainmain
e469c449b4 [improvement] supersonic adapt checkstyle (#451) 2023-11-30 11:41:55 +08:00
jerryjzhang
f8bdb8a4b4 [improvement][checkstyle]Add multiple empty lines checks 2023-11-30 11:03:22 +08:00
jerryjzhang
d76216a2ec [improvement][chat]Refactor certain packages to make code cleaner 2023-11-30 10:05:45 +08:00
jerryjzhang
82cfb3050d [improvement][chat]Rename LLMInterpreter as LLMProxy 2023-11-29 16:57:48 +08:00
jerryjzhang
57f7d0c67d [improvement][chat]Restructure Agent&Tool package 2023-11-29 16:34:52 +08:00
LXW
c11a242f34 (improvement)(chat) Add model name set in ModelCluster (#449)
Co-authored-by: jolunoluo
2023-11-29 12:13:26 +08:00
jerryjzhang
576fad5fb1 Merge remote-tracking branch 'origin/master' 2023-11-29 10:29:05 +08:00
jerryjzhang
8171d754e0 [improvement][chat]Rename PostProcessor to ResponseProcessor 2023-11-29 10:28:49 +08:00
mainmain
6be0f02c75 [improvement] add database config (#447)
Co-authored-by: zuopengge
2023-11-29 10:14:52 +08:00
LXW
95e3138ab2 (improvement)(chat) Merge ParseResponder into PostProcessor, and change ExecuteResponder to QueryResponder (#448)
Co-authored-by: jolunoluo
2023-11-29 10:08:25 +08:00
lexluo09
3a30a1a317 [improvement](project) Support cspider multi-table association, fix dictionary loading, and repair InternalMetric exceptions. (#446) 2023-11-28 21:16:02 +08:00
LXW
46733d1728 (improvement)(semantic) Batch download compatible with empty data (#445)
Co-authored-by: jolunoluo
2023-11-28 16:38:30 +08:00
lexluo09
b6734d99e1 [improvement](chat) add DemoChatConfig in cspider (#444) 2023-11-28 15:42:13 +08:00
lexluo09
9cb01149f8 [improvement](chat) Optimize the configuration of cspider-related models, and fix the issue of different models having the same dimensionName (#443) 2023-11-28 15:08:46 +08:00
LXW
db88127da9 (fix)(semantic) Modify data type of s2_collect in schema-mysql.sql and fixed startup problem when database data is empty (#442)
Co-authored-by: jolunoluo
2023-11-28 13:55:19 +08:00
Scott
0e492ef402 (fix):fix startup crash (#441)
* (fix):fix startup crash
2023-11-28 13:29:58 +08:00
LXW
4d095f9676 (fix)(chat) Fix query dimension value error (#440)
Co-authored-by: jolunoluo
2023-11-28 01:21:55 +08:00
lexluo09
7c7ccadcfd [improvement](chat) fix checkstyle error in CollectService (#439) 2023-11-28 00:39:22 +08:00
LXW
02b9dc6947 (improvement)(chat) Update ConfigureDemo and dict txt for test (#438)
Co-authored-by: jolunoluo
2023-11-28 00:31:54 +08:00
lexluo09
4222d7e2b5 [improvement](chat) fix filter_condition size ==0 error in python service and update version to '0.8.0-SNAPSHOT' (#437) 2023-11-28 00:27:21 +08:00
tristanliu
b5daf04c96 [improvement][semantic-fe] Fixing the issue with passing the model ID for dimensions in the indicator market. (#436)
* [improvement][semantic-fe] Add model alias setting & Add view permission restrictions to the model permission management tab.
[improvement][semantic-fe] Add permission control to the action buttons for the main domain; apply high sensitivity filtering to the authorization of metrics/dimensions.
[improvement][semantic-fe] Optimize the editing mode in the dimension/metric/datasource components to use the modelId stored in the database for data, instead of relying on the data from the state manager.

* [improvement][semantic-fe] Add time granularity setting in the data source configuration.

* [improvement][semantic-fe] Dictionary import for dimension values supported in Q&A visibility

* [improvement][semantic-fe] Modification of data source creation prompt wording"

* [improvement][semantic-fe] metric market experience optimization

* [improvement][semantic-fe] enhance the analysis of metric trends

* [improvement][semantic-fe] optimize the presentation of metric trend permissions

* [improvement][semantic-fe] add metric trend download functionality

* [improvement][semantic-fe] fix the dimension initialization issue in metric correlation

* [improvement][semantic-fe] Fix the issue of database changes not taking effect when creating based on an SQL data source.

* [improvement][semantic-fe] Optimizing pagination logic and some CSS styles

* [improvement][semantic-fe] Fixing the API for the indicator list by changing "current" to "pageNum"

* [improvement][semantic-fe] Fixing the default value setting for the indicator list

* [improvement][semantic-fe] Adding batch operations for indicators/dimensions/models

* [improvement][semantic-fe] Replacing the single status update API for indicators/dimensions with a batch update API

* [improvement][semantic-fe] Redesigning the indicator homepage to incorporate trend charts and table functionality for indicators

* [improvement][semantic-fe] Optimizing the logic for setting dimension values and editing data sources, and adding system settings functionality

* [improvement][semantic-fe] Upgrading antd version to 5.x, extracting the batch operation button component, optimizing the interaction for system settings, and expanding the configuration generation types for list-to-select component.

* [improvement][semantic-fe] Adding the ability to filter dimensions based on whether they are tags or not.

* [improvement][semantic-fe] Adding the ability to edit relationships between models in the canvas.

* [improvement][semantic-fe] Updating the datePicker component to use dayjs instead.

* [improvement][semantic-fe] Fixing the issue with passing the model ID for dimensions in the indicator market.
2023-11-27 23:38:31 +08:00
lexluo09
d26089a249 [improvement](chat) fix checkstyle in ParseInfoUpdateProcessor (#435) 2023-11-27 23:15:36 +08:00
lexluo09
627683d437 [improvement](chat) fix ParseResponder class compile error (#434) 2023-11-27 23:06:58 +08:00
lexluo09
87e222eecc [improvement](chat) QueryTypeParser tag optimize (#433) 2023-11-27 22:58:24 +08:00
jerryjzhang
667272b103 [improvement](chat)Rename some ParseResponder classes 2023-11-27 22:05:41 +08:00
tristanliu
3f08d95aaa [improvement][semantic-fe] Updating the datePicker component to use dayjs instead. (#432)
* [improvement][semantic-fe] Add model alias setting & Add view permission restrictions to the model permission management tab.
[improvement][semantic-fe] Add permission control to the action buttons for the main domain; apply high sensitivity filtering to the authorization of metrics/dimensions.
[improvement][semantic-fe] Optimize the editing mode in the dimension/metric/datasource components to use the modelId stored in the database for data, instead of relying on the data from the state manager.

* [improvement][semantic-fe] Add time granularity setting in the data source configuration.

* [improvement][semantic-fe] Dictionary import for dimension values supported in Q&A visibility

* [improvement][semantic-fe] Modification of data source creation prompt wording"

* [improvement][semantic-fe] metric market experience optimization

* [improvement][semantic-fe] enhance the analysis of metric trends

* [improvement][semantic-fe] optimize the presentation of metric trend permissions

* [improvement][semantic-fe] add metric trend download functionality

* [improvement][semantic-fe] fix the dimension initialization issue in metric correlation

* [improvement][semantic-fe] Fix the issue of database changes not taking effect when creating based on an SQL data source.

* [improvement][semantic-fe] Optimizing pagination logic and some CSS styles

* [improvement][semantic-fe] Fixing the API for the indicator list by changing "current" to "pageNum"

* [improvement][semantic-fe] Fixing the default value setting for the indicator list

* [improvement][semantic-fe] Adding batch operations for indicators/dimensions/models

* [improvement][semantic-fe] Replacing the single status update API for indicators/dimensions with a batch update API

* [improvement][semantic-fe] Redesigning the indicator homepage to incorporate trend charts and table functionality for indicators

* [improvement][semantic-fe] Optimizing the logic for setting dimension values and editing data sources, and adding system settings functionality

* [improvement][semantic-fe] Upgrading antd version to 5.x, extracting the batch operation button component, optimizing the interaction for system settings, and expanding the configuration generation types for list-to-select component.

* [improvement][semantic-fe] Adding the ability to filter dimensions based on whether they are tags or not.

* [improvement][semantic-fe] Adding the ability to edit relationships between models in the canvas.

* [improvement][semantic-fe] Updating the datePicker component to use dayjs instead.
2023-11-27 21:31:51 +08:00
tristanliu
27ebda3439 [improvement][semantic-fe] Adding the ability to edit relationships between models in the canvas. (#431)
* [improvement][semantic-fe] Add model alias setting & Add view permission restrictions to the model permission management tab.
[improvement][semantic-fe] Add permission control to the action buttons for the main domain; apply high sensitivity filtering to the authorization of metrics/dimensions.
[improvement][semantic-fe] Optimize the editing mode in the dimension/metric/datasource components to use the modelId stored in the database for data, instead of relying on the data from the state manager.

* [improvement][semantic-fe] Add time granularity setting in the data source configuration.

* [improvement][semantic-fe] Dictionary import for dimension values supported in Q&A visibility

* [improvement][semantic-fe] Modification of data source creation prompt wording"

* [improvement][semantic-fe] metric market experience optimization

* [improvement][semantic-fe] enhance the analysis of metric trends

* [improvement][semantic-fe] optimize the presentation of metric trend permissions

* [improvement][semantic-fe] add metric trend download functionality

* [improvement][semantic-fe] fix the dimension initialization issue in metric correlation

* [improvement][semantic-fe] Fix the issue of database changes not taking effect when creating based on an SQL data source.

* [improvement][semantic-fe] Optimizing pagination logic and some CSS styles

* [improvement][semantic-fe] Fixing the API for the indicator list by changing "current" to "pageNum"

* [improvement][semantic-fe] Fixing the default value setting for the indicator list

* [improvement][semantic-fe] Adding batch operations for indicators/dimensions/models

* [improvement][semantic-fe] Replacing the single status update API for indicators/dimensions with a batch update API

* [improvement][semantic-fe] Redesigning the indicator homepage to incorporate trend charts and table functionality for indicators

* [improvement][semantic-fe] Optimizing the logic for setting dimension values and editing data sources, and adding system settings functionality

* [improvement][semantic-fe] Upgrading antd version to 5.x, extracting the batch operation button component, optimizing the interaction for system settings, and expanding the configuration generation types for list-to-select component.

* [improvement][semantic-fe] Adding the ability to filter dimensions based on whether they are tags or not.

* [improvement][semantic-fe] Adding the ability to edit relationships between models in the canvas.
2023-11-27 21:26:55 +08:00
lexluo09
52eca178d3 [improvement](chat) remove FilterCondition in LLMReq (#430) 2023-11-27 20:38:20 +08:00
lexluo09
f5a064aaad [improvement](chat) add TAG to Element and Nature, fix MetricTagQuery queryMode (#429) 2023-11-27 17:51:54 +08:00
lexluo09
41e585324d [improvement](chat) remove Python service and rewrite it using a Java project (#428) 2023-11-27 17:40:10 +08:00
mainmain
c36082476f (improvement)(chat) improve corrector and support sql union (#427) 2023-11-27 17:02:04 +08:00
lexluo09
4bc1378285 [improvement](python) fix examplar datediff('day') to datediff('month') (#426) 2023-11-27 16:29:05 +08:00
williamhliu
23d01c4f83 (feature)(webapp) add query mode in parse tip and change query modes query to METRIC and TAG (#425) 2023-11-27 16:12:10 +08:00
LXW
49ebb70cb3 (improvement)(chat) Modify the query types supported by agent rule-type tools to metric type and tag types (#424)
Co-authored-by: jolunoluo
2023-11-27 15:02:20 +08:00
jipeli
27bb1b322e (improvement) Move out the datasource and merge the datasource with the model, and adapt the chat module (#423)
Co-authored-by: jolunoluo <jolunoluo@tencent.com>
2023-11-27 11:05:24 +08:00
williamhliu
0534053ff9 (feature)(chat-sdk) trend chart supports switch between line and bar,add second drill-down dimensions,chang queryMode from ENTITY to TAG (#422) 2023-11-25 11:13:10 +08:00
lexluo09
fe2a424718 [improvement](project) Switch ENTITY to TAG uniformly in the queryType and semanticQuery (#420) 2023-11-24 18:17:48 +08:00
LXW
d79e30cd7a (improvement)(knowledge) ModelSchema add tag type element (#419)
Co-authored-by: jolunoluo
2023-11-24 17:52:30 +08:00
lexluo09
aa433baa06 [improvement](python) LLM parsing related services support Python service and Java service invocation (#418) 2023-11-24 15:59:29 +08:00
tristanliu
30bb9a1dc0 [improvement][semantic-fe] Adding the ability to filter dimensions based on whether they are tags or not. (#417)
* [improvement][semantic-fe] Add model alias setting & Add view permission restrictions to the model permission management tab.
[improvement][semantic-fe] Add permission control to the action buttons for the main domain; apply high sensitivity filtering to the authorization of metrics/dimensions.
[improvement][semantic-fe] Optimize the editing mode in the dimension/metric/datasource components to use the modelId stored in the database for data, instead of relying on the data from the state manager.

* [improvement][semantic-fe] Add time granularity setting in the data source configuration.

* [improvement][semantic-fe] Dictionary import for dimension values supported in Q&A visibility

* [improvement][semantic-fe] Modification of data source creation prompt wording"

* [improvement][semantic-fe] metric market experience optimization

* [improvement][semantic-fe] enhance the analysis of metric trends

* [improvement][semantic-fe] optimize the presentation of metric trend permissions

* [improvement][semantic-fe] add metric trend download functionality

* [improvement][semantic-fe] fix the dimension initialization issue in metric correlation

* [improvement][semantic-fe] Fix the issue of database changes not taking effect when creating based on an SQL data source.

* [improvement][semantic-fe] Optimizing pagination logic and some CSS styles

* [improvement][semantic-fe] Fixing the API for the indicator list by changing "current" to "pageNum"

* [improvement][semantic-fe] Fixing the default value setting for the indicator list

* [improvement][semantic-fe] Adding batch operations for indicators/dimensions/models

* [improvement][semantic-fe] Replacing the single status update API for indicators/dimensions with a batch update API

* [improvement][semantic-fe] Redesigning the indicator homepage to incorporate trend charts and table functionality for indicators

* [improvement][semantic-fe] Optimizing the logic for setting dimension values and editing data sources, and adding system settings functionality

* [improvement][semantic-fe] Upgrading antd version to 5.x, extracting the batch operation button component, optimizing the interaction for system settings, and expanding the configuration generation types for list-to-select component.

* [improvement][semantic-fe] Adding the ability to filter dimensions based on whether they are tags or not.
2023-11-23 16:29:10 +08:00
LXW
c168925f03 (improvement)(chat) metric check compatible with count(*) (#416)
Co-authored-by: jolunoluo
2023-11-22 18:29:58 +08:00
mainmain
42c0bea8fc [improvement](chat) rule and llm support replace metric (#415)
* [improvement] replace metric

* [improvement] replace metric

* [improvement] supports replace metric

---------

Co-authored-by: zuopengge
2023-11-22 15:05:10 +08:00
LXW
291c00749a (improvement)(semantic) Support dimension search by tag or not, compatible with historical data (#414)
Co-authored-by: jolunoluo
2023-11-22 10:31:35 +08:00
LXW
6763ea0f7b (improvement)(semantic) Support dimension search by tag or not (#413)
Co-authored-by: jolunoluo
2023-11-21 22:06:36 +08:00
lexluo09
f917defea8 [improvement](chat) Converting bizName to Name requires consideration of the time field (#412) 2023-11-21 15:44:00 +08:00
LXW
91718592d4 (improvement)(semantic) Add is_tag label to the dimension and Specify entity alias on datasource primary-key (#411)
Co-authored-by: jolunoluo
2023-11-21 11:44:27 +08:00
mainmain
6d9a8095eb [improvement](chat) adapt checkstyle. (#410) 2023-11-20 20:42:23 +08:00
mainmain
5b8fdbc6fd [improvement](chat) rule and llm supports replace metric (#408) 2023-11-20 17:04:14 +08:00
williamhliu
e15e44e4a2 (feature)(chat-sdk) update antd version to 5 (#409) 2023-11-20 16:58:53 +08:00
LXW
980d317152 (improvement)(common) Add description for sys parameter (#407)
Co-authored-by: jolunoluo
2023-11-20 14:52:47 +08:00
lexluo09
2c23c2f574 [improvement](chat) Fix the shutdown issue with the Python service. (#405) 2023-11-20 13:24:38 +08:00
tristanliu
80ad75503b [improvement][semantic-fe] Upgrading antd version to 5.x, extracting the batch operation button component, optimizing the interaction for system settings, and expanding the configuration generation types for list-to-select component. (#404)
* [improvement][semantic-fe] Add model alias setting & Add view permission restrictions to the model permission management tab.
[improvement][semantic-fe] Add permission control to the action buttons for the main domain; apply high sensitivity filtering to the authorization of metrics/dimensions.
[improvement][semantic-fe] Optimize the editing mode in the dimension/metric/datasource components to use the modelId stored in the database for data, instead of relying on the data from the state manager.

* [improvement][semantic-fe] Add time granularity setting in the data source configuration.

* [improvement][semantic-fe] Dictionary import for dimension values supported in Q&A visibility

* [improvement][semantic-fe] Modification of data source creation prompt wording"

* [improvement][semantic-fe] metric market experience optimization

* [improvement][semantic-fe] enhance the analysis of metric trends

* [improvement][semantic-fe] optimize the presentation of metric trend permissions

* [improvement][semantic-fe] add metric trend download functionality

* [improvement][semantic-fe] fix the dimension initialization issue in metric correlation

* [improvement][semantic-fe] Fix the issue of database changes not taking effect when creating based on an SQL data source.

* [improvement][semantic-fe] Optimizing pagination logic and some CSS styles

* [improvement][semantic-fe] Fixing the API for the indicator list by changing "current" to "pageNum"

* [improvement][semantic-fe] Fixing the default value setting for the indicator list

* [improvement][semantic-fe] Adding batch operations for indicators/dimensions/models

* [improvement][semantic-fe] Replacing the single status update API for indicators/dimensions with a batch update API

* [improvement][semantic-fe] Redesigning the indicator homepage to incorporate trend charts and table functionality for indicators

* [improvement][semantic-fe] Optimizing the logic for setting dimension values and editing data sources, and adding system settings functionality

* [improvement][semantic-fe] Upgrading antd version to 5.x, extracting the batch operation button component, optimizing the interaction for system settings, and expanding the configuration generation types for list-to-select component.
2023-11-20 12:04:08 +08:00
LXW
0143b0a1b2 (improvement)(chat)Add PostProcessor to do some logic after parser and corrector (#403)
* (improvement)(chat) Add PostProcessor to do some logic after parser and corrector

* (improvement)(chat) Add MetricCheckPostProcessor used to verify whether the dimensions involved in the query in metric mode can drill down on the metric

---------

Co-authored-by: jolunoluo
2023-11-20 09:58:25 +08:00
daikon
dd115f9d37 [improvement](knowledge) add dataSource filter sql for fillKnowledgeDimValue (#402)
Co-authored-by: kanedai <kanedai@tencent.com>
2023-11-18 16:12:31 +08:00
lexluo09
f198ce1ef8 [improvement](chat) If there is no aggregate function in the S2SQL, add the field to the 'SELECT' statement. (#401) 2023-11-18 10:28:09 +08:00
LXW
18211a215d (improvement) (common) Update sys parameter init (#400)
Co-authored-by: jolunoluo
2023-11-17 18:34:58 +08:00
lexluo09
d6a386ad03 [improvement](project) Parameters are uniformly obtained from system settings, removing optimization.properties, and modifying SysParameter parameters (#399) 2023-11-17 18:11:07 +08:00
LXW
8f19584ad7 (improvement)(semantic)Simplify datasource related code and support setting filter SQL for dict generation (#397)
* (improvement) (semantic) Simplify datasource related code and support setting filtering SQL for dict generation
* (improvement) (semantic) Remove the semicolon at the end of the datasource SQL
* (improvement) (common) Update sys parameter init

---------

Co-authored-by: jolunoluo
2023-11-17 17:52:28 +08:00
lexluo09
d9eaf79ab8 [improvement](python) remove virtualenv in python shell (#395) 2023-11-17 10:33:32 +08:00
lexluo09
05b1a7ec3b [improvement](chat) remove nativeQuery config in chat (#394) 2023-11-16 21:51:08 +08:00
lexluo09
11cdcb29fa [improvement](chat) When determining the query type, S2SQL is uniformly used for parsing. (#393) 2023-11-16 17:39:46 +08:00
lexluo09
46a9e5b097 [improvement](chat) Added query type parsing, supporting metrics, entities, and other query types. (#392) 2023-11-16 17:08:56 +08:00
jerryjzhang
8c65ac80b5 [improvement][chat] Move python code out of chat-core module 2023-11-16 15:30:45 +08:00
lexluo09
5b3a9ffba8 [improvement](chat) remove duplicates from multiple SQL identified by LLM. (#391) 2023-11-16 09:59:54 +08:00
jerryjzhang
8688c8c2b3 [improvement][chat] Move python code out of chat-core module 2023-11-16 09:58:25 +08:00
天河
13d8b9cff5 Get original name for dimensions and metrics. (#390) 2023-11-15 20:14:30 +08:00
lexluo09
aa448b1ba3 [improvement](chat) Add a LLMParserLayer to interact with a Python service and add comments to certain classes (#388) 2023-11-15 14:49:22 +08:00
jerryjzhang
7ef3d92f2c [doc][chat]Add javadoc to rule-based semantic parsers 2023-11-15 10:41:59 +08:00
LXW
9f09598ccd (improvement) (semantic) add auth check and exception catch for batch download (#385)
Co-authored-by: jolunoluo
2023-11-15 09:58:50 +08:00
LXW
36c8938ff7 (improvement) (common) add sys parameter setting (#384)
Co-authored-by: jolunoluo
2023-11-14 21:41:59 +08:00
yangde
3271db4ca6 (fix)(chat) Fix NPE (#382) 2023-11-14 20:58:37 +08:00
tristanliu
400d8b34fd [improvement][semantic-fe] Optimizing the logic for setting dimension values and editing data sources, and adding system settings functionality (#383)
* [improvement][semantic-fe] Add model alias setting & Add view permission restrictions to the model permission management tab.
[improvement][semantic-fe] Add permission control to the action buttons for the main domain; apply high sensitivity filtering to the authorization of metrics/dimensions.
[improvement][semantic-fe] Optimize the editing mode in the dimension/metric/datasource components to use the modelId stored in the database for data, instead of relying on the data from the state manager.

* [improvement][semantic-fe] Add time granularity setting in the data source configuration.

* [improvement][semantic-fe] Dictionary import for dimension values supported in Q&A visibility

* [improvement][semantic-fe] Modification of data source creation prompt wording"

* [improvement][semantic-fe] metric market experience optimization

* [improvement][semantic-fe] enhance the analysis of metric trends

* [improvement][semantic-fe] optimize the presentation of metric trend permissions

* [improvement][semantic-fe] add metric trend download functionality

* [improvement][semantic-fe] fix the dimension initialization issue in metric correlation

* [improvement][semantic-fe] Fix the issue of database changes not taking effect when creating based on an SQL data source.

* [improvement][semantic-fe] Optimizing pagination logic and some CSS styles

* [improvement][semantic-fe] Fixing the API for the indicator list by changing "current" to "pageNum"

* [improvement][semantic-fe] Fixing the default value setting for the indicator list

* [improvement][semantic-fe] Adding batch operations for indicators/dimensions/models

* [improvement][semantic-fe] Replacing the single status update API for indicators/dimensions with a batch update API

* [improvement][semantic-fe] Redesigning the indicator homepage to incorporate trend charts and table functionality for indicators

* [improvement][semantic-fe] Optimizing the logic for setting dimension values and editing data sources, and adding system settings functionality
2023-11-14 06:01:23 -06:00
Scott
d4374f7074 (fix):using virtual env and fix chromadb's version (#381) 2023-11-14 17:51:47 +08:00
jipeli
438ee539d6 (improvement)(chat) metricSemantic query without dateInfo not get queryRatio (#380)
Co-authored-by: jipengli <jipengli@tencent.com>
2023-11-14 17:02:27 +08:00
LXW
5ccde0206c (feature) (chat) add llm examples in chat config (#379)
Co-authored-by: jolunoluo
2023-11-14 16:27:10 +08:00
lexluo09
74ed269544 (improvement)(chat) linkingValues is not passed to llm and optimize SchemaCorrector code (#378) 2023-11-14 11:12:27 +08:00
LXW
1ad2c5402b (feature) (common) add sys parameter setting (#377)
Co-authored-by: jolunoluo
2023-11-13 22:07:18 +08:00
yangde
805abeb261 (fix)(chat)Fix WhereCorrector's handling of time dimensions of weeks and months (#372) 2023-11-13 21:06:49 +08:00
lexluo09
551a376b00 (improvement)(chat) add linking value switch and rename use.s2SQL.switch parameters (#376) 2023-11-13 20:22:25 +08:00
mainmain
47be92d5f6 [improvement] remove number condition (#375) 2023-11-13 19:52:18 +08:00
lexluo09
5feac0c14e (improvement)(chat) Fixed an error in struct sql query order by aggregate metric (#374) 2023-11-13 16:06:10 +08:00
lexluo09
0f02e21eaa (improvement)(chat) rename logicSql to correctS2SQL and the rule does not perform corrector operation (#373) 2023-11-13 15:36:27 +08:00
mainmain
cdb84716b7 (improvement)(chat) aggregator supports from chinese to english in s2sql (#371) 2023-11-13 14:51:23 +08:00
LXW
731238de08 Feature/Refactor querySelect to queryRanker and fix some errors in integration tests (#369)
* (fix) (chat) fix the context saving failure caused by the loss of default values caused by @builder

* (fix) (chat) fix date and metrics result in parse info in integration test

* (improvement) (chat) refactor querySelect to queryRanker

---------

Co-authored-by: jolunoluo
2023-11-12 22:47:58 +08:00
lexluo09
cb1ad94086 (improvement)(chat) struct query need to correct (#366) 2023-11-10 22:00:24 +08:00
lexluo09
24b0be7566 (improvement)(chat) when added to SchemaMap, duplicate elements are removed (#365) 2023-11-10 21:47:20 +08:00
williamhliu
3241ef87a3 (improvement)(webapp) optimize schema map content (#364) 2023-11-10 20:55:56 +08:00
williamhliu
bd541e1199 (feature)(webapp) agent defaults to list mode, supports switching to card mode (#362) 2023-11-10 18:21:59 +08:00
williamhliu
f998f27c6f (feature)(chat-sdk) compatible with the selectedParses field (#361) 2023-11-10 17:19:08 +08:00
lexluo09
cf788316c3 (improvement)(chat) updateParseInfo after selectQueries and add update mysql s2_agent table LLM_S2QL -> LLM_S2SQL (#359) 2023-11-10 16:43:23 +08:00
LXW
8ed7e91221 (improvement) (semantic) support metric data batch download (#358)
Co-authored-by: jolunoluo
2023-11-10 16:35:17 +08:00
lexluo09
e537b738e4 (improvement)(chat) Make s2ql switch compatible, executeDirectQuery also needs to perform corrections, and update ParserInfo. (#355) 2023-11-10 14:31:02 +08:00
williamhliu
bf3a111e55 (feature)(webapp) modify QL to SQL (#354) 2023-11-10 09:36:50 +08:00
lexluo09
63a526709d (improvement)(chat) fix count_distinct error in struct query and not init S2SqlByStruct if isUseS2SqlSwitch is false (#353) 2023-11-09 23:02:17 +08:00
lexluo09
e0088e8f8f update work to doXXX and integrate the SemanticCorrector code (#351) 2023-11-09 22:17:13 +08:00
lexluo09
7d33c49db8 Modify s2ql to s2sql and add LLMSemanticQuery containing S2SQLQuery and MetricInterpretQuery. (#350) 2023-11-09 21:59:27 +08:00
lexluo09
acee0a36da (improvement)(chat) fix test error (#349) 2023-11-09 20:48:40 +08:00
williamhliu
a528ba6070 Merge pull request #348 from williamhliu/master
(feature)(chat-sdk) modify recommend metric rule
2023-11-09 20:45:47 +08:00
williamhliu
ba224ac335 (feature)(chat-sdk) modify recommend metric rule 2023-11-09 20:27:18 +08:00
tristanliu
18aa14118c [improvement][semantic-fe] Redesigning the indicator homepage to incorporate trend charts and table functionality for indicators (#347)
* [improvement][semantic-fe] Add model alias setting & Add view permission restrictions to the model permission management tab.
[improvement][semantic-fe] Add permission control to the action buttons for the main domain; apply high sensitivity filtering to the authorization of metrics/dimensions.
[improvement][semantic-fe] Optimize the editing mode in the dimension/metric/datasource components to use the modelId stored in the database for data, instead of relying on the data from the state manager.

* [improvement][semantic-fe] Add time granularity setting in the data source configuration.

* [improvement][semantic-fe] Dictionary import for dimension values supported in Q&A visibility

* [improvement][semantic-fe] Modification of data source creation prompt wording"

* [improvement][semantic-fe] metric market experience optimization

* [improvement][semantic-fe] enhance the analysis of metric trends

* [improvement][semantic-fe] optimize the presentation of metric trend permissions

* [improvement][semantic-fe] add metric trend download functionality

* [improvement][semantic-fe] fix the dimension initialization issue in metric correlation

* [improvement][semantic-fe] Fix the issue of database changes not taking effect when creating based on an SQL data source.

* [improvement][semantic-fe] Optimizing pagination logic and some CSS styles

* [improvement][semantic-fe] Fixing the API for the indicator list by changing "current" to "pageNum"

* [improvement][semantic-fe] Fixing the default value setting for the indicator list

* [improvement][semantic-fe] Adding batch operations for indicators/dimensions/models

* [improvement][semantic-fe] Replacing the single status update API for indicators/dimensions with a batch update API

* [improvement][semantic-fe] Redesigning the indicator homepage to incorporate trend charts and table functionality for indicators
2023-11-09 05:37:36 -06:00
lexluo09
4e139c837a (improvement)(chat) Optimize the update parserInfo code and resolve compilation exceptions (#346) 2023-11-09 17:35:38 +08:00
jerryjzhang
6ad74bb206 [improvement][chat]Use one RuleBasedParser to encapsulate all rule-based semantic parsers 2023-11-09 16:13:30 +08:00
lexluo09
16c3de44e4 (improvement)(chat) Overall code optimization for the corrector (#345) 2023-11-09 16:03:05 +08:00
Scott
608a4f7a2f (fix):fix compile error (#344) 2023-11-09 15:37:26 +08:00
jerryjzhang
cd972d0850 [improvement][chat] Remove deprecated executeQuery method 2023-11-09 14:28:34 +08:00
LXW
2aeeb1a14e (improvement) (semantic) query dimension value support specifying time range (#343)
Co-authored-by: jolunoluo
2023-11-09 11:50:19 +08:00
codescracker
41aa6ff8e4 add api service for sql_agent for crud opereations of few-shots examples. (#342) 2023-11-09 11:46:56 +08:00
yangde
67f658ced2 (fix)(semantic) Fixed monday time fetch under MysqlAdaptor (#340) 2023-11-09 10:30:02 +08:00
LXW
94fa86629d (improvement) (chat) optimize the number and order of similar metrics (#341)
Co-authored-by: jolunoluo
2023-11-08 22:14:33 +08:00
mainmain
2cb0640a7b (improvement)(chat) add timecost aspect (#339) 2023-11-08 17:25:23 +08:00
lexluo09
772d5bd3ae (improvement)(chat) support filterCondition in requestLLM (#337) 2023-11-08 12:07:34 +08:00
LXW
d6681ead60 (improvement) (chat) (#336)
optimize the preconditions for similar metrics recall

Co-authored-by: jolunoluo
2023-11-08 11:28:40 +08:00
lexluo09
d94fd4714f (improvement)(chat) Performance optimization for Embedding Mapper, adding maximum and minimum text detection configurations (#335) 2023-11-07 21:05:03 +08:00
lexluo09
0365886270 (improvement)(chat) Rules and large model queries should be queried using s2sql (#334) 2023-11-07 16:23:31 +08:00
LXW
aa6c658a9a (improvement) optimize schema data change monitoring (#333)
Co-authored-by: jolunoluo
2023-11-06 22:11:56 +08:00
lexluo09
6e3f871015 (improvement)(chat) support remove dictionary and rename match strategy (#332) 2023-11-06 21:03:38 +08:00
williamhliu
6c9983164e (feature)(webapp) add display of time consumption at each stage (#331) 2023-11-06 20:35:14 +08:00
lexluo09
e00b935c1f (improvement)(chat) Perform a complete refactoring of the mapper and integrate the fuzzyNameMapper into the BaseMatchStrategy (#328) 2023-11-06 17:43:46 +08:00
tristanliu
f5f9c0314a [improvement][semantic-fe] Replacing the single status update API for indicators/dimensions with a batch update API (#327)
* [improvement][semantic-fe] Add model alias setting & Add view permission restrictions to the model permission management tab.
[improvement][semantic-fe] Add permission control to the action buttons for the main domain; apply high sensitivity filtering to the authorization of metrics/dimensions.
[improvement][semantic-fe] Optimize the editing mode in the dimension/metric/datasource components to use the modelId stored in the database for data, instead of relying on the data from the state manager.

* [improvement][semantic-fe] Add time granularity setting in the data source configuration.

* [improvement][semantic-fe] Dictionary import for dimension values supported in Q&A visibility

* [improvement][semantic-fe] Modification of data source creation prompt wording"

* [improvement][semantic-fe] metric market experience optimization

* [improvement][semantic-fe] enhance the analysis of metric trends

* [improvement][semantic-fe] optimize the presentation of metric trend permissions

* [improvement][semantic-fe] add metric trend download functionality

* [improvement][semantic-fe] fix the dimension initialization issue in metric correlation

* [improvement][semantic-fe] Fix the issue of database changes not taking effect when creating based on an SQL data source.

* [improvement][semantic-fe] Optimizing pagination logic and some CSS styles

* [improvement][semantic-fe] Fixing the API for the indicator list by changing "current" to "pageNum"

* [improvement][semantic-fe] Fixing the default value setting for the indicator list

* [improvement][semantic-fe] Adding batch operations for indicators/dimensions/models

* [improvement][semantic-fe] Replacing the single status update API for indicators/dimensions with a batch update API
2023-11-05 22:22:20 -06:00
lexluo09
910384d17f (improvement)(chat) Support semantic understanding, optimize the overall code of the mapper. (#321) 2023-11-05 13:14:07 +08:00
yangde
2fe56e7462 (improvement)(chat) Special handling for count_distinct operator during SQL correcting and explaining (#320) 2023-11-04 12:58:25 +08:00
daikon
b8989e204f [improvement](knowledge) support knowledge scenes without dates (#318)
Co-authored-by: kanedai <kanedai@tencent.com>
2023-11-03 17:34:03 +08:00
LXW
84b7c2c062 (improvement)(chat) add similar metric recall execute responder (#317)
Co-authored-by: jolunoluo
2023-11-03 17:32:55 +08:00
codescracker
14373309aa add retrieve service. (#316) 2023-11-03 11:08:19 +08:00
mainmain
9cd3e22721 (improvement)(chat) fix agentCanSupport null execption (#315) 2023-11-02 21:51:59 +08:00
lexluo09
2f812372d7 add switch to translate S2QL into SQL (#314) 2023-11-02 20:58:45 +08:00
tristanliu
9f813ca1c0 [improvement][semantic-fe] Adding batch operations for indicators/dimensions/models (#313)
* [improvement][semantic-fe] Add model alias setting & Add view permission restrictions to the model permission management tab.
[improvement][semantic-fe] Add permission control to the action buttons for the main domain; apply high sensitivity filtering to the authorization of metrics/dimensions.
[improvement][semantic-fe] Optimize the editing mode in the dimension/metric/datasource components to use the modelId stored in the database for data, instead of relying on the data from the state manager.

* [improvement][semantic-fe] Add time granularity setting in the data source configuration.

* [improvement][semantic-fe] Dictionary import for dimension values supported in Q&A visibility

* [improvement][semantic-fe] Modification of data source creation prompt wording"

* [improvement][semantic-fe] metric market experience optimization

* [improvement][semantic-fe] enhance the analysis of metric trends

* [improvement][semantic-fe] optimize the presentation of metric trend permissions

* [improvement][semantic-fe] add metric trend download functionality

* [improvement][semantic-fe] fix the dimension initialization issue in metric correlation

* [improvement][semantic-fe] Fix the issue of database changes not taking effect when creating based on an SQL data source.

* [improvement][semantic-fe] Optimizing pagination logic and some CSS styles

* [improvement][semantic-fe] Fixing the API for the indicator list by changing "current" to "pageNum"

* [improvement][semantic-fe] Fixing the default value setting for the indicator list

* [improvement][semantic-fe] Adding batch operations for indicators/dimensions/models
2023-11-02 06:11:12 -05:00
LXW
70784598e1 (fix)(config) fix SwaggerConfig checkstyle (#312)
Co-authored-by: jolunoluo
2023-11-02 18:57:47 +08:00
LXW
ad20380283 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
2023-11-02 18:44:58 +08:00
lexluo09
f4e3922f47 (improvement)(chat) Optimize mapper code by adding unified logging, unified comments, and LLM prior knowledge optimization (#309) 2023-11-02 16:55:25 +08:00
Scott
bfac71a7d0 (chore):add swagger config (#308) 2023-11-02 14:47:11 +08:00
lexluo09
435e789fa4 (improvement)(project) SqlFilterUtils and DateModeUtils move to common (#307) 2023-11-02 11:41:00 +08:00
lexluo09
b9f5e0a354 (improvement)(project) The Corrector is integrated into the Semantic module as an intermediate step for translating S2QL into SQL (#306) 2023-11-01 22:34:55 +08:00
jipeli
372e4acc2c (improvement)(semantic) fixed withAs not supported on CK version lower than 20.4 (#305)
Co-authored-by: jipengli <jipengli@tencent.com>
2023-11-01 17:57:38 +08:00
lexluo09
8f37c3175f (improvement)(semantic) If the field of the "AS" statement is equal to the alias, then do not replace the alias (#304) 2023-10-31 21:12:47 +08:00
codescracker
438e8463f5 add self-consistency feature for text2sql (#303) 2023-10-31 20:02:20 +08:00
mainmain
ae9aa1ba0f (improvement)(chat) fix in replace bug (#302) 2023-10-31 15:54:15 +08:00
lexluo09
688d26c457 (improvement)(semantic) optimized llms2qlParser code and support prior exts to llm (#300) 2023-10-27 13:03:55 +08:00
tristanliu
8b99b46787 [improvement][semantic-fe] Fixing the default value setting for the indicator list (#297)
* [improvement][semantic-fe] Add model alias setting & Add view permission restrictions to the model permission management tab.
[improvement][semantic-fe] Add permission control to the action buttons for the main domain; apply high sensitivity filtering to the authorization of metrics/dimensions.
[improvement][semantic-fe] Optimize the editing mode in the dimension/metric/datasource components to use the modelId stored in the database for data, instead of relying on the data from the state manager.

* [improvement][semantic-fe] Add time granularity setting in the data source configuration.

* [improvement][semantic-fe] Dictionary import for dimension values supported in Q&A visibility

* [improvement][semantic-fe] Modification of data source creation prompt wording"

* [improvement][semantic-fe] metric market experience optimization

* [improvement][semantic-fe] enhance the analysis of metric trends

* [improvement][semantic-fe] optimize the presentation of metric trend permissions

* [improvement][semantic-fe] add metric trend download functionality

* [improvement][semantic-fe] fix the dimension initialization issue in metric correlation

* [improvement][semantic-fe] Fix the issue of database changes not taking effect when creating based on an SQL data source.

* [improvement][semantic-fe] Optimizing pagination logic and some CSS styles

* [improvement][semantic-fe] Fixing the API for the indicator list by changing "current" to "pageNum"

* [improvement][semantic-fe] Fixing the default value setting for the indicator list
2023-10-26 20:57:58 -05:00
mainmain
80cce47f58 [improvement] add dimensionValue alias for sql execute (#296) 2023-10-26 21:13:43 +08:00
tristanliu
c92184d89f [improvement][semantic-fe] Fixing the API for the indicator list by changing "current" to "pageNum" (#295)
* [improvement][semantic-fe] Add model alias setting & Add view permission restrictions to the model permission management tab.
[improvement][semantic-fe] Add permission control to the action buttons for the main domain; apply high sensitivity filtering to the authorization of metrics/dimensions.
[improvement][semantic-fe] Optimize the editing mode in the dimension/metric/datasource components to use the modelId stored in the database for data, instead of relying on the data from the state manager.

* [improvement][semantic-fe] Add time granularity setting in the data source configuration.

* [improvement][semantic-fe] Dictionary import for dimension values supported in Q&A visibility

* [improvement][semantic-fe] Modification of data source creation prompt wording"

* [improvement][semantic-fe] metric market experience optimization

* [improvement][semantic-fe] enhance the analysis of metric trends

* [improvement][semantic-fe] optimize the presentation of metric trend permissions

* [improvement][semantic-fe] add metric trend download functionality

* [improvement][semantic-fe] fix the dimension initialization issue in metric correlation

* [improvement][semantic-fe] Fix the issue of database changes not taking effect when creating based on an SQL data source.

* [improvement][semantic-fe] Optimizing pagination logic and some CSS styles

* [improvement][semantic-fe] Fixing the API for the indicator list by changing "current" to "pageNum"
2023-10-26 05:02:05 -05:00
tristanliu
a8fe575999 [improvement][semantic-fe] Optimizing pagination logic and some CSS styles (#294)
* [improvement][semantic-fe] Add model alias setting & Add view permission restrictions to the model permission management tab.
[improvement][semantic-fe] Add permission control to the action buttons for the main domain; apply high sensitivity filtering to the authorization of metrics/dimensions.
[improvement][semantic-fe] Optimize the editing mode in the dimension/metric/datasource components to use the modelId stored in the database for data, instead of relying on the data from the state manager.

* [improvement][semantic-fe] Add time granularity setting in the data source configuration.

* [improvement][semantic-fe] Dictionary import for dimension values supported in Q&A visibility

* [improvement][semantic-fe] Modification of data source creation prompt wording"

* [improvement][semantic-fe] metric market experience optimization

* [improvement][semantic-fe] enhance the analysis of metric trends

* [improvement][semantic-fe] optimize the presentation of metric trend permissions

* [improvement][semantic-fe] add metric trend download functionality

* [improvement][semantic-fe] fix the dimension initialization issue in metric correlation

* [improvement][semantic-fe] Fix the issue of database changes not taking effect when creating based on an SQL data source.

* [improvement][semantic-fe] Optimizing pagination logic and some CSS styles
2023-10-26 04:41:19 -05:00
lexluo09
38099c8cc7 (improvement)(semantic) add weight to multi sql in llmParser (#293) 2023-10-26 16:42:01 +08:00
lexluo09
32e51257f6 (improvement)(semantic) support llm multiple parsing sql (#290) 2023-10-25 22:23:15 +08:00
daikon
e44e7ca8d5 [improvement](materialization) materializationZipperUtils support array type (#289) 2023-10-25 20:21:24 +08:00
lexluo09
d533496b2a (improvement)(semantic) support multi sub-query in select (#288) 2023-10-25 17:36:46 +08:00
lexluo09
eb9db28352 (improvement)(chat) remove useless code fix code check (#287) 2023-10-25 15:24:51 +08:00
LXW
836ee5f3ed (improvement)(chat) modify plugin pre condition check (#286)
Co-authored-by: jolunoluo
2023-10-25 09:55:57 +08:00
LXW
0fa31f84a3 (improvement)(semantic) compatible with old versions of clickhouse (#285)
Co-authored-by: jolunoluo
2023-10-24 18:26:49 +08:00
lexluo09
9a3c71df4a (improvement)(chat) modelId similarity >=1 and change hanlpHelper FILE_SPILT to fit windows (#284) 2023-10-24 16:34:04 +08:00
mainmain
e4e39e0496 (improvement)(chat) add traceId and time cost for show (#272) 2023-10-24 16:21:30 +08:00
LXW
cd901fbc68 (fix)(semantic) fix query response show type (#282)
Co-authored-by: jolunoluo
2023-10-24 10:50:09 +08:00
lexluo09
8fde378534 llm Corrector group by optimize (#280) 2023-10-23 23:13:20 +08:00
lexluo09
d8f81aca65 (improvement)(chat) queryDimensionValue query top10 in queue (#279) 2023-10-23 22:18:38 +08:00
LXW
b9895d541b (improvement)(chat) opt page query for show case (#278)
Co-authored-by: jolunoluo
2023-10-23 22:14:04 +08:00
lexluo09
4fbc3c8533 (improvement)(chat) queryDimensionValue query top10 in queue (#277) 2023-10-23 20:38:13 +08:00
LXW
62e2bf7de6 (improvement)(chat) show cases distinct by queryText (#275)
Co-authored-by: jolunoluo
2023-10-23 18:57:12 +08:00
LXW
c6f9ea2b20 (improvement)(chat) show cases order by feedback score (#273)
Co-authored-by: jolunoluo
2023-10-23 17:35:27 +08:00
lexluo09
166a3cfe09 (improvement)(chat)Dimension value queries are uniformly conducted through HanLP dictionary queries (#271) 2023-10-23 13:09:51 +08:00
jipeli
cbf84876de (improvement)(semantic) add dimension array dataType (#269)
Co-authored-by: jipengli <jipengli@tencent.com>
2023-10-23 10:23:00 +08:00
Scott
8bd43f113b (improvement):use model match score to select model (#268) 2023-10-20 22:43:41 +08:00
LXW
d710986923 (improvement)(chat) show case fill candidate parse (#267)
Co-authored-by: jolunoluo
2023-10-20 16:09:50 +08:00
lexluo09
dd63b78937 (improvement)(chat) support InExpression in DimensionFilter and fix removeWhereExpression error (#266) 2023-10-20 16:01:43 +08:00
LXW
8d1a07585b (improvement)(chat) remove unused import (#265)
Co-authored-by: jolunoluo
2023-10-20 11:34:37 +08:00
LXW
f4638b48d5 (improvement)(chat) async save time statistic and update parse info (#264)
Co-authored-by: jolunoluo
2023-10-20 11:23:13 +08:00
Scott
a1d56fc7e4 (fix):Fix Java string escape error (#263) 2023-10-20 10:27:49 +08:00
mainmain
9879c99873 (improvement)(chat) add cspider demo (#262) 2023-10-19 10:47:39 +08:00
daikon
1016efc646 Merge pull request #261 from daikon12/dev
[improvement](knowledge) compatible with file delimiters of various systems
2023-10-19 09:55:33 +08:00
kanedai
156aa6822b [improvement](knowledge) compatible with file delimiters of various systems 2023-10-19 09:52:16 +08:00
lexluo09
34eb94320e (feature)(chat) support querying of dimension aliases and metric aliases (#260) 2023-10-18 21:35:12 +08:00
LXW
ba1d14f40a (improvement)(chat) show case filter empty result (#259)
Co-authored-by: jolunoluo
2023-10-18 21:29:28 +08:00
LXW
dc4fbb1a14 (improvement)(config) remove semantic url in standalone yaml (#258)
Co-authored-by: jolunoluo
2023-10-18 19:44:35 +08:00
mainmain
7d770d2a6d (improvement)(chat) dsl supports revision (#254) 2023-10-18 17:44:14 +08:00
williamhliu
7b861f563c (improvement)(webapp) optimize show case query code (#257) 2023-10-18 17:35:38 +08:00
williamhliu
65614ed3ba (feature)(webapp) add multiple parse infos in history message (#256)
Co-authored-by: williamhliu <williamhliu@tencent.com>
2023-10-18 17:26:43 +08:00
tristanliu
7acdf9cb3d [improvement][semantic-fe] Fix the issue of database changes not taking effect when creating based on an SQL data source. (#255)
* [improvement][semantic-fe] Add model alias setting & Add view permission restrictions to the model permission management tab.
[improvement][semantic-fe] Add permission control to the action buttons for the main domain; apply high sensitivity filtering to the authorization of metrics/dimensions.
[improvement][semantic-fe] Optimize the editing mode in the dimension/metric/datasource components to use the modelId stored in the database for data, instead of relying on the data from the state manager.

* [improvement][semantic-fe] Add time granularity setting in the data source configuration.

* [improvement][semantic-fe] Dictionary import for dimension values supported in Q&A visibility

* [improvement][semantic-fe] Modification of data source creation prompt wording"

* [improvement][semantic-fe] metric market experience optimization

* [improvement][semantic-fe] enhance the analysis of metric trends

* [improvement][semantic-fe] optimize the presentation of metric trend permissions

* [improvement][semantic-fe] add metric trend download functionality

* [improvement][semantic-fe] fix the dimension initialization issue in metric correlation

* [improvement][semantic-fe] Fix the issue of database changes not taking effect when creating based on an SQL data source.
2023-10-18 03:39:48 -05:00
LXW
2e4954a4e8 (improvement)(chat) chat history record save query sql (#253)
* (improvement)(chat) history record save query sql

* (improvement)(semantic) update easyexcel version

---------

Co-authored-by: jolunoluo
2023-10-18 15:06:29 +08:00
williamhliu
36052cb4f2 (feature)(webapp) add show case and support multiple selection and deletion of filter conditions (#251) 2023-10-18 09:56:35 +08:00
lexluo09
8d81f63e08 (feature)(project) change dsl to s2ql in project and queryMode to llmParser (#250) 2023-10-18 09:53:01 +08:00
lexluo09
bf5be11549 (feature)(chat) If the unit is set to less than 0, then do not add relative date (#249) 2023-10-17 22:47:09 +08:00
Scott
36907ccac1 (style):more clear error message (#242) 2023-10-17 20:54:38 +08:00
tristanliu
0f3e9e8754 [improvement][semantic-fe] fix the dimension initialization issue in metric correlation (#247)
* [improvement][semantic-fe] Add model alias setting & Add view permission restrictions to the model permission management tab.
[improvement][semantic-fe] Add permission control to the action buttons for the main domain; apply high sensitivity filtering to the authorization of metrics/dimensions.
[improvement][semantic-fe] Optimize the editing mode in the dimension/metric/datasource components to use the modelId stored in the database for data, instead of relying on the data from the state manager.

* [improvement][semantic-fe] Add time granularity setting in the data source configuration.

* [improvement][semantic-fe] Dictionary import for dimension values supported in Q&A visibility

* [improvement][semantic-fe] Modification of data source creation prompt wording"

* [improvement][semantic-fe] metric market experience optimization

* [improvement][semantic-fe] enhance the analysis of metric trends

* [improvement][semantic-fe] optimize the presentation of metric trend permissions

* [improvement][semantic-fe] add metric trend download functionality

* [improvement][semantic-fe] fix the dimension initialization issue in metric correlation
2023-10-17 06:55:18 -05:00
tristanliu
883cdbefbe [improvement][semantic-fe] add metric trend download functionality (#246)
* [improvement][semantic-fe] Add model alias setting & Add view permission restrictions to the model permission management tab.
[improvement][semantic-fe] Add permission control to the action buttons for the main domain; apply high sensitivity filtering to the authorization of metrics/dimensions.
[improvement][semantic-fe] Optimize the editing mode in the dimension/metric/datasource components to use the modelId stored in the database for data, instead of relying on the data from the state manager.

* [improvement][semantic-fe] Add time granularity setting in the data source configuration.

* [improvement][semantic-fe] Dictionary import for dimension values supported in Q&A visibility

* [improvement][semantic-fe] Modification of data source creation prompt wording"

* [improvement][semantic-fe] metric market experience optimization

* [improvement][semantic-fe] enhance the analysis of metric trends

* [improvement][semantic-fe] optimize the presentation of metric trend permissions

* [improvement][semantic-fe] add metric trend download functionality
2023-10-17 05:35:24 -05:00
LXW
968d50e071 (improvement)(chat) show case filter by user name (#245)
Co-authored-by: jolunoluo
2023-10-17 17:52:27 +08:00
LXW
a9bb1c1f68 (feature)add metric check parser in chat and add metric check convert in semantic, download metric data in semantic (#241)
* (improvement)(chat) add metric check parser

* (improvement)(semantic) support metric data download

---------

Co-authored-by: jolunoluo
2023-10-17 13:20:20 +08:00
jipeli
207d6cba43 [improvement][semantic] add materialization aggOption default function (#240)
Co-authored-by: jipengli <jipengli@tencent.com>
2023-10-17 12:30:43 +08:00
jipeli
40ba179703 (feature)(semantic) add materialization optimizer (#239)
Co-authored-by: jipengli <jipengli@tencent.com>
2023-10-16 22:07:45 +08:00
tristanliu
5b8fde70ca [improvement][semantic-fe] optimize the presentation of metric trend permissions (#238)
* [improvement][semantic-fe] Add model alias setting & Add view permission restrictions to the model permission management tab.
[improvement][semantic-fe] Add permission control to the action buttons for the main domain; apply high sensitivity filtering to the authorization of metrics/dimensions.
[improvement][semantic-fe] Optimize the editing mode in the dimension/metric/datasource components to use the modelId stored in the database for data, instead of relying on the data from the state manager.

* [improvement][semantic-fe] Add time granularity setting in the data source configuration.

* [improvement][semantic-fe] Dictionary import for dimension values supported in Q&A visibility

* [improvement][semantic-fe] Modification of data source creation prompt wording"

* [improvement][semantic-fe] metric market experience optimization

* [improvement][semantic-fe] enhance the analysis of metric trends

* [improvement][semantic-fe] optimize the presentation of metric trend permissions
2023-10-16 07:16:39 -05:00
lexluo09
e3232f0198 (improvement)(chat) support sub-query in having (#237) 2023-10-16 20:05:05 +08:00
tristanliu
c5536aa25d [improvement][semantic-fe] enhance the analysis of metric trends (#234)
* [improvement][semantic-fe] Add model alias setting & Add view permission restrictions to the model permission management tab.
[improvement][semantic-fe] Add permission control to the action buttons for the main domain; apply high sensitivity filtering to the authorization of metrics/dimensions.
[improvement][semantic-fe] Optimize the editing mode in the dimension/metric/datasource components to use the modelId stored in the database for data, instead of relying on the data from the state manager.

* [improvement][semantic-fe] Add time granularity setting in the data source configuration.

* [improvement][semantic-fe] Dictionary import for dimension values supported in Q&A visibility

* [improvement][semantic-fe] Modification of data source creation prompt wording"

* [improvement][semantic-fe] metric market experience optimization

* [improvement][semantic-fe] enhance the analysis of metric trends
2023-10-16 06:10:37 -05:00
lexluo09
37bb9ff767 (improvement)(semantic) format code in RecommendServiceImpl (#233) 2023-10-16 18:07:06 +08:00
LXW
f2e8207245 (improvement)(semantic) support metric relate dimension setting (#229)
Co-authored-by: jolunoluo
2023-10-16 16:43:09 +08:00
lexluo09
86bf40c8fb (feature)(chat) optimized code in GroupByCorrector (#226) 2023-10-16 12:11:59 +08:00
lexluo09
f90ab22119 (feature)(chat) add aggregate to metric in GroupByCorrector (#225) 2023-10-16 10:45:40 +08:00
williamhliu
8e7d224b7b (feature)(webapp) modify chat sdk setupProxy config (#224)
* (feature)(webapp) use nativeQuery field to determine whether it is a selection

* (feature)(webapp) modify chat sdk version

* (feature)(webapp) modify setupProxy target

* (feature)(webapp) modify setupProxy target

* (feature)(webapp) modify setupProxy target

* (feature)(webapp) modify chat sdk setupProxy config
2023-10-14 17:31:19 +08:00
williamhliu
29925a90ca (feature)(webapp) modify chat sdk setupProxy config (#223) 2023-10-14 17:14:40 +08:00
williamhliu
fdf48d7bfd (feature)(webapp) use nativeQuery field to determine whether it is a selection (#222) 2023-10-14 16:37:28 +08:00
LXW
d9efe8f137 (improvement)(semantic) modify demo data to adapt to sql splicing (#221)
Co-authored-by: jolunoluo
2023-10-13 22:13:35 +08:00
lexluo09
6afb2f0914 (improvement)(chat) deal webapp copy in start (#220) 2023-10-13 21:11:05 +08:00
lexluo09
82ab9e3a6a (improvement)(chat) reduce log in build.sh and set dir in individual (#219) 2023-10-13 20:25:30 +08:00
lexluo09
f5ca33859c (improvement)(chat) remove setEnvToWeb in moveAllToRuntime (#218) 2023-10-13 19:58:54 +08:00
LXW
a0b4fb33c1 (improvement)(chat) solved query recall add embedding url check (#217)
Co-authored-by: jolunoluo
2023-10-13 19:53:22 +08:00
williamhliu
40705181a0 (fix)(webapp) fix the issue of missing agentId in the parameter passing of recommended similar questions in the history record (#216) 2023-10-13 19:43:18 +08:00
lexluo09
308178f299 (improvement)(project) update the changelog (update to 0.7.5) (#215) 2023-10-13 19:20:03 +08:00
lexluo09
410f2c93b9 (improvement)(chat) update version to 0.7.5 and reduce log in supersonic-daemon.sh (#214) 2023-10-13 19:16:31 +08:00
williamhliu
767abc2b90 (feature)(webapp) add filter modify and similar questions (#213) 2023-10-13 18:31:00 +08:00
lexluo09
ab19b18169 (improvement)(chat) fix supersonic sh set envToWeb (#212) 2023-10-13 17:54:36 +08:00
lexluo09
406fe995c9 (improvment)(chat) add relative path to supersonic-common.sh (#211) 2023-10-13 17:32:29 +08:00
lexluo09
151963ea79 (improvement)(chat) support nested query sql (#210) 2023-10-13 17:24:10 +08:00
lexluo09
5583426115 (improvement)(chat) optimize start stop build scripts and the runtime dir does not exist move all to runtime (#209) 2023-10-13 16:32:59 +08:00
LXW
9d1707eba1 (improvement)(script) build runtime directory in supersonic-daemon.bat (#208)
Co-authored-by: jolunoluo
2023-10-13 15:34:27 +08:00
lexluo09
f605cf0ef9 (improvment)(chat) if exist count() in dsl,set query to NATIVE and only order by field and group by field can add to select (#206) 2023-10-13 14:25:24 +08:00
LXW
119e5b8c58 (improvement)(chat) solved query code compatible with checkstyle (#205)
Co-authored-by: jolunoluo
2023-10-13 13:27:46 +08:00
lexluo09
de764f3353 (improvment)(chat) refactor the jsqlparser code (#204) 2023-10-13 11:45:04 +08:00
LXW
e4280e5516 (improvment)(chat) semantic parse info dimension filters support UNION and AND splicing methods (#203)
Co-authored-by: jolunoluo
2023-10-13 11:33:03 +08:00
LXW
886ee32e2f (improvment)(chat) remove low-scoring queries from recommended questions (#202)
Co-authored-by: jolunoluo
2023-10-13 11:17:52 +08:00
LXW
7544780ff7 (improvment)(chat) remove the parse in candidate parse that has the same score as selectparse (#201)
Co-authored-by: jolunoluo
2023-10-13 10:05:51 +08:00
mainmain
26beff1080 (improvement)(chat) dsl supports revision (#200) 2023-10-12 21:45:40 +08:00
LXW
88b8130d37 (improvment)(semantic) dimension and metric list support alias and createdBy query (#199)
Co-authored-by: jolunoluo
2023-10-12 17:12:12 +08:00
LXW
e7b8c68dba (improvment)(chat) optimize parse performance (#197)
* (improvment)(chat) optimize parse performance
---------

Co-authored-by: jolunoluo
2023-10-12 11:51:57 +08:00
lexluo09
b753eda9b9 (improvement)(chat) set native value in parser and execute , optimized the executeDirectQuery code (#196) 2023-10-12 11:38:48 +08:00
lexluo09
e6f2ce2598 (improvement)(chat) if there is no group by in dsl,set MetricTable's aggOption to NATIVE (#195) 2023-10-11 23:51:09 +08:00
lexluo09
a191bbbf6e (improvement)(chat) update load bench mark demo - to _ (#194) 2023-10-11 15:17:13 +08:00
jipeli
65f48dd789 Merge pull request #193 from jipeli/master
(improvement)(semantic) metric table add agg option
2023-10-11 14:51:46 +08:00
jipengli
c14d4e59d4 (improvement)(semantic) metric table add agg option 2023-10-11 14:45:20 +08:00
lexluo09
6b2a14e589 (improvement)(chat) The group by field can be added even if the group by field already exists (#192) 2023-10-11 13:14:42 +08:00
lexluo09
d6cefaa6d2 (improvement)(chat) If the number of aggregated fields is equal to the number of queried fields, do not add fields to select (#191) 2023-10-11 11:08:45 +08:00
mainmain
278af3ce34 (improvement)(chat) dsl supports revision and fix queryDimensionValue performance (#188) 2023-10-10 21:28:42 +08:00
lexluo09
3b1cbd4fd7 (improvement)(chat) group by corrector remove aggregate fields (#186) 2023-10-10 17:42:19 +08:00
lexluo09
500652da36 (improvement)(chat) support add parenthesis and add arenthesis in sys_imp_date (#184) 2023-10-10 16:13:48 +08:00
lexluo09
eee39f56a8 (improvement)(chat) support updateFieldValueByLinkingValue and fix EntityListQuery NullPointerException (#182) 2023-10-10 11:16:52 +08:00
lexluo09
719b797037 (improvement)(chat) support remove InExpression and partly complete fillResponse if queryResults exist primaryEntityBizName (#181) 2023-10-09 18:07:14 +08:00
Bowen Liang
7cb8208065 use default python and pip (#178) 2023-10-09 15:28:20 +08:00
Bowen Liang
a03ababc80 show commands in scripts (#177) 2023-10-09 15:26:01 +08:00
jerryjzhang
a3565a0ae9 [improvement][docs]Update README to add wechat account 2023-10-09 14:11:45 +08:00
jipeli
07a64375ce Merge pull request #179 from jipeli/master
(improvement)(semantic) fixed queryBySql execute error on mysql <=5.7
2023-10-09 12:02:19 +08:00
jipengli
ec1e63e2f2 (improvement)(semantic) fixed queryBySql execute error on mysql <=5.7 2023-10-09 12:00:25 +08:00
lexluo09
8487966888 (improvement)(chat) suppoprt show having filter and sum(metirc) filter (#176) 2023-10-08 21:46:49 +08:00
codescracker
4bbd2c7446 Features that allow user to config LLM by config file. (#174) 2023-10-08 19:35:22 +08:00
lexluo09
d9bab899fe (improvement)(chat) remove space before function in semantic parser (#175) 2023-10-08 18:24:18 +08:00
jerryjzhang
e3b3e8861d [improvement][docs]Update README to improve motivation part 2023-10-08 14:08:48 +08:00
LXW
69242f9f2d (improvement)(chat) add responder to fill additional information, such as  entity information (#173)
* (improvement)(chat) add responder to fill additional information, such as  entity information

---------

Co-authored-by: jolunoluo
2023-10-08 12:00:28 +08:00
jerryjzhang
a21c7bce40 [improvement][docs]Update README to improve motivation part 2023-10-08 11:01:27 +08:00
lexluo09
7379e3a833 (improvement)(chat) remove check llmParser error than exit (#172) 2023-10-08 10:14:17 +08:00
jerryjzhang
b565b9c4e5 [improvement][chat]Rename SemanticLayer to SemanticInterpreter 2023-10-08 09:33:41 +08:00
lexluo09
99ac17a5e4 (improvement)(chat) fix check llmParser health error if not install jq (#171) 2023-10-07 22:07:14 +08:00
lexluo09
4ccee8b107 (improvement)(chat) support remove where condition and fix simplifySql space error and addAggregateToMetric optimize (#170) 2023-10-07 21:51:37 +08:00
jerryjzhang
eccd791a39 [improvement][docs]Update README and wechat group 2023-10-07 16:48:35 +08:00
LXW
3d6878fe9f (improvement)(script) optimize bat script encoding (#168)
* (improvement)(script) optimize bat script encoding

---------

Co-authored-by: jolunoluo
2023-10-07 12:00:33 +08:00
Bowen Liang
1e1803d148 Inroduce Loguru for Python logging (#151)
* add loguru to pip requirements

* init logger

* use logger
2023-10-07 10:42:02 +08:00
Scott
343995fd8f (improve)add health check to python service (#167) 2023-10-07 10:40:34 +08:00
williamhliu
71cb20eb4f Integrate Chat and Copilot into chat-sdk, and add SQL parse display (#166) 2023-10-02 18:05:12 +08:00
lexluo09
741ed4191b (improvement)(chat) support show sum metric in chinese name and support multiple conditions in having and if not exist metirc than not addAggregateToMetric (#165) 2023-09-30 23:35:58 +08:00
lexluo09
2a6391a2ee (improvement)(chat) add metric aggregate only in select not exit metirc (#164) 2023-09-28 17:59:37 +08:00
LXW
405e846a0e (improvement)(script) update bat script (#163)
* (improvement)(script) update bat script

---------

Co-authored-by: jolunoluo
2023-09-28 12:05:16 +08:00
lexluo09
155cf22841 (improvement)(chat) remove tableCorrector and add replaceFieldNameByValue test (#162) 2023-09-27 21:03:40 +08:00
mainmain
e688422ec3 (improvement)(semantic) perfect dsl permission (#161) 2023-09-27 21:01:44 +08:00
codescracker
6047c787b3 1. upgrade text2sql for absolute time related expression in query. 2. add feature of resolved queries retrieval. (#160) 2023-09-27 18:46:03 +08:00
LXW
c03166b622 (improvement)(doc) remove sql.ddl in semantic and chat (#158)
Co-authored-by: jolunoluo
2023-09-27 18:16:35 +08:00
lexluo09
617db611c3 (improvement)(chat) logic sql show in chinese and convert to bizName in execute (#156) 2023-09-27 17:27:31 +08:00
lexluo09
f931951ad5 (improvement)(chat) support corrector fieldName by fieldValue in like (#153) 2023-09-27 14:13:13 +08:00
lexluo09
df7fea9ee3 (improvement)(chat) add addAggregateToMetric in GlobalAfterCorrector and fix getAgg null (#152) 2023-09-27 12:55:59 +08:00
lexluo09
24e8e756de (improvement)(chat) add default aggregate to all metric and add group by to dimension and add metric filter in having (#150) 2023-09-27 00:05:45 +08:00
LXW
ff5479f1a2 add metric and dimension name check (#149)
* (improvement)(semantic) add metric and dimension name check

* (improvement)(chat) opt QueryResponder recalling history similar solved query

---------

Co-authored-by: jolunoluo
2023-09-26 20:17:52 +08:00
lexluo09
4ad3e1d9cf (improvement)(chat) support show logicSql querySql llmParseSql (#148) 2023-09-26 20:17:02 +08:00
LXW
e4af83380b Merge pull request #147 from lxwcodemonkey/master
(improvement)(doc) update readme
2023-09-26 17:46:44 +08:00
jolunoluo
d30fe53ef3 (improvement)(doc) update readme 2023-09-26 17:45:33 +08:00
Bowen Liang
9e0abc60be (feat)(llm) expose config for Open API base url (#112) 2023-09-26 11:45:09 +08:00
Bowen Liang
dc33cdce5a remove unused imports in Python (#145) 2023-09-26 11:43:57 +08:00
Bowen Liang
f5b8690ce0 (improvement) Support PIP_PATH and PYTHON_PATH env var for building and starting services (#146) 2023-09-26 11:42:55 +08:00
jerryjzhang
fbb67f54ab [improvement][docs]Update README and wechat group 2023-09-26 09:57:35 +08:00
lexluo09
5c4e80c8f8 (improvement)(chat) filter nature throw detectModelIds in mapper and add loginSql (#144) 2023-09-25 21:56:47 +08:00
LXW
0774c35589 Merge pull request #143 from lxwcodemonkey/master
(improvement)(common) increase http connection time
2023-09-25 21:30:40 +08:00
jolunoluo
553963a10a (improvement)(common) increase http connection time 2023-09-25 21:29:30 +08:00
LXW
0bf171c8a6 Merge pull request #142 from lxwcodemonkey/feature/lxw
(improvement)(chat) add QueryResponder to recall history similar solved query
2023-09-25 21:20:51 +08:00
jolunoluo
f5549f7430 Merge branch 'master' into feature/lxw 2023-09-25 21:17:03 +08:00
jolunoluo
34816451c0 (improvement)(chat) recall history solved query in every parse 2023-09-25 21:09:43 +08:00
jolunoluo
e1772c25c4 Merge branch 'feature/showcase' into feature/lxw
# Conflicts:
#	chat/core/src/main/java/com/tencent/supersonic/chat/service/impl/QueryServiceImpl.java
#	chat/core/src/main/resources/mapper/ChatQueryDOMapper.xml
2023-09-25 16:59:31 +08:00
jolunoluo
65653c0ee2 (improvement)(chat) save agentId in history query 2023-09-25 16:54:36 +08:00
lexluo09
3addfb9a87 (improvement)(common) support addAggregateToField and addGroupBy and convert metricFilter to Having (#140) 2023-09-25 16:18:58 +08:00
LXW
67be01f504 Merge pull request #139 from lxwcodemonkey/feature/modelDemoData
Feature/create model and benchmark demo data through api instead of data-h2.sql
2023-09-25 15:33:20 +08:00
jolunoluo
99aa7c9433 Merge branch 'master' into feature/modelDemoData 2023-09-25 15:17:21 +08:00
jolunoluo
ccfdec8b45 (improvement)(semantic) create model demo data through api instead of data-h2.sql
(improvement)(semantic) create benchmark demo data through api instead of data-h2.sql
2023-09-25 15:16:14 +08:00
Bowen Liang
dbd259adb0 (chore)(sytle) Apply Python styling by black via spotless maven plugin (#113)
* introduce spotless maven plugin with Python black for styling
2023-09-25 10:57:14 +08:00
LXW
ec151d7b53 Merge pull request #132 from lxwcodemonkey/feature/removeImagesInDocs
(improvement)(docs) remove useless user guides
2023-09-23 22:01:14 +08:00
jolunoluo
5fbb1927a4 (improvement)(docs) remove useless user guides 2023-09-23 21:57:58 +08:00
LXW
3bc13642af Merge pull request #131 from lxwcodemonkey/feature/removeImagesInDocs
(improvement)(docs) remove useless images
2023-09-22 22:26:19 +08:00
jolunoluo
6b38a4f602 (improvement)(docs) remove useless images 2023-09-22 22:24:05 +08:00
jolunoluo
51f62438cf (improvement)(chat) add QueryResponder to recall history similar solved query 2023-09-22 14:52:53 +08:00
jolunoluo
9d8b54072a Merge branch 'master' into feature/lxw 2023-09-22 10:01:33 +08:00
mainmain
0982c013d1 [improvement](chat) dsl dimensionfilter can revise and add dsl permission (#118) 2023-09-21 21:57:26 +08:00
lexluo09
03a4719aed [improvement][chat]llm parser corrector is simplified by sql distribution (#120) 2023-09-21 21:57:06 +08:00
jerryjzhang
5c3fd75ed4 [improvement][docs]Update wechat group 2023-09-21 11:37:23 +08:00
jipeli
6dfc728b5b support foreign identify (#111)
* [improvement][semantic] add get metric agg function

* [improvement][semantic] support foreign identify
2023-09-20 22:20:00 +08:00
jipeli
071ef8432e [improvement][semantic] add get metric agg function (#110) 2023-09-20 21:39:59 +08:00
jolunoluo
8ad5ffe20f Merge remote-tracking branch 'origin/master' 2023-09-20 17:03:04 +08:00
LXW
49ba0e3f41 (feature)support adding tag for metric and support super admin configuration (#108) 2023-09-20 17:00:38 +08:00
tristanliu
5a42ff4b78 [improvement][semantic-fe] metric market experience optimization (#109)
* [improvement][semantic-fe] Add model alias setting & Add view permission restrictions to the model permission management tab.
[improvement][semantic-fe] Add permission control to the action buttons for the main domain; apply high sensitivity filtering to the authorization of metrics/dimensions.
[improvement][semantic-fe] Optimize the editing mode in the dimension/metric/datasource components to use the modelId stored in the database for data, instead of relying on the data from the state manager.

* [improvement][semantic-fe] Add time granularity setting in the data source configuration.

* [improvement][semantic-fe] Dictionary import for dimension values supported in Q&A visibility

* [improvement][semantic-fe] Modification of data source creation prompt wording"

* [improvement][semantic-fe] metric market experience optimization
2023-09-20 16:58:57 +08:00
jolunoluo
20472dce88 Merge branch 'master' into feature/metricAddTag 2023-09-20 16:44:15 +08:00
Scott
057a7c9c6d fix:set script file executable (#107) 2023-09-20 16:26:03 +08:00
jolunoluo
63eff5c62a (improvement)(semantic) add admin auth check in metric market 2023-09-20 16:10:04 +08:00
jolunoluo
b824cd8ce7 (improvement)(auth) support super admin configuration 2023-09-20 16:09:46 +08:00
lexluo09
eee82dea07 (improvement)(project) dsl support get topN dimension/metric filter by modelId (#106) 2023-09-20 12:09:42 +08:00
lexluo09
98656eb445 (improvement)(project) dsl support get topN dimension/metric by useCount and fix semanticService get dimension/metric usrCount error (#105) 2023-09-20 11:21:50 +08:00
codescracker
c8ff37e304 (improvement)(text2sql) add text2sql feature that only call LLM once, and add correponding configs and docs. (#102)
Co-authored-by: shaoweigong <shaoweigong@tencent.com>
2023-09-20 10:22:20 +08:00
jolunoluo
3fe726ac23 (improvement)(semantic) support adding tag for metric 2023-09-19 23:51:24 +08:00
jolunoluo
d5a253a781 (improvement)(chat) add QueryResponder to recall history similar solved query 2023-09-19 21:08:41 +08:00
williamhliu
6a5a95e543 [fix](webapp) fix front end package version issues (#104) 2023-09-19 19:23:00 +08:00
lexluo09
a94a44826b (improvement)(project) support explain in semantic and show explain sql in web and fix chat start error (#103) 2023-09-19 16:38:24 +08:00
jolunoluo
31c8fea2dc (improvement)(chat) add QueryResponder to recall history similar solved query 2023-09-19 15:44:01 +08:00
tristanliu
13dcf0edb9 [improvement][semantic-fe] Modification of data source creation prompt wording (#100)
* [improvement][semantic-fe] Add model alias setting & Add view permission restrictions to the model permission management tab.
[improvement][semantic-fe] Add permission control to the action buttons for the main domain; apply high sensitivity filtering to the authorization of metrics/dimensions.
[improvement][semantic-fe] Optimize the editing mode in the dimension/metric/datasource components to use the modelId stored in the database for data, instead of relying on the data from the state manager.

* [improvement][semantic-fe] Add time granularity setting in the data source configuration.

* [improvement][semantic-fe] Dictionary import for dimension values supported in Q&A visibility

* [improvement][semantic-fe] Modification of data source creation prompt wording"
2023-09-19 11:25:16 +08:00
LXW
7bc64bc53b (fix)(semantic) fix database db name modify error (#99) 2023-09-19 09:11:14 +08:00
daikon
4991efe50c [chat](fix) fix system default metric fetch wrong datasourceBizName (#98) 2023-09-19 09:11:01 +08:00
lexluo09
a87304b22b (improvement)(chat) dsl corrector support add agg metric in having (#95) 2023-09-15 17:54:51 +08:00
lexluo09
3701ade05f (improvement)(chat) dsl parser and corrector support having function (#94) 2023-09-15 15:38:33 +08:00
lexluo09
45ed5648c4 (improvement)(project) support move webapp to chat/semantic/standalone class and copy to runtime in build (#93) 2023-09-15 15:09:42 +08:00
lexluo09
682d35b2b2 (improvement)(chat) update llm url to llmParser in chat project (#92) 2023-09-14 22:59:11 +08:00
lexluo09
30f5fc9ab1 (improvement)(project) rename llm to llmParser and optimizing python start scripts and optimizing and optimizing build/start scripts (#91) 2023-09-14 22:30:06 +08:00
LXW
bc69d2221a (improvement)(semantic) support dimension value query in SemanticLayer (#90) 2023-09-14 14:01:51 +08:00
daikon
592870f397 [knowledge](improve) add knowledge base dimension value task manage (#88) 2023-09-14 14:01:38 +08:00
tristanliu
157c2999dc [improvement][semantic-fe] Dictionary import for dimension values supported in Q&A visibility (#89)
* [improvement][semantic-fe] Add model alias setting & Add view permission restrictions to the model permission management tab.
[improvement][semantic-fe] Add permission control to the action buttons for the main domain; apply high sensitivity filtering to the authorization of metrics/dimensions.
[improvement][semantic-fe] Optimize the editing mode in the dimension/metric/datasource components to use the modelId stored in the database for data, instead of relying on the data from the state manager.

* [improvement][semantic-fe] Add time granularity setting in the data source configuration.

* [improvement][semantic-fe] Dictionary import for dimension values supported in Q&A visibility
2023-09-14 12:14:02 +08:00
jerryjzhang
b6d984475c [improvement][launcher]Rename service and binary names 2023-09-14 10:06:43 +08:00
lexluo09
6a98ce9d28 (improvement)(chat) remove domain in wordservice and the model id takes precedence over the number of model aliases (#87) 2023-09-13 21:25:31 +08:00
LXW
c802c508fb (improvement)(build)modify the compressed package name from supersonic-standalone.tar.gz to supersonic.tar.gz (#86) 2023-09-13 18:38:16 +08:00
codescracker
545fb139ee Allow user to config examples and number of examples used by text2sql in middle of run (#85) 2023-09-13 17:24:12 +08:00
williamhliu
c38507d50c [improvement](webapp) optimize drill down dimensions (#84) 2023-09-13 15:05:23 +08:00
lexluo09
c8b5c0f3a3 (improvement) remove separate shell and support start llmParser service (#83) 2023-09-13 14:32:41 +08:00
mainmain
ef30e7a5b8 [improvement] alter script (#82) 2023-09-13 14:02:02 +08:00
LXW
12417c66cd (improvement) simplify build and start script (#81) 2023-09-13 11:31:07 +08:00
lexluo09
f00da45824 (improvement)(chat) remove FunctionAliasReplaceVisitor in chat config (#80) 2023-09-12 20:20:10 +08:00
lexluo09
8d8440f724 (improvement)(chat) add FunctionAliasCorrector in dsl corrector (#79) 2023-09-12 17:30:53 +08:00
williamhliu
55138986ed [feature](webapp) add a minimize button for copilot (#78) 2023-09-12 17:10:43 +08:00
lexluo09
2c621a1338 (improvement)(chat) remove group by dimension and add FunctionAliasReplaceVisitor in dsl (#77)
* (improvement)(chat) remove group by dimension in join case

* (improvement)(chat) add FunctionAliasReplaceVisitor in dsl

---------
2023-09-12 17:10:43 +08:00
jerryjzhang
c6b87d30a5 [improvement][docs]Move "how to build" chapter to project wiki 2023-09-12 17:09:23 +08:00
williamhliu
8c5c7c2e32 [feature](webapp) add dsl query fields (#75) 2023-09-12 14:29:26 +08:00
lexluo09
7fce9bacc2 (improvement)(chat) two display modes are supported in dsl: group by and details (#74) 2023-09-12 13:21:23 +08:00
lexluo09
8aedfbb6a0 (improvement)(chat) support llm default modelId and fix delete agent tool error (#73) 2023-09-11 23:46:08 +08:00
mainmain
eca92d2493 [fix](chat) fix visibility when searching (#72) 2023-09-11 18:05:24 +08:00
lexluo09
a4fc11887c (improvement)(chat) support add model aliasList to dict and update domainName to modelName (#71) 2023-09-11 13:03:03 +08:00
tristanliu
e4b0129fba [improvement][semantic-fe] Add time granularity setting in the data source configuration. (#70)
* [improvement][semantic-fe] Add model alias setting & Add view permission restrictions to the model permission management tab.
[improvement][semantic-fe] Add permission control to the action buttons for the main domain; apply high sensitivity filtering to the authorization of metrics/dimensions.
[improvement][semantic-fe] Optimize the editing mode in the dimension/metric/datasource components to use the modelId stored in the database for data, instead of relying on the data from the state manager.

* [improvement][semantic-fe] Add time granularity setting in the data source configuration.
2023-09-11 12:26:04 +08:00
LXW
76e8d253b1 [improvement](config) add bat script for standalone start and llm start (#69) 2023-09-11 10:47:36 +08:00
lexluo09
d173924efd (improvement)(chat)the DslTool is configured on the agent by default (#68) 2023-09-11 10:30:51 +08:00
daikon
465416e30c [release](project)update revision to 0.7.4 (#67) 2023-09-10 22:32:32 +08:00
daikon
a8add4c013 [release](project)update version 0.7.4 backend (#66) 2023-09-10 21:26:46 +08:00
williamhliu
02068f58c7 [feature](chat-sdk) add @ant-design/icons dependency (#65) 2023-09-10 19:51:18 +08:00
williamhliu
3c0edb67c7 [feature](webapp) add mobile agents drawer (#64) 2023-09-10 11:50:26 +08:00
tristanliu
5bab18e092 [improvement][semantic-fe] Add model alias setting & Add view permission restrictions to the model permission management tab. (#63)
[improvement][semantic-fe] Add permission control to the action buttons for the main domain; apply high sensitivity filtering to the authorization of metrics/dimensions.
[improvement][semantic-fe] Optimize the editing mode in the dimension/metric/datasource components to use the modelId stored in the database for data, instead of relying on the data from the state manager.
2023-09-09 18:36:54 +08:00
LXW
71d9f9c9e9 [improvement](config) Add a switch to load the demo and update schema-mysql.sql 2023-09-08 17:00:18 +08:00
williamhliu
90f6a20516 [feature](webapp) add script command to accommodate different Node.js versions and change lerna + npm to pnpm workspaces (#61) 2023-09-07 21:29:13 +08:00
jerryjzhang
898108d7e1 [improvement][docs]Add wiki link to README 2023-09-07 21:04:27 +08:00
lexluo09
728e7647dc add llm default url config and add pandas in requirements.txt (#59) 2023-09-07 11:14:44 +08:00
jerryjzhang
ac0f7ea982 [docs]update wechat contact 2023-09-07 09:00:58 +08:00
SunDean
20d7941d57 (improvement)(doc) remove user guide in doc directory and update user guide images (#58) 2023-09-06 22:38:22 +08:00
SunDean
ddcdd99188 (improvement)(doc) update user guide images (#57) 2023-09-06 21:33:27 +08:00
williamhliu
9267f8ed18 [fix](supersonic-fe) fix the issue of agent metric interpret value display (#56)
* [fix](supersonic-fe) fix the issue of agent metric interpret value display
2023-09-05 12:00:00 +08:00
jerryjzhang
249728919d [improvement][docs]update README and demo video 2023-09-04 16:33:03 +08:00
williamhliu
f3f84ab9af [improvement](webapp) optimize agent background color and remove entity metric tip (#54)
* [improvement](webapp) optimize agent background color and remove entity metric tip
2023-09-04 16:26:58 +08:00
jerryjzhang
90e62ddccc [improvement](webapp) optimize filter css styles and modify menu name
Co-authored-by: williamhliu <williamhliu@tencent.com>
2023-09-04 15:35:17 +08:00
tristanliu
fbd145fd92 Merge pull request #50 from sevenliu1896/master
[improvement][semantic-fe] Refactor database settings functionality.
2023-09-04 12:36:03 +08:00
tristanliu
f5a7068d5e [improvement][semantic-fe] Refactor database settings functionality. 2023-09-04 12:29:07 +08:00
williamhliu
d5c5c63a75 [feature](webapp) upgrade agent 2023-09-04 11:46:36 +08:00
lexluo09
559ef974b0 (improvement)(project) support for modifying filter conditions and fix group by pushdown and add windows scipt (#49)
Co-authored-by: lexluo <lexluo@tencent.com>
2023-09-03 23:51:47 +08:00
SunDean
8440f1f30e (improvement)(build) add bat scripts for deployment on windows (#46) 2023-09-01 10:23:57 +08:00
jerryjzhang
728235907d [improvement][docs]update demo video and wechat contact 2023-08-31 20:24:24 +08:00
1282 changed files with 91307 additions and 32735 deletions

4
.gitignore vendored
View File

@@ -15,4 +15,6 @@ assembly/runtime/*
/assembly/deploy
/runtime
**/.flattened-pom.xml
__pycache__/
chm_db/
__pycache__/
/dict

View File

@@ -4,6 +4,49 @@
- "Breaking Changes" describes any changes that may break existing functionality or cause
compatibility issues with previous versions.
## SuperSonic [0.8.2] - 2023-12-18
### Added
- rewrite Python service with Java project, default to Java implementation.
- support setting the SQL generation method for large models in the interface.
- optimization of metric market experience.
- optimization of semantic modeling canvas experience.
- code structure adjustment and abstraction optimization for chat.
## SuperSonic [0.7.5] - 2023-10-13
### Added
- add SQL generation improvement optimization, support LLM SQL, Logic SQL, and Physical SQL display.
- add showcase functionality to support recommending similar questions.
- add frontend modification of filtering conditions and re-querying feature.
- support nested query functionality in semantic.
- support switching queries between multiple parsers in the frontend.
### Updated
- optimizing the build and deployment of the project.
- overall optimization of the SQL Corrector functionality.
### Fixed
- fix execute error on mysql <=5.7
## SuperSonic [0.7.4] - 2023-09-10
### Added
- add llm parser config
- add datasource agg_time option
- add function name adaptor in clickhouse
- add dimension and metric show in dsl
### Updated
- update user guide doc
- update query building of plugin in default model
- update some core API constructs to keep naming consistency
- update ConfigureDemo config
- update the association mechanism so that invisible dimensions and metrics will no longer be associated
### Fixed
- fix hasAggregateFunction logic in SqlParserSelectHelper
## SuperSonic [0.7.3] - 2023-08-29
### Added

View File

@@ -1,27 +1,27 @@
English | [中文](README_CN.md)
[中文介绍](README_CN.md) | [文档中心](https://github.com/tencentmusic/supersonic/wiki)
# SuperSonic (超音数)
**SuperSonic is an out-of-the-box yet highly extensible framework for building a data chatbot**. SuperSonic provides a chat interface that empowers users to query data using natural language and visualize the results with suitable charts. To enable such experience, the only thing necessary is to build logical semantic models (definition of metrics/dimensions/entities, along with their meaning, context and relationships) on top of physical data models, and no data modification or copying is required. Meanwhile, SuperSonic is designed to be pluggable, allowing new functionalities to be added through plugins and core components to be integrated with other systems.
**SuperSonic is the next-generation LLM-powered data analytics platform that integrates ChatBI and HeadlessBI**. SuperSonic provides a chat interface that empowers users to query data using natural language and visualize the results with suitable charts. To enable such experience, the only thing necessary is to build logical semantic models (definition of entities/metrics/dimensions/tags, along with their meaning, context and relationships) on top of physical data models, and **no data modification or copying** is required. Meanwhile, SuperSonic is designed to be **highly extensible**, allowing custom functionalities to be added and configured with Java SPI.
<img src="./docs/images/supersonic_demo.gif" height="100%" width="100%" align="center"/>
## Motivation
The emergence of Large Language Model (LLM) like ChatGPT is reshaping the way information is retrieved. In the field of data analytics, both academia and industry are primarily focused on leveraging LLM to convert natural language queries into SQL queries. While some works show promising results, they are still not applicable to real-world scenarios.
The emergence of Large Language Model (LLM) like ChatGPT is reshaping the way information is retrieved. In the field of data analytics, both academia and industry are primarily focused on leveraging LLM to convert natural language into SQL (so called Text2SQL or NL2SQL). While some approaches exhibit promising results, their **reliability** and **efficiency** are insufficient for real-world applications.
From our perspective, the key to filling the real-world gap lies in three aspects:
1. Complement the LLM-based semantic parser with rule-based semantic parsers to improve **efficiency**(in terms of latency and cost).
2. Augment semantic parsing with schema mappers(as a kind of preprocessor) and semantic correctors(as a kind of postprocessor) to improve **accuracy** and **stability**.
3. Introduce a semantic layer encapsulating underlying data context(joins, formulas, etc) to reduce **complexity**.
1. Integrate ChatBI with HeadlessBI encapsulating underlying data context (joins, keys, formulas, etc) to **reduce complexity**.
2. Augment the LLM with schema mappers(as a kind of preprocessor) and semantic correctors(as a kind of postprocessor) to **mitigate hallucination**.
3. Utilize rule-based schema parsers when necessary to **improve efficiency**(in terms of latency and cost).
With these ideas in mind, we develop SuperSonic as a practical reference implementation and use it to power our real-world products. Additionally, to facilitate further development of data chatbot, we decide to open source SuperSonic as an extensible framework.
With these ideas in mind, we develop SuperSonic as a practical reference implementation and use it to power our real-world products. Additionally, to facilitate further development of ChatBI, we decide to open source SuperSonic as an extensible framework.
## Out-of-the-box Features
- Built-in CUI(Chat User Interface) for *business users* to enter data queries
- Built-in GUI(Graphical User Interface) for *analytics engineers* to build semantic models
- Built-in GUI for *system administrators* to manage chat plugins and agents
- Built-in ChatBI interface for *business users* to enter natural language queries
- Built-in HeadlessBI interface for *analytics engineers* to build semantic models
- Built-in GUI for *system administrators* to manage chat agents and third-party plugins
- Support input auto-completion as well as query recommendation
- Support multi-turn conversation and history context management
- Support four-level permission control: domain-level, model-level, column-level and row-level
@@ -40,7 +40,7 @@ The high-level architecture and main process flow is as follows:
- **Semantic Corrector:** checks validity of extracted semantic information and performs correction and optimization if needed.
- **Semantic Layer:** performs execution according to extracted semantic information. It generates SQL queries and executes them against physical data models.
- **Semantic Interpreter:** performs execution according to extracted semantic information. It generates SQL statements and executes them against physical data models.
- **Chat Plugin:** extends functionality with third-party tools. The LLM is going to select the most suitable one, given all configured plugins with function description and sample questions.
@@ -49,27 +49,15 @@ The high-level architecture and main process flow is as follows:
SuperSonic comes with sample semantic models as well as chat conversations that can be used as a starting point. Please follow the steps:
- Download the latest prebuilt binary from the [release page](https://github.com/tencentmusic/supersonic/releases)
- Run script "bin/start-standalone.sh" to start a standalone server
- Run script "assembly/bin/supersonic-daemon.sh start" to start a standalone Java service
- Visit http://localhost:9080 in the browser to start exploration
## How to Build
## Build and Development
SuperSonic can be deployed in two modes: standalone (for a quick demo) and distributed (for production use).
### Build for Standalone Mode
Pull the source code and run script "assembly/bin/build-standalone.sh" to build a single packages.
### Build for Distributed Mode
Pull the source code and run scripts "assembly/bin/build-chat.sh" and "assembly/bin/build-semantic.sh" separately to build packages.
### Build for Local Development
Pull the source code and run script "assembly/bin/build-ide.sh" and run bootstrap class "StandaloneLauncher" in the IDE.
Please refer to project [wiki](https://github.com/tencentmusic/supersonic/wiki).
## WeChat Contact
Please join the chat group to suggest feedbacks or ideas:
Please follow SuperSonic wechat official account:
<img src="./docs/images/wechat_contact.jpeg" height="30%" width="30%" align="center"/>
<img src="./docs/images/supersonic_wechat_oa.png" height="50%" width="50%" align="center"/>

View File

@@ -1,36 +1,36 @@
# 超音数(SuperSonic
# SuperSonic (超音数)
**超音数是一个开箱即用且易于扩展的数据问答对话框架**。通过超音数的问答对话界面,用户能够使用自然语言查询数据,系统会选择合适的可视化图表呈现结果。超音数不需要修改或复制数据,只需要在物理数据模型之上构建逻辑语义模型(指标/维度/实体的定义,以及他们的业务含义、相互间关系等),即可开启数据问答体验。与此同时,超音数被设计为可插拔的框架,允许以插件形式来扩展新功能,或者将核心组件与其他系统集成
**SuperSonic融合ChatBI和HeadlessBI打造新一代的数据分析平台**。通过SuperSonic的问答对话界面,用户能够使用自然语言查询数据,系统会选择合适的可视化图表呈现结果。SuperSonic不需要修改或复制数据,只需要在物理数据模型之上构建逻辑语义模型(指标/维度/实体的定义,以及他们的业务含义、相互间关系等),即可开启数据问答体验。与此同时,SuperSonic被设计为可插拔的框架,采用Java SPI机制来扩展定制功能
<img src="./docs/images/supersonic_demo.gif" height="100%" width="100%" align="center"/>
## 项目动机
大型语言模型LLMs如ChatGPT的出现正在重塑信息检索的方式。在数据分析领域学术界和工业界主要关注利用深度学习模型将自然语言查询转换为SQL查询。虽然一些工作显示出有前景的结果但它们还并不适用于实际场景
大型语言模型LLMs如ChatGPT的出现正在重塑信息检索的方式。在数据分析领域学术界和工业界主要关注利用深度学习模型将自然语言查询转换为SQL查询。虽然一些工作显示出有前景的结果但它们的可靠性还达不到生产可用的要求
在我们看来,为了在实际场景发挥价值,有三个关键点:
1. 在基于大模型语义解析器基础上,增加基于规则的解析器,提升语义解析的**效率**。
2. 加入模式映射器和语义修正器,来增强语义解析能力,提升语义解析的**准确性**和**稳定性**
3. 引入语义模型层,封装底层数据的上下文(关联、公式等),降低语义解析的**复杂性**。
1. 融合HeadlessBI通过统一语义层封装底层数据细节关联、键值、公式等降低SQL生成的**复杂度**。
2. 通过一前一后的模式映射器和语义修正器,来缓解LLM常见的**幻觉**现象
3. 设计启发式的规则,在一些特定场景提升语义解析的**效率**。
为了验证上述想法,我们开发了超音数项目,并将其应用在实际的内部产品中。与此同时,我们将超音数作为一个可扩展的框架开源,希望能够促进数据问答对话领域的进一步发展。
为了验证上述想法,我们开发了SuperSonic项目,并将其应用在实际的内部产品中。与此同时,我们将SuperSonic作为一个可扩展的框架开源,希望能够促进数据问答对话领域的进一步发展。
## 开箱即用的特性
- 内置对话界面以便*业务用户*输入数据查询。
- 内置图形界面以便*分析工程师*构建语义模型。
- 内置图形界面以便*系统管理员*管理问答插件和助理。
- 内置ChatBI界面以便*业务用户*输入数据查询。
- 内置HeadlessBI界面以便*分析工程师*构建语义模型。
- 内置图形用户界面以便*系统管理员*管理第三方插件和对话助理。
- 支持文本输入的联想和查询问题的推荐。
- 支持多轮对话,根据语境自动切换上下文。
- 支持四级权限控制:主题域级、模型级、列级、行级。
## 易于扩展的组件
超音数的整体架构和主流程如下图所示:
SuperSonic的整体架构和主流程如下图所示:
<img src="./docs/images/supersonic_components.png" height="65%" width="65%" align="center"/>
- **知识库(Knowledge Base)** 定期从语义模型中提取相关的模式信息,构建词典和索引,以便后续的模式映射。
- **模型知识库(Knowledge Base)** 定期从语义模型中提取相关的模式信息,构建词典和索引,以便后续的模式映射。
- **模式映射器(Schema Mapper)** 将自然语言文本在知识库中进行匹配,为后续的语义解析提供相关信息。
@@ -38,36 +38,24 @@
- **语义修正器(Semantic Corrector)** 检查语义信息的合法性,对不合法的信息做修正和优化处理。
- **语义模型层(Semantic Layer)** 根据语义信息生成物理SQL执行查询。
- **语义解释器(Semantic Interpreter)** 根据语义信息生成物理SQL执行查询。
- **问答插件(Chat Plugin)** 通过第三方工具扩展功能。给定所有配置的插件及其功能描述和示例问题,大语言模型将选择最合适的插件。
## 快速体验
超音数自带样例的语义模型和问答对话,只需以下三步即可快速体验:
SuperSonic自带样例的语义模型和问答对话,只需以下三步即可快速体验:
- 从[release page](https://github.com/tencentmusic/supersonic/releases)下载预先构建好的发行包
- 运行 "bin/start-standalone.sh"启动服务
- 运行 "assembly/bin/supersonic-daemon.sh start"启动standalone模式的Java服务
- 在浏览器访问http://localhost:9080 开启探索
## 如何构建
## 如何构建和部署
超音数可以运行在两个模式standalone一般用于快速演示和distributed一般用于生产环境
### Standalone模式构建
下载源码包,运行脚本"assembly/bin/build-standalone.sh",将所有服务一起编译打包。
### Distributed模式构建
下载源码包,分别运行脚本"assembly/bin/build-chat.sh"、"assembly/bin/build-semantic.sh",为问答层服务和语义层服务编译打包。
### 本地开发构建
下载源码包,运行脚本"assembly/bin/build-ide.sh"然后在本地IDE运行启动类"StandaloneLauncher"。
请参考项目[wiki](https://github.com/tencentmusic/supersonic/wiki)
## 微信联系方式
欢迎加入微信群反馈建议
欢迎关注微信公众号
<img src="./docs/images/wechat_contact.jpeg" height="30%" width="30%" align="center"/>
<img src="./docs/images/supersonic_wechat_oa.png" height="50%" width="50%" align="center"/>

View File

@@ -1,12 +0,0 @@
#!/usr/bin/env bash
sbinDir=$(cd "$(dirname "$0")"; pwd)
baseDir=$(cd "$sbinDir/.." && pwd -P)
runtimeDir=$baseDir/runtime
buildDir=$baseDir/build
cd $baseDir
#1. move package to build
cp $baseDir/../launchers/chat/target/*.tar.gz ${buildDir}/supersonic-chat.tar.gz

View File

@@ -1,13 +0,0 @@
#!/usr/bin/env bash
sbinDir=$(cd "$(dirname "$0")"; pwd)
baseDir=$(cd "$sbinDir/.." && pwd -P)
buildDir=$baseDir/build
cd $baseDir/bin
sh build-standalone.sh
cd $buildDir
tar xvf supersonic-webapp.tar.gz
mv supersonic-webapp webapp
mv webapp ../../launchers/standalone/target/classes

View File

@@ -1,23 +0,0 @@
#!/usr/bin/env bash
sbinDir=$(cd "$(dirname "$0")"; pwd)
baseDir=$(cd "$sbinDir/.." && pwd -P)
runtimeDir=$baseDir/runtime
buildDir=$baseDir/build
cd $baseDir
#1. build semantic service
rm -fr ${buildDir}/*.tar.gz
rm -fr dist
mvn -f $baseDir/../ clean package -DskipTests
#2. move package to build
cp $baseDir/../launchers/semantic/target/*.tar.gz ${buildDir}/supersonic-semantic.tar.gz
#3. build webapp
chmod +x $baseDir/../webapp/start-fe-prod.sh
cd ../webapp
sh ./start-fe-prod.sh
cp -fr ./supersonic-webapp.tar.gz ${buildDir}/

View File

@@ -1,23 +0,0 @@
#!/usr/bin/env bash
sbinDir=$(cd "$(dirname "$0")"; pwd)
baseDir=$(cd "$sbinDir/.." && pwd -P)
runtimeDir=$baseDir/runtime
buildDir=$baseDir/build
cd $baseDir
#1. build semantic chat service
rm -fr ${buildDir}/*.tar.gz
rm -fr dist
mvn -f $baseDir/../ clean package -DskipTests
#2. move package to build
cp $baseDir/../launchers/standalone/target/*.tar.gz ${buildDir}/supersonic.tar.gz
#3. build webapp
chmod +x $baseDir/../webapp/start-fe-prod.sh
cd ../webapp
sh ./start-fe-prod.sh
cp -fr ./supersonic-webapp.tar.gz ${buildDir}/

View File

@@ -1,35 +0,0 @@
#!/usr/bin/env bash
sbinDir=$(cd "$(dirname "$0")"; pwd)
baseDir=$(cd "$sbinDir/.." && pwd -P)
runtimeDir=$baseDir/../runtime
buildDir=$baseDir/build
cd $baseDir
#2. package lib
tar -zxvf ${buildDir}/supersonic-chat.tar.gz -C ${runtimeDir}
mv ${runtimeDir}/launchers-chat-* ${runtimeDir}/supersonic-chat
tar -zxvf ${buildDir}/supersonic-webapp.tar.gz -C ${buildDir}
mkdir -p ${runtimeDir}/supersonic-chat/webapp
cp -fr ${buildDir}/supersonic-webapp/* ${runtimeDir}/supersonic-chat/webapp
rm -fr ${buildDir}/supersonic-webapp
json=$(cat ${runtimeDir}/supersonic-chat/webapp/supersonic.config.json)
json=$(echo $json | jq '.env="chat"')
echo $json > ${runtimeDir}/supersonic-chat/webapp/supersonic.config.json
#3. start service
#3.1 start chat service
echo ${runtimeDir}
sh ${runtimeDir}/supersonic-chat/bin/service.sh restart
#3.2 start llm service
sh ${runtimeDir}/supersonic-chat/llm/bin/service.sh restart

View File

@@ -1,36 +0,0 @@
#!/usr/bin/env bash
sbinDir=$(cd "$(dirname "$0")"; pwd)
baseDir=$(cd "$sbinDir/.." && pwd -P)
runtimeDir=$baseDir/../runtime
buildDir=$baseDir/build
cd $baseDir
#1. clear file
mkdir -p ${runtimeDir}
rm -fr ${runtimeDir}/*
#2. package lib
tar -zxvf ${buildDir}/supersonic-semantic.tar.gz -C ${runtimeDir}
mv ${runtimeDir}/launchers-semantic-* ${runtimeDir}/supersonic-semantic
tar -zxvf ${buildDir}/supersonic-webapp.tar.gz -C ${buildDir}
mkdir -p ${runtimeDir}/supersonic-semantic/webapp
cp -fr ${buildDir}/supersonic-webapp/* ${runtimeDir}/supersonic-semantic/webapp
rm -fr ${buildDir}/supersonic-webapp
json=$(cat ${runtimeDir}/supersonic-semantic/webapp/supersonic.config.json)
json=$(echo $json | jq '.env="semantic"')
echo $json > ${runtimeDir}/supersonic-semantic/webapp/supersonic.config.json
#3. start service
sh ${runtimeDir}/supersonic-semantic/bin/service.sh restart

View File

@@ -1,32 +0,0 @@
#!/usr/bin/env bash
sbinDir=$(cd "$(dirname "$0")"; pwd)
baseDir=$(cd "$sbinDir/.." && pwd -P)
runtimeDir=$baseDir/../runtime
buildDir=$baseDir/build
cd $baseDir
#1. clear file
mkdir -p ${runtimeDir}
rm -fr ${runtimeDir}/*
#2. package lib
tar -zxvf ${buildDir}/supersonic.tar.gz -C ${runtimeDir}
mv ${runtimeDir}/launchers-standalone-* ${runtimeDir}/supersonic-standalone
tar -zxvf ${buildDir}/supersonic-webapp.tar.gz -C ${buildDir}
mkdir -p ${runtimeDir}/supersonic-standalone/webapp
cp -fr ${buildDir}/supersonic-webapp/* ${runtimeDir}/supersonic-standalone/webapp
rm -fr ${buildDir}/supersonic-webapp
#3. start service
#start standalone service
sh ${runtimeDir}/supersonic-standalone/bin/service.sh restart
#start llm service
sh ${runtimeDir}/supersonic-standalone/llm/bin/service.sh restart

View File

@@ -0,0 +1,72 @@
@echo off
setlocal
chcp 65001
set "sbinDir=%~dp0"
set "baseDir=%~dp0.."
set "buildDir=%baseDir%\build"
set "runtimeDir=%baseDir%\..\runtime"
set "pip_path=pip3"
set "service=%~1"
rem 1. build backend java modules
del /q "%buildDir%\*.tar.gz" 2>NUL
call mvn -f "%baseDir%\..\pom.xml" clean package -DskipTests
IF ERRORLEVEL 1 (
ECHO Failed to build backend Java modules.
EXIT /B 1
)
rem 2. move package to build
echo f|xcopy "%baseDir%\..\launchers\standalone\target\*.tar.gz" "%buildDir%\supersonic-standalone.tar.gz"
rem 3. build frontend webapp
cd "%baseDir%\..\webapp"
call start-fe-prod.bat
copy /y "%baseDir%\..\webapp\supersonic-webapp.tar.gz" "%buildDir%\"
IF ERRORLEVEL 1 (
ECHO Failed to build frontend webapp.
EXIT /B 1
)
rem 4. copy webapp to java classpath
cd "%buildDir%"
tar -zxvf supersonic-webapp.tar.gz
move supersonic-webapp webapp
move webapp ..\..\launchers\standalone\target\classes
rem 5. build backend python modules
if "%service%"=="pyllm" (
echo "start installing python modules with pip: ${pip_path}"
set requirementPath="%baseDir%/../chat/python/requirements.txt"
%pip_path% install -r %requirementPath%
echo "install python modules success"
)
call :BUILD_RUNTIME
:BUILD_RUNTIME
rem 6. reset runtime
IF EXIST "%runtimeDir%" (
echo begin to delete dir : %runtimeDir%
rd /s /q "%runtimeDir%"
) ELSE (
echo %runtimeDir% does not exist, create directly
)
mkdir "%runtimeDir%"
tar -zxvf "%buildDir%\supersonic-standalone.tar.gz" -C "%runtimeDir%"
for /d %%f in ("%runtimeDir%\launchers-standalone-*") do (
move "%%f" "%runtimeDir%\supersonic-standalone"
)
rem 7. copy webapp to runtime
tar -zxvf "%buildDir%\supersonic-webapp.tar.gz" -C "%buildDir%"
if not exist "%runtimeDir%\supersonic-standalone\webapp" mkdir "%runtimeDir%\supersonic-standalone\webapp"
xcopy /s /e /h /y "%buildDir%\supersonic-webapp\*" "%runtimeDir%\supersonic-standalone\webapp"
if not exist "%runtimeDir%\supersonic-standalone\conf\webapp" mkdir "%runtimeDir%\supersonic-standalone\conf\webapp"
xcopy /s /e /h /y "%runtimeDir%\supersonic-standalone\webapp\*" "%runtimeDir%\supersonic-standalone\conf\webapp"
rd /s /q "%buildDir%\supersonic-webapp"
endlocal

View File

@@ -0,0 +1,58 @@
#!/usr/bin/env bash
set -x
sbinDir=$(cd "$(dirname "$0")"; pwd)
chmod +x $sbinDir/supersonic-common.sh
source $sbinDir/supersonic-common.sh
cd $baseDir
service=$1
#1. build backend java modules
rm -fr ${buildDir}/*.tar.gz
rm -fr dist
set +x
mvn -f $baseDir/../ clean package -DskipTests
# check build result
if [ $? -ne 0 ]; then
echo "Failed to build backend Java modules."
exit 1
fi
#2. move package to build
cp $baseDir/../launchers/semantic/target/*.tar.gz ${buildDir}/supersonic-semantic.tar.gz
cp $baseDir/../launchers/chat/target/*.tar.gz ${buildDir}/supersonic-chat.tar.gz
cp $baseDir/../launchers/standalone/target/*.tar.gz ${buildDir}/supersonic-standalone.tar.gz
#3. build frontend webapp
chmod +x $baseDir/../webapp/start-fe-prod.sh
cd ../webapp
sh ./start-fe-prod.sh
cp -fr ./supersonic-webapp.tar.gz ${buildDir}/
# check build result
if [ $? -ne 0 ]; then
echo "Failed to build frontend webapp."
exit 1
fi
#4. copy webapp to java classpath
cd $buildDir
tar xvf supersonic-webapp.tar.gz
mv supersonic-webapp webapp
cp -fr webapp ../../launchers/semantic/target/classes
cp -fr webapp ../../launchers/chat/target/classes
cp -fr webapp ../../launchers/standalone/target/classes
rm -fr ${buildDir}/webapp
#5. build backend python modules
if [ "$service" == "pyllm" ]; then
echo "start installing python modules with pip: ${pip_path}"
requirementPath=$baseDir/../chat/python/requirements.txt
${pip_path} install -r ${requirementPath}
echo "install python modules success"
fi
#6. reset runtime
rm -fr $runtimeDir/supersonic*
moveAllToRuntime
setEnvToWeb chat
setEnvToWeb semantic

110
assembly/bin/supersonic-common.sh Executable file
View File

@@ -0,0 +1,110 @@
#!/usr/bin/env bash
# environment parameters
python_path=${PYTHON_PATH:-"python3"}
pip_path=${PIP_PATH:-"pip3"}
sbinDir=$(cd "$(dirname "$0")"; pwd)
baseDir=$(cd "$sbinDir/.." && pwd -P)
runtimeDir=$baseDir/../runtime
buildDir=$baseDir/build
readonly CHAT_APP_NAME="supersonic_chat"
readonly SEMANTIC_APP_NAME="supersonic_semantic"
readonly PYLLM_APP_NAME="supersonic_pyllm"
readonly STANDALONE_APP_NAME="supersonic_standalone"
readonly CHAT_SERVICE="chat"
readonly SEMANTIC_SERVICE="semantic"
readonly PYLLM_SERVICE="pyllm"
readonly STANDALONE_SERVICE="standalone"
readonly PYLLM_HOST="127.0.0.1"
readonly PYLLM_PORT="9092"
function setEnvToWeb {
model_name=$1
json='{"env": "'$model_name'"}'
echo $json > ${runtimeDir}/supersonic-${model_name}/webapp/supersonic.config.json
echo $json > $baseDir/../launchers/${model_name}/target/classes/webapp/supersonic.config.json
}
function moveToRuntime {
model_name=$1
file="${buildDir}/supersonic-${model_name}.tar.gz"
if [ -f "$file" ]; then
tar -zxvf "$file" -C ${runtimeDir}
mv ${runtimeDir}/launchers-${model_name}-* ${runtimeDir}/supersonic-${model_name}
mkdir -p ${runtimeDir}/supersonic-${model_name}/webapp
cp -fr ${buildDir}/webapp/* ${runtimeDir}/supersonic-${model_name}/webapp
else
echo "File $file does not exist. Skipping the move to runtime."
fi
}
function moveAllToRuntime {
mkdir -p ${runtimeDir}
tar xvf ${buildDir}/supersonic-webapp.tar.gz -C ${buildDir}
mv ${buildDir}/supersonic-webapp ${buildDir}/webapp
moveToRuntime chat
moveToRuntime semantic
moveToRuntime standalone
rm -fr ${buildDir}/webapp
}
# run java service
function runJavaService {
javaRunDir=${runtimeDir}/supersonic-${model_name}
local_app_name=$1
libDir=$javaRunDir/lib
confDir=$javaRunDir/conf
CLASSPATH=""
CLASSPATH=$CLASSPATH:$confDir
for jarPath in $libDir/*.jar; do
CLASSPATH=$CLASSPATH:$jarPath
done
export CLASSPATH
export LANG="zh_CN.UTF-8"
cd $javaRunDir
if [[ "$JAVA_HOME" == "" ]]; then
JAVA_HOME=$(ls /usr/jdk64/jdk* -d 2>/dev/null | xargs | awk '{print "'$local_app_name'"}')
fi
export PATH=$JAVA_HOME/bin:$PATH
command="-Dfile.encoding="UTF-8" -Duser.language="Zh" -Duser.region="CN" -Duser.timezone="GMT+08" -Dapp_name=${local_app_name} -Xms1024m -Xmx2048m "$main_class
mkdir -p $javaRunDir/logs
if [[ "$is_test" == "true" ]]; then
java -Dspring.profiles.active="dev" $command >/dev/null 2>$javaRunDir/logs/error.log &
else
java $command $javaRunDir >/dev/null 2>$javaRunDir/logs/error.log &
fi
}
# run python service
function runPythonService {
pythonRunDir=${runtimeDir}/supersonic-${model_name}/pyllm
cd $pythonRunDir
nohup ${python_path} supersonic_pyllm.py > $pythonRunDir/pyllm.log 2>&1 &
# add health check
for i in {1..10}
do
echo "pyllm health check attempt $i..."
response=$(curl -s http://${PYLLM_HOST}:${PYLLM_PORT}/health)
echo "pyllm health check response: $response"
status_ok="Healthy"
if [[ $response == *$status_ok* ]] ; then
echo "pyllm Health check passed."
break
else
if [ "$i" -eq 10 ]; then
echo "pyllm Health check failed after 10 attempts."
echo "May still downloading model files. Please check pyllm.log in runtime directory."
fi
echo "Retrying after 5 seconds..."
sleep 5
fi
done
}

View File

@@ -0,0 +1,118 @@
@echo off
setlocal
chcp 65001
set "sbinDir=%~dp0"
set "baseDir=%~dp0.."
set "runtimeDir=%baseDir%\..\runtime"
set "buildDir=%baseDir%\build"
set "main_class=com.tencent.supersonic.StandaloneLauncher"
set "python_path=python"
set "pip_path=pip3"
set "standalone_service=standalone"
set "pyllm_service=pyllm"
set "javaRunDir=%runtimeDir%\supersonic-standalone"
set "pythonRunDir=%runtimeDir%\supersonic-standalone\pyllm"
set "command=%~1"
set "service=%~2"
if "%service%"=="" (
set "service=%standalone_service%"
)
IF "%service%"=="pyllm" (
SET "llmProxy=PythonLLMProxy"
)
call :BUILD_RUNTIME
if "%command%"=="restart" (
call :STOP
call :START
goto :EOF
) else if "%command%"=="start" (
call :START
goto :EOF
) else if "%command%"=="stop" (
call :STOP
goto :EOF
) else if "%command%"=="reload" (
call :RELOAD_EXAMPLE
goto :EOF
) else (
echo "Use command {start|stop|restart} to run."
goto :EOF
)
:START
if "%service%"=="%pyllm_service%" (
call :START_PYTHON
call :START_JAVA
goto :EOF
)
call :START_JAVA
goto :EOF
:STOP
call :STOP_PYTHON
call :STOP_JAVA
goto :EOF
:START_PYTHON
echo 'python service starting, see logs in pyllm/pyllm.log'
cd "%pythonRunDir%"
start /B %python_path% supersonic_pyllm.py > %pythonRunDir%\pyllm.log 2>&1
timeout /t 10 >nul
echo 'python service started'
goto :EOF
:START_JAVA
echo 'java service starting, see logs in logs/'
cd "%javaRunDir%"
if not exist "%runtimeDir%\supersonic-standalone\logs" mkdir "%runtimeDir%\supersonic-standalone\logs"
set "libDir=%runtimeDir%\supersonic-standalone\lib"
set "confDir=%runtimeDir%\supersonic-standalone\conf"
set "webDir=%runtimeDir%\supersonic-standalone\webapp"
set "classpath=%confDir%;%webDir%;%libDir%\*"
set "java-command=-Dfile.encoding=UTF-8 -Duser.language=Zh -Duser.region=CN -Duser.timezone=GMT+08 -Xms1024m -Xmx2048m -cp %CLASSPATH% %MAIN_CLASS%"
start /B java %java-command% >nul 2>&1
timeout /t 10 >nul
echo 'java service started'
goto :EOF
:STOP_PYTHON
for /f "tokens=2" %%i in ('tasklist ^| findstr /i "python"') do (
taskkill /PID %%i /F
echo "python service (PID = %%i) is killed."
)
goto :EOF
:STOP_JAVA
for /f "tokens=2" %%i in ('tasklist ^| findstr /i "java"') do (
taskkill /PID %%i /F
echo "java service (PID = %%i) is killed."
)
goto :EOF
:RELOAD_EXAMPLE
cd "%runtimeDir%\supersonic-standalone\pyllm\sql"
start %python_path% examples_reload_run.py
goto :EOF
:BUILD_RUNTIME
rem 6. reset runtime
if exist "%runtimeDir%" goto :EOF
mkdir "%runtimeDir%"
tar -zxvf "%buildDir%\supersonic-standalone.tar.gz" -C "%runtimeDir%"
for /d %%f in ("%runtimeDir%\launchers-standalone-*") do (
move "%%f" "%runtimeDir%\supersonic-standalone"
)
rem 7. copy webapp to runtime
tar -zxvf "%buildDir%\supersonic-webapp.tar.gz" -C "%buildDir%"
if not exist "%runtimeDir%\supersonic-standalone\webapp" mkdir "%runtimeDir%\supersonic-standalone\webapp"
xcopy /s /e /h /y "%buildDir%\supersonic-webapp\*" "%runtimeDir%\supersonic-standalone\webapp"
if not exist "%runtimeDir%\supersonic-standalone\conf\webapp" mkdir "%runtimeDir%\supersonic-standalone\conf\webapp"
xcopy /s /e /h /y "%runtimeDir%\supersonic-standalone\webapp\*" "%runtimeDir%\supersonic-standalone\conf\webapp"
rd /s /q "%buildDir%\supersonic-webapp"

143
assembly/bin/supersonic-daemon.sh Executable file
View File

@@ -0,0 +1,143 @@
#!/usr/bin/env bash
set -x
sbinDir=$(cd "$(dirname "$0")"; pwd)
chmod +x $sbinDir/supersonic-common.sh
source $sbinDir/supersonic-common.sh
# 1.init environment parameters
if [ ! -d "$runtimeDir" ]; then
echo "the runtime dir does not exist move all to runtime"
moveAllToRuntime
fi
set +x
command=$1
service=$2
if [ -z "$service" ]; then
service=${STANDALONE_SERVICE}
fi
app_name=$STANDALONE_APP_NAME
main_class="com.tencent.supersonic.StandaloneLauncher"
model_name=$service
if [ "$service" == "pyllm" ]; then
model_name=${STANDALONE_SERVICE}
export llmProxy=PythonLLMProxy
fi
cd $baseDir
# 2.set main class
function setMainClass {
if [ "$service" == $CHAT_SERVICE ]; then
main_class="com.tencent.supersonic.ChatLauncher"
elif [ "$service" == $SEMANTIC_SERVICE ]; then
main_class="com.tencent.supersonic.SemanticLauncher"
fi
}
setMainClass
# 3.set app name
function setAppName {
if [ "$service" == $CHAT_SERVICE ]; then
app_name=$CHAT_APP_NAME
elif [ "$service" == $SEMANTIC_SERVICE ]; then
app_name=$SEMANTIC_APP_NAME
elif [ "$service" == $PYLLM_SERVICE ]; then
app_name=$PYLLM_APP_NAME
fi
}
setAppName
function reloadExamples {
pythonRunDir=${runtimeDir}/supersonic-${model_name}/pyllm
cd $pythonRunDir/sql
${python_path} examples_reload_run.py
}
function start()
{
local_app_name=$1
pid=$(ps aux |grep ${local_app_name} | grep -v grep | awk '{print $2}')
if [[ "$pid" == "" ]]; then
if [[ ${local_app_name} == $PYLLM_APP_NAME ]]; then
runPythonService ${local_app_name}
else
runJavaService ${local_app_name}
fi
else
echo "Process (PID = $pid) is running."
return 1
fi
}
function stop()
{
pid=$(ps aux | grep $1 | grep -v grep | awk '{print $2}')
if [[ "$pid" == "" ]]; then
echo "Process $1 is not running !"
return 1
else
kill -9 $pid
echo "Process (PID = $pid) is killed !"
return 0
fi
}
function reload()
{
if [[ $1 == $PYLLM_APP_NAME ]]; then
reloadExamples
fi
}
# 4. execute command operation
case "$command" in
start)
if [ "$service" == $PYLLM_SERVICE ]; then
echo "Starting $app_name"
start $app_name
echo "Starting $STANDALONE_APP_NAME"
start $STANDALONE_APP_NAME
else
echo "Starting $app_name"
start $app_name
fi
echo "Start success"
;;
stop)
echo "Stopping $app_name"
stop $app_name
echo "Stopping $PYLLM_APP_NAME"
stop $PYLLM_APP_NAME
echo "Stop success"
;;
reload)
echo "Reloading ${app_name}"
reload ${app_name}
echo "Reload success"
;;
restart)
if [ "$service" == $PYLLM_SERVICE ]; then
echo "Stopping ${app_name}"
stop ${app_name}
echo "Stopping ${STANDALONE_APP_NAME}"
stop $STANDALONE_APP_NAME
echo "Starting ${app_name}"
start ${app_name}
echo "Starting ${STANDALONE_APP_NAME}"
start $STANDALONE_APP_NAME
else
echo "Stopping ${app_name}"
stop ${app_name}
echo "Starting ${app_name}"
start ${app_name}
fi
echo "Restart success"
;;
*)
echo "Use command {start|stop|restart} to run."
exit 1
esac

View File

@@ -6,14 +6,6 @@
<format>tar.gz</format>
</formats>
<fileSets>
<fileSet>
<directory>${project.basedir}/src/main/bin</directory>
<outputDirectory>bin</outputDirectory>
<fileMode>0777</fileMode>
<directoryMode>0755</directoryMode>
</fileSet>
<fileSet>
<directory>${project.basedir}/src/main/resources</directory>
<outputDirectory>conf</outputDirectory>
@@ -29,8 +21,8 @@
</includes>
</fileSet>
<fileSet>
<directory>${project.basedir}/../../chat/core/src/main/python</directory>
<outputDirectory>llm</outputDirectory>
<directory>${project.basedir}/../../chat/python</directory>
<outputDirectory>pyllm</outputDirectory>
<fileMode>0777</fileMode>
<directoryMode>0755</directoryMode>
</fileSet>

View File

@@ -3,9 +3,13 @@ package com.tencent.supersonic.auth.api.authentication.adaptor;
import com.tencent.supersonic.auth.api.authentication.pojo.Organization;
import com.tencent.supersonic.auth.api.authentication.pojo.User;
import com.tencent.supersonic.auth.api.authentication.request.UserReq;
import java.util.List;
import java.util.Set;
/**
* UserAdaptor defines some interfaces for obtaining user and organization information
*/
public interface UserAdaptor {
List<String> getUserNames();

View File

@@ -9,10 +9,12 @@ import org.springframework.context.annotation.Configuration;
@Configuration
public class AuthenticationConfig {
@Value("${authentication.exclude.path:XXX}")
private String excludePath;
@Value("${authentication.include.path:/api}")
private String includePath;
@Value("${authentication.enable:false}")
private boolean enabled;
@@ -22,5 +24,4 @@ public class AuthenticationConfig {
@Value("${authentication.token.http.header.key:Authorization}")
private String tokenHttpHeaderKey;
}

View File

@@ -12,6 +12,8 @@ public class UserConstants {
public static final String TOKEN_USER_EMAIL = "token_user_email";
public static final String TOKEN_IS_ADMIN = "token_is_admin";
public static final String TOKEN_ALGORITHM = "HS512";
public static final String TOKEN_CREATE_TIME = "token_create_time";

View File

@@ -1,9 +1,10 @@
package com.tencent.supersonic.auth.api.authentication.pojo;
import com.google.common.collect.Lists;
import java.util.List;
import lombok.Data;
import java.util.List;
@Data
public class Organization {

View File

@@ -18,17 +18,22 @@ public class User {
private String email;
public static User get(Long id, String name, String displayName, String email) {
return new User(id, name, displayName, email);
private Integer isAdmin;
public static User get(Long id, String name, String displayName, String email, Integer isAdmin) {
return new User(id, name, displayName, email, isAdmin);
}
public static User getFakeUser() {
return new User(1L, "admin", "admin", "admin@email");
return new User(1L, "admin", "admin", "admin@email", 1);
}
public String getDisplayName() {
return StringUtils.isBlank(displayName) ? name : displayName;
}
public boolean isSuperAdmin() {
return isAdmin != null && isAdmin == 1;
}
}

View File

@@ -9,13 +9,14 @@ public class UserWithPassword extends User {
private String password;
public UserWithPassword(Long id, String name, String displayName, String email, String password) {
super(id, name, displayName, email);
public UserWithPassword(Long id, String name, String displayName, String email, String password, Integer isAdmin) {
super(id, name, displayName, email, isAdmin);
this.password = password;
}
public static UserWithPassword get(Long id, String name, String displayName, String email, String password) {
return new UserWithPassword(id, name, displayName, email, password);
public static UserWithPassword get(Long id, String name, String displayName,
String email, String password, Integer isAdmin) {
return new UserWithPassword(id, name, displayName, email, password, isAdmin);
}
}

View File

@@ -3,6 +3,7 @@ package com.tencent.supersonic.auth.api.authentication.service;
import com.tencent.supersonic.auth.api.authentication.pojo.Organization;
import com.tencent.supersonic.auth.api.authentication.pojo.User;
import com.tencent.supersonic.auth.api.authentication.request.UserReq;
import java.util.List;
import java.util.Set;

View File

@@ -1,6 +1,7 @@
package com.tencent.supersonic.auth.api.authentication.service;
import com.tencent.supersonic.auth.api.authentication.pojo.User;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

View File

@@ -6,7 +6,7 @@ import lombok.Data;
@Data
public class AuthGroup {
private String modelId;
private Long modelId;
private String name;
private Integer groupId;
private List<AuthRule> authRules;

View File

@@ -7,13 +7,13 @@ import lombok.ToString;
@ToString
public class AuthRes {
private String modelId;
private Long modelId;
private String name;
public AuthRes() {
}
public AuthRes(String modelId, String name) {
public AuthRes(Long modelId, String name) {
this.modelId = modelId;
this.name = name;
}

View File

@@ -1,10 +1,13 @@
package com.tencent.supersonic.auth.api.authorization.request;
import com.google.common.collect.Lists;
import com.tencent.supersonic.auth.api.authorization.pojo.AuthRes;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
import lombok.ToString;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
@Data
@ToString
@@ -14,5 +17,17 @@ public class QueryAuthResReq {
private List<AuthRes> resources;
private String modelId;
private Long modelId;
private List<Long> modelIds;
public List<Long> getModelIds() {
if (!CollectionUtils.isEmpty(modelIds)) {
return modelIds;
}
if (modelId != null) {
return Lists.newArrayList(modelId);
}
return Lists.newArrayList();
}
}

View File

@@ -4,6 +4,7 @@ import com.tencent.supersonic.auth.api.authorization.pojo.AuthResGrp;
import com.tencent.supersonic.auth.api.authorization.pojo.DimensionFilter;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
@Data

View File

@@ -6,12 +6,11 @@ import com.tencent.supersonic.auth.api.authorization.request.QueryAuthResReq;
import com.tencent.supersonic.auth.api.authorization.response.AuthorizedResourceResp;
import java.util.List;
public interface AuthService {
List<AuthGroup> queryAuthGroups(String domainId, Integer groupId);
void updateAuthGroup(AuthGroup group);
void addOrUpdateAuthGroup(AuthGroup group);
void removeAuthGroup(AuthGroup group);

View File

@@ -33,12 +33,6 @@
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
@@ -52,12 +46,7 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>${mybatis-spring.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper</artifactId>

View File

@@ -11,11 +11,14 @@ import com.tencent.supersonic.auth.authentication.persistence.dataobject.UserDO;
import com.tencent.supersonic.auth.authentication.persistence.repository.UserRepository;
import com.tencent.supersonic.auth.authentication.utils.UserTokenUtils;
import com.tencent.supersonic.common.util.ContextUtils;
import org.springframework.beans.BeanUtils;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import org.springframework.beans.BeanUtils;
/**
* DefaultUserAdaptor provides a default method to obtain user and organization information
*/
public class DefaultUserAdaptor implements UserAdaptor {
private List<UserDO> getUserDOList() {
@@ -71,7 +74,7 @@ public class DefaultUserAdaptor implements UserAdaptor {
}
if (userDO.getPassword().equals(userReq.getPassword())) {
UserWithPassword user = UserWithPassword.get(userDO.getId(), userDO.getName(), userDO.getDisplayName(),
userDO.getEmail(), userDO.getPassword());
userDO.getEmail(), userDO.getPassword(), userDO.getIsAdmin());
return userTokenUtils.generateToken(user);
}
throw new RuntimeException("password not correct, please try again");

View File

@@ -29,7 +29,6 @@ public abstract class AuthenticationInterceptor implements HandlerInterceptor {
protected S2ThreadContext s2ThreadContext;
protected boolean isExcludedUri(String uri) {
String excludePathStr = authenticationConfig.getExcludePath();
if (Strings.isEmpty(excludePathStr)) {
@@ -42,13 +41,23 @@ public abstract class AuthenticationInterceptor implements HandlerInterceptor {
return excludePaths.stream().anyMatch(uri::startsWith);
}
protected boolean isIncludedUri(String uri) {
String includePathStr = authenticationConfig.getIncludePath();
if (Strings.isEmpty(includePathStr)) {
return false;
}
List<String> includePaths = Arrays.asList(includePathStr.split(","));
if (CollectionUtils.isEmpty(includePaths)) {
return false;
}
return includePaths.stream().anyMatch(uri::startsWith);
}
protected boolean isInternalRequest(HttpServletRequest request) {
String internal = request.getHeader(UserConstants.INTERNAL);
return "true".equalsIgnoreCase(internal);
}
protected void reflectSetparam(HttpServletRequest request, String key, String value) {
try {
if (request instanceof StandardMultipartHttpServletRequest) {

View File

@@ -46,6 +46,10 @@ public class DefaultAuthenticationInterceptor extends AuthenticationInterceptor
}
String uri = request.getServletPath();
if (!isIncludedUri(uri)) {
return true;
}
if (isExcludedUri(uri)) {
return true;
}
@@ -72,5 +76,4 @@ public class DefaultAuthenticationInterceptor extends AuthenticationInterceptor
s2ThreadContext.set(threadContext);
}
}

View File

@@ -1,11 +1,12 @@
package com.tencent.supersonic.auth.authentication.interceptor;
import java.util.List;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.support.SpringFactoriesLoader;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import java.util.List;
@Configuration
public class InterceptorFactory implements WebMvcConfigurer {

View File

@@ -1,99 +1,129 @@
package com.tencent.supersonic.auth.authentication.persistence.dataobject;
public class UserDO {
/**
*
*
*/
private Long id;
/**
*
*
*/
private String name;
/**
*
*
*/
private String password;
/**
*
*
*/
private String displayName;
/**
*
*
*/
private String email;
/**
* @return id
*
*/
private Integer isAdmin;
/**
*
* @return id
*/
public Long getId() {
return id;
}
/**
* @param id
*
* @param id
*/
public void setId(Long id) {
this.id = id;
}
/**
* @return name
*
* @return name
*/
public String getName() {
return name;
}
/**
* @param name
*
* @param name
*/
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
/**
* @return password
*
* @return password
*/
public String getPassword() {
return password;
}
/**
* @param password
*
* @param password
*/
public void setPassword(String password) {
this.password = password == null ? null : password.trim();
}
/**
* @return display_name
*
* @return display_name
*/
public String getDisplayName() {
return displayName;
}
/**
* @param displayName
*
* @param displayName
*/
public void setDisplayName(String displayName) {
this.displayName = displayName == null ? null : displayName.trim();
}
/**
* @return email
*
* @return email
*/
public String getEmail() {
return email;
}
/**
* @param email
*
* @param email
*/
public void setEmail(String email) {
this.email = email == null ? null : email.trim();
}
/**
*
* @return is_admin
*/
public Integer getIsAdmin() {
return isAdmin;
}
/**
*
* @param isAdmin
*/
public void setIsAdmin(Integer isAdmin) {
this.isAdmin = isAdmin;
}
}

View File

@@ -4,7 +4,6 @@ import java.util.ArrayList;
import java.util.List;
public class UserDOExample {
/**
* s2_user
*/
@@ -31,6 +30,7 @@ public class UserDOExample {
protected Integer limitEnd;
/**
*
* @mbg.generated
*/
public UserDOExample() {
@@ -38,13 +38,7 @@ public class UserDOExample {
}
/**
* @mbg.generated
*/
public String getOrderByClause() {
return orderByClause;
}
/**
*
* @mbg.generated
*/
public void setOrderByClause(String orderByClause) {
@@ -52,13 +46,15 @@ public class UserDOExample {
}
/**
*
* @mbg.generated
*/
public boolean isDistinct() {
return distinct;
public String getOrderByClause() {
return orderByClause;
}
/**
*
* @mbg.generated
*/
public void setDistinct(boolean distinct) {
@@ -66,6 +62,15 @@ public class UserDOExample {
}
/**
*
* @mbg.generated
*/
public boolean isDistinct() {
return distinct;
}
/**
*
* @mbg.generated
*/
public List<Criteria> getOredCriteria() {
@@ -73,6 +78,7 @@ public class UserDOExample {
}
/**
*
* @mbg.generated
*/
public void or(Criteria criteria) {
@@ -80,6 +86,7 @@ public class UserDOExample {
}
/**
*
* @mbg.generated
*/
public Criteria or() {
@@ -89,6 +96,7 @@ public class UserDOExample {
}
/**
*
* @mbg.generated
*/
public Criteria createCriteria() {
@@ -100,6 +108,7 @@ public class UserDOExample {
}
/**
*
* @mbg.generated
*/
protected Criteria createCriteriaInternal() {
@@ -108,6 +117,7 @@ public class UserDOExample {
}
/**
*
* @mbg.generated
*/
public void clear() {
@@ -117,6 +127,15 @@ public class UserDOExample {
}
/**
*
* @mbg.generated
*/
public void setLimitStart(Integer limitStart) {
this.limitStart=limitStart;
}
/**
*
* @mbg.generated
*/
public Integer getLimitStart() {
@@ -124,31 +143,25 @@ public class UserDOExample {
}
/**
*
* @mbg.generated
*/
public void setLimitStart(Integer limitStart) {
this.limitStart = limitStart;
public void setLimitEnd(Integer limitEnd) {
this.limitEnd=limitEnd;
}
/**
*
* @mbg.generated
*/
public Integer getLimitEnd() {
return limitEnd;
}
/**
* @mbg.generated
*/
public void setLimitEnd(Integer limitEnd) {
this.limitEnd = limitEnd;
}
/**
* s2_user null
*/
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
@@ -528,6 +541,66 @@ public class UserDOExample {
addCriterion("email not between", value1, value2, "email");
return (Criteria) this;
}
public Criteria andIsAdminIsNull() {
addCriterion("is_admin is null");
return (Criteria) this;
}
public Criteria andIsAdminIsNotNull() {
addCriterion("is_admin is not null");
return (Criteria) this;
}
public Criteria andIsAdminEqualTo(Integer value) {
addCriterion("is_admin =", value, "isAdmin");
return (Criteria) this;
}
public Criteria andIsAdminNotEqualTo(Integer value) {
addCriterion("is_admin <>", value, "isAdmin");
return (Criteria) this;
}
public Criteria andIsAdminGreaterThan(Integer value) {
addCriterion("is_admin >", value, "isAdmin");
return (Criteria) this;
}
public Criteria andIsAdminGreaterThanOrEqualTo(Integer value) {
addCriterion("is_admin >=", value, "isAdmin");
return (Criteria) this;
}
public Criteria andIsAdminLessThan(Integer value) {
addCriterion("is_admin <", value, "isAdmin");
return (Criteria) this;
}
public Criteria andIsAdminLessThanOrEqualTo(Integer value) {
addCriterion("is_admin <=", value, "isAdmin");
return (Criteria) this;
}
public Criteria andIsAdminIn(List<Integer> values) {
addCriterion("is_admin in", values, "isAdmin");
return (Criteria) this;
}
public Criteria andIsAdminNotIn(List<Integer> values) {
addCriterion("is_admin not in", values, "isAdmin");
return (Criteria) this;
}
public Criteria andIsAdminBetween(Integer value1, Integer value2) {
addCriterion("is_admin between", value1, value2, "isAdmin");
return (Criteria) this;
}
public Criteria andIsAdminNotBetween(Integer value1, Integer value2) {
addCriterion("is_admin not between", value1, value2, "isAdmin");
return (Criteria) this;
}
}
/**
@@ -544,7 +617,6 @@ public class UserDOExample {
* s2_user null
*/
public static class Criterion {
private String condition;
private Object value;
@@ -561,6 +633,38 @@ public class UserDOExample {
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
@@ -596,37 +700,5 @@ public class UserDOExample {
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
}
}

View File

@@ -3,8 +3,8 @@ package com.tencent.supersonic.auth.authentication.persistence.repository.impl;
import com.tencent.supersonic.auth.authentication.persistence.dataobject.UserDO;
import com.tencent.supersonic.auth.authentication.persistence.dataobject.UserDOExample;
import com.tencent.supersonic.auth.authentication.persistence.mapper.UserDOMapper;
import com.tencent.supersonic.auth.authentication.persistence.repository.UserRepository;
import com.tencent.supersonic.auth.authentication.persistence.mapper.UserDOMapper;
import java.util.List;
import java.util.Optional;
import org.springframework.stereotype.Component;
@@ -20,7 +20,6 @@ public class UserRepositoryImpl implements UserRepository {
this.userDOMapper = userDOMapper;
}
@Override
public List<UserDO> getUserList() {
return userDOMapper.selectByExample(new UserDOExample());
@@ -40,5 +39,4 @@ public class UserRepositoryImpl implements UserRepository {
return userDOOptional.orElse(null);
}
}

View File

@@ -29,7 +29,6 @@ public class UserController {
this.userService = userService;
}
@GetMapping("/getCurrentUser")
public User getCurrentUser(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
return UserHolder.findUser(httpServletRequest, httpServletResponse);
@@ -70,5 +69,4 @@ public class UserController {
return userService.login(userCmd);
}
}

View File

@@ -7,12 +7,12 @@ import com.tencent.supersonic.auth.api.authentication.service.UserService;
import com.tencent.supersonic.auth.authentication.utils.ComponentFactory;
import java.util.List;
import java.util.Set;
import org.springframework.stereotype.Service;
@Service
public class UserServiceImpl implements UserService {
@Override
public List<String> getUserNames() {
return ComponentFactory.getUserAdaptor().getUserNames();

View File

@@ -20,5 +20,4 @@ public class FakeUserStrategy implements UserStrategy {
return User.getFakeUser();
}
}

View File

@@ -1,8 +1,8 @@
package com.tencent.supersonic.auth.authentication.utils;
import com.tencent.supersonic.auth.api.authentication.adaptor.UserAdaptor;
import java.util.Objects;
import org.springframework.core.io.support.SpringFactoriesLoader;
import java.util.Objects;
public class ComponentFactory {

View File

@@ -2,6 +2,7 @@ package com.tencent.supersonic.auth.authentication.utils;
import static com.tencent.supersonic.auth.api.authentication.constant.UserConstants.TOKEN_ALGORITHM;
import static com.tencent.supersonic.auth.api.authentication.constant.UserConstants.TOKEN_CREATE_TIME;
import static com.tencent.supersonic.auth.api.authentication.constant.UserConstants.TOKEN_IS_ADMIN;
import static com.tencent.supersonic.auth.api.authentication.constant.UserConstants.TOKEN_PREFIX;
import static com.tencent.supersonic.auth.api.authentication.constant.UserConstants.TOKEN_TIME_OUT;
import static com.tencent.supersonic.auth.api.authentication.constant.UserConstants.TOKEN_USER_DISPLAY_NAME;
@@ -42,6 +43,7 @@ public class UserTokenUtils {
claims.put(TOKEN_USER_PASSWORD, StringUtils.isEmpty(user.getPassword()) ? "" : user.getPassword());
claims.put(TOKEN_USER_DISPLAY_NAME, user.getDisplayName());
claims.put(TOKEN_CREATE_TIME, System.currentTimeMillis());
claims.put(TOKEN_IS_ADMIN, user.getIsAdmin());
return generate(claims);
}
@@ -52,10 +54,10 @@ public class UserTokenUtils {
claims.put(TOKEN_USER_PASSWORD, "admin");
claims.put(TOKEN_USER_DISPLAY_NAME, "admin");
claims.put(TOKEN_CREATE_TIME, System.currentTimeMillis());
claims.put(TOKEN_IS_ADMIN, 1);
return generate(claims);
}
public User getUser(HttpServletRequest request) {
String token = request.getHeader(authenticationConfig.getTokenHttpHeaderKey());
final Claims claims = getClaims(token);
@@ -63,7 +65,9 @@ public class UserTokenUtils {
String userName = String.valueOf(claims.get(TOKEN_USER_NAME));
String email = String.valueOf(claims.get(TOKEN_USER_EMAIL));
String displayName = String.valueOf(claims.get(TOKEN_USER_DISPLAY_NAME));
return User.get(userId, userName, displayName, email);
Integer isAdmin = claims.get(TOKEN_IS_ADMIN) == null
? 0 : Integer.parseInt(claims.get(TOKEN_IS_ADMIN).toString());
return User.get(userId, userName, displayName, email, isAdmin);
}
public UserWithPassword getUserWithPassword(HttpServletRequest request) {
@@ -79,7 +83,9 @@ public class UserTokenUtils {
String email = String.valueOf(claims.get(TOKEN_USER_EMAIL));
String displayName = String.valueOf(claims.get(TOKEN_USER_DISPLAY_NAME));
String password = String.valueOf(claims.get(TOKEN_USER_PASSWORD));
return UserWithPassword.get(userId, userName, displayName, email, password);
Integer isAdmin = claims.get(TOKEN_IS_ADMIN) == null
? 0 : Integer.parseInt(claims.get(TOKEN_IS_ADMIN).toString());
return UserWithPassword.get(userId, userName, displayName, email, password, isAdmin);
}
private Claims getClaims(String token) {
@@ -113,5 +119,4 @@ public class UserTokenUtils {
.compact();
}
}

View File

@@ -1,159 +1,118 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.tencent.supersonic.auth.authentication.persistence.mapper.UserDOMapper">
<resultMap id="BaseResultMap"
type="com.tencent.supersonic.auth.authentication.persistence.dataobject.UserDO">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="name" jdbcType="VARCHAR" property="name"/>
<result column="password" jdbcType="VARCHAR" property="password"/>
<result column="display_name" jdbcType="VARCHAR" property="displayName"/>
<result column="email" jdbcType="VARCHAR" property="email"/>
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and
#{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem"
open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
<resultMap id="BaseResultMap" type="com.tencent.supersonic.auth.authentication.persistence.dataobject.UserDO">
<result column="id" jdbcType="BIGINT" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="password" jdbcType="VARCHAR" property="password" />
<result column="display_name" jdbcType="VARCHAR" property="displayName" />
<result column="email" jdbcType="VARCHAR" property="email" />
<result column="is_admin" jdbcType="INTEGER" property="isAdmin" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id
, name, password, display_name, email
</sql>
<select id="selectByExample"
parameterType="com.tencent.supersonic.auth.authentication.persistence.dataobject.UserDOExample"
resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</trim>
</if>
<include refid="Base_Column_List"/>
from s2_user
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
<if test="limitStart != null and limitStart>=0">
limit #{limitStart} , #{limitEnd}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from s2_user
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete
from s2_user
where id = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert"
parameterType="com.tencent.supersonic.auth.authentication.persistence.dataobject.UserDO">
insert into s2_user (id, name, password,
display_name, email)
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},
#{displayName,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective"
parameterType="com.tencent.supersonic.auth.authentication.persistence.dataobject.UserDO">
insert into s2_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="name != null">
name,
</if>
<if test="password != null">
password,
</if>
<if test="displayName != null">
display_name,
</if>
<if test="email != null">
email,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="password != null">
#{password,jdbcType=VARCHAR},
</if>
<if test="displayName != null">
#{displayName,jdbcType=VARCHAR},
</if>
<if test="email != null">
#{email,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample"
parameterType="com.tencent.supersonic.auth.authentication.persistence.dataobject.UserDOExample"
resultType="java.lang.Long">
select count(*) from s2_user
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
</select>
<update id="updateByPrimaryKeySelective"
parameterType="com.tencent.supersonic.auth.authentication.persistence.dataobject.UserDO">
update s2_user
<set>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="password != null">
password = #{password,jdbcType=VARCHAR},
</if>
<if test="displayName != null">
display_name = #{displayName,jdbcType=VARCHAR},
</if>
<if test="email != null">
email = #{email,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey"
parameterType="com.tencent.supersonic.auth.authentication.persistence.dataobject.UserDO">
update s2_user
set name = #{name,jdbcType=VARCHAR},
password = #{password,jdbcType=VARCHAR},
display_name = #{displayName,jdbcType=VARCHAR},
email = #{email,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, name, password, display_name, email, is_admin
</sql>
<select id="selectByExample" parameterType="com.tencent.supersonic.auth.authentication.persistence.dataobject.UserDOExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from s2_user
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
<if test="limitStart != null and limitStart>=0">
limit #{limitStart} , #{limitEnd}
</if>
</select>
<insert id="insert" parameterType="com.tencent.supersonic.auth.authentication.persistence.dataobject.UserDO">
insert into s2_user (id, name, password,
display_name, email, is_admin
)
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},
#{displayName,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{isAdmin,jdbcType=INTEGER}
)
</insert>
<insert id="insertSelective" parameterType="com.tencent.supersonic.auth.authentication.persistence.dataobject.UserDO">
insert into s2_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="name != null">
name,
</if>
<if test="password != null">
password,
</if>
<if test="displayName != null">
display_name,
</if>
<if test="email != null">
email,
</if>
<if test="isAdmin != null">
is_admin,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="password != null">
#{password,jdbcType=VARCHAR},
</if>
<if test="displayName != null">
#{displayName,jdbcType=VARCHAR},
</if>
<if test="email != null">
#{email,jdbcType=VARCHAR},
</if>
<if test="isAdmin != null">
#{isAdmin,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.tencent.supersonic.auth.authentication.persistence.dataobject.UserDOExample" resultType="java.lang.Long">
select count(*) from s2_user
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
</mapper>

View File

@@ -35,10 +35,6 @@
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<dependency>
<groupId>com.tencent.supersonic</groupId>
<artifactId>auth-authentication</artifactId>
@@ -48,4 +44,4 @@
</dependencies>
</project>
</project>

View File

@@ -40,7 +40,7 @@ public class AuthController {
@PostMapping("/createGroup")
public void newAuthGroup(@RequestBody AuthGroup group) {
group.setGroupId(null);
authService.updateAuthGroup(group);
authService.addOrUpdateAuthGroup(group);
}
@PostMapping("/removeGroup")
@@ -58,7 +58,7 @@ public class AuthController {
if (group.getGroupId() == null || group.getGroupId() == 0) {
throw new RuntimeException("groupId is empty");
}
authService.updateAuthGroup(group);
authService.addOrUpdateAuthGroup(group);
}
/**

View File

@@ -1,6 +1,7 @@
package com.tencent.supersonic.auth.authorization.application;
package com.tencent.supersonic.auth.authorization.service;
import com.google.common.base.Strings;
import com.google.common.collect.Lists;
import com.google.gson.Gson;
import com.tencent.supersonic.auth.api.authentication.pojo.User;
import com.tencent.supersonic.auth.api.authentication.service.UserService;
@@ -13,7 +14,6 @@ import com.tencent.supersonic.auth.api.authorization.service.AuthService;
import com.tencent.supersonic.auth.api.authorization.pojo.AuthGroup;
import com.tencent.supersonic.auth.api.authorization.pojo.AuthRule;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
@@ -48,12 +48,12 @@ public class AuthServiceImpl implements AuthService {
public List<AuthGroup> queryAuthGroups(String modelId, Integer groupId) {
return load().stream()
.filter(group -> (Objects.isNull(groupId) || groupId.equals(group.getGroupId()))
&& modelId.equals(group.getModelId()))
&& modelId.equals(group.getModelId().toString()))
.collect(Collectors.toList());
}
@Override
public void updateAuthGroup(AuthGroup group) {
public void addOrUpdateAuthGroup(AuthGroup group) {
Gson g = new Gson();
if (group.getGroupId() == null) {
int nextGroupId = 1;
@@ -76,21 +76,17 @@ public class AuthServiceImpl implements AuthService {
jdbcTemplate.update("delete from s2_auth_groups where group_id = ?", group.getGroupId());
}
@Override
public AuthorizedResourceResp queryAuthorizedResources(QueryAuthResReq req, User user) {
Set<String> userOrgIds = userService.getUserAllOrgId(user.getName());
if (!CollectionUtils.isEmpty(userOrgIds)) {
req.setDepartmentIds(new ArrayList<>(userOrgIds));
}
List<AuthGroup> groups = getAuthGroups(req, user.getName());
List<AuthGroup> groups = getAuthGroups(req.getModelIds(), user.getName(), new ArrayList<>(userOrgIds));
AuthorizedResourceResp resource = new AuthorizedResourceResp();
Map<String, List<AuthGroup>> authGroupsByModelId = groups.stream()
Map<Long, List<AuthGroup>> authGroupsByModelId = groups.stream()
.collect(Collectors.groupingBy(AuthGroup::getModelId));
Map<String, List<AuthRes>> reqAuthRes = req.getResources().stream()
Map<Long, List<AuthRes>> reqAuthRes = req.getResources().stream()
.collect(Collectors.groupingBy(AuthRes::getModelId));
for (String modelId : reqAuthRes.keySet()) {
for (Long modelId : reqAuthRes.keySet()) {
List<AuthRes> reqResourcesList = reqAuthRes.get(modelId);
AuthResGrp rg = new AuthResGrp();
if (authGroupsByModelId.containsKey(modelId)) {
@@ -113,8 +109,11 @@ public class AuthServiceImpl implements AuthService {
}
}
if (StringUtils.isNotEmpty(req.getModelId())) {
List<AuthGroup> authGroups = authGroupsByModelId.get(req.getModelId());
if (!CollectionUtils.isEmpty(req.getModelIds())) {
List<AuthGroup> authGroups = Lists.newArrayList();
for (Long modelId : authGroupsByModelId.keySet()) {
authGroups.addAll(authGroupsByModelId.getOrDefault(modelId, Lists.newArrayList()));
}
if (!CollectionUtils.isEmpty(authGroups)) {
for (AuthGroup group : authGroups) {
if (group.getDimensionFilters() != null
@@ -130,17 +129,17 @@ public class AuthServiceImpl implements AuthService {
return resource;
}
private List<AuthGroup> getAuthGroups(QueryAuthResReq req, String userName) {
private List<AuthGroup> getAuthGroups(List<Long> modelIds, String userName, List<String> departmentIds) {
List<AuthGroup> groups = load().stream()
.filter(group -> {
if (!Objects.equals(group.getModelId(), req.getModelId())) {
if (CollectionUtils.isEmpty(modelIds) || !modelIds.contains(group.getModelId())) {
return false;
}
if (!CollectionUtils.isEmpty(group.getAuthorizedUsers()) && group.getAuthorizedUsers()
.contains(userName)) {
return true;
}
for (String departmentId : req.getDepartmentIds()) {
for (String departmentId : departmentIds) {
if (!CollectionUtils.isEmpty(group.getAuthorizedDepartmentIds())
&& group.getAuthorizedDepartmentIds().contains(departmentId)) {
return true;
@@ -148,7 +147,7 @@ public class AuthServiceImpl implements AuthService {
}
return false;
}).collect(Collectors.toList());
log.info("user:{} department:{} authGroups:{}", userName, req.getDepartmentIds(), groups);
log.info("user:{} department:{} authGroups:{}", userName, departmentIds, groups);
return groups;
}

View File

@@ -3,11 +3,8 @@ package com.tencent.supersonic.chat.api.component;
import com.tencent.supersonic.chat.api.pojo.QueryContext;
/**
* This interface defines the contract for a schema mapper that identifies references to schema
* elements in natural language queries.
*
* The schema mapper matches queries against the knowledge base which is constructed using the
* schema of semantic models.
* A schema mapper identifies references to schema elements(metrics/dimensions/entities/values)
* in user queries. It matches the query text against the knowledge base.
*/
public interface SchemaMapper {

View File

@@ -1,9 +1,13 @@
package com.tencent.supersonic.chat.api.component;
import com.tencent.supersonic.chat.api.pojo.CorrectionInfo;
import net.sf.jsqlparser.JSQLParserException;
import com.tencent.supersonic.chat.api.pojo.SemanticParseInfo;
import com.tencent.supersonic.chat.api.pojo.request.QueryReq;
/**
* A semantic corrector checks validity of extracted semantic information and
* performs correction and optimization if needed.
*/
public interface SemanticCorrector {
CorrectionInfo corrector(CorrectionInfo correctionInfo) throws JSQLParserException;
void correct(QueryReq queryReq, SemanticParseInfo semanticParseInfo);
}

View File

@@ -8,20 +8,23 @@ import com.tencent.supersonic.semantic.api.model.request.PageDimensionReq;
import com.tencent.supersonic.semantic.api.model.request.PageMetricReq;
import com.tencent.supersonic.semantic.api.model.response.DomainResp;
import com.tencent.supersonic.semantic.api.model.response.DimensionResp;
import com.tencent.supersonic.semantic.api.model.response.ModelResp;
import com.tencent.supersonic.semantic.api.model.response.ExplainResp;
import com.tencent.supersonic.semantic.api.model.response.MetricResp;
import com.tencent.supersonic.semantic.api.model.response.ModelResp;
import com.tencent.supersonic.semantic.api.model.response.ModelSchemaResp;
import com.tencent.supersonic.semantic.api.model.response.QueryResultWithSchemaResp;
import com.tencent.supersonic.semantic.api.query.request.QueryDslReq;
import com.tencent.supersonic.semantic.api.query.request.ExplainSqlReq;
import com.tencent.supersonic.semantic.api.query.request.QueryDimValueReq;
import com.tencent.supersonic.semantic.api.query.request.QueryS2SQLReq;
import com.tencent.supersonic.semantic.api.query.request.QueryMultiStructReq;
import com.tencent.supersonic.semantic.api.query.request.QueryStructReq;
import java.util.List;
/**
* This interface defines the contract for a semantic layer that provides a simplified and
* consistent view of data from multiple sources.
* The semantic layer abstracts away the complexity of the underlying data sources and provides
* a unified view of the data that is easier to understand and use.
* A semantic layer provides a simplified and consistent view of data from multiple sources.
* It abstracts away the complexity of the underlying data sources and provides a unified view
* of the data that is easier to understand and use.
* <p>
* The interface defines methods for getting metadata as well as querying data in the semantic layer.
* Implementations of this interface should provide concrete implementations that interact with the
@@ -29,16 +32,32 @@ import java.util.List;
* as proxy to a remote semantic service.
* </p>
*/
public interface SemanticLayer {
public interface SemanticInterpreter {
QueryResultWithSchemaResp queryByStruct(QueryStructReq queryStructReq, User user);
QueryResultWithSchemaResp queryByMultiStruct(QueryMultiStructReq queryMultiStructReq, User user);
QueryResultWithSchemaResp queryByDsl(QueryDslReq queryDslReq, User user);
QueryResultWithSchemaResp queryByS2SQL(QueryS2SQLReq queryS2SQLReq, User user);
QueryResultWithSchemaResp queryDimValue(QueryDimValueReq queryDimValueReq, User user);
List<ModelSchema> getModelSchema();
List<ModelSchema> getModelSchema(List<Long> ids);
ModelSchema getModelSchema(Long model, Boolean cacheEnable);
PageInfo<DimensionResp> getDimensionPage(PageDimensionReq pageDimensionCmd);
PageInfo<MetricResp> getMetricPage(PageMetricReq pageMetricCmd);
PageInfo<DimensionResp> getDimensionPage(PageDimensionReq pageDimensionReq);
PageInfo<MetricResp> getMetricPage(PageMetricReq pageDimensionReq, User user);
List<DomainResp> getDomainList(User user);
List<ModelResp> getModelList(AuthType authType, Long domainId, User user);
<T> ExplainResp explain(ExplainSqlReq<T> explainSqlReq, User user) throws Exception;
List<ModelSchemaResp> fetchModelSchema(List<Long> ids, Boolean cacheEnable);
}

View File

@@ -5,11 +5,9 @@ import com.tencent.supersonic.chat.api.pojo.ChatContext;
import com.tencent.supersonic.chat.api.pojo.QueryContext;
/**
* This interface defines the contract for a semantic parser that can analyze natural language query
* and extract meaning from it.
*
* The semantic parser uses either rule-based or model-based algorithms to identify query intent
* and related semantic items described in the query.
* A semantic parser understands user queries and extracts semantic information.
* It could leverage either rule-based or LLM-based approach to identify query intent
* and extract related semantic items from the query.
*/
public interface SemanticParser {

View File

@@ -6,8 +6,7 @@ import com.tencent.supersonic.chat.api.pojo.response.QueryResult;
import org.apache.calcite.sql.parser.SqlParseException;
/**
* This class defines the contract for a semantic query that executes specific type of
* query based on the results of semantic parsing.
* A semantic query executes specific type of query based on the results of semantic parsing.
*/
public interface SemanticQuery {
@@ -15,6 +14,10 @@ public interface SemanticQuery {
QueryResult execute(User user) throws SqlParseException;
void initS2Sql(User user);
String explain(User user);
SemanticParseInfo getParseInfo();
void setParseInfo(SemanticParseInfo parseInfo);

View File

@@ -1,9 +1,15 @@
package com.tencent.supersonic.chat.api.pojo;
import com.google.common.collect.Sets;
import com.tencent.supersonic.common.pojo.ModelRela;
import lombok.Data;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import lombok.Data;
@Data
public class ModelSchema {
@@ -12,7 +18,9 @@ public class ModelSchema {
private Set<SchemaElement> metrics = new HashSet<>();
private Set<SchemaElement> dimensions = new HashSet<>();
private Set<SchemaElement> dimensionValues = new HashSet<>();
private Set<SchemaElement> tags = new HashSet<>();
private SchemaElement entity = new SchemaElement();
private List<ModelRela> modelRelas = new ArrayList<>();
public SchemaElement getElement(SchemaElementType elementType, long elementID) {
Optional<SchemaElement> element = Optional.empty();
@@ -33,6 +41,9 @@ public class ModelSchema {
case VALUE:
element = dimensionValues.stream().filter(e -> e.getId() == elementID).findFirst();
break;
case TAG:
element = tags.stream().filter(e -> e.getId() == elementID).findFirst();
break;
default:
}
@@ -43,4 +54,45 @@ public class ModelSchema {
}
}
public SchemaElement getElement(SchemaElementType elementType, String name) {
Optional<SchemaElement> element = Optional.empty();
switch (elementType) {
case ENTITY:
element = Optional.ofNullable(entity);
break;
case MODEL:
element = Optional.of(model);
break;
case METRIC:
element = metrics.stream().filter(e -> name.equals(e.getName())).findFirst();
break;
case DIMENSION:
element = dimensions.stream().filter(e -> name.equals(e.getName())).findFirst();
break;
case VALUE:
element = dimensionValues.stream().filter(e -> name.equals(e.getName())).findFirst();
break;
default:
}
if (element.isPresent()) {
return element.get();
} else {
return null;
}
}
public Set<Long> getModelClusterSet() {
if (CollectionUtils.isEmpty(modelRelas)) {
return Sets.newHashSet();
}
Set<Long> modelClusterSet = new HashSet<>();
modelRelas.forEach(modelRela -> {
modelClusterSet.add(modelRela.getToModelId());
modelClusterSet.add(modelRela.getFromModelId());
});
return modelClusterSet;
}
}

View File

@@ -2,11 +2,12 @@ package com.tencent.supersonic.chat.api.pojo;
import com.tencent.supersonic.chat.api.component.SemanticQuery;
import com.tencent.supersonic.chat.api.pojo.request.QueryReq;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.ArrayList;
import java.util.List;
@Data
@NoArgsConstructor
public class QueryContext {
@@ -14,6 +15,7 @@ public class QueryContext {
private QueryReq request;
private List<SemanticQuery> candidateQueries = new ArrayList<>();
private SchemaMapInfo mapInfo = new SchemaMapInfo();
private SchemaModelClusterMapInfo modelClusterMapInfo = new SchemaModelClusterMapInfo();
public QueryContext(QueryReq request) {
this.request = request;

View File

@@ -0,0 +1,19 @@
package com.tencent.supersonic.chat.api.pojo;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class RelatedSchemaElement {
private Long dimensionId;
private boolean isNecessary;
}

View File

@@ -1,18 +1,19 @@
package com.tencent.supersonic.chat.api.pojo;
import com.google.common.base.Objects;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
import lombok.Data;
import lombok.Getter;
import lombok.Builder;
import lombok.NoArgsConstructor;
@Data
@Getter
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class SchemaElement implements Serializable {
@@ -23,17 +24,12 @@ public class SchemaElement implements Serializable {
private Long useCnt;
private SchemaElementType type;
private List<String> alias;
private List<SchemaValueMap> schemaValueMaps;
private List<RelatedSchemaElement> relatedSchemaElements;
public SchemaElement(Long model, Long id, String name, String bizName,
Long useCnt, SchemaElementType type, List<String> alias) {
this.model = model;
this.id = id;
this.name = name;
this.bizName = bizName;
this.useCnt = useCnt;
this.type = type;
this.alias = alias;
}
private String defaultAgg;
private double order;
@Override
public boolean equals(Object o) {
@@ -46,12 +42,13 @@ public class SchemaElement implements Serializable {
SchemaElement schemaElement = (SchemaElement) o;
return Objects.equal(model, schemaElement.model) && Objects.equal(id,
schemaElement.id) && Objects.equal(name, schemaElement.name)
&& Objects.equal(bizName, schemaElement.bizName) && Objects.equal(
useCnt, schemaElement.useCnt) && Objects.equal(type, schemaElement.type);
&& Objects.equal(bizName, schemaElement.bizName)
&& Objects.equal(type, schemaElement.type);
}
@Override
public int hashCode() {
return Objects.hashCode(model, id, name, bizName, useCnt, type);
return Objects.hashCode(model, id, name, bizName, type);
}
}

View File

@@ -6,6 +6,7 @@ public enum SchemaElementType {
DIMENSION,
VALUE,
ENTITY,
TAG,
ID,
DATE
}

View File

@@ -21,6 +21,10 @@ public class SchemaMapInfo {
return modelElementMatches;
}
public void setModelElementMatches(Map<Long, List<SchemaElementMatch>> modelElementMatches) {
this.modelElementMatches = modelElementMatches;
}
public void setMatchedElements(Long model, List<SchemaElementMatch> elementMatches) {
modelElementMatches.put(model, elementMatches);
}

View File

@@ -0,0 +1,61 @@
package com.tencent.supersonic.chat.api.pojo;
import com.clickhouse.client.internal.apache.commons.compress.utils.Lists;
import com.tencent.supersonic.common.pojo.ModelCluster;
import lombok.Data;
import org.springframework.util.CollectionUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
@Data
public class SchemaModelClusterMapInfo {
private Map<String, List<SchemaElementMatch>> modelElementMatches = new HashMap<>();
public Set<String> getMatchedModelClusters() {
return modelElementMatches.keySet();
}
public List<SchemaElementMatch> getMatchedElements(Long modelId) {
for (String key : modelElementMatches.keySet()) {
if (ModelCluster.getModelIdFromKey(key).contains(modelId)) {
return modelElementMatches.get(key);
}
}
return Lists.newArrayList();
}
public List<SchemaElementMatch> getMatchedElements(String modelCluster) {
return modelElementMatches.get(modelCluster);
}
public Map<String, List<SchemaElementMatch>> getModelElementMatches() {
return modelElementMatches;
}
public Map<String, List<SchemaElementMatch>> getElementMatchesByModelIds(Set<Long> modelIds) {
if (CollectionUtils.isEmpty(modelIds)) {
return modelElementMatches;
}
Map<String, List<SchemaElementMatch>> modelElementMatchesFiltered = new HashMap<>();
for (String key : modelElementMatches.keySet()) {
for (Long modelId : modelIds) {
if (ModelCluster.getModelIdFromKey(key).contains(modelId)) {
modelElementMatchesFiltered.put(key, modelElementMatches.get(key));
}
}
}
return modelElementMatchesFiltered;
}
public void setModelElementMatches(Map<String, List<SchemaElementMatch>> modelElementMatches) {
this.modelElementMatches = modelElementMatches;
}
public void setMatchedElements(String modelCluster, List<SchemaElementMatch> elementMatches) {
modelElementMatches.put(modelCluster, elementMatches);
}
}

View File

@@ -0,0 +1,24 @@
package com.tencent.supersonic.chat.api.pojo;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
@Data
public class SchemaValueMap {
/**
* dimension value in db
*/
private String techName;
/**
* dimension value for result show
*/
private String bizName;
/**
* dimension value for user query
*/
private List<String> alias = new ArrayList<>();
}

View File

@@ -10,7 +10,7 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class CorrectionInfo {
public class SemanticCorrectInfo {
private QueryFilters queryFilters;
@@ -18,4 +18,5 @@ public class CorrectionInfo {
private String sql;
private String preSql;
}

View File

@@ -1,53 +1,74 @@
package com.tencent.supersonic.chat.api.pojo;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;
import java.util.LinkedHashSet;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.Comparator;
import com.tencent.supersonic.chat.api.pojo.request.QueryFilter;
import com.tencent.supersonic.chat.api.pojo.response.EntityInfo;
import com.tencent.supersonic.chat.api.pojo.response.SqlInfo;
import com.tencent.supersonic.common.pojo.DateConf;
import com.tencent.supersonic.common.pojo.ModelCluster;
import com.tencent.supersonic.common.pojo.Order;
import com.tencent.supersonic.common.pojo.enums.QueryType;
import com.tencent.supersonic.common.pojo.enums.AggregateTypeEnum;
import com.tencent.supersonic.common.pojo.enums.FilterType;
import lombok.Data;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
@Data
public class SemanticParseInfo {
private Integer id;
private String queryMode;
private SchemaElement model;
private ModelCluster model = new ModelCluster();
private Set<SchemaElement> metrics = new TreeSet<>(new SchemaNameLengthComparator());
private Set<SchemaElement> dimensions = new LinkedHashSet();
private SchemaElement entity;
private AggregateTypeEnum aggType = AggregateTypeEnum.NONE;
private FilterType filterType = FilterType.UNION;
private Set<QueryFilter> dimensionFilters = new LinkedHashSet();
private Set<QueryFilter> metricFilters = new LinkedHashSet();
private Set<Order> orders = new LinkedHashSet();
private DateConf dateInfo;
private Long limit;
private Boolean nativeQuery = false;
private double score;
private List<SchemaElementMatch> elementMatches = new ArrayList<>();
private Map<String, Object> properties = new HashMap<>();
private EntityInfo entityInfo;
public Long getModelId() {
return model != null ? model.getId() : 0L;
private SqlInfo sqlInfo = new SqlInfo();
private QueryType queryType = QueryType.ID;
public String getModelClusterKey() {
if (model == null) {
return "";
}
return model.getKey();
}
public String getModelName() {
return model != null ? model.getName() : "null";
if (model == null) {
return "";
}
return model.getName();
}
private static class SchemaNameLengthComparator implements Comparator<SchemaElement> {
@Override
public int compare(SchemaElement o1, SchemaElement o2) {
if (o1.getOrder() != o2.getOrder()) {
if (o1.getOrder() < o2.getOrder()) {
return -1;
} else {
return 1;
}
}
int len1 = o1.getName().length();
int len2 = o2.getName().length();
if (len1 != len2) {
@@ -65,4 +86,27 @@ public class SemanticParseInfo {
return metrics;
}
private Map<Long, Integer> getModelElementCountMap() {
Map<Long, Integer> elementCountMap = new HashMap<>();
elementMatches.stream().filter(element -> element.getElement().getModel() != null)
.forEach(element -> {
int count = elementCountMap.getOrDefault(element.getElement().getModel(), 0);
elementCountMap.put(element.getElement().getModel(), count + 1);
});
return elementCountMap;
}
public Long getModelId() {
Map<Long, Integer> elementCountMap = getModelElementCountMap();
Long modelId = -1L;
int maxCnt = 0;
for (Long model : elementCountMap.keySet()) {
if (elementCountMap.get(model) > maxCnt) {
maxCnt = elementCountMap.get(model);
modelId = model;
}
}
return modelId;
}
}

View File

@@ -1,9 +1,14 @@
package com.tencent.supersonic.chat.api.pojo;
import org.springframework.util.CollectionUtils;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;
public class SemanticSchema implements Serializable {
@@ -18,6 +23,64 @@ public class SemanticSchema implements Serializable {
modelSchemaList.add(schema);
}
public SchemaElement getElement(SchemaElementType elementType, long elementID) {
Optional<SchemaElement> element = Optional.empty();
switch (elementType) {
case ENTITY:
element = getElementsById(elementID, getEntities());
break;
case MODEL:
element = getElementsById(elementID, getModels());
break;
case METRIC:
element = getElementsById(elementID, getMetrics());
break;
case DIMENSION:
element = getElementsById(elementID, getDimensions());
break;
case VALUE:
element = getElementsById(elementID, getDimensionValues());
break;
default:
}
if (element.isPresent()) {
return element.get();
} else {
return null;
}
}
public SchemaElement getElementByName(SchemaElementType elementType, String name) {
Optional<SchemaElement> element = Optional.empty();
switch (elementType) {
case ENTITY:
element = getElementsByNameOrAlias(name, getEntities());
break;
case MODEL:
element = getElementsByNameOrAlias(name, getModels());
break;
case METRIC:
element = getElementsByNameOrAlias(name, getMetrics());
break;
case DIMENSION:
element = getElementsByNameOrAlias(name, getDimensions());
break;
case VALUE:
element = getElementsByNameOrAlias(name, getDimensionValues());
break;
default:
}
if (element.isPresent()) {
return element.get();
} else {
return null;
}
}
public Map<Long, String> getModelIdToName() {
return modelSchemaList.stream()
.collect(Collectors.toMap(a -> a.getModel().getId(), a -> a.getModel().getName(), (k1, k2) -> k1));
@@ -35,21 +98,85 @@ public class SemanticSchema implements Serializable {
return dimensions;
}
public List<SchemaElement> getDimensions(Set<Long> modelIds) {
List<SchemaElement> dimensions = getDimensions();
return getElementsByModelId(modelIds, dimensions);
}
public SchemaElement getDimensions(Long id) {
List<SchemaElement> dimensions = getDimensions();
Optional<SchemaElement> dimension = getElementsById(id, dimensions);
return dimension.orElse(null);
}
public List<SchemaElement> getTags() {
List<SchemaElement> tags = new ArrayList<>();
modelSchemaList.stream().forEach(d -> tags.addAll(d.getTags()));
return tags;
}
public List<SchemaElement> getTags(Set<Long> modelIds) {
List<SchemaElement> tags = new ArrayList<>();
modelSchemaList.stream().filter(schemaElement -> modelIds.contains(schemaElement.getModel()))
.forEach(d -> tags.addAll(d.getTags()));
return tags;
}
public List<SchemaElement> getMetrics() {
List<SchemaElement> metrics = new ArrayList<>();
modelSchemaList.stream().forEach(d -> metrics.addAll(d.getMetrics()));
return metrics;
}
public List<SchemaElement> getMetrics(Set<Long> modelIds) {
List<SchemaElement> metrics = getMetrics();
return getElementsByModelId(modelIds, metrics);
}
public List<SchemaElement> getEntities() {
List<SchemaElement> entities = new ArrayList<>();
modelSchemaList.stream().forEach(d -> entities.add(d.getEntity()));
return entities;
}
private List<SchemaElement> getElementsByModelId(Set<Long> modelIds, List<SchemaElement> elements) {
return elements.stream()
.filter(schemaElement -> modelIds.contains(schemaElement.getModel()))
.collect(Collectors.toList());
}
private Optional<SchemaElement> getElementsById(Long id, List<SchemaElement> elements) {
return elements.stream()
.filter(schemaElement -> id.equals(schemaElement.getId()))
.findFirst();
}
private Optional<SchemaElement> getElementsByNameOrAlias(String name, List<SchemaElement> elements) {
return elements.stream()
.filter(schemaElement ->
name.equals(schemaElement.getName()) || schemaElement.getAlias().contains(name)
).findFirst();
}
public List<SchemaElement> getModels() {
List<SchemaElement> models = new ArrayList<>();
modelSchemaList.stream().forEach(d -> models.add(d.getModel()));
return models;
}
public List<SchemaElement> getEntities() {
List<SchemaElement> entities = new ArrayList<>();
modelSchemaList.stream().forEach(d -> entities.add(d.getEntity()));
return entities;
public Map<String, String> getBizNameToName(Set<Long> modelIds) {
List<SchemaElement> allElements = new ArrayList<>();
allElements.addAll(getDimensions(modelIds));
allElements.addAll(getMetrics(modelIds));
return allElements.stream()
.collect(Collectors.toMap(SchemaElement::getBizName, SchemaElement::getName, (k1, k2) -> k1));
}
public Map<Long, ModelSchema> getModelSchemaMap() {
if (CollectionUtils.isEmpty(modelSchemaList)) {
return new HashMap<>();
}
return modelSchemaList.stream().collect(Collectors.toMap(modelSchema
-> modelSchema.getModel().getModel(), modelSchema -> modelSchema));
}
}

View File

@@ -1,8 +1,9 @@
package com.tencent.supersonic.chat.api.pojo.request;
import java.util.List;
import lombok.Data;
import java.util.List;
@Data
public class ChatAggConfigReq {

View File

@@ -1,10 +1,12 @@
package com.tencent.supersonic.chat.api.pojo.request;
import com.tencent.supersonic.common.pojo.enums.StatusEnum;
import java.util.List;
import lombok.Data;
import lombok.ToString;
import java.util.List;
/**
* extended information command about model
*/
@@ -30,6 +32,11 @@ public class ChatConfigBaseReq {
*/
private List<RecommendedQuestionReq> recommendedQuestions;
/**
* the llm examples about the model
*/
private String llmExamples;
/**
* available status
*/

View File

@@ -2,9 +2,10 @@ package com.tencent.supersonic.chat.api.pojo.request;
import com.tencent.supersonic.common.pojo.Constants;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
@Data
public class ChatDefaultConfigReq {

View File

@@ -1,8 +1,9 @@
package com.tencent.supersonic.chat.api.pojo.request;
import java.util.List;
import lombok.Data;
import java.util.List;
@Data
public class ChatDetailConfigReq {

View File

@@ -0,0 +1,23 @@
package com.tencent.supersonic.chat.api.pojo.request;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import javax.validation.constraints.NotNull;
import java.util.List;
import static java.time.LocalDate.now;
@ToString
@Data
@NoArgsConstructor
public class DictLatestTaskReq {
@NotNull
private Long modelId;
private List<Long> dimIds;
private String createdAt = now().plusDays(-4).toString();
}

View File

@@ -0,0 +1,20 @@
package com.tencent.supersonic.chat.api.pojo.request;
import com.tencent.supersonic.common.pojo.enums.TaskStatusEnum;
import lombok.Data;
import lombok.ToString;
@ToString
@Data
public class DictTaskFilterReq {
private Long id;
private String name;
private String createdBy;
private String createdAt;
private TaskStatusEnum status;
}

View File

@@ -0,0 +1,21 @@
package com.tencent.supersonic.chat.api.pojo.request;
import javax.validation.constraints.NotNull;
import lombok.Data;
@Data
public class DimensionValueReq {
private Integer agentId;
@NotNull
private Long elementID;
@NotNull
private Long modelId;
private String bizName;
@NotNull
private String value;
}

View File

@@ -3,11 +3,12 @@ package com.tencent.supersonic.chat.api.pojo.request;
import com.tencent.supersonic.auth.api.authentication.pojo.User;
import com.tencent.supersonic.chat.api.pojo.SemanticParseInfo;
import lombok.Builder;
import lombok.Data;
@Builder
@Data
public class ExecuteQueryReq {
private User user;
private Integer agentId;
private Integer chatId;
@@ -15,5 +16,5 @@ public class ExecuteQueryReq {
private Long queryId;
private Integer parseId;
private SemanticParseInfo parseInfo;
private boolean saveAnswer = true;
private boolean saveAnswer;
}

View File

@@ -0,0 +1,13 @@
package com.tencent.supersonic.chat.api.pojo.request;
import lombok.Data;
import lombok.ToString;
@Data
@ToString
public class ItemNameVisibility {
private ItemNameVisibilityInfo aggVisibilityInfo;
private ItemNameVisibilityInfo detailVisibilityInfo;
}

View File

@@ -0,0 +1,23 @@
package com.tencent.supersonic.chat.api.pojo.request;
import lombok.Data;
import lombok.ToString;
import java.util.ArrayList;
import java.util.List;
@Data
@ToString
public class ItemNameVisibilityInfo {
/**
* invisible dimensions
*/
private List<String> blackDimNameList = new ArrayList<>();
/**
* invisible metrics
*/
private List<String> blackMetricNameList = new ArrayList<>();
}

View File

@@ -1,8 +1,9 @@
package com.tencent.supersonic.chat.api.pojo.request;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
/**
* advanced knowledge config

View File

@@ -1,7 +1,9 @@
package com.tencent.supersonic.chat.api.pojo.request;
import com.tencent.supersonic.common.pojo.enums.TypeEnums;
import javax.validation.constraints.NotNull;
import lombok.Data;
/**
@@ -30,6 +32,4 @@ public class KnowledgeInfoReq {
* advanced knowledge config for single item
*/
private KnowledgeAdvancedConfig knowledgeAdvancedConfig;
}

View File

@@ -1,6 +1,7 @@
package com.tencent.supersonic.chat.api.pojo.request;
import lombok.Data;
import java.util.List;
@Data
public class PageQueryInfoReq {
@@ -11,27 +12,9 @@ public class PageQueryInfoReq {
private String userName;
public int getPageSize() {
return pageSize;
}
private List<Long> ids;
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
public int getCurrent() {
return current;
}
public void setCurrent(int current) {
this.current = current;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
public Integer getLimitStart() {
return this.pageSize * (this.current - 1);
}
}

View File

@@ -1,24 +1,21 @@
package com.tencent.supersonic.chat.api.pojo.request;
import com.tencent.supersonic.auth.api.authentication.pojo.User;
import com.tencent.supersonic.chat.api.pojo.SchemaElement;
import com.tencent.supersonic.common.pojo.DateConf;
import com.tencent.supersonic.common.pojo.Order;
import java.util.HashSet;
import java.util.Set;
import lombok.Data;
@Data
public class QueryDataReq {
String queryMode;
SchemaElement model;
Set<SchemaElement> metrics = new HashSet<>();
Set<SchemaElement> dimensions = new HashSet<>();
Set<QueryFilter> dimensionFilters = new HashSet<>();
Set<QueryFilter> metricFilters = new HashSet<>();
private Set<Order> orders = new HashSet<>();
private User user;
private Set<SchemaElement> metrics = new HashSet<>();
private Set<SchemaElement> dimensions = new HashSet<>();
private Set<QueryFilter> dimensionFilters = new HashSet<>();
private Set<QueryFilter> metricFilters = new HashSet<>();
private DateConf dateInfo;
private Long limit;
private Boolean nativeQuery = false;
private Long queryId;
private Integer parseId;
}

View File

@@ -1,7 +1,7 @@
package com.tencent.supersonic.chat.api.pojo.request;
import com.tencent.supersonic.semantic.api.query.enums.FilterOperatorEnum;
import java.util.Objects;
import com.google.common.base.Objects;
import com.tencent.supersonic.common.pojo.enums.FilterOperatorEnum;
import lombok.Data;
import lombok.ToString;
@@ -19,6 +19,8 @@ public class QueryFilter {
private Long elementID;
private String function;
@Override
public boolean equals(Object o) {
if (this == o) {
@@ -27,14 +29,15 @@ public class QueryFilter {
if (o == null || getClass() != o.getClass()) {
return false;
}
QueryFilter filter = (QueryFilter) o;
return Objects.equals(bizName, filter.bizName) && Objects.equals(name, filter.name)
&& operator == filter.operator && Objects.equals(value, filter.value) && Objects.equals(
elementID, filter.elementID);
QueryFilter that = (QueryFilter) o;
return Objects.equal(bizName, that.bizName) && Objects.equal(name,
that.name) && operator == that.operator && Objects.equal(value, that.value)
&& Objects.equal(elementID, that.elementID) && Objects.equal(
function, that.function);
}
@Override
public int hashCode() {
return Objects.hash(bizName, name, operator, value, elementID);
return Objects.hashCode(bizName, name, operator, value, elementID, function);
}
}

View File

@@ -1,14 +1,13 @@
package com.tencent.supersonic.chat.api.pojo.request;
import lombok.Data;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import lombok.Data;
@Data
public class QueryFilters {
private List<QueryFilter> filters = new ArrayList<>();
private Map<String, Object> params = new HashMap<>();
}

View File

@@ -5,10 +5,9 @@ import lombok.Data;
@Data
public class QueryReq {
private String queryText;
private Integer chatId;
private Long modelId = 0L;
private Long modelId;
private User user;
private QueryFilters queryFilters;
private boolean saveAnswer = true;

View File

@@ -0,0 +1,13 @@
package com.tencent.supersonic.chat.api.pojo.request;
import lombok.Data;
@Data
public class RecommendReq {
private Long modelId;
private Long metricId;
}

View File

@@ -0,0 +1,25 @@
package com.tencent.supersonic.chat.api.pojo.request;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class SimilarQueryReq {
private Long queryId;
private Integer parseId;
private String queryText;
private String modelId;
private Integer agentId;
}

View File

@@ -2,9 +2,10 @@ package com.tencent.supersonic.chat.api.pojo.response;
import com.tencent.supersonic.chat.api.pojo.request.KnowledgeAdvancedConfig;
import com.tencent.supersonic.chat.api.pojo.request.KnowledgeInfoReq;
import java.util.List;
import lombok.Data;
import java.util.List;
@Data
public class ChatAggRichConfigResp {

View File

@@ -4,8 +4,10 @@ import com.tencent.supersonic.chat.api.pojo.request.ChatAggConfigReq;
import com.tencent.supersonic.chat.api.pojo.request.ChatDetailConfigReq;
import com.tencent.supersonic.chat.api.pojo.request.RecommendedQuestionReq;
import com.tencent.supersonic.common.pojo.enums.StatusEnum;
import java.util.Date;
import java.util.List;
import lombok.Data;
@Data
@@ -21,6 +23,8 @@ public class ChatConfigResp {
private List<RecommendedQuestionReq> recommendedQuestions;
private String llmExamples;
/**
* available status
*/

View File

@@ -4,6 +4,7 @@ import com.tencent.supersonic.chat.api.pojo.request.RecommendedQuestionReq;
import com.tencent.supersonic.common.pojo.enums.StatusEnum;
import java.util.Date;
import java.util.List;
import lombok.Data;
@Data

View File

@@ -4,9 +4,10 @@ package com.tencent.supersonic.chat.api.pojo.response;
import com.tencent.supersonic.chat.api.pojo.SchemaElement;
import com.tencent.supersonic.chat.api.pojo.request.ChatDefaultConfigReq;
import com.tencent.supersonic.common.pojo.Constants;
import java.util.List;
import lombok.Data;
import java.util.List;
@Data
public class ChatDefaultRichConfigResp {

View File

@@ -2,9 +2,10 @@ package com.tencent.supersonic.chat.api.pojo.response;
import com.tencent.supersonic.chat.api.pojo.request.KnowledgeAdvancedConfig;
import com.tencent.supersonic.chat.api.pojo.request.KnowledgeInfoReq;
import java.util.List;
import lombok.Data;
import java.util.List;
@Data
public class ChatDetailRichConfigResp {

View File

@@ -0,0 +1,30 @@
package com.tencent.supersonic.chat.api.pojo.response;
import com.tencent.supersonic.common.pojo.enums.TaskStatusEnum;
import lombok.Data;
import lombok.ToString;
import java.util.Date;
@ToString
@Data
public class DictLatestTaskResp {
private Long dimId;
private Long id;
private String name;
private String description;
private String command;
private TaskStatusEnum status;
private String createdBy;
private Date createdAt;
private Long elapsedMs;
}

View File

@@ -1,14 +1,14 @@
package com.tencent.supersonic.chat.api.pojo.response;
import com.tencent.supersonic.chat.api.pojo.SchemaElement;
import java.util.List;
import lombok.Data;
@Data
public class EntityRichInfoResp {
/**
* entity alias
* entity alias
*/
private List<String> names;

View File

@@ -1,12 +1,13 @@
package com.tencent.supersonic.chat.api.pojo.response;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
import lombok.Data;
@Data
public class ModelInfo extends DataInfo implements Serializable {
private List<String> words;
private String primaryEntityBizName;
private String primaryKey;
}

View File

@@ -1,30 +1,23 @@
package com.tencent.supersonic.chat.api.pojo.response;
import com.google.common.collect.Lists;
import com.tencent.supersonic.chat.api.pojo.SemanticParseInfo;
import lombok.Data;
import lombok.Getter;
import lombok.Builder;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;
import java.util.List;
@Data
@Getter
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ParseResp {
private Integer chatId;
private String queryText;
private Long queryId;
private ParseState state;
private List<SemanticParseInfo> selectedParses;
private List<SemanticParseInfo> candidateParses;
private List<SemanticParseInfo> selectedParses = Lists.newArrayList();
private ParseTimeCostDO parseTimeCost = new ParseTimeCostDO();
public enum ParseState {
COMPLETED,
PENDING,
FAILED
}
}

View File

@@ -0,0 +1,15 @@
package com.tencent.supersonic.chat.api.pojo.response;
import lombok.Data;
@Data
public class ParseTimeCostDO {
private long parseStartTime;
private long parseTime;
private long sqlTime;
public ParseTimeCostDO() {
this.parseStartTime = System.currentTimeMillis();
}
}

View File

@@ -0,0 +1,11 @@
package com.tencent.supersonic.chat.api.pojo.response;
import lombok.Data;
import java.util.List;
@Data
public class QueryRecallResp {
private List<SimilarQueryRecallResp> solvedQueryRecallRespList;
private Long queryTimeCost;
}

View File

@@ -1,7 +1,9 @@
package com.tencent.supersonic.chat.api.pojo.response;
import java.util.Date;
import com.tencent.supersonic.chat.api.pojo.SemanticParseInfo;
import lombok.Data;
import java.util.Date;
import java.util.List;
@Data
public class QueryResp {
@@ -13,4 +15,6 @@ public class QueryResp {
private String feedback;
private String queryText;
private QueryResult queryResult;
private List<SemanticParseInfo> parseInfos;
private List<SimilarQueryRecallResp> similarQueries;
}

View File

@@ -1,11 +1,12 @@
package com.tencent.supersonic.chat.api.pojo.response;
import com.tencent.supersonic.chat.api.pojo.SchemaElement;
import com.tencent.supersonic.chat.api.pojo.SemanticParseInfo;
import com.tencent.supersonic.common.pojo.QueryAuthorization;
import com.tencent.supersonic.common.pojo.QueryColumn;
import lombok.Data;
import java.util.List;
import java.util.Map;
import lombok.Data;
@Data
public class QueryResult {
@@ -21,4 +22,6 @@ public class QueryResult {
private SemanticParseInfo chatContext;
private Object response;
private List<Map<String, Object>> queryResults;
private Long queryTimeCost;
private List<SchemaElement> recommendedDimensions;
}

View File

@@ -1,14 +1,14 @@
package com.tencent.supersonic.chat.api.pojo.response;
import com.tencent.supersonic.chat.api.pojo.request.RecommendedQuestionReq;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Data;
import java.util.List;
@Data
@AllArgsConstructor
public class RecommendQuestionResp {
private Long modelId;
private List<RecommendedQuestionReq> recommendedQuestions;
}

View File

@@ -1,12 +1,12 @@
package com.tencent.supersonic.chat.api.pojo.response;
import com.tencent.supersonic.chat.api.pojo.SchemaElement;
import java.util.List;
import lombok.Data;
import java.util.List;
@Data
public class RecommendResp {
private List<SchemaElement> dimensions;
private List<SchemaElement> metrics;
}

View File

@@ -0,0 +1,17 @@
package com.tencent.supersonic.chat.api.pojo.response;
import lombok.Builder;
import lombok.Data;
@Data
@Builder
public class SimilarQueryRecallResp {
private Long queryId;
private Integer parseId;
private String queryText;
}

View File

@@ -0,0 +1,11 @@
package com.tencent.supersonic.chat.api.pojo.response;
import lombok.Data;
@Data
public class SqlInfo {
private String s2SQL;
private String correctS2SQL;
private String querySQL;
}

View File

@@ -40,11 +40,6 @@
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
@@ -59,16 +54,7 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>${mybatis-spring.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
@@ -78,24 +64,6 @@
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter-test</artifactId>
<version>${mybatis.test.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>${pagehelper.spring.version}</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
@@ -116,7 +84,6 @@
<groupId>com.tencent.supersonic</groupId>
<artifactId>semantic-query</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.tencent.supersonic</groupId>
@@ -124,18 +91,20 @@
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.tencent.supersonic</groupId>
<artifactId>semantic-query</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.github.xkzhangsan</groupId>
<artifactId>xk-time</artifactId>
<version>${xk.time.version}</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-inline</artifactId>
<version>${mockito-inline.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>

Some files were not shown because too many files have changed in this diff Show More