Spaces:
Running
Running
Update chromedb_service.py
Browse files- chromedb_service.py +2 -1
chromedb_service.py
CHANGED
@@ -64,11 +64,12 @@ def delete_collection(collection_name):
|
|
64 |
print(f"Collection {collection_name} supprimée avec succès !")
|
65 |
|
66 |
# Recherche dans une collection
|
67 |
-
def search(collection_name, query, n_results):
|
68 |
chroma_client = chromadb.HttpClient(host='https://stable-diffusion-engine.oneiro-lego.com')
|
69 |
collection = chroma_client.get_or_create_collection(name=collection_name)
|
70 |
results = collection.query(
|
71 |
query_texts=[query],
|
|
|
72 |
n_results=n_results
|
73 |
)
|
74 |
return parse_chromadb_response(results)
|
|
|
64 |
print(f"Collection {collection_name} supprimée avec succès !")
|
65 |
|
66 |
# Recherche dans une collection
|
67 |
+
def search(collection_name, query, metadata, n_results):
|
68 |
chroma_client = chromadb.HttpClient(host='https://stable-diffusion-engine.oneiro-lego.com')
|
69 |
collection = chroma_client.get_or_create_collection(name=collection_name)
|
70 |
results = collection.query(
|
71 |
query_texts=[query],
|
72 |
+
metadata=metadata,
|
73 |
n_results=n_results
|
74 |
)
|
75 |
return parse_chromadb_response(results)
|