diff --git a/libs/core/langchain_core/runnables/history.py b/libs/core/langchain_core/runnables/history.py index 98c6b1a09123e..e0bb9281ffd5e 100644 --- a/libs/core/langchain_core/runnables/history.py +++ b/libs/core/langchain_core/runnables/history.py @@ -197,8 +197,6 @@ def get_input_schema( 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, diff --git a/libs/core/tests/unit_tests/runnables/test_history.py b/libs/core/tests/unit_tests/runnables/test_history.py index c5f02c931337a..49f68825ba239 100644 --- a/libs/core/tests/unit_tests/runnables/test_history.py +++ b/libs/core/tests/unit_tests/runnables/test_history.py @@ -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: {