Skip to content

Add Anthropic support to Advanced Paste - #50268

Open
Sthitadhi Maity (Sthitadhi1) wants to merge 5 commits into
microsoft:mainfrom
Sthitadhi1:add-anthropic-support-12025191860560465632
Open

Add Anthropic support to Advanced Paste#50268
Sthitadhi Maity (Sthitadhi1) wants to merge 5 commits into
microsoft:mainfrom
Sthitadhi1:add-anthropic-support-12025191860560465632

Conversation

@Sthitadhi1

@Sthitadhi1 Sthitadhi Maity (Sthitadhi1) commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Summary of the Pull Request

Adds official support for Anthropic (Claude) to Advanced Paste with AI. It introduces an AnthropicPasteProvider using the official Anthropic C# SDK rather than forcing Claude traffic through Semantic Kernel's OpenAI compatibility layer, ensuring native message/content semantics are preserved.

PR Checklist

  • Communication: I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected
  • Tests: Added/updated and all pass
  • Localization: All end-user-facing strings can be localized
  • Dev docs: Added/updated
  • New binaries: Added on the required places
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

I initially considered routing Anthropic through Microsoft.SemanticKernel.Connectors.OpenAI using 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# Anthropic SDK with IChatClient integration. 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 SemanticKernelPasteProvider focused on providers with native Semantic Kernel connectors and adding a dedicated AnthropicPasteProvider backed by the official Anthropic package. This lets us map the existing PasteAIRequest directly to Claude's native Messages API (via IChatClient abstraction), including the current text/image clipboard input, without relying on an OpenAI compatibility layer.

The resulting structure is:
AIServiceType.Anthropic → AnthropicPasteProvider → AnthropicClient/IChatClient

This PR adds:

  • AIServiceType.Anthropic integration across Settings.UI and AdvancedPaste.
  • A dedicated AnthropicPasteProvider utilizing the official Anthropic C# SDK (AnthropicClient).
  • GPO policies (AllowAdvancedPasteAnthropic) to properly restrict or allow its usage in enterprise environments.

Validation Steps Performed

  • Unit tested the instantiation of AnthropicPasteProvider and configuration fallback.
  • Verified the build succeeds on Windows with no errors and the code formats correctly.
  • Verified GPO configuration defaults and settings definitions.

google-labs-jules Bot and others added 5 commits August 13, 2026 15:12
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

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@github-actions github-actions Bot added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something Product-Advanced Paste Refers to the Advanced Paste module labels Aug 31, 2026
@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown

🧭 PR intake

Visual evidence: Required — The pull request changes product UI files, so reviewers need to see the visible result. Visual evidence is currently missing.

Author action

Sthitadhi Maity (@Sthitadhi1), please update the following before review:

  • Add a screenshot, GIF, or video to the PR description so reviewers can validate the visible change.

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.

@jiripolasek

Copy link
Copy Markdown
Collaborator

Hi Sthitadhi Maity (@Sthitadhi1),
we'll gladly delegate filling out the PR template to you:

image

I have to ask: have you built this locally and tested the change yourself?

@zadjii-msft Mike Griese (zadjii-msft) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

@Sthitadhi1 Sthitadhi Maity (Sthitadhi1) changed the title Add anthropic support 12025191860560465632 Add Anthropic support to Advanced Paste Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something Product-Advanced Paste Refers to the Advanced Paste module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Paste with AI - Add Claude

3 participants