mirror of
https://github.com/hwchase17/langchain
synced 2024-11-06 03:20:49 +00:00
propogate kwargs fully (#6076)
This commit is contained in:
parent
ec1a2adf9c
commit
6ac5d80286
@ -190,9 +190,10 @@ class BaseChatModel(BaseLanguageModel, ABC):
|
|||||||
messages: List[BaseMessage],
|
messages: List[BaseMessage],
|
||||||
stop: Optional[List[str]] = None,
|
stop: Optional[List[str]] = None,
|
||||||
callbacks: Callbacks = None,
|
callbacks: Callbacks = None,
|
||||||
|
**kwargs: Any,
|
||||||
) -> BaseMessage:
|
) -> BaseMessage:
|
||||||
generation = self.generate(
|
generation = self.generate(
|
||||||
[messages], stop=stop, callbacks=callbacks
|
[messages], stop=stop, callbacks=callbacks, **kwargs
|
||||||
).generations[0][0]
|
).generations[0][0]
|
||||||
if isinstance(generation, ChatGeneration):
|
if isinstance(generation, ChatGeneration):
|
||||||
return generation.message
|
return generation.message
|
||||||
@ -227,7 +228,7 @@ class BaseChatModel(BaseLanguageModel, ABC):
|
|||||||
_stop = None
|
_stop = None
|
||||||
else:
|
else:
|
||||||
_stop = list(stop)
|
_stop = list(stop)
|
||||||
result = self([HumanMessage(content=text)], stop=_stop)
|
result = self([HumanMessage(content=text)], stop=_stop, **kwargs)
|
||||||
return result.content
|
return result.content
|
||||||
|
|
||||||
def predict_messages(
|
def predict_messages(
|
||||||
|
Loading…
Reference in New Issue
Block a user