openai/openai-python

Public

mirrored from https://github.com/openai/openai-pythonAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
98925cef766fc8d1adaaed9013ad43a44739edef

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

src/openai/_utils/_streams.py

12lines · modecode

1from typing import Any
2from typing_extensions import Iterator, AsyncIterator
3
4
5def consume_sync_iterator(iterator: Iterator[Any]) -> None:
6 for _ in iterator:
7 ...
8
9
10async def consume_async_iterator(iterator: AsyncIterator[Any]) -> None:
11 async for _ in iterator:
12 ...