mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-14 08:56:27 +00:00
mistralai[patch]: Use public attribute for eventsource.response (#20580)
Minor change, use the public attribute instead of the protected one.
This commit is contained in:
parent
66fb0b1f35
commit
8c29b7bf35
@ -148,9 +148,7 @@ async def _aiter_sse(
|
|||||||
) -> AsyncIterator[Dict]:
|
) -> AsyncIterator[Dict]:
|
||||||
"""Iterate over the server-sent events."""
|
"""Iterate over the server-sent events."""
|
||||||
async with event_source_mgr as event_source:
|
async with event_source_mgr as event_source:
|
||||||
# TODO(Team): Remove after this is fixed in httpx dependency
|
await _araise_on_error(event_source.response)
|
||||||
# https://github.com/florimondmanca/httpx-sse/pull/25/files
|
|
||||||
await _araise_on_error(event_source._response)
|
|
||||||
async for event in event_source.aiter_sse():
|
async for event in event_source.aiter_sse():
|
||||||
if event.data == "[DONE]":
|
if event.data == "[DONE]":
|
||||||
return
|
return
|
||||||
@ -370,9 +368,7 @@ class ChatMistralAI(BaseChatModel):
|
|||||||
with connect_sse(
|
with connect_sse(
|
||||||
self.client, "POST", "/chat/completions", json=kwargs
|
self.client, "POST", "/chat/completions", json=kwargs
|
||||||
) as event_source:
|
) as event_source:
|
||||||
# TODO(Team): Remove after this is fixed in httpx dependency
|
_raise_on_error(event_source.response)
|
||||||
# https://github.com/florimondmanca/httpx-sse/pull/25/files
|
|
||||||
_raise_on_error(event_source._response)
|
|
||||||
for event in event_source.iter_sse():
|
for event in event_source.iter_sse():
|
||||||
if event.data == "[DONE]":
|
if event.data == "[DONE]":
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user