Remove AI Tool Reduction experimental APIs#7353
Conversation
Remove IToolReductionStrategy interface, ToolReducingChatClient, EmbeddingToolReductionStrategy, UseToolReduction extension method, associated tests, API baselines, CHANGELOG entry, and diagnostic ID. Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
|
@copilot, other than in the changelog, are there any remaining references anywhere in the repo in any kind of file to tool reduction, tool reducers, etc.? |
…oval Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
Yes — there was one remaining reference in |
There was a problem hiding this comment.
Pull request overview
This PR removes the experimental “tool reduction” surface area from the Microsoft.Extensions.AI stack (APIs, middleware, diagnostic ID, and associated integration tests), aligning with the decision to not commit to a first-class MEAI abstraction for tool reduction.
Changes:
- Deleted the tool reduction abstractions and implementations (
IToolReductionStrategy,ToolReducingChatClient,EmbeddingToolReductionStrategy, and builder extensions). - Removed tool-reduction-focused integration tests and updated integration test baselines accordingly.
- Removed the associated experimental diagnostic ID and API baseline entries.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/Libraries/Microsoft.Extensions.AI.Integration.Tests/ToolReductionTests.cs | Removes unit/integration coverage dedicated to tool reduction strategies and middleware. |
| test/Libraries/Microsoft.Extensions.AI.Integration.Tests/ChatClientIntegrationTests.cs | Deletes tool reduction scenarios and embedding-generator plumbing that existed to support them. |
| src/Shared/DiagnosticIds/DiagnosticIds.cs | Removes the AIToolReduction experiment diagnostic constant. |
| src/Libraries/Microsoft.Extensions.AI/ToolReduction/ToolReducingChatClient.cs | Deletes the tool-reducing delegating chat client middleware. |
| src/Libraries/Microsoft.Extensions.AI/ToolReduction/EmbeddingToolReductionStrategy.cs | Deletes the embedding-based tool reduction strategy implementation. |
| src/Libraries/Microsoft.Extensions.AI/ToolReduction/ChatClientBuilderToolReductionExtensions.cs | Deletes UseToolReduction pipeline extension. |
| src/Libraries/Microsoft.Extensions.AI/Microsoft.Extensions.AI.json | Removes tool reduction types from the AI library API baseline. |
| src/Libraries/Microsoft.Extensions.AI.Abstractions/ToolReduction/IToolReductionStrategy.cs | Deletes the tool reduction strategy abstraction from the abstractions package. |
| src/Libraries/Microsoft.Extensions.AI.Abstractions/Microsoft.Extensions.AI.Abstractions.json | Removes IToolReductionStrategy from the abstractions API baseline. |
test/Libraries/Microsoft.Extensions.AI.Integration.Tests/ChatClientIntegrationTests.cs
Show resolved
Hide resolved
test/Libraries/Microsoft.Extensions.AI.Integration.Tests/ChatClientIntegrationTests.cs
Show resolved
Hide resolved
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
Head branch was pushed to by a user without write access
…ntIntegrationTests Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
Head branch was pushed to by a user without write access
The only remaining reference is in |
|
@copilot fix the CI failures by updating the compatibility suppressions |
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
Head branch was pushed to by a user without write access
Added auto-generated |
src/Libraries/Microsoft.Extensions.AI.Abstractions/ToolReduction/IToolReductionStrategy.cssrc/Libraries/Microsoft.Extensions.AI/ToolReduction/ToolReducingChatClient.cssrc/Libraries/Microsoft.Extensions.AI/ToolReduction/EmbeddingToolReductionStrategy.cssrc/Libraries/Microsoft.Extensions.AI/ToolReduction/ChatClientBuilderToolReductionExtensions.cstest/Libraries/Microsoft.Extensions.AI.Integration.Tests/ToolReductionTests.csRemoveToolAfterFirstUseStrategyhelper class fromChatClientIntegrationTests.csEmbeddingGeneratorproperty,CreateEmbeddingGenerator(), andEnsureEmbeddingGenerator()members (and stale "tool reduction" comment) fromChatClientIntegrationTests.csAIToolReductiondiagnostic ID fromDiagnosticIds.csMicrosoft.Extensions.AI.jsonandMicrosoft.Extensions.AI.Abstractions.json)using System.Diagnostics.CodeAnalysis;needed for[MemberNotNull]onSkipIfNotEnabledCreateEmbeddingGenerator()override fromOpenAIChatClientIntegrationTests(no references in any tests)CompatibilitySuppressions.xmlfor both AI packages to suppress baseline compatibility errors for removed experimental typesOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.
Microsoft Reviewers: Open in CodeFlow