|
@@ -70,7 +70,7 @@ class ChromaClient:
|
|
return None
|
|
return None
|
|
|
|
|
|
def query(
|
|
def query(
|
|
- self, collection_name: str, filter: dict, limit: int = 1
|
|
|
|
|
|
+ self, collection_name: str, filter: dict, limit: int = 2
|
|
) -> Optional[GetResult]:
|
|
) -> Optional[GetResult]:
|
|
# Query the items from the collection based on the filter.
|
|
# Query the items from the collection based on the filter.
|
|
|
|
|
|
@@ -82,15 +82,18 @@ class ChromaClient:
|
|
limit=limit,
|
|
limit=limit,
|
|
)
|
|
)
|
|
|
|
|
|
|
|
+ print(result)
|
|
|
|
+
|
|
return GetResult(
|
|
return GetResult(
|
|
**{
|
|
**{
|
|
- "ids": result["ids"],
|
|
|
|
- "documents": result["documents"],
|
|
|
|
- "metadatas": result["metadatas"],
|
|
|
|
|
|
+ "ids": [result["ids"]],
|
|
|
|
+ "documents": [result["documents"]],
|
|
|
|
+ "metadatas": [result["metadatas"]],
|
|
}
|
|
}
|
|
)
|
|
)
|
|
return None
|
|
return None
|
|
except Exception as e:
|
|
except Exception as e:
|
|
|
|
+ print(e)
|
|
return None
|
|
return None
|
|
|
|
|
|
def get(self, collection_name: str) -> Optional[GetResult]:
|
|
def get(self, collection_name: str) -> Optional[GetResult]:
|