Update langchain-community to version 0.3.1 #96
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Dependency Update:
Update langchain-community to version 0.3.1
langchain-ai/langchain@28ad244
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.