Conversation
🎉 Good job! The coverage increased 🎉
Full code coverage report: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1492107&view=codecoverage-tab |
There was a problem hiding this comment.
Pull request overview
Updates the repo’s OpenAI SDK dependency to v2.12.0 and adapts Microsoft.Extensions.AI.OpenAI’s container-file listing implementation to the SDK’s updated API surface.
Changes:
- Bumped the
OpenAINuGet dependency from2.11.0to2.12.0. - Updated
OpenAIHostedFileClient.ListFilesAsyncto callContainerClient.GetContainerFilesAsyncusing the newContainerFileCollectionOptionsparameter object while preserving the “single raw page only” pagination workaround.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| eng/packages/General.props | Updates the centrally-managed OpenAI package version to 2.12.0. |
| src/Libraries/Microsoft.Extensions.AI.OpenAI/OpenAIHostedFileClient.cs | Adjusts container file listing to the new GetContainerFilesAsync(ContainerFileCollectionOptions, …) signature without changing the existing manual paging + raw JSON parsing behavior. |
| { | ||
| PageSizeLimit = limit < int.MaxValue ? limit : null, | ||
| AfterId = after, | ||
| }, cancellationToken); |
There was a problem hiding this comment.
The comment a few lines up still says "Use OpenAI's protocol overload," but in 2.12.0 the only GetContainerFilesAsync overload is the convenience one returning AsyncCollectionResult<T> (upcast to the base here). The workaround still holds, since you only read the first raw page via GetRawPagesAsync(), but the comment is now inaccurate and worth updating.
| AsyncCollectionResult result = containerClient.GetContainerFilesAsync( | ||
| containerId, limit < int.MaxValue ? limit : null, | ||
| null, after, new() { CancellationToken = cancellationToken }); | ||
| new ContainerFileCollectionOptions(containerId) |
There was a problem hiding this comment.
Optional: 2.12.0 adds GetContainerFileCollectionPageAsync(containerId, limit, order, after, RequestOptions), which returns a single raw ClientResult page. That is the actual protocol single-page primitive and matches the "single page, handle paging manually" intent more directly than upcasting a convenience collection and relying on GetRawPagesAsync() to avoid deserialization. It would also keep the comment above accurate.
🎉 Good job! The coverage increased 🎉
Full code coverage report: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1492273&view=codecoverage-tab |
Bumps the
OpenAINuGet package from 2.11.0 to 2.12.0 and fixes the one breaking API change that surfaced.Changes
eng/packages/General.props—OpenAIversion2.11.0→2.12.0OpenAIHostedFileClient.cs—ContainerClient.GetContainerFilesAsyncchanged its signature from five flat parameters to aContainerFileCollectionOptionsobject:The other 2.12.0 breaking changes (container type renames,
Conversationsparameter ordering,Responsestype renames) are all in experimental APIs not referenced by this codebase.Microsoft Reviewers: Open in CodeFlow