Skip to content
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

Fix chat vertexai astream #152

Conversation

mathiasburger
Copy link

Do not pop the prompt from the conversation history which would pass an empty list of messages to the google client library.

Do not pop the prompt from the conversation history which would pass an empty list of messages to the google client library.
@@ -722,7 +719,6 @@ async def _astream(
project=self.project,
convert_system_message_to_human=self.convert_system_message_to_human,
)
message = history_gemini.pop()
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable message is currently unused.

It should not be removed from the history as generate_content_async requires the user message to be present in the contents parameter passed to the client, see https://ai.google.dev/api/python/google/generativeai/GenerativeModel#multi-turn.

@lkuligin
Copy link
Collaborator

thanks!
it's already fixed here: #151

we'll run a release later today

@lkuligin lkuligin closed this Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants