mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-22 11:00:37 +00:00
core[patch]: configurable init params (#20070)
Proposed fix for #20061. need to test --------- Co-authored-by: Erick Friis <erick@langchain.dev>
This commit is contained in:
@@ -345,8 +345,13 @@ class RunnableConfigurableFields(DynamicRunnable[Input, Output]):
|
||||
}
|
||||
|
||||
if configurable:
|
||||
init_params = {
|
||||
k: v
|
||||
for k, v in self.default.__dict__.items()
|
||||
if k in self.default.__fields__
|
||||
}
|
||||
return (
|
||||
self.default.__class__(**{**self.default.__dict__, **configurable}),
|
||||
self.default.__class__(**{**init_params, **configurable}),
|
||||
config,
|
||||
)
|
||||
else:
|
||||
|
Reference in New Issue
Block a user