From 6ac5d8028621dccc5d7015a56264ad9e3e3686c6 Mon Sep 17 00:00:00 2001 From: Harrison Chase Date: Mon, 12 Jun 2023 22:37:55 -0700 Subject: [PATCH] propogate kwargs fully (#6076) --- langchain/chat_models/base.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/langchain/chat_models/base.py b/langchain/chat_models/base.py index f3521df6..440336f2 100644 --- a/langchain/chat_models/base.py +++ b/langchain/chat_models/base.py @@ -190,9 +190,10 @@ class BaseChatModel(BaseLanguageModel, ABC): messages: List[BaseMessage], stop: Optional[List[str]] = None, callbacks: Callbacks = None, + **kwargs: Any, ) -> BaseMessage: generation = self.generate( - [messages], stop=stop, callbacks=callbacks + [messages], stop=stop, callbacks=callbacks, **kwargs ).generations[0][0] if isinstance(generation, ChatGeneration): return generation.message @@ -227,7 +228,7 @@ class BaseChatModel(BaseLanguageModel, ABC): _stop = None else: _stop = list(stop) - result = self([HumanMessage(content=text)], stop=_stop) + result = self([HumanMessage(content=text)], stop=_stop, **kwargs) return result.content def predict_messages(