Skip to content

[Bugfix]: Fix bug when using default embed in vector retrieval and url document.#740

Merged
wzh1994 merged 6 commits intoLazyAGI:mainfrom
ChenJiahaoST:cjh/fix-retriever-urldocument
Sep 5, 2025
Merged

[Bugfix]: Fix bug when using default embed in vector retrieval and url document.#740
wzh1994 merged 6 commits intoLazyAGI:mainfrom
ChenJiahaoST:cjh/fix-retriever-urldocument

Conversation

@ChenJiahaoST
Copy link
Collaborator

📌 PR Description

  • Fix bug of retrieval when using default embed (not dict format) and urldocument.
  • Add set/get state for Retriever Module so that it can be set as ServerModule.

🔍Related Issue

✅ 变更类型 / Type of Change

  • 修复 Bug / Bug fix (non-breaking change that fixes an issue)
  • 新功能 / New feature (non-breaking change that adds functionality)
  • 重构 / Refactor (no functionality change, code structure optimized)
  • 重大变更 / Breaking change (fix or feature that would cause existing functionality to change)
  • 文档更新 / Documentation update (changes to docs only)

⚡ 更新后的用法示例 / Usage After Update

  1. set document
docs = lazyllm.Document(dataset_path="", embed=embed_model, store_conf=store_conf,  server=True)
docs.create_node_group(name="line", display_name='句子切片', group_type=NodeGroupType.CHUNK, transform=lambda x: x.split("。"))
docs.activate_group("line")
docs.start()
  1. set retriever
r = lazyllm.Retriever(docs, "block", 'cosine', topk=10)
r("query")
```
3. use server module
````python
from lazyllm import ServerModule
m = ServerModule(r)
m.start()
res = m("query")
```

## ⚠️ 注意事项 / Additional Notes
<!-- 是否有依赖更新迁移步骤或其他注意点 / Mention dependencies, migration steps, or any other concerns -->
Note: Only when `server=True` (Document does have a url), retriever can be set as `ServerModule` 

@mergify mergify bot added the lint_pass label Sep 1, 2025
@lwj-st lwj-st removed the lint_pass label Sep 2, 2025
@mergify mergify bot added the lint_pass label Sep 2, 2025
@lwj-st lwj-st removed the lint_pass label Sep 2, 2025
@mergify mergify bot added the lint_pass label Sep 2, 2025
@wzh1994 wzh1994 merged commit d143661 into LazyAGI:main Sep 5, 2025
25 of 30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Bug with UrlDocument

3 participants