Skip to content

The agent engineering platform.

Add parameters to send_message() call for vertexai chat models (PaLM2) (#5566)

khallbobo934319fc28a4
diff --git a/langchain/chat_models/vertexai.py b/langchain/chat_models/vertexai.py
index 87cf0ee954..4f78b31081 100644
--- a/langchain/chat_models/vertexai.py
+++ b/langchain/chat_models/vertexai.py
@@ -122,7 +122,7 @@ class ChatVertexAI(_VertexAICommon, BaseChatModel):
chat = self.client.start_chat(context=context, **self._default_params)
for pair in history.history:
chat._history.append((pair.question.content, pair.answer.content))
- response = chat.send_message(question.content)
+ response = chat.send_message(question.content, **self._default_params)
text = self._enforce_stop_words(response.text, stop)
return ChatResult(generations=[ChatGeneration(message=AIMessage(content=text))])