-
Notifications
You must be signed in to change notification settings - Fork 850
.NET: Change type of ContinuationToken properties #7050
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
.NET: Change type of ContinuationToken properties #7050
Conversation
test/Libraries/Microsoft.Extensions.AI.OpenAI.Tests/OpenAIResponseClientIntegrationTests.cs
Show resolved
Hide resolved
There was a problem hiding this 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
ContinuationTokenproperty type fromobject?toResponseContinuationToken?inChatOptions,ChatResponse, andChatResponseUpdate - Updated test code to use the new strongly-typed
ResponseContinuationToken?instead ofobject?
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? |
…ontinuationToken?
e9f5920 to
265f919
Compare
265f919 to
b1480b9
Compare
* Change type of ContinuationToken properties from object? to ResponseContinuationToken? * Delete unnecessary compat suppressions --------- Co-authored-by: Stephen Toub <[email protected]>
* Change type of ContinuationToken properties from object? to ResponseContinuationToken? * Delete unnecessary compat suppressions --------- Co-authored-by: Stephen Toub <[email protected]>
|
|
This PR updates the type of the
ChatOptions.ContinuationToken,ChatResponse.ContinuationToken, andChatResponseUpdate.ContinuationTokenproperties fromobject?toResponseContinuationToken?.CC: @stephentoub