nexent icon indicating copy to clipboard operation
nexent copied to clipboard

extract images of attachments uploaded during conversations

Open yzAiden opened this issue 5 months ago • 1 comments

修复描述:因为返回值类型改变,导致原本接收单个值的变量报错,通过解包后修复 修复前: 505ddf5f8e83eb4e8a8ae222549c6bc2

56e5d7c221960cbebb0933f36fac660e

修复后: db8ef6fe9de4100571140f5c9f8703cd

yzAiden avatar Jun 11 '26 02:06 yzAiden

实现的功能:提取对话时上传的附件的图片,并输出用户指定的图片

实现思路: 1.采用已有的图片提取功能 2.在文件分析工具中,识别文件类型,获取sdk层返回的图片信息,图片本身存入minio,图片元数据和纯文本合并后统一传给llm分析 3.llm提取图片url并是用图片分析工具分析,最终在对话部分输出用户指定的图片。来源部分可以显示图片元数据、图片部分可以显示提取到的图片

实现效果展示: 7f62f5dddc1d96cf53721fcdf5aa7adc

bb39083ea9e3cbaac6b3e18e8ec2486b ffc78b04b6a8904044f4682d637783f1

yzAiden avatar Jun 15 '26 07:06 yzAiden

The image extraction logic from PDF files is a useful addition. Please ensure edge cases (corrupted images, unsupported formats) are handled gracefully and covered by tests.

WMC001 avatar Jun 24 '26 07:06 WMC001

Bug 3: chunks_count assertion is now wrong

test/backend/services/test_data_process_service.py line 2123 — the test asserts result["chunks_count"] == 3, but the implementation now returns len(text_chunks) + len(images_chunks). With the mock returning text_chunks=2 and images_chunks=3, the assertion should be 5, not 3. The comment includes chunk without 'content' is now stale and misleading.

Fix: update the assertion to self.assertEqual(result["chunks_count"], 5) and update the comment to reflect the new logic.

WMC001 avatar Jun 24 '26 08:06 WMC001

解决了已存在的问题,修改内容如下: 1.调用detect_file_type()进行了类型验证,保证传入的是bytes类型; 2.加入MinIO上传失败处理; 3.chunks_count拆分为文本chunk和图片元数据chunk; 4.chunks, _ = data_process.file_process(...)已修改,后续也使用了图片信息; 5.图片上传加入了尺寸验证; 6.将原来硬编码的文件夹名称作为了常量; 7.process_uploaded_text_file()中的image_descriptions格式改为使用——分隔符; 8._build_search_results方法使用的索引值来源已修改; 9.单元测试已修改,已通过。

yzAiden avatar Jun 25 '26 16:06 yzAiden

#3078 问题已解决。 修改方式:保留输入过滤作为安全层

#2720 问题已解决。 修改方式:加入MinIO上传失败处理

yzAiden avatar Jun 25 '26 16:06 yzAiden

#3176 问题已解决。 存在的问题: 无法解析在知识库中上传的.epub类型文件 f4524b23f297fdb5cef63ea4c5c8d731

失败原因: 未安装pandoc 45d7149ed815841a735ee6bcb9dd57d6 image

解决方式: 构建data-process镜像时安装pandoc

解决后的效果: 1.安装了pandoc image

2.成功解析.epub文件 6630e40146afe38f9e0fdc141966d005

yzAiden avatar Jun 28 '26 08:06 yzAiden

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests.

:loudspeaker: Thoughts on this report? Let us know!

codecov[bot] avatar Jul 26 '26 06:07 codecov[bot]