Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: change the filter condition of the tool search_knowledge #434

Merged
merged 6 commits into from
Oct 15, 2024

Conversation

xingwanying
Copy link
Contributor

  • 文档入库和知识查询改为以repo_name为索引,防止不同机器人但是同个repo的重复入库造成的资源浪费

Copy link

vercel bot commented Oct 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
petercat ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 15, 2024 7:27am

Copy link

Walkthrough

此PR通过将文档存储和知识查询的索引更改为repo_name,以避免不同机器人但相同仓库的重复存储导致的资源浪费。涉及的更改包括数据库类型定义、SQL函数、任务处理逻辑和API路由。

Changes

文件 概要
client/types/database.types.ts 更新了数据库类型定义,添加了match_embedding_docs类型,并调整了类型定义的语法。
migrations/supabase/migrations/20240911082857_remote_schema.sql 修改了SQL函数match_rag_docsmatch_embedding_docs,并更改了过滤条件。
petercat_utils/rag_helper/git_doc_task.py 重构了add_rag_git_doc_task函数和GitDocTask类的初始化逻辑。
petercat_utils/rag_helper/git_task.py 重构了GitTask类的初始化逻辑。
petercat_utils/rag_helper/retrieval.py 更新了查询逻辑,移除了对bot_id的依赖,增加了BotDAO的使用。
server/README.zh-CN.md 更新了文档,移除了bot_id相关内容。
server/core/models/bot.py Bot模型中添加了repo_name字段。
server/rag/router.py 修改了search_knowledge路由的参数,从bot_id改为repo_name

Copy link

codecov bot commented Oct 12, 2024

Codecov Report

Attention: Patch coverage is 43.47826% with 13 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
petercat_utils/rag_helper/git_doc_task.py 33.33% 4 Missing ⚠️
petercat_utils/rag_helper/retrieval.py 42.85% 4 Missing ⚠️
petercat_utils/rag_helper/git_task.py 40.00% 3 Missing ⚠️
server/rag/router.py 50.00% 2 Missing ⚠️
Files with missing lines Coverage Δ
server/core/models/bot.py 100.00% <100.00%> (ø)
server/rag/router.py 37.50% <50.00%> (ø)
petercat_utils/rag_helper/git_task.py 52.00% <40.00%> (ø)
petercat_utils/rag_helper/git_doc_task.py 24.59% <33.33%> (ø)
petercat_utils/rag_helper/retrieval.py 30.43% <42.85%> (+0.13%) ⬆️

... and 7 files with indirect coverage changes

@RaoHai RaoHai merged commit ab76db6 into main Oct 15, 2024
4 of 5 checks passed
@RaoHai RaoHai deleted the refactor_rag branch October 15, 2024 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants