Add Anthropic support to Advanced Paste - #50268
Add Anthropic support to Advanced Paste#50268Sthitadhi Maity (Sthitadhi1) wants to merge 5 commits into
Conversation
This commit adds a test to verify that `SemanticKernelPasteProvider.CreateExecutionSettings()` does not set the `ReasoningEffort` property on `OpenAIPromptExecutionSettings` for OpenAI configurations, which caused an HTTP 400 on models that don't support it. Co-authored-by: Sthitadhi1 <137975462+Sthitadhi1@users.noreply.github.com>
…fort-test-12006183165712339204 Add regression test for microsoft#49838 to ensure ReasoningEffort is not hardcoded for OpenAI models
* Introduce `AIServiceType.Anthropic` and `AnthropicPasteProvider` powered by the official `Anthropic` SDK. * Integrate into settings UI, preserving compatibility with Semantic Kernel providers. * Support GPO configurations for Anthropic. Co-authored-by: Sthitadhi1 <137975462+Sthitadhi1@users.noreply.github.com>
* Introduce `AIServiceType.Anthropic` and `AnthropicPasteProvider` powered by the official `Anthropic` SDK using the `IChatClient` abstraction. * Integrate into Settings UI (Strings, Icons, Default Model). * Add GPO configurations for Anthropic in the C++ layer and expose to WinRT securely. Co-authored-by: Sthitadhi1 <137975462+Sthitadhi1@users.noreply.github.com>
* Introduce `AIServiceType.Anthropic` and `AnthropicPasteProvider` powered by the official `Anthropic` SDK using the `IChatClient` abstraction. * Integrate into Settings UI (Strings, Icons, Default Model). * Add GPO configurations for Anthropic in the C++ layer and expose to WinRT securely. Co-authored-by: Sthitadhi1 <137975462+Sthitadhi1@users.noreply.github.com>
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
🧭 PR intakeVisual evidence: Required — The pull request changes product UI files, so reviewers need to see the visible result. Visual evidence is currently missing. Author actionSthitadhi Maity (@Sthitadhi1), please update the following before review:
See the contribution guide for the full checklist. If there is no author response within 7 days, this PR will be automatically closed. Automated PR intake; PowerToys maintainers make final decisions. |
|
Hi Sthitadhi Maity (@Sthitadhi1),
I have to ask: have you built this locally and tested the change yourself? |
Mike Griese (zadjii-msft)
left a comment
There was a problem hiding this comment.
What the hell is the number in this PR title?
You'll need to force push these commits without attribution to a language model. Humans are responsible for maintaining this codebase, not machines.
We will close this with prejudice if there's no visual evidence you ran this locally.

Summary of the Pull Request
Adds official support for Anthropic (Claude) to Advanced Paste with AI. It introduces an
AnthropicPasteProviderusing the officialAnthropicC# SDK rather than forcing Claude traffic through Semantic Kernel's OpenAI compatibility layer, ensuring native message/content semantics are preserved.PR Checklist
Detailed Description of the Pull Request / Additional comments
I initially considered routing Anthropic through
Microsoft.SemanticKernel.Connectors.OpenAIusing Claude's OpenAI-compatible endpoint, but after checking the current Anthropic/Semantic Kernel ecosystem, I think a native Anthropic provider is a better fit.Anthropic now provides an official C#
AnthropicSDK withIChatClientintegration. Semantic Kernel still does not provide a first-party .NET Anthropic connector, and Anthropic's OpenAI compatibility layer is intended primarily for compatibility/testing and does not expose the full Claude API surface.For Paste with AI, I propose keeping
SemanticKernelPasteProviderfocused on providers with native Semantic Kernel connectors and adding a dedicatedAnthropicPasteProviderbacked by the officialAnthropicpackage. This lets us map the existingPasteAIRequestdirectly to Claude's native Messages API (viaIChatClientabstraction), including the current text/image clipboard input, without relying on an OpenAI compatibility layer.The resulting structure is:
AIServiceType.Anthropic → AnthropicPasteProvider → AnthropicClient/IChatClientThis PR adds:
AIServiceType.Anthropicintegration acrossSettings.UIandAdvancedPaste.AnthropicPasteProviderutilizing the officialAnthropicC# SDK (AnthropicClient).AllowAdvancedPasteAnthropic) to properly restrict or allow its usage in enterprise environments.Validation Steps Performed
AnthropicPasteProviderand configuration fallback.