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

chore: Added init_options property #541

Merged
merged 6 commits into from
Jul 17, 2024
Merged

chore: Added init_options property #541

merged 6 commits into from
Jul 17, 2024

Conversation

Anush008
Copy link
Member

@Anush008 Anush008 commented Mar 14, 2024

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 Anush008 requested review from generall and joein March 14, 2024 17:43
Copy link

netlify bot commented Mar 14, 2024

Deploy Preview for poetic-froyo-8baba7 ready!

Name Link
🔨 Latest commit f643483
🔍 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.

@joein
Copy link
Member

joein commented Mar 14, 2024

Hey @Anush008

It does not sound like the right motivation

Could you please provide more details and explain the need?

@Anush008
Copy link
Member Author

@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.

@joein
Copy link
Member

joein commented Mar 14, 2024

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

@Anush008
Copy link
Member Author

Anush008 commented Mar 14, 2024

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

@joein
Copy link
Member

joein commented Mar 14, 2024

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?

@Anush008
Copy link
Member Author

Anush008 commented Mar 14, 2024

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.

@generall generall closed this May 7, 2024
@Anush008 Anush008 reopened this Jul 2, 2024
@joein joein merged commit a0d263e into dev Jul 17, 2024
14 checks passed
@Anush008 Anush008 deleted the init-opts branch July 17, 2024 15:54
joein pushed a commit that referenced this pull request Aug 12, 2024
* chore: Added init_options property

* refactor: @Property

* test: init_opts

* chore: regen async client again with Py 3.10

* chore: deepcopy kwargs
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.

3 participants