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

✨ feat: 允许用户自行定义 Embedding 模型 #4370

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

cookieY
Copy link
Contributor

@cookieY cookieY commented Oct 14, 2024

💻 变更类型 | Change Type

  • ✨ feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 👷 build
  • ⚡️ perf
  • 📝 docs
  • 🔨 chore

🔀 变更说明 | Description of Change

本次变更主要实现了embedding 模型可配置性

通过新增环境变量DEFAULT_FILES_CONFIG实现可自主配置embedding 模型, provider基于现有模型供应商列表

示例:

以 / 为分隔符 openai 为模型提供商, text-embedding-3-small为 embedding 模型

DEFAULT_FILES_CONFIG="embedding_model=zhipu/embedding-3,reranker_model=cohere/rerank-english-v3.0,query_mode=full_text"

📝 补充信息 | Additional Information

目前已支持 zhipu/github/openai/bedrock/ollama模型提供商的embedding 模型

可在agent-runtime下对各模型提供商实现 embeddings 方法从而增加 embedding 模型支持

为后续检索策略预留 rerank 模型以及查询模式变量入口

Copy link

vercel bot commented Oct 14, 2024

@cookieY is attempting to deploy a commit to the LobeChat Community Team on Vercel.

A member of the Team first needs to authorize it.

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Oct 14, 2024
@lobehubbot
Copy link
Member

👍 @cookieY

Thank you for raising your pull request and contributing to our Community
Please make sure you have followed our contributing guidelines. We will review it as soon as possible.
If you encounter any problems, please feel free to connect with us.
非常感谢您提出拉取请求并为我们的社区做出贡献,请确保您已经遵循了我们的贡献指南,我们会尽快审查它。
如果您遇到任何问题,请随时与我们联系。

@dosubot dosubot bot added the 🌠 Feature Request New feature or request | 特性与建议 label Oct 14, 2024
Copy link

codecov bot commented Oct 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.37%. Comparing base (e189e5c) to head (d730ee0).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4370      +/-   ##
==========================================
+ Coverage   92.21%   97.37%   +5.16%     
==========================================
  Files         493       28     -465     
  Lines       35390     4002   -31388     
  Branches     2304      322    -1982     
==========================================
- Hits        32634     3897   -28737     
+ Misses       2756      105    -2651     
Flag Coverage Δ
app ?
server 97.37% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌠 Feature Request New feature or request | 特性与建议 size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants