qdrant-client icon indicating copy to clipboard operation
qdrant-client copied to clipboard

chore: Added init_options property

Open Anush008 opened this issue 1 year ago • 7 comments

All Submissions:

  • [x] Contributions should target the dev branch. Did you create your branch from dev?
  • [x] Have you followed the guidelines in our Contributing document?
  • [x] Have you checked to ensure there aren't other open Pull Requests for the same update/change?

New Feature Submissions:

  1. [x] Does your submission pass tests?
  2. [x] Have you installed pre-commit with pip3 install pre-commit and set up hooks with pre-commit install?

Why?

This change will be helpful in our integration implementations as we won't have to necessitate users to pass instances of both QdrantClient and AsyncQdrantClient. Either one will suffice.

Anush008 avatar Mar 14 '24 17:03 Anush008

Deploy Preview for poetic-froyo-8baba7 ready!

Name Link
Latest commit f643483ca4c7236292ce789108dbb9029ad190ea
Latest deploy log https://app.netlify.com/sites/poetic-froyo-8baba7/deploys/6683f76e62908c00085430d9
Deploy Preview https://deploy-preview-541--poetic-froyo-8baba7.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar Mar 14 '24 17:03 netlify[bot]

Hey @Anush008

It does not sound like the right motivation

Could you please provide more details and explain the need?

joein avatar Mar 14 '24 18:03 joein

@joein, yes. For instances like these.

https://discord.com/channels/907569970500743200/1206597766999056435/1206601751747371089

Some frameworks require us to pass SDK instances and not the params to construct those. So instead of forcing users to pass 2 instances(sync, async) of essentially the same thing, we can construct one from the other.

Anush008 avatar Mar 14 '24 18:03 Anush008

Could you please explain why do they need to create two instances?

joein avatar Mar 14 '24 18:03 joein

To implement the sync and async interfaces of the frameworks.

Like Langchain for example, has equivalent sync and async methods that've been implemented.

https://python.langchain.com/docs/modules/data_connection/vectorstores/#asynchronous-operations

Anush008 avatar Mar 14 '24 18:03 Anush008

So can they just use one client or another one? Why do they need to use both simultaneously?

What is the use case for having two clients at the same time?

joein avatar Mar 14 '24 18:03 joein

For example, the Qdrant class from Langchain has both sync and async interfaces.

So for


Qdrant#add_documents(...)
...
await Qdrant#asimiliarity_search(...)

...

await Qdrant#aadd_documents(...)
...

Qdrant#similiarity_search(...)

to work, we need the sync and async instances within the Qdrant class.

Anush008 avatar Mar 14 '24 18:03 Anush008