Commit Graph

61 Commits

Author SHA1 Message Date
eeee0717 dd3d25762b Merge branch 'main' into feat-knowlege-ocr 2025-06-11 19:01:10 +08:00
Wang Jiyuan 66ddeb94bf fix: ollama embedding knowledge query score always 100% (#7001)
* fix: ollama embedding knowledge query score always 100%

* fix: force ollama to use api without v1
2025-06-09 16:52:01 +08:00
eeee0717 a351fba483 feat: add preprocess icon 2025-06-05 20:32:47 +08:00
eeee0717 85043f1faf feat: improve ui and notification 2025-06-05 15:38:01 +08:00
eeee0717 62cfccc035 feat: split ocr and preprocess 2025-06-04 20:45:57 +08:00
eeee0717 3b3453c963 chore 2025-06-04 14:33:27 +08:00
eeee0717 fa7d7deda6 feat: remove upload file 2025-06-04 14:30:03 +08:00
eeee0717 777eb48e6e rename ocr to preprocess 2025-06-03 21:29:08 +08:00
suyao 109a355116 refactor: update file handling and dependencies
- Added '@cherrystudio/mac-system-ocr' to external dependencies in electron.vite.config.ts.
- Updated debug script in package.json to use 'electron-vite dev' for better debugging.
- Renamed 'File_Create' to 'File_CreateTempFile' in IpcChannel for clarity.
- Replaced 'adm-zip' with 'node-stream-zip' for zip file extraction in install-bun.js and install-uv.js scripts.
- Refactored file handling across various components to use 'FileMetadata' instead of 'FileType' for improved type consistency.
- Removed unused GeminiService and updated related file handling logic.
- Enhanced error handling and logging in file services and message services.
2025-05-27 12:06:18 +08:00
suyao 98707a9d59 Merge branch 'main' into feat-knowlege-ocr 2025-05-12 22:33:27 +08:00
kangfenmao cb950ecde1 refactor: replace console.log with Logger for improved logging consistency across the application 2025-05-11 19:25:50 +08:00
suyao 47c8e8096c Merge branch 'main' into feat-knowlege-ocr 2025-05-10 01:33:08 +08:00
kangfenmao 9c6de71fbb lint: fix eslint error 2025-04-05 10:52:45 +08:00
Hamm 3290ac4b1b refactor(Constants): 优化一些常量和枚举值 (#3773)
* refactor(main): 使用枚举管理 IPC 通道

- 新增 IpcChannel 枚举,用于统一管理所有的 IPC 通道
- 修改相关代码,使用 IpcChannel 枚举替代硬编码的字符串通道名称
- 此改动有助于提高代码的可维护性和可读性,避免因通道名称变更导致的错误

* refactor(ipc): 将字符串通道名称替换为 IpcChannel 枚举

- 在多个文件中将硬编码的字符串通道名称替换为 IpcChannel 枚举值
- 更新了相关文件的导入,增加了对 IpcChannel 的引用
- 通过使用枚举来管理 IPC 通道名称,提高了代码的可维护性和可读性

* refactor(ipc): 调整 IPC 通道枚举和预加载脚本

- 移除了 IpcChannel 枚举中的未使用注释
- 更新了预加载脚本中 IpcChannel 的导入路径

* refactor(ipc): 更新 IpcChannel导入路径

- 将 IpcChannel 的导入路径从 @main/enum/IpcChannel 修改为 @shared/IpcChannel
- 此修改涉及多个文件,包括 AppUpdater、BackupManager、EditMcpJsonPopup 等
- 同时移除了 tsconfig.web.json 中对 src/main/**/* 的引用

* refactor(ipc): 添加 ReduxStoreReady 事件并更新事件监听

- 在 IpcChannel 枚举中添加 ReduxStoreReady 事件
- 更新 ReduxService 中的事件监听,使用新的枚举值

* refactor(main): 重构 ReduxService 中的状态变化事件处理

- 将状态变化事件名称定义为常量 STATUS_CHANGE_EVENT
- 更新事件监听和触发使用新的常量
- 优化了代码结构,提高了可维护性

* refactor(i18n): 优化国际化配置和语言选择逻辑

- 在多个文件中引入 defaultLanguage 常量,统一默认语言设置
- 调整 i18n 初始化和语言变更逻辑,使用新配置
- 更新相关组件和 Hook 中的语言选择逻辑

* refactor(ConfigManager): 重构配置管理器

- 添加 ConfigKeys 枚举,用于统一配置项的键名
- 引入 defaultLanguage,作为默认语言设置
- 重构 get 和 set 方法,使用 ConfigKeys 枚举作为键名
- 优化类型定义和方法签名,提高代码可读性和可维护性

* refactor(ConfigManager): 重命名配置键 ZoomFactor

将配置键 zoomFactor 重命名为 ZoomFactor,以符合命名规范。
更新了相关方法和属性以反映这一变更。

* refactor(shared): 重构常量定义并优化文件大小格式化逻辑

- 在 constant.ts 中添加 KB、MB、GB 常量定义
- 将 defaultLanguage 移至 constant.ts
- 更新 ConfigManager、useAppInit、i18n、GeneralSettings 等文件中的导入路径
- 优化 formatFileSize 函数,使用新定义的常量

* refactor(FileSize): 使用 GB/MB/KB 等常量处理文件大小计算

* refactor(ipc): 将字符串通道名称替换为 IpcChannel 枚举

- 在多个文件中将硬编码的字符串通道名称替换为 IpcChannel 枚举值
- 更新了相关文件的导入,增加了对 IpcChannel 的引用
- 通过使用枚举来管理 IPC 通道名称,提高了代码的可维护性和可读性

* refactor(ipc): 更新 IpcChannel导入路径

- 将 IpcChannel 的导入路径从 @main/enum/IpcChannel 修改为 @shared/IpcChannel
- 此修改涉及多个文件,包括 AppUpdater、BackupManager、EditMcpJsonPopup 等
- 同时移除了 tsconfig.web.json 中对 src/main/**/* 的引用

* refactor(i18n): 优化国际化配置和语言选择逻辑

- 在多个文件中引入 defaultLanguage 常量,统一默认语言设置
- 调整 i18n 初始化和语言变更逻辑,使用新配置
- 更新相关组件和 Hook 中的语言选择逻辑

* refactor(shared): 重构常量定义并优化文件大小格式化逻辑

- 在 constant.ts 中添加 KB、MB、GB 常量定义
- 将 defaultLanguage 移至 constant.ts
- 更新 ConfigManager、useAppInit、i18n、GeneralSettings 等文件中的导入路径
- 优化 formatFileSize 函数,使用新定义的常量

* refactor: 移除重复的导入语句

- 在 HomeWindow.tsx 和 useAppInit.ts 文件中移除了重复的 defaultLanguage导入语句
- 这个改动简化了代码结构,提高了代码的可读性和维护性
2025-04-04 19:07:23 +08:00
suyao 7f69ef5356 chore(OCR): remove redundant logging statements 2025-03-28 22:21:28 +08:00
suyao 7f310bc29f feat(OCR): add recognition level and minimum confidence options for Mac system OCR provider 2025-03-28 22:09:36 +08:00
suyao 29ccbf16d8 Merge branch 'main' into local-pr-3734 2025-03-28 16:30:17 +08:00
Chen Tao 710171278a fix(Reranker): 修复rerank 400 and 完善错误信息 (#4013)
feat(Reranker): enhance error handling with detailed error messages and early return for empty results
2025-03-27 20:04:37 +08:00
suyao a3e300e672 Merge branch 'main' into local-pr-3734 2025-03-27 14:30:33 +08:00
kangfenmao cc32c36222 build: replace @llm-tools/embedjs with @cherrystudio/embedjs 2025-03-26 18:14:04 +08:00
eeee0717 5be9b318ea feat(KnowledgeService): 提取OCR预处理逻辑为单独方法 2025-03-26 16:37:06 +08:00
suyao 25bdb61c56 feat(OCR): add MacSysOcrProvider for macOS OCR functionality
- Introduced MacSysOcrProvider to handle OCR tasks using the mac-system-ocr library.
- Enhanced the OcrProviderFactory to support the new macOS OCR provider.
- Updated file handling to include base64 file processing.
- Added a new SVG icon for the macOS OCR provider.
- Updated the state management to include the new system OCR provider option.
- Improved user interface to conditionally display the system OCR provider based on the operating system.
2025-03-25 17:24:35 +08:00
eeee0717 adb34464c9 Merge branch 'main' into feat-knowlege-ocr 2025-03-24 16:17:43 +08:00
suyao 5fe4bf3f19 feat(OCR): implement Mistral OCR provider and enhance file handling
- Introduced MistralOcrProvider for processing OCR tasks with Mistral API.
- Updated BaseOcrProvider to return LocalFileSource in parseFile method.
- Enhanced file upload and retrieval logic in MistralService.
- Added support for local file source handling in various services.
- Updated preload API and type definitions to accommodate new OCR provider functionalities.
2025-03-24 12:38:07 +08:00
Chen Tao ae8869e1b6 feat(knowledge): support Voyage AI (#3810)
* feat(knowledge): support Voyage AI

* chore
2025-03-23 19:31:18 +08:00
eeee0717 d787dc140e feat(knowledge-ocr): optimize and clean code 2025-03-22 16:00:53 +08:00
eeee0717 bddec81402 fix 2025-03-21 20:21:19 +08:00
eeee0717 a824e81b30 Merge branch 'main' into feat-knowlege-ocr 2025-03-21 16:32:12 +08:00
eeee0717 7196931527 feat: support doc2x ocr 2025-03-21 16:26:41 +08:00
SuYao 4927f98e59 revert(Proxy): remove proxyManager usage from multiple services (#3720)
* revert(Proxy): remove proxyManager usage from multiple services

* refactor(ProxyManager): streamline proxy configuration and management
2025-03-21 16:04:45 +08:00
eeee0717 b50f8a4c11 feat(knowledge base): enhance knowledge base with rerank model 2025-03-18 21:47:06 +08:00
kangfenmao e760b1be6b refactor: replace console.debug with console.log for improved logging consistency
- Updated various components and services to replace console.debug statements with console.log for better visibility in logs.
- This change enhances the logging approach across the application, ensuring that important messages are consistently logged.
2025-03-17 13:10:11 +08:00
suyao b9d97e8a35 feat(Proxy): Implement proxy management system
- Add ProxyManager service to handle system, custom, and no proxy configurations
- Integrate proxy support for Gemini, Knowledge, and WebDav services
- Add fetch-socks and undici for advanced proxy handling
- Enhance proxy configuration with environment variable and session management
2025-03-11 09:56:40 +08:00
kangfenmao 687f140a5c docs: Add comprehensive documentation for KnowledgeService concurrent processing mechanism
- Created detailed technical documentation explaining the KnowledgeService's task queue and workload management
- Added JSDoc comment to KnowledgeService.ts to provide high-level overview
- Documented key aspects of concurrent task processing, including workload evaluation, task state management, and resource optimization strategies
2025-03-02 20:36:13 +08:00
icinggslits 1b09bb47bf feat: Improve file upload for the knowledge base (#2544)
* feat: Improve file upload for the knowledge base

* feat: Improve file upload for the knowledge base

* feat: Improve file upload for the knowledge base

---------

Co-authored-by: 亢奋猫 <kangfenmao@qq.com>
2025-03-02 20:21:23 +08:00
kangfenmao 11bd55701c revert: some proxy errors in main process (#2294) 2025-03-01 23:17:44 +08:00
suyao 5bacf048f2 fix: The proxy configuration is not correctly passed. 2025-03-01 00:42:56 +08:00
SuYao d51da99b8f fix: some proxy errors in main process (#2294)
* formatter proxy config type

* fix: some proxy errors in main process

* chore: Remove debug logging in ProxyManager
2025-02-27 16:46:05 +08:00
eeee0717 88dd75827a fix bug: uniqueIds is null when uploaded directory 2025-02-24 21:40:17 +08:00
sijie-chan 3015e90925 fix: 添加多个目录到知识库多个进度之间展示混淆 2025-02-24 12:40:00 +08:00
kangfenmao 40203fb721 fix: Remove LM Studio provider from initial state 2025-02-22 22:31:37 +08:00
sijie-chan d0e233f1b3 fix: 添加目录到知识库任意一个失败界面上会展示失败 2025-02-22 11:26:31 +08:00
eeee0717 3c958c3d11 feat: 目录进度可视化 2025-02-18 19:45:47 +08:00
kangfenmao b9affe3eb8 style: code format 2025-02-13 11:40:55 +08:00
Chen Tao c6f136caa2 feat: knowledge base support more file types (#1300)
* feat: knowledge base support more file types

* chore: add common document types

* feat: finish basic odloader

* feat: finish open document loader

* feat: support more type from dictionary

* fix: 删除目录时仍能检索到信息

* chore
2025-02-13 11:36:33 +08:00
Wenwei Lin c900a186b7 feat: 知识库文件支持 html 类型 2025-02-09 21:27:15 +08:00
kangfenmao 3d2e209550 feat: add knowledge base settings 2025-02-08 19:19:59 +08:00
kangfenmao bfa61ae3ee feat: reduce embedding batch size to 5 2025-02-04 12:35:42 +08:00
Nanami 7f7300e6dc feat: Support configurable chunk size and overlap for knowledge base 2025-01-27 12:30:22 +08:00
亢奋猫 c9813bb1e2 feature: customizable sidebar module #644 (#680)
* feat:对话的时候支持侧边栏拖拽调整宽度

* feat:对话的时候支持侧边栏拖拽调整宽度

* feat: 隐藏app sidebar 用户体验度提升,不支持隐藏对话

* fix:对话勾选知识库 国际化错误

* refactor: split the SidebarIconsManager module out of DisplaySettings

* style: update SidebarIconsManager style

* ci: fix typecheck

* Revert "feat:对话的时候支持侧边栏拖拽调整宽度"

This reverts commit 58072128f0.

* refactor: merge migrate versions

* refactor: simplify sidebarIcons data structure

* chore: move react-beautiful-dnd to dev dependencies

* chore: use @hello-pangea/dnd replace react-beautiful-dnd

* docs: update translation and formatting of input messages

---------

Co-authored-by: hxp0618 <1169924772@qq.com>
Co-authored-by: huang <hxp0618@gmail.com>
2025-01-07 19:11:12 +08:00