-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
bugSomething isn't workingSomething isn't workingfixed in v1Issues addressed by the v1 betaIssues addressed by the v1 beta
Description
Describe the bug
When I use FastAPI for forwarding and set stream=True, for example: async for res in await openai.ChatCompletion.acreate(**kwargs), when this request is terminated before it completes, an exception occurs as follows: [asyncio] [ERROR]: Unclosed client session client_session: <aiohttp.client.ClientSession object at 0x7f0ca458c490>.
To Reproduce
1. Write a FastAPI request using the acreate method to return data in streaming format.
2. Use a packet sending tool to make a request to the written API, terminate the request while receiving data.
3. Wait for a moment, and the exception will be displayed in the terminal.
Code snippets
No response
OS
Linux
Python version
Python 3.11.4
Library version
openai 0.27.8
### Tasks
DavidHuie, haifengwu-msft, hikilyc, hynky1999, ShantanuNair and 1 more
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingfixed in v1Issues addressed by the v1 betaIssues addressed by the v1 beta