You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
langchain/libs
Yuki Watanabe cfecbda48b
community[minor]: Allow passing `allow_dangerous_deserialization` when loading LLM chain (#18894)
### Issue
Recently, the new `allow_dangerous_deserialization` flag was introduced
for preventing unsafe model deserialization that relies on pickle
without user's notice (#18696). Since then some LLMs like Databricks
requires passing in this flag with true to instantiate the model.

However, this breaks existing functionality to loading such LLMs within
a chain using `load_chain` method, because the underlying loader
function
[load_llm_from_config](f96dd57501/libs/langchain/langchain/chains/loading.py (L40))
 (and load_llm) ignores keyword arguments passed in. 

### Solution
This PR fixes this issue by propagating the
`allow_dangerous_deserialization` argument to the class loader iff the
LLM class has that field.

---------

Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
Co-authored-by: Bagatur <22008038+baskaryan@users.noreply.github.com>
3 months ago
..
cli cli[patch]: Fix Tuple typing problem when create new langchain app (#19141) 3 months ago
community community[minor]: Allow passing `allow_dangerous_deserialization` when loading LLM chain (#18894) 3 months ago
core core[minor]: Use BaseChatMessageHistory async methods in RunnableWithMessageHistory (#19565) 3 months ago
experimental experimental[patch]: update module doc strings (#19539) 3 months ago
langchain community[minor]: Allow passing `allow_dangerous_deserialization` when loading LLM chain (#18894) 3 months ago
partners docs: added `partners/package-name` folders (#19290) 3 months ago
text-splitters splitters: Add ensure_ascii parameter (#18485) 3 months ago