Skip to content

Conversation

@annelo-msft
Copy link
Contributor

@annelo-msft annelo-msft commented Jul 1, 2024

In System.ClientModel 1.1.0-beta.5, PageableCollection<T> was changed to PageCollection<T> to better align convenience and protocol methods.

This PR upgrades the OpenAI library to SCM 1.1.0-beta.5, and manually implements internal types that will be generated from TypeSpec API specification in the future. Specifically, it:

  • Updates return types that have been renamed for streaming service methods
  • For service methods corresponding to paginated-collection endpoints
    • Returns PageCollection<T> or AsyncPageCollection<T> from convenience methods
    • Takes XxCollectionOptions types that describe the paginated collection to be returned
    • Adds "rehydration" methods that return a collection that starts where another collection type left off via a persisted rehydration token
    • Returns IEnumerable<ClientResult> or IAsyncEnumerable<ClientResult> from protocol methods, representing a collection of service responses, where each corresponds to a page of results returned from the paginated endpoint
    • Implements internal page enumerator and page token types for each paginated-endpoint operation

Types that are intended to be output by the generator have been added in a temporary folder called To.Be.Generated.

@annelo-msft annelo-msft marked this pull request as ready for review July 15, 2024 21:50
@annelo-msft annelo-msft changed the title Update paging APIs to use updated SCM types: Generate enumerator approach Update paging APIs to use updated SCM types Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants