Expression language: parallel answering of retrieved documents #9306
-
Hi guys, chat_history | standalone_question | retrieve_documents | answer_each_doc_in_parallel | create_final_answer Basically I want to implement map_reduce with the expression language. How do I do that? I built a retrieve that is for example returning 7 documents and I want to pass them to something that is implementing map_reduce. Does someone know how to do it? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
I am also very interested in this. Is it already possible to use a retriever and distribute the retrieved documents in a map step and then combine them in a reduce step to a final answer via expression language? |
Beta Was this translation helpful? Give feedback.
-
Also looking for this, 8 months later |
Beta Was this translation helpful? Give feedback.
-
It was added to Langchain via the map method. You can map the results of the retrieval to a chain. Something like: chain = retriever | map _chain.map() | reduce_chain |
Beta Was this translation helpful? Give feedback.
It was added to Langchain via the map method. You can map the results of the retrieval to a chain.
Something like:
chain = retriever | map _chain.map() | reduce_chain