mirror of
https://github.com/hwchase17/langchain
synced 2024-11-04 06:00:26 +00:00
RunnableWithMessageHistory: Fix input schema (#14516)
Input schema should not have history key
This commit is contained in:
parent
d9bfdc95ea
commit
c0f4b95aa9
@ -197,8 +197,6 @@ class RunnableWithMessageHistory(RunnableBindingBase):
|
||||
fields[self.input_messages_key] = (Sequence[BaseMessage], ...)
|
||||
else:
|
||||
fields["__root__"] = (Sequence[BaseMessage], ...)
|
||||
if self.history_messages_key:
|
||||
fields[self.history_messages_key] = (Sequence[BaseMessage], ...)
|
||||
return create_model( # type: ignore[call-overload]
|
||||
"RunnableWithChatHistoryInput",
|
||||
**fields,
|
||||
|
@ -178,7 +178,6 @@ def test_output_dict() -> None:
|
||||
def test_get_input_schema_input_dict() -> None:
|
||||
class RunnableWithChatHistoryInput(BaseModel):
|
||||
input: Union[str, BaseMessage, Sequence[BaseMessage]]
|
||||
history: Sequence[BaseMessage]
|
||||
|
||||
runnable = RunnableLambda(
|
||||
lambda input: {
|
||||
|
Loading…
Reference in New Issue
Block a user