Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating to v9 from v7 seems to buffer streaming OpenAI calls #40111

Closed
joakimriedel opened this issue Nov 19, 2023 · 1 comment
Closed

Updating to v9 from v7 seems to buffer streaming OpenAI calls #40111

joakimriedel opened this issue Nov 19, 2023 · 1 comment
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@joakimriedel
Copy link

Library name and version

Azure.AI.OpenAI_1.0.0-beta.9

Describe the bug

I just migrated an existing streaming implementation from v7 to v9. All seems good, and I prefer the new API structure, but now I seem to get some kind of buffering happening. The stream won't start sending updates until the entire response has been received, afterwards it just quickly rushes through all updates of the stream to the client. This kind of defeats the idea of streaming 😄

I will try to debug this further but my code diff is such a simple drop in replacement, so I would guess the buffering occurs internally somehow in the OpenAI.GetChatCompletionsStreaming() method. I wanted to post this here in the meantime if someone else has the same issue after migration and could give me some pointers to where I should look for a solution.

Expected behavior

The update chunks should flow through the stream at the same pace as they are received from server side, as they did with v7.

Actual behavior

All update chunks start to stream after the entire response has been buffered.

Reproduction Steps

Follow the migration steps here #39347

Environment

.NET 7

@github-actions github-actions bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Nov 19, 2023
@joakimriedel
Copy link
Author

joakimriedel commented Nov 19, 2023

A few hours later it seems to work without any code changes.. Perhaps it was some kind of server-side error in Azure OpenAI ?

I'll get back to this issue if I see this behaviour reproducing again.

@github-actions github-actions bot locked and limited conversation to collaborators Feb 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

No branches or pull requests

1 participant