Closed xlzuvekas closed 2 months ago
@xlzuvekas , super thanks for addressing the issue along with the details logs for the investigation! I'll merge it and create a new tag.
@xlzuvekas , super thanks for addressing the issue along with the details logs for the investigation! I'll merge it and create a new tag.
Happy to help! Cheers!
Dependency Update:
Update langchain-community to version 0.3.1
https://github.com/langchain-ai/langchain/commit/28ad244e775610d4826fbfe34c62dba826cf26c9
Dependency Update:
requirements.txt
Reason for Change
The application previously encountered the following error during runtime:
This error originated from the
langchain_community/chat_models/openai.py
file, specifically within the_combine_llm_outputs
method. The root cause was the unsupported operation of adding two dictionaries using the+=
operator. Updatinglangchain
to version0.3.1
introduces support for nested dictionaries.Logs:
Error Type:
TypeError
Error Message:
unsupported operand type(s) for +=: 'dict' and 'dict'
Location:
langchain_community/chat_models/openai.py
, line 377, in_combine_llm_outputs
Description:
An attempt was made to use the
+=
operator to add two dictionaries (overall_token_usage[k]
andv
), which is not supported in Python. This error occurs within thelangchain_community
package while processing the output of language model calls.Call Stack Overview:
/opt/***/run/auto-news/src/af_save.py
run
→process_rss
→op.summarize
/home/***/.local/lib/python3.11/site-packages/langchain/chains/base.py
run
→__call__
→invoke
/home/***/.local/lib/python3.11/site-packages/langchain/chains/combine_documents/map_reduce.py
combine_docs
→self.llm_chain.apply
/home/***/.local/lib/python3.11/site-packages/langchain_community/chat_models/openai.py
_combine_llm_outputs
Impact:
The task failed to execute successfully, resulting in the termination of the process with a return code
1
. This affects theauto-news
application's ability to process and summarize RSS feeds.