Skip to content

Commit

Permalink
mistralai[patch]: Use public attribute for eventsource.response (#20580)
Browse files Browse the repository at this point in the history
Minor change, use the public attribute instead of the protected one.
  • Loading branch information
eyurtsev authored Apr 18, 2024
1 parent 66fb0b1 commit 8c29b7b
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions libs/partners/mistralai/langchain_mistralai/chat_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,7 @@ async def _aiter_sse(
) -> AsyncIterator[Dict]:
"""Iterate over the server-sent events."""
async with event_source_mgr as event_source:
# TODO(Team): Remove after this is fixed in httpx dependency
# https://github.com/florimondmanca/httpx-sse/pull/25/files
await _araise_on_error(event_source._response)
await _araise_on_error(event_source.response)
async for event in event_source.aiter_sse():
if event.data == "[DONE]":
return
Expand Down Expand Up @@ -370,9 +368,7 @@ def iter_sse() -> Iterator[Dict]:
with connect_sse(
self.client, "POST", "/chat/completions", json=kwargs
) as event_source:
# TODO(Team): Remove after this is fixed in httpx dependency
# https://github.com/florimondmanca/httpx-sse/pull/25/files
_raise_on_error(event_source._response)
_raise_on_error(event_source.response)
for event in event_source.iter_sse():
if event.data == "[DONE]":
return
Expand Down

0 comments on commit 8c29b7b

Please sign in to comment.