Skip to content

Commit

Permalink
vertexai[patch]: use default astream for gemini models
Browse files Browse the repository at this point in the history
  • Loading branch information
baskaryan committed Oct 1, 2024
1 parent c03162e commit e362a16
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion libs/vertexai/langchain_google_vertexai/chat_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1593,8 +1593,13 @@ async def _astream(
run_manager: Optional[AsyncCallbackManagerForLLMRun] = None,
**kwargs: Any,
) -> AsyncIterator[ChatGenerationChunk]:
# TODO: Update to properly support async streaming from gemini.
if not self._is_gemini_model:
raise NotImplementedError()
async for chunk in super()._astream(
messages, stop=stop, run_manager=run_manager, **kwargs
):
yield chunk
return
request = self._prepare_request_gemini(messages=messages, stop=stop, **kwargs)

response_iter = _acompletion_with_retry(
Expand Down

0 comments on commit e362a16

Please sign in to comment.