Open robch opened 1 year ago
Note: this appears to be an issue with the built-in behavior of the event logger rather than a library-specific problem for OpenAI. I suspect this problem would reproduce in any parallel setup -- it may just be that the non-buffered text/event-stream used here is hitting a condition not previously exercised.
@annelo-msft : I'm going to move this over to Core to that we can validate the scenario. Given that logging happens in Core, I don't believe there would be anything OpenAI specific here.
Library name and version
Azure.AI.OpenAI 1.0.0-beta.6
Describe the bug
When using
AzureEventSourceListener(Action<EventWrittenEventArgs, string>, EventLevel)
, withOpenAIClient
v1.0.0-beta.6 while streaming, I do not get the correct callback data representing the payload (duplicates or not enough chunks).Expected behavior
My action to be called back for all the response chunks that are present and visible via Fiddler or via the IAsyncEnumerable interfaces. Fiddler always shows the full correct payload response. Use of
IAsyncEnumerable
viachoice.GetMessageStreaming
also shows the correct payload data...Actual behavior
I never see all the data that should be sent via the EventSource. I either only see the first handful of chunks, or I see a chunk representing the first word, that is repeated many times.
Here are two logs that demonstrate what I'm sending and receiving:
and
Reproduction Steps
code something like this:
and
and
and
Environment
Windows 11 x64 latest public build (not insiders).