Skip to content

Commit

Permalink
RunnableWithMessageHistory: Fix input schema (langchain-ai#14516)
Browse files Browse the repository at this point in the history
Input schema should not have history key
  • Loading branch information
eyurtsev authored Dec 11, 2023
1 parent d9bfdc9 commit c0f4b95
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 3 deletions.
2 changes: 0 additions & 2 deletions libs/core/langchain_core/runnables/history.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion libs/core/tests/unit_tests/runnables/test_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

0 comments on commit c0f4b95

Please sign in to comment.