How to output specific intermediary results at the end of the chain
Edit: I found out how to do this with (lambda x: intermediate_results.update({"resultA":x}) or x)
I have a chain in langchain that calls on LLMs several times and then processes the output. It looks something like prompt1 | llm | OutputParser | prompt2 | llm | OutlutParser etc. I would like to capture the results that come out of the Output Parser and have the chain return those together with the actual result of the chain.