Created
July 14, 2024 10:27
-
-
Save pavlovmilen/8a033887b65846a2ebaf578d2c6ebc17 to your computer and use it in GitHub Desktop.
Filter on metadata
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
if metadata: | |
res = app.app_state.collection.query( | |
query_embeddings=query_embeddings, | |
n_results=results, | |
where={"Metadata": metadata}, | |
include=["documents", "metadatas", "distances", "embeddings"] | |
) | |
else: | |
res = app.app_state.collection.query( | |
query_embeddings=query_embeddings, | |
n_results=results, | |
include=["documents", "metadatas", "distances", "embeddings"] | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment