Skip to content

Conversation

alex-16rd
Copy link

Description

Summary: (summary)

  • add optional api-key parameter for Qdrant

Tested with:

  • pytest -q MemOS/tests/configs/test_vec_db.py::test_qdrant_vec_db_config
  • pytest -q MemOS/tests/vec_dbs/test_qdrant.py::test_client_receives_api_key

Checklist:

  • [Y] I have performed a self-review of my own code | 我已自行检查了自己的代码
  • [Y] I have commented my code in hard-to-understand areas | 我已在难以理解的地方对代码进行了注释
  • [Y] I have added tests that prove my fix is effective or that my feature works | 我已添加测试以证明我的修复有效或功能正常
  • I have created related documentation issue/PR in MemOS-Docs (if applicable) | 我已在 MemOS-Docs 中创建了相关的文档 issue/PR(如果适用)
  • I have linked the issue to this PR (if applicable) | 我已将 issue 链接到此 PR(如果适用)
  • I have mentioned the person who will review this PR | 我已提及将审查此 PR 的人

@fridayL fridayL requested review from CaralHsi and Ki-Seki August 13, 2025 03:46
@Ki-Seki Ki-Seki requested a review from Copilot August 15, 2025 14:24
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds optional API key authentication support for Qdrant vector database configuration. This enhancement allows MemOS to connect to Qdrant instances that require API key authentication, expanding the deployment options for the vector database backend.

  • Added api_key optional field to QdrantVecDBConfig
  • Modified Qdrant client initialization to conditionally include API key
  • Added comprehensive test coverage for the new API key functionality

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/memos/configs/vec_db.py Added optional api_key field to Qdrant configuration model
src/memos/vec_dbs/qdrant.py Updated client initialization to conditionally pass API key parameter
tests/configs/test_vec_db.py Updated test to include api_key in optional fields list
tests/vec_dbs/test_qdrant.py Added new test to verify API key is properly passed to Qdrant client

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

)
_ = VecDBFactory.from_config(cfg)

# 断言 QdrantClient 被以 api_key 关键字参数调用
Copy link
Preview

Copilot AI Aug 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment is in Chinese. For consistency with the rest of the codebase, consider using English: '# Assert that QdrantClient was called with api_key keyword argument'

Suggested change
# 断言 QdrantClient 被以 api_key 关键字参数调用
# Assert that QdrantClient was called with api_key keyword argument

Copilot uses AI. Check for mistakes.

Copy link
Member

@Ki-Seki Ki-Seki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure the submitted PR meets the following requirements:

  1. The target branch for merging should be dev
  2. Ensure the PR is updated with the latest changes from the dev branch
  3. If CI tests fail, necessary modifications are required
  4. Consider Copilot's suggestions and make appropriate code changes
  5. Use English consistently for all comments

确保提交的PR满足以下条件:

  1. 合并目标分支应为dev
  2. 确保与dev分支保持同步更新
  3. 若CI测试未通过,需进行相应修改
  4. 参考Copilot的建议,可适当修改代码
  5. 注释统一使用英文

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.

2 participants