Skip to content

Conversation

@SergeyMenshykh
Copy link
Contributor

@SergeyMenshykh SergeyMenshykh commented Nov 17, 2025

This PR updates the type of the ChatOptions.ContinuationToken, ChatResponse.ContinuationToken, and ChatResponseUpdate.ContinuationToken properties from object? to ResponseContinuationToken?.

CC: @stephentoub

Copilot AI review requested due to automatic review settings November 17, 2025 16:08
@SergeyMenshykh SergeyMenshykh requested a review from a team as a code owner November 17, 2025 16:08
@github-actions github-actions bot added the area-ai Microsoft.Extensions.AI libraries label Nov 17, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR improves type safety by changing the ContinuationToken property type from object? to ResponseContinuationToken? across three key chat completion classes: ChatOptions, ChatResponse, and ChatResponseUpdate. This change provides stronger type checking at compile time while maintaining the same runtime behavior.

Key Changes

  • Updated ContinuationToken property type from object? to ResponseContinuationToken? in ChatOptions, ChatResponse, and ChatResponseUpdate
  • Updated test code to use the new strongly-typed ResponseContinuationToken? instead of object?

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/Libraries/Microsoft.Extensions.AI.Abstractions/ChatCompletion/ChatOptions.cs Changed ContinuationToken property type to ResponseContinuationToken?
src/Libraries/Microsoft.Extensions.AI.Abstractions/ChatCompletion/ChatResponse.cs Changed ContinuationToken property type to ResponseContinuationToken?
src/Libraries/Microsoft.Extensions.AI.Abstractions/ChatCompletion/ChatResponseUpdate.cs Changed ContinuationToken property type to ResponseContinuationToken?
test/Libraries/Microsoft.Extensions.AI.OpenAI.Tests/OpenAIResponseClientIntegrationTests.cs Updated test variable declaration to use ResponseContinuationToken?

@stephentoub stephentoub force-pushed the change-type-of-continuation-token branch from e9f5920 to 265f919 Compare November 21, 2025 02:52
@stephentoub stephentoub enabled auto-merge (squash) November 21, 2025 02:58
@stephentoub stephentoub force-pushed the change-type-of-continuation-token branch from 265f919 to b1480b9 Compare November 21, 2025 13:13
@stephentoub stephentoub merged commit 7c6f384 into dotnet:main Nov 21, 2025
6 checks passed
stephentoub added a commit to jeffhandley/extensions that referenced this pull request Nov 21, 2025
* Change type of ContinuationToken properties from object? to ResponseContinuationToken?

* Delete unnecessary compat suppressions

---------

Co-authored-by: Stephen Toub <[email protected]>
jeffhandley pushed a commit that referenced this pull request Nov 21, 2025
* Change type of ContinuationToken properties from object? to ResponseContinuationToken?

* Delete unnecessary compat suppressions

---------

Co-authored-by: Stephen Toub <[email protected]>
@ericstj
Copy link
Member

ericstj commented Nov 26, 2025

This was a binary breaking change and needs to be undone. nevermind. I see this is experimental API so we are allowing ourselves to make binary breaking changes.

This was referenced Dec 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-ai Microsoft.Extensions.AI libraries breaking-change Issue or PR that represents a breaking API or functional change over a previous release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants