Skip to content

Commit ec7381d

Browse files
committed
feat: add support for Qwen3 model and optimize various functionalities
feat: add support for Qwen3 model and optimize various functionalities - Add support for the Qwen3 model - Optimize result parsing for certain search engines - Add OCR support for pure image PDFs (macOS requires manual installation of Poppler) - Improve the effect of using search engines in agent scenarios - Optimize parsing of MCP tool invocation results fix: resolve several known issues - Fix various identified bugs
1 parent fd7fc2b commit ec7381d

60 files changed

Lines changed: 1684 additions & 801 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

electron/data/config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"max_common_use":10}

electron/rag/doc_engins/doc.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ export class DocumentParser {
6161
'.gif': imageParse,
6262
'.bmp': imageParse,
6363
'.webp': imageParse,
64+
'.ppm': imageParse,
65+
'.tiff': imageParse,
6466

6567
// Markdown文件
6668
'.md': txtParse,

electron/rag/doc_engins/libs/image_parse.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { createWorker, PSM } from 'tesseract.js';
44
// 定义常量,方便修改配置
55
const LANG = 'eng+chi_sim';
66
const WORKER_THREADS = 3;
7-
const CONFIDENCE_THRESHOLD = 40;
7+
export const CONFIDENCE_THRESHOLD = 40;
88

99
// 封装错误处理函数
1010
const handleError = (error: any, message: string) => {
@@ -13,7 +13,7 @@ const handleError = (error: any, message: string) => {
1313
};
1414

1515
// 初始化 Tesseract worker
16-
const initializeWorker = async () => {
16+
export const initializeWorker = async () => {
1717
const worker = await createWorker(LANG, WORKER_THREADS, {
1818
langPath: pub.get_resource_path() + "/traineddata",
1919
});
@@ -27,15 +27,15 @@ const initializeWorker = async () => {
2727
};
2828

2929
// 对识别结果进行后处理
30-
const postProcessText = (text: string) => {
30+
export const postProcessText = (text: string) => {
3131
return text
3232
.replace(/\s{2,}/g, ' ')
3333
.replace(/\n{3,}/g, '\n\n')
3434
.trim();
3535
};
3636

3737
// 过滤低置信度行
38-
const filterLowConfidenceLines = (lines: any[], threshold: number) => {
38+
export const filterLowConfidenceLines = (lines: any[], threshold: number) => {
3939
return lines
4040
.filter(line => line.confidence > threshold)
4141
.map(line => line.text)

0 commit comments

Comments
 (0)