nbaldwin commited on
Commit
b922a7a
·
1 Parent(s): 5a12fca

bug fix Chromadb

Browse files
Files changed (1) hide show
  1. ChromaDBFlow.py +8 -8
ChromaDBFlow.py CHANGED
@@ -122,14 +122,14 @@ class ChromaDBFlow(AtomicFlow):
122
  raise ValueError(f"content(query) must be a string during read, got {type(content)}: {content}")
123
  if content == "":
124
  response["retrieved"] = [[""]]
125
- return response
126
- query = content
127
- query_result = self.collection.query(
128
- query_embeddings=embeddings.embed_query(query),
129
- n_results=self.flow_config["n_results"]
130
- )
131
-
132
- response["retrieved"] = [doc for doc in query_result["documents"]]
133
 
134
  elif operation == "write":
135
  if content != "":
 
122
  raise ValueError(f"content(query) must be a string during read, got {type(content)}: {content}")
123
  if content == "":
124
  response["retrieved"] = [[""]]
125
+ else:
126
+ query = content
127
+ query_result = self.collection.query(
128
+ query_embeddings=embeddings.embed_query(query),
129
+ n_results=self.flow_config["n_results"]
130
+ )
131
+
132
+ response["retrieved"] = [doc for doc in query_result["documents"]]
133
 
134
  elif operation == "write":
135
  if content != "":