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

collection.upsert() and client.get_or_create_collection() #8

Open
wmbutler opened this issue May 29, 2023 · 0 comments
Open

collection.upsert() and client.get_or_create_collection() #8

wmbutler opened this issue May 29, 2023 · 0 comments

Comments

@wmbutler
Copy link

Thanks for your work on this. I'm really enjoying Langchain, Chroma and OpenAI.

I am using this plugin as follows and it works great. I'm trying to also safeguard against creating new collections when one already exists. Also trying to do the same thing for items in the collection. Ideally, I'd like to know how to incorporate

client.get_or_create_collection
collection.upsert()

into my code below to facilitate this. I've started going down the path of building the db natively with Chroma, but thought it might be possible to do it in langchain with this plugin.

db = Chroma.from_texts(texts, embeddings, metadatas=metadatas, ids=ids, collection_name=collection_name, persist_directory="db")
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

No branches or pull requests

1 participant