-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Closed as not planned
Description
Confirm this is an issue with the Python library and not an underlying OpenAI API
- This is an issue with the Python library
Describe the bug
Hi - we have this code below (Using Azure Open AI)
I didn't find any documentation or open bugs about it.
When chunks_stream is None? in what situation?
How can we avoid it?
NOTE: We are not near the rate limitations
chunks_stream = await self._client.chat.completions.create(
model=self._model_name,
messages=typing.cast(
typing.Iterable[ChatCompletionMessageParam], messages
),
stream=True,
**completion_config,
)
if chunks_stream is None:
raise Exception(
f"OpenAI returned a null stream. Model: {self._model_name}"
)
To Reproduce
chunks_stream = await self._client.chat.completions.create(
model=self._model_name,
messages=typing.cast(
typing.Iterable[ChatCompletionMessageParam], messages
),
stream=True,
**completion_config,
)
if chunks_stream is None:
raise Exception(
f"OpenAI returned a null stream. Model: {self._model_name}"
)
Code snippets
chunks_stream = await self._client.chat.completions.create(
model=self._model_name,
messages=typing.cast(
typing.Iterable[ChatCompletionMessageParam], messages
),
stream=True,
**completion_config,
)
if chunks_stream is None:
raise Exception(
f"OpenAI returned a null stream. Model: {self._model_name}"
)OS
macOS
Python version
Python v3.11.5
Library version
openai v1.62
OmriBenShoham
Metadata
Metadata
Assignees
Labels
No labels