RunnableWithMessageHistory: Fix input schema (#14516)

Input schema should not have history key
pull/14290/head^2
Eugene Yurtsev 10 months ago committed by GitHub
parent d9bfdc95ea
commit c0f4b95aa9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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…
Cancel
Save