mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-08 04:25:46 +00:00
x
This commit is contained in:
parent
c0c6d61fa5
commit
33b3e22083
@ -5217,7 +5217,7 @@ class RunnableBindingBase(RunnableSerializable[Input, Output]):
|
|||||||
kwargs.
|
kwargs.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
config: RunnableConfig = Field(default_factory=dict)
|
config: RunnableConfig = Field(default_factory=RunnableConfig)
|
||||||
"""The config to bind to the underlying Runnable."""
|
"""The config to bind to the underlying Runnable."""
|
||||||
|
|
||||||
config_factories: list[Callable[[RunnableConfig], RunnableConfig]] = Field(
|
config_factories: list[Callable[[RunnableConfig], RunnableConfig]] = Field(
|
||||||
|
@ -211,7 +211,7 @@ def pre_init(func: Callable) -> Any:
|
|||||||
name not in values or values[name] is None
|
name not in values or values[name] is None
|
||||||
) and not field_info.is_required():
|
) and not field_info.is_required():
|
||||||
if field_info.default_factory is not None:
|
if field_info.default_factory is not None:
|
||||||
values[name] = field_info.default_factory()
|
values[name] = field_info.default_factory() # type: ignore
|
||||||
else:
|
else:
|
||||||
values[name] = field_info.default
|
values[name] = field_info.default
|
||||||
|
|
||||||
|
@ -14047,7 +14047,8 @@
|
|||||||
"stop": [
|
"stop": [
|
||||||
"Thought:"
|
"Thought:"
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
|
"config": {}
|
||||||
},
|
},
|
||||||
"name": "FakeListChatModel"
|
"name": "FakeListChatModel"
|
||||||
},
|
},
|
||||||
|
@ -2949,7 +2949,9 @@ def test_seq_prompt_map(mocker: MockerFixture, snapshot: SnapshotAssertion) -> N
|
|||||||
assert chain.first == prompt
|
assert chain.first == prompt
|
||||||
assert chain.middle == [RunnableLambda(passthrough)]
|
assert chain.middle == [RunnableLambda(passthrough)]
|
||||||
assert isinstance(chain.last, RunnableParallel)
|
assert isinstance(chain.last, RunnableParallel)
|
||||||
assert dumps(chain, pretty=True) == snapshot
|
|
||||||
|
if (PYDANTIC_MAJOR_VERSION, PYDANTIC_MINOR_VERSION) >= (2, 10):
|
||||||
|
assert dumps(chain, pretty=True) == snapshot
|
||||||
|
|
||||||
# Test invoke
|
# Test invoke
|
||||||
prompt_spy = mocker.spy(prompt.__class__, "invoke")
|
prompt_spy = mocker.spy(prompt.__class__, "invoke")
|
||||||
|
Loading…
Reference in New Issue
Block a user