-
Notifications
You must be signed in to change notification settings - Fork 15.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ChatVertexAI broken - Fix error with sending context in params #6652
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@dev2049 Hi, can you look at this quickly? When you merged the last update on VertexAI to add in Codey, I think you added by mistake the context in the params but send_message function doesn't accept that in params. Can we fix this ASAP? we cannot use chat-bison at all now, currently its broken. Thanks! |
@@ -129,8 +129,9 @@ def _generate( | |||
context = history.system_message.content if history.system_message else None | |||
params = {**self._default_params, **kwargs} | |||
if not self.is_codey_model: | |||
params["context"] = context | |||
chat = self.client.start_chat(**params) | |||
chat = self.client.start_chat(context=context, **params) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is functionally equivalent, no? we're only adding "context" to params if it's not a codey model
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The start_chat logic is equivalent, but the error is caused by chat.send_message(question.content, **params)
. In the previous version, context was added, but context isn't a valid argument for either session types (ChatSession and CodeChatSession). With this new change, context is never added to params
Here's the API reference for ChatSession.send_message: https://cloud.google.com/python/docs/reference/aiplatform/latest/vertexai.preview.language_models.ChatSession
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not, because you are using params variable in a different function, send_message just a few lines after and that's causing the issue. That function doesn't support context in params for any chat models for vertexai. Only chat-bison supports context at start chat function only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah i see, thanks for explaining!
in issue error seems to happen with chat-bison, which isn't code model |
0.0.212 is out with the fix, apologies for the issue and thanks for the fix! |
Thanks for getting this one out! We needed this fix too! |
vertex Ai chat is broken right now. That is because context is in params and chat.send_message doesn't accept that as a params.
@dev2049