From 27c43bf79f76a897de82f29ee24da1dd3d40d454 Mon Sep 17 00:00:00 2001 From: Camus Cheung Date: Mon, 15 Apr 2024 16:52:27 +0800 Subject: [PATCH 01/12] docs: Fix typo in README.md (#95) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2cde66c3b..f4fa0d621 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ docker run -d --name=maxkb -p 8080:8080 -v ~/.maxkb:/var/lib/postgresql/data 1pa - 前端:[Vue.js](https://cn.vuejs.org/) - 后端:[Python / Django](https://www.djangoproject.com/) -- Langchain:[Langchain](https://www.langchain.com/) +- LangChain:[LangChain](https://www.langchain.com/) - 向量数据库:[PostgreSQL / pgvector](https://www.postgresql.org/) - 大模型:Azure OpenAI、百度千帆大模型、[Ollama](https://github.com/ollama/ollama) From 879d9a7d9caa3f09d1c7c9b38e8fc43ffabffba5 Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Mon, 15 Apr 2024 16:52:41 +0800 Subject: [PATCH 02/12] =?UTF-8?q?style:=20=E7=AE=80=E5=8C=96=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E4=BB=A3=E7=A0=81=20(#96)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/views/application/CreateAndSetting.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/src/views/application/CreateAndSetting.vue b/ui/src/views/application/CreateAndSetting.vue index ffdaa2888..e363abadd 100644 --- a/ui/src/views/application/CreateAndSetting.vue +++ b/ui/src/views/application/CreateAndSetting.vue @@ -54,7 +54,7 @@ Date: Mon, 15 Apr 2024 16:52:58 +0800 Subject: [PATCH 03/12] chore(TS): skipLibCheck (#97) --- ui/tsconfig.node.json | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ui/tsconfig.node.json b/ui/tsconfig.node.json index 795f45286..b4a879535 100644 --- a/ui/tsconfig.node.json +++ b/ui/tsconfig.node.json @@ -11,6 +11,9 @@ "composite": true, "module": "ESNext", "moduleResolution": "node", - "types": ["node"] + "skipLibCheck": true, // 跳过node依赖包语法检查 + "types": [ + "node" + ] } -} +} \ No newline at end of file From 2375b470b0dd2038b627052625c0f36850d52a48 Mon Sep 17 00:00:00 2001 From: song-cc-rock Date: Mon, 15 Apr 2024 16:53:18 +0800 Subject: [PATCH 05/12] Update tsconfig.app.json config (#100) --- ui/tsconfig.app.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ui/tsconfig.app.json b/ui/tsconfig.app.json index c472e7029..86013947d 100644 --- a/ui/tsconfig.app.json +++ b/ui/tsconfig.app.json @@ -6,6 +6,8 @@ "composite": true, "moduleResolution": "node", "baseUrl": ".", + "target": "esnext", // 使用ES最新语法 + "module": "esnext", // 使用ES模块语法 "paths": { "@/*": ["./src/*"] } From dfb04b10525f75829c7df12281bd055803a45791 Mon Sep 17 00:00:00 2001 From: Eric_Lee Date: Mon, 15 Apr 2024 16:53:26 +0800 Subject: [PATCH 06/12] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E5=92=8C=E9=94=99=E8=AF=AF=E6=8F=90=E7=A4=BA=20(#101)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/common/util/file_util.py | 6 ++---- apps/smartdoc/conf.py | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/apps/common/util/file_util.py b/apps/common/util/file_util.py index f46c460a7..447b007bc 100644 --- a/apps/common/util/file_util.py +++ b/apps/common/util/file_util.py @@ -9,8 +9,6 @@ def get_file_content(path): - file = open(path, "r", - encoding='utf-8') - content = file.read() - file.close() + with open(path, "r", encoding='utf-8') as file: + content = file.read() return content diff --git a/apps/smartdoc/conf.py b/apps/smartdoc/conf.py index 855b507a1..162971f48 100644 --- a/apps/smartdoc/conf.py +++ b/apps/smartdoc/conf.py @@ -193,11 +193,11 @@ class ConfigManager: if manager.load_from_yml(): config = manager.config else: - msg = """ + msg = f""" Error: No config file found. - You can run `cp config_example.yml config_example.yml`, and edit it. + You can run `cp config_example.yml {root_path}/config_example.yml`, and edit it. """ raise ImportError(msg) return config From 731801a977336a8386ff18aec67603323e13c97f Mon Sep 17 00:00:00 2001 From: WangXu10 <45236607+WangXu10@users.noreply.github.com> Date: Mon, 15 Apr 2024 16:53:35 +0800 Subject: [PATCH 07/12] Update tsconfig.vitest.json config (#104) --- ui/tsconfig.vitest.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ui/tsconfig.vitest.json b/ui/tsconfig.vitest.json index d080d611e..940b2dfc5 100644 --- a/ui/tsconfig.vitest.json +++ b/ui/tsconfig.vitest.json @@ -3,6 +3,8 @@ "exclude": [], "compilerOptions": { "composite": true, + "target": "esnext", // 使用ES最新语法 + "module": "esnext", // 使用ES模块语法 "lib": [], "types": ["node", "jsdom"] } From e4123dfb54b08cdcfa46190ed650b388152f2951 Mon Sep 17 00:00:00 2001 From: xuwei-fit2cloud Date: Mon, 15 Apr 2024 17:34:49 +0800 Subject: [PATCH 08/12] =?UTF-8?q?chore:=20=E5=A2=9E=E5=8A=A0=E6=8B=BC?= =?UTF-8?q?=E5=86=99=E6=A3=80=E6=B5=8BAction?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/typos_check.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/workflows/typos_check.yml diff --git a/.github/workflows/typos_check.yml b/.github/workflows/typos_check.yml new file mode 100644 index 000000000..099b219d3 --- /dev/null +++ b/.github/workflows/typos_check.yml @@ -0,0 +1,13 @@ +name: Typos Check +on: [push, pull_request] + +jobs: + run: + name: Spell Check with Typos + runs-on: ubuntu-latest + steps: + - name: Checkout Actions Repository + uses: actions/checkout@v2 + + - name: Check spelling + uses: crate-ci/typos@master From 493939017ef8e004a27d9a3cddd44c91dd5fcaf2 Mon Sep 17 00:00:00 2001 From: Bryan Date: Mon, 15 Apr 2024 18:05:50 +0800 Subject: [PATCH 09/12] fix: Support config.yml, config.yaml (#111) --- apps/smartdoc/conf.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/smartdoc/conf.py b/apps/smartdoc/conf.py index 162971f48..27e1e8b08 100644 --- a/apps/smartdoc/conf.py +++ b/apps/smartdoc/conf.py @@ -174,7 +174,7 @@ class ConfigManager: return True def load_from_yml(self): - for i in ['config_example.yml', 'config.yaml']: + for i in ['config_example.yml', 'config.yaml', 'config.yml']: if not os.path.isfile(os.path.join(self.root_path, i)): continue loaded = self.from_yaml(i) @@ -197,7 +197,8 @@ class ConfigManager: Error: No config file found. - You can run `cp config_example.yml {root_path}/config_example.yml`, and edit it. + You can run `cp config_example.yml {root_path}/config.yml`, and edit it. + """ raise ImportError(msg) return config From e15dc64be93714358cd360ee7659c588a3d2804f Mon Sep 17 00:00:00 2001 From: wangdan-fit2cloud Date: Mon, 15 Apr 2024 18:46:03 +0800 Subject: [PATCH 10/12] fix: typos --- ui/src/api/application-overview.ts | 40 +++++++-------- ui/src/api/application.ts | 50 +++++++++---------- ui/src/api/dataset.ts | 32 ++++++------ ui/src/components/ai-chat/index.vue | 4 +- .../app-charts/components/LineCharts.vue | 6 +-- ui/src/components/app-charts/index.vue | 2 +- ui/src/components/app-table/index.vue | 4 +- .../items/complex/ArrayObjectCard.vue | 4 +- ui/src/layout/components/breadcrumb/index.vue | 2 +- ui/src/router/modules/application.ts | 2 +- ui/src/stores/modules/dataset.ts | 12 ++--- ui/src/styles/element-plus.scss | 2 +- ui/src/theme/index.ts | 8 +-- ui/src/utils/utils.ts | 2 +- .../component/StatisticsCharts.vue | 16 +++--- ui/src/views/application/CreateAndSetting.vue | 14 +++--- ui/src/views/dataset/CreateDataset.vue | 2 +- ui/src/views/dataset/DatasetSetting.vue | 4 +- .../views/dataset/component/SyncWebDialog.vue | 2 +- .../dataset/component/UploadComponent.vue | 4 +- ui/src/views/dataset/index.vue | 8 +-- ui/src/views/dataset/step/StepFirst.vue | 2 +- ui/src/views/document/index.vue | 2 +- .../views/log/component/ChatRecordDrawer.vue | 4 +- ui/src/views/log/index.vue | 2 +- .../problem/component/DetailProblemDrawer.vue | 4 +- ui/src/views/problem/index.vue | 2 +- 27 files changed, 118 insertions(+), 118 deletions(-) diff --git a/ui/src/api/application-overview.ts b/ui/src/api/application-overview.ts index d77da6322..e6a4d2c4d 100644 --- a/ui/src/api/application-overview.ts +++ b/ui/src/api/application-overview.ts @@ -7,64 +7,64 @@ const prefix = '/application' /** * API_KEY列表 - * @param 参数 applicaiton_id + * @param 参数 application_id */ -const getAPIKey: (applicaiton_id: string, loading?: Ref) => Promise> = ( - applicaiton_id, +const getAPIKey: (application_id: string, loading?: Ref) => Promise> = ( + application_id, loading ) => { - return get(`${prefix}/${applicaiton_id}/api_key`, undefined, loading) + return get(`${prefix}/${application_id}/api_key`, undefined, loading) } /** * 新增API_KEY - * @param 参数 applicaiton_id + * @param 参数 application_id */ -const postAPIKey: (applicaiton_id: string, loading?: Ref) => Promise> = ( - applicaiton_id, +const postAPIKey: (application_id: string, loading?: Ref) => Promise> = ( + application_id, loading ) => { - return post(`${prefix}/${applicaiton_id}/api_key`, {}, undefined, loading) + return post(`${prefix}/${application_id}/api_key`, {}, undefined, loading) } /** * 删除API_KEY - * @param 参数 applicaiton_id api_key_id + * @param 参数 application_id api_key_id */ const delAPIKey: ( - applicaiton_id: String, + application_id: String, api_key_id: String, loading?: Ref -) => Promise> = (applicaiton_id, api_key_id, loading) => { - return del(`${prefix}/${applicaiton_id}/api_key/${api_key_id}`, undefined, undefined, loading) +) => Promise> = (application_id, api_key_id, loading) => { + return del(`${prefix}/${application_id}/api_key/${api_key_id}`, undefined, undefined, loading) } /** * 修改API_KEY - * @param 参数 applicaiton_id,api_key_id + * @param 参数 application_id,api_key_id * data { * is_active: boolean * } */ const putAPIKey: ( - applicaiton_id: string, + application_id: string, api_key_id: String, data: any, loading?: Ref -) => Promise> = (applicaiton_id, api_key_id, data, loading) => { - return put(`${prefix}/${applicaiton_id}/api_key/${api_key_id}`, data, undefined, loading) +) => Promise> = (application_id, api_key_id, data, loading) => { + return put(`${prefix}/${application_id}/api_key/${api_key_id}`, data, undefined, loading) } /** * 统计 - * @param 参数 applicaiton_id, data + * @param 参数 application_id, data */ const getStatistics: ( - applicaiton_id: string, + application_id: string, data: any, loading?: Ref -) => Promise> = (applicaiton_id, data, loading) => { - return get(`${prefix}/${applicaiton_id}/statistics/chat_record_aggregate_trend`, data, loading) +) => Promise> = (application_id, data, loading) => { + return get(`${prefix}/${application_id}/statistics/chat_record_aggregate_trend`, data, loading) } export default { diff --git a/ui/src/api/application.ts b/ui/src/api/application.ts index 888e6f495..c83ff3c8e 100644 --- a/ui/src/api/application.ts +++ b/ui/src/api/application.ts @@ -49,70 +49,70 @@ const postApplication: ( */ const putApplication: ( - applicaiton_id: String, + application_id: String, data: ApplicationFormType, loading?: Ref -) => Promise> = (applicaiton_id, data, loading) => { - return put(`${prefix}/${applicaiton_id}`, data, undefined, loading) +) => Promise> = (application_id, data, loading) => { + return put(`${prefix}/${application_id}`, data, undefined, loading) } /** * 删除应用 - * @param 参数 applicaiton_id + * @param 参数 application_id */ const delApplication: ( - applicaiton_id: String, + application_id: String, loading?: Ref -) => Promise> = (applicaiton_id, loading) => { - return del(`${prefix}/${applicaiton_id}`, undefined, {}, loading) +) => Promise> = (application_id, loading) => { + return del(`${prefix}/${application_id}`, undefined, {}, loading) } /** * 应用详情 - * @param 参数 applicaiton_id + * @param 参数 application_id */ const getApplicationDetail: ( - applicaiton_id: string, + application_id: string, loading?: Ref -) => Promise> = (applicaiton_id, loading) => { - return get(`${prefix}/${applicaiton_id}`, undefined, loading) +) => Promise> = (application_id, loading) => { + return get(`${prefix}/${application_id}`, undefined, loading) } /** * 获得当前应用可使用的知识库 - * @param 参数 applicaiton_id + * @param 参数 application_id */ const getApplicationDataset: ( - applicaiton_id: string, + application_id: string, loading?: Ref -) => Promise> = (applicaiton_id, loading) => { - return get(`${prefix}/${applicaiton_id}/list_dataset`, undefined, loading) +) => Promise> = (application_id, loading) => { + return get(`${prefix}/${application_id}/list_dataset`, undefined, loading) } /** * 获取AccessToken - * @param 参数 applicaiton_id + * @param 参数 application_id */ -const getAccessToken: (applicaiton_id: string, loading?: Ref) => Promise> = ( - applicaiton_id, +const getAccessToken: (application_id: string, loading?: Ref) => Promise> = ( + application_id, loading ) => { - return get(`${prefix}/${applicaiton_id}/access_token`, undefined, loading) + return get(`${prefix}/${application_id}/access_token`, undefined, loading) } /** * 修改AccessToken - * @param 参数 applicaiton_id + * @param 参数 application_id * data { * "is_active": true * } */ const putAccessToken: ( - applicaiton_id: string, + application_id: string, data: any, loading?: Ref -) => Promise> = (applicaiton_id, data, loading) => { - return put(`${prefix}/${applicaiton_id}/access_token`, data, undefined, loading) +) => Promise> = (application_id, data, loading) => { + return put(`${prefix}/${application_id}/access_token`, data, undefined, loading) } /** @@ -161,8 +161,8 @@ const postChatOpen: (data: ApplicationFormType) => Promise> = (data) ] } */ -const getChatOpen: (applicaiton_id: String) => Promise> = (applicaiton_id) => { - return get(`${prefix}/${applicaiton_id}/chat/open`) +const getChatOpen: (application_id: String) => Promise> = (application_id) => { + return get(`${prefix}/${application_id}/chat/open`) } /** * 对话 diff --git a/ui/src/api/dataset.ts b/ui/src/api/dataset.ts index a95395b45..850626cf4 100644 --- a/ui/src/api/dataset.ts +++ b/ui/src/api/dataset.ts @@ -17,7 +17,7 @@ const prefix = '/dataset' "name": "string", } */ -const getDateset: ( +const getDataset: ( page: pageRequest, param: any, loading?: Ref @@ -29,7 +29,7 @@ const getDateset: ( * 获取全部知识库 * @param 参数 */ -const getAllDateset: (loading?: Ref) => Promise> = (loading) => { +const getAllDataset: (loading?: Ref) => Promise> = (loading) => { return get(`${prefix}`, undefined, loading) } @@ -37,7 +37,7 @@ const getAllDateset: (loading?: Ref) => Promise> = (loadi * 删除知识库 * @param 参数 dataset_id */ -const delDateset: (dataset_id: String, loading?: Ref) => Promise> = ( +const delDataset: (dataset_id: String, loading?: Ref) => Promise> = ( dataset_id, loading ) => { @@ -69,7 +69,7 @@ const delDateset: (dataset_id: String, loading?: Ref) => Promise) => Promise> = ( +const postDataset: (data: datasetData, loading?: Ref) => Promise> = ( data, loading ) => { @@ -86,7 +86,7 @@ const postDateset: (data: datasetData, loading?: Ref) => Promise) => Promise> = ( +const postWebDataset: (data: any, loading?: Ref) => Promise> = ( data, loading ) => { @@ -97,7 +97,7 @@ const postWebDateset: (data: any, loading?: Ref) => Promise * 知识库详情 * @param 参数 dataset_id */ -const getDatesetDetail: (dataset_id: string, loading?: Ref) => Promise> = ( +const getDatasetDetail: (dataset_id: string, loading?: Ref) => Promise> = ( dataset_id, loading ) => { @@ -113,7 +113,7 @@ const getDatesetDetail: (dataset_id: string, loading?: Ref) => Promise< "desc": true } */ -const putDateset: (dataset_id: string, data: any) => Promise> = ( +const putDataset: (dataset_id: string, data: any) => Promise> = ( dataset_id, data: any ) => { @@ -152,7 +152,7 @@ const getDatasetHitTest: ( * @param 参数 dataset_id * @query 参数 sync_type // 同步类型->replace:替换同步,complete:完整同步 */ -const putSyncWebDateset: ( +const putSyncWebDataset: ( dataset_id: string, sync_type: string, loading?: Ref @@ -161,14 +161,14 @@ const putSyncWebDateset: ( } export default { - getDateset, - getAllDateset, - delDateset, - postDateset, - getDatesetDetail, - putDateset, + getDataset, + getAllDataset, + delDataset, + postDataset, + getDatasetDetail, + putDataset, listUsableApplication, getDatasetHitTest, - postWebDateset, - putSyncWebDateset + postWebDataset, + putSyncWebDataset } diff --git a/ui/src/components/ai-chat/index.vue b/ui/src/components/ai-chat/index.vue index 2d3d4d753..4ace004bc 100644 --- a/ui/src/components/ai-chat/index.vue +++ b/ui/src/components/ai-chat/index.vue @@ -14,7 +14,7 @@