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

[azopenai] Azure OpenAI first entry is empty when streaming chat completions or completions #21086

Closed
richardpark-msft opened this issue Jun 30, 2023 · 7 comments · Fixed by #21169
Assignees
Labels
blocking-release Blocks release Client This issue points to a problem in the data-plane of the library. OpenAI
Milestone

Comments

@richardpark-msft
Copy link
Member

richardpark-msft commented Jun 30, 2023

Using 2023-06-01-preview, the first entry that comes back from the service is empty. Skipping it allows things to work but this isn't needed for OpenAI, just Azure OpenAI.

This has to be fixed before release.

@richardpark-msft richardpark-msft added Client This issue points to a problem in the data-plane of the library. OpenAI labels Jun 30, 2023
@richardpark-msft richardpark-msft added this to the 2023-07 milestone Jun 30, 2023
@richardpark-msft richardpark-msft self-assigned this Jun 30, 2023
@richardpark-msft richardpark-msft changed the title [azopenai] Azure OpenAI returns an empty first-entry when streaming chat completions or completions [azopenai] Azure OpenAI first entry is empty when streaming chat completions or completions Jun 30, 2023
@richardpark-msft richardpark-msft added the blocking-release Blocks release label Jun 30, 2023
@richardpark-msft
Copy link
Member Author

I have more information, and I believe we can close this.

The "bug" here was actually an interesting side-effect of content-filtering. in Azure OpenAI events can carry prompt annotations, which give you information on when content has been filtered and why (ie, violence, etc..). When this happens it's possible you get an "empty" event, but in reality it's an event that's just carrying metadata, not content.

I think we can close this - the example and our tests have been adjusted to handle this.

@jacoblee93
Copy link

So future models will have this behavior?

@richardpark-msft
Copy link
Member Author

Currently (ie, as of my next PR).

We're discussing how to represent this because, without prior knowledge, it's not clear that an empty Choices array is expected.

I'm curious on your opinion on this, if you don't mind.

@jacoblee93
Copy link

It's not related to the Go SDK directly but it's a change in behavior from core OpenAI and breaks handling for LangChain's wrappers:

langchain-ai/langchainjs#1914

It's possible to account for - just didn't want to do so before knowing if it was here to stay or if it was just part of preview. I'd personally prefer to keep it the same but I lack context as to why the change was made.

@m-hamaro
Copy link

Will the response format change again from 06-01-preview to 07-01?
What is the current discussion?

@richardpark-msft
Copy link
Member Author

Reopening and adding @trrwilson to aid in tracking.

@RickWinter RickWinter modified the milestones: 2023-07, 2023-10 Aug 29, 2023
@RickWinter RickWinter modified the milestones: 2023-10, 2024-01 Dec 6, 2023
@RickWinter RickWinter modified the milestones: 2024-01, 2024-04 Mar 6, 2024
@RickWinter RickWinter modified the milestones: 2024-04, 2024-10 Sep 25, 2024
@richardpark-msft
Copy link
Member Author

Closing until there's an update to share.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
blocking-release Blocks release Client This issue points to a problem in the data-plane of the library. OpenAI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants