-
Dear all I'm Noob and not a good programmer, I have a semantic or logical error or maybe found an issue I have a weird piece of behaviour which I find baffling it works in one scenario with what I think is incorrect coded but in workaround scenario I get what I expect. This can be simply explained as the chaining not working correctly (possible issue) or I'm missing some understanding. But logically I just don't get it so any help would be appreciated the key line is the commented out line
If I leave commented the results is as expected I get a dumb down explanation, but if I uncomment the expert answer. It's as if the chains are not connected (inputs ouputs )both run without error but the results are different. My understanding says I should get the correct result with the code uncommented , I have the work around but what am I missing in my understanding ? Any help would be appreciated I have two prompts
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
Answer generated by a 🤖 AnswerHello, Thank you for reaching out and providing a detailed explanation of your issue. I understand that you're having trouble understanding the behavior of the The In the context of the
Here is the relevant code from the def _call(
self,
inputs: Dict[str, str],
run_manager: Optional[CallbackManagerForChainRun] = None,
) -> Dict[str, str]:
...
return {k: known_values[k] for k in self.output_variables}
async def _acall(
self,
inputs: Dict[str, Any],
run_manager: Optional[AsyncCallbackManagerForChainRun] = None,
) -> Dict[str, Any]:
...
return {k: known_values[k] for k in self.output_variables} I hope this helps clarify the role of Best, Sources
This response is meant to be useful, save you time, and share context. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. |
Beta Was this translation helpful? Give feedback.
-
i have the next code
i need pass the answer of rag_chain to summary_chain but i cant apply rag_chain | StrOutputParser() because i need the documents retrieve from rag_chain , how do that with lcel? |
Beta Was this translation helpful? Give feedback.
Answer generated by a 🤖
Answer
Hello,
In the LangChain Python framework, the
output_variables
attribute in theSequentialChain
class is used to specify which variables should be returned as output when the chain is run. It's a list of strings that represent the keys of the output data. After each chain in the sequence is executed, its output is added to aknown_values
dictionary. At the end of the sequence, a new dictionary is created that only includes the keys specified inoutput_variables
from theknown_values
dictionary. This new dictionary is then returned as the final output of theSequentialChain
.The
output_key
attribute in theLLMChain
class is used as the key for the output gene…