这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@timothycarambat
Copy link
Member

Pull Request Type

  • ✨ feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 🔨 chore
  • 📝 docs

What is in this change?

For vectorDbs who require a strict dimension argument on creation, we opt to now infer the dimensionality from the first chunk that is being upserted to the collection in question.

Additional Information

This only applies to Milvus and QDrant

Developer Validations

  • I ran yarn lint from the root of the repo & committed changes
  • Relevant documentation has been updated
  • I have tested my code functionality
  • Docker build succeeds locally

@review-agent-prime
Copy link

server/utils/vectorDbProviders/qdrant/index.js

Instead of using the push method inside a loop, it would be more efficient to use the map method to create the arrays. This would improve the performance of the code.
Create Issue
See the diff
Checkout the fix

    submission.ids = vectors.map(vectorRecord => vectorRecord.id);
    submission.vectors = vectors.map(vectorRecord => vectorRecord.vector);
    submission.payloads = vectors.map(vectorRecord => vectorRecord.payload);
git fetch origin && git checkout -b ReviewBot/Impro-lgn71n4 origin/ReviewBot/Impro-lgn71n4

@timothycarambat timothycarambat merged commit d0a3f1e into master Jan 16, 2024
@timothycarambat timothycarambat deleted the vector-db-preset-dimensions branch January 16, 2024 21:41
cabwds pushed a commit to cabwds/anything-llm that referenced this pull request Jul 3, 2025
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