Created
November 24, 2023 12:55
-
-
Save tazarov/76b239fcfd2823b5c62d1a79868a4b43 to your computer and use it in GitHub Desktop.
Keyword Search in Chroma
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import chromadb | |
from chromadb.config import Settings | |
client = chromadb.PersistentClient(path="test", settings=Settings(allow_reset=True)) | |
client.reset() | |
col = client.get_or_create_collection("test") | |
col.add(ids=["1", "2", "3"], documents=["He is a technology freak and he loves AI topics", "AI technology are advancing at a fast pace", "Innovation in LLMs is a hot topic"]) | |
col.query(query_texts=["technology"], where_document={"$or":[{"$contains":"technology"}, {"$contains":"freak"}]}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment