Stabilize CodeInterpreter and WebSearch content types#7493
Merged
Conversation
Remove [Experimental] from CodeInterpreterToolCallContent, CodeInterpreterToolResultContent, WebSearchToolCallContent, and WebSearchToolResultContent so IChatClient consumers can use them without MEAI001 suppression. - Rename WebSearchToolResultContent.Results -> Outputs to align with CodeInterpreterToolResultContent.Outputs - Uncomment [JsonDerivedType] on AIContent, ToolCallContent, and ToolResultContent for the four content types - Remove corresponding AddAIContentTypeChain runtime workarounds and [JsonSerializable] entries from AIJsonUtilities.Defaults - Update API baseline (Experimental -> Stable) - Update OpenAI WebSearch result construction to use Outputs - Extend Stabilization.Tests to cover the newly stabilized types Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR stabilizes the CodeInterpreter and WebSearch content types in Microsoft.Extensions.AI.Abstractions so IChatClient consumers can use them without MEAI001 suppression, while aligning WebSearch result naming with the CodeInterpreter pattern and simplifying JSON polymorphism configuration.
Changes:
- Removes
[Experimental]from the CodeInterpreter/WebSearch tool call & result content types and updates API baseline stages to Stable. - Renames
WebSearchToolResultContent.ResultstoOutputsand updates all call sites/tests accordingly. - Enables polymorphic JSON support via
[JsonDerivedType]attributes and removes the related runtime/source-gen workarounds fromAIJsonUtilities.Defaults.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/Libraries/Microsoft.Extensions.AI.Stabilization.Tests/Microsoft.Extensions.AI.Stabilization.Tests.csproj | Extends stabilization test project to include CodeInterpreter and WebSearch test coverage. |
| test/Libraries/Microsoft.Extensions.AI.OpenAI.Tests/OpenAIResponseClientTests.cs | Updates WebSearch assertions to use Outputs instead of Results. |
| test/Libraries/Microsoft.Extensions.AI.OpenAI.Tests/OpenAIResponseClientIntegrationTests.cs | Updates integration assertions to use Outputs. |
| test/Libraries/Microsoft.Extensions.AI.Abstractions.Tests/Contents/WebSearchToolResultContentTests.cs | Renames tests and JSON payload expectations from results to outputs. |
| src/Libraries/Microsoft.Extensions.AI.OpenAI/OpenAIResponsesChatClient.cs | Constructs WebSearchToolResultContent using Outputs. |
| src/Libraries/Microsoft.Extensions.AI.Abstractions/Utilities/AIJsonUtilities.Defaults.cs | Removes temporary type registration workarounds now that types are stabilized and participate via [JsonDerivedType]. |
| src/Libraries/Microsoft.Extensions.AI.Abstractions/Microsoft.Extensions.AI.Abstractions.json | Updates API baseline stages to Stable and reflects Results→Outputs rename. |
| src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/WebSearchToolResultContent.cs | Removes [Experimental] and renames Results property to Outputs with updated docs. |
| src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/WebSearchToolCallContent.cs | Removes [Experimental]. |
| src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/ToolResultContent.cs | Enables [JsonDerivedType] for CodeInterpreter/WebSearch tool result content. |
| src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/ToolCallContent.cs | Enables [JsonDerivedType] for CodeInterpreter/WebSearch tool call content. |
| src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/CodeInterpreterToolResultContent.cs | Removes [Experimental]. |
| src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/CodeInterpreterToolCallContent.cs | Removes [Experimental]. |
| src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AIContent.cs | Enables [JsonDerivedType] entries for the four stabilized content types. |
Convert Serialization_DerivedTypes_Roundtrips tests to [Theory] with a useBuiltInJsonContext bool parameter that selects between AIJsonUtilities.DefaultOptions (the library's built-in JsonContext) and TestJsonSerializerContext.Default.Options (a consumer-style source-gen context). Now that CodeInterpreter and WebSearch content types are stable, both paths can be exercised. Also extend the AIContent, ToolCallContent, and ToolResultContent fixtures with the newly stabilized types. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The Results property on WebSearchToolResultContent was renamed to Outputs as part of stabilizing the type. Since the experimental member shipped in 10.4.0, the renamed (removed) member trips package validation. Suppress the diagnostic for all target frameworks via a baseline suppression file. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
These constants no longer have any references after stabilizing the CodeInterpreter and WebSearch content types. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
jeffhandley
pushed a commit
that referenced
this pull request
May 1, 2026
* Stabilize CodeInterpreter and WebSearch content types Remove [Experimental] from CodeInterpreterToolCallContent, CodeInterpreterToolResultContent, WebSearchToolCallContent, and WebSearchToolResultContent so IChatClient consumers can use them without MEAI001 suppression. - Rename WebSearchToolResultContent.Results -> Outputs to align with CodeInterpreterToolResultContent.Outputs - Uncomment [JsonDerivedType] on AIContent, ToolCallContent, and ToolResultContent for the four content types - Remove corresponding AddAIContentTypeChain runtime workarounds and [JsonSerializable] entries from AIJsonUtilities.Defaults - Update API baseline (Experimental -> Stable) - Update OpenAI WebSearch result construction to use Outputs - Extend Stabilization.Tests to cover the newly stabilized types Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Parameterize Serialization_DerivedTypes_Roundtrips over JSON context Convert Serialization_DerivedTypes_Roundtrips tests to [Theory] with a useBuiltInJsonContext bool parameter that selects between AIJsonUtilities.DefaultOptions (the library's built-in JsonContext) and TestJsonSerializerContext.Default.Options (a consumer-style source-gen context). Now that CodeInterpreter and WebSearch content types are stable, both paths can be exercised. Also extend the AIContent, ToolCallContent, and ToolResultContent fixtures with the newly stabilized types. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Suppress ApiCompat CP0002 for WebSearchToolResultContent.Results rename The Results property on WebSearchToolResultContent was renamed to Outputs as part of stabilizing the type. Since the experimental member shipped in 10.4.0, the renamed (removed) member trips package validation. Suppress the diagnostic for all target frameworks via a baseline suppression file. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Remove unused AICodeInterpreter and AIWebSearch DiagnosticIds These constants no longer have any references after stabilizing the CodeInterpreter and WebSearch content types. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remove [Experimental] from CodeInterpreterToolCallContent, CodeInterpreterToolResultContent, WebSearchToolCallContent, and WebSearchToolResultContent so IChatClient consumers can use them without MEAI001 suppression.
Microsoft Reviewers: Open in CodeFlow