Skip to content

Commit

Permalink
anext() was introduced in py3.10, use __anext__ to support 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
mattf committed Jul 31, 2024
1 parent b329903 commit 70a3c4b
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,9 @@ async def test_ai_endpoints_astream(chat_model: str, mode: dict) -> None:
llm = ChatNVIDIA(model=chat_model, max_tokens=35, **mode)

generator = llm.astream("Count to 100, e.g. 1 2 3 4")
response = await anext(generator)
response = (
await generator.__anext__()
) # todo: use anext(generator) when py3.8 is dropped
cnt = 0
async for chunk in generator:
assert isinstance(chunk.content, str)
Expand Down

0 comments on commit 70a3c4b

Please sign in to comment.