feat: 从 URL 创建知识时自动提取 HTML 标题 - #31
Closed
fennoai[bot] wants to merge 4 commits into
Closed
Conversation
V0 版本 - 开源项目 WeKnora 代码
## 问题 当前从 URL 创建知识时,生成的 knowledge 没有标题,影响搜索效率 ## 解决方案 1. 扩展 protobuf 定义,在 ReadResponse 中添加 title 字段 2. WebParser 自动从 HTML 提取标题: - 优先使用 <title> 标签 - 其次使用 <h1> 标签 - 最后使用默认值 "Untitled Web Page" 3. Go 服务从响应中获取并更新知识标题 ## 修改文件 - services/docreader/src/proto/docreader.proto: 添加 title 字段 - services/docreader/src/parser/base_parser.py: ParseResult 添加 title 支持 - services/docreader/src/parser/web_parser.py: 保存提取的标题 - services/docreader/src/proto/docreader.pb.go: 更新 Go protobuf 定义 - services/docreader/src/server/server.py: 返回提取的标题 - internal/application/service/knowledge.go: 使用提取的标题更新知识记录 Fixes #30 🤖 Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: cn0809 <63532205+cn0809@users.noreply.github.com>
Collaborator
|
@xgopilot 主干分支是 main 分支!基于当前 main 分支最新代码重新提交 pr, 然后关掉这个pr |
Contributor
Author
任务完成已成功基于最新的 main 分支重新创建 PR。 完成的任务:
新 PR 链接: #32 说明:
|
Contributor
Author
|
已基于最新的 main 分支重新创建 PR: #32 请关闭此 PR。 |
fennoai
Bot
deleted the
xgopilot/claude/issue-30-1761474504-implementation
branch
October 26, 2025 12:49
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
解决 issue #30: 从 URL 创建的知识需要添加标题
问题描述
目前调用 URL 创建知识的接口,生成的 knowledge 都没有标题,影响搜索效率
解决方案
实现了从 HTML 页面自动提取标题的功能:
ReadResponse消息中添加title字段<title>标签<h1>标签修改文件
services/docreader/src/proto/docreader.proto: 添加 title 字段定义services/docreader/src/parser/base_parser.py: ParseResult 添加 title 字段services/docreader/src/parser/web_parser.py: 实现标题提取逻辑services/docreader/src/proto/docreader.pb.go: 更新 Go protobuf 定义services/docreader/src/server/server.py: 在响应中返回提取的标题internal/application/service/knowledge.go: 使用提取的标题更新知识记录测试建议
<title>标签的页面<h1>标签的页面Checklist
Fixes #30
🤖 Generated with codeagent
Co-authored-by: cn0809 63532205+cn0809@users.noreply.github.com