Add comments to clarify the structure of the result dict

This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-02-15 16:35:30 -03:00
commit bd5ecb8763

View file

@ -45,4 +45,6 @@ class RetrievalQAComponent(CustomComponent):
self.status = runnable
result = runnable.invoke({input_key: inputs})
result = result.content if hasattr(result, "content") else result
# Result is a dict with keys "query", "result" and "source_documents"
# for now we just return the result
return result.get("result")