Skip to content

Commit 756feb9

Browse files
authored
Clean up unused providers for AdvancedPaste (#43433)
<!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request Clean up unused providers for AdvancedPaste <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist - [x] Closes: #43429 - [ ] **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 - [ ] [JSON for signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json) for new binaries - [ ] [WXS for installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs) for new binaries and localization folder - [ ] [YML for CI pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml) for new test projects - [ ] [YML for signed pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml) - [ ] **Documentation updated:** If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys) and link it here: #xxx <!-- Provide a more detailed description of the PR, other things fixed, or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed
1 parent 2fff688 commit 756feb9

File tree

23 files changed

+13
-154
lines changed

23 files changed

+13
-154
lines changed

.github/actions/spell-check/expect.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ Allmodule
4747
ALLOWUNDO
4848
ALLVIEW
4949
ALPHATYPE
50-
amazonbedrock
5150
AModifier
5251
amr
5352
ANDSCANS
@@ -696,7 +695,6 @@ hmonitor
696695
homies
697696
homljgmgpmcbpjbnjpfijnhipfkiclkd
698697
HOOKPROC
699-
huggingface
700698
HORZRES
701699
HORZSIZE
702700
Hostbackdropbrush

Directory.Packages.props

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,8 @@
5151
<PackageVersion Include="Microsoft.AI.Foundry.Local" Version="0.3.0" />
5252
<PackageVersion Include="Microsoft.SemanticKernel" Version="1.66.0" />
5353
<PackageVersion Include="Microsoft.SemanticKernel.Connectors.OpenAI" Version="1.66.0" />
54-
<PackageVersion Include="Microsoft.SemanticKernel.Connectors.Amazon" Version="1.66.0-alpha" />
5554
<PackageVersion Include="Microsoft.SemanticKernel.Connectors.AzureAIInference" Version="1.66.0-beta" />
5655
<PackageVersion Include="Microsoft.SemanticKernel.Connectors.Google" Version="1.66.0-alpha" />
57-
<PackageVersion Include="Microsoft.SemanticKernel.Connectors.HuggingFace" Version="1.66.0-preview" />
5856
<PackageVersion Include="Microsoft.SemanticKernel.Connectors.MistralAI" Version="1.66.0-alpha" />
5957
<PackageVersion Include="Microsoft.SemanticKernel.Connectors.Ollama" Version="1.66.0-alpha" />
6058
<PackageVersion Include="Microsoft.Toolkit.Uwp.Notifications" Version="7.1.2" />

src/common/GPOWrapper/GPOWrapper.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,6 @@ namespace winrt::PowerToys::GPOWrapper::implementation
216216
{
217217
return static_cast<GpoRuleConfigured>(powertoys_gpo::getAllowedAdvancedPasteGoogleValue());
218218
}
219-
GpoRuleConfigured GPOWrapper::GetAllowedAdvancedPasteAnthropicValue()
220-
{
221-
return static_cast<GpoRuleConfigured>(powertoys_gpo::getAllowedAdvancedPasteAnthropicValue());
222-
}
223219
GpoRuleConfigured GPOWrapper::GetAllowedAdvancedPasteOllamaValue()
224220
{
225221
return static_cast<GpoRuleConfigured>(powertoys_gpo::getAllowedAdvancedPasteOllamaValue());

src/common/GPOWrapper/GPOWrapper.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ namespace winrt::PowerToys::GPOWrapper::implementation
6060
static GpoRuleConfigured GetAllowedAdvancedPasteAzureAIInferenceValue();
6161
static GpoRuleConfigured GetAllowedAdvancedPasteMistralValue();
6262
static GpoRuleConfigured GetAllowedAdvancedPasteGoogleValue();
63-
static GpoRuleConfigured GetAllowedAdvancedPasteAnthropicValue();
6463
static GpoRuleConfigured GetAllowedAdvancedPasteOllamaValue();
6564
static GpoRuleConfigured GetAllowedAdvancedPasteFoundryLocalValue();
6665
static GpoRuleConfigured GetConfiguredNewPlusEnabledValue();

src/common/GPOWrapper/GPOWrapper.idl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ namespace PowerToys
6464
static GpoRuleConfigured GetAllowedAdvancedPasteAzureAIInferenceValue();
6565
static GpoRuleConfigured GetAllowedAdvancedPasteMistralValue();
6666
static GpoRuleConfigured GetAllowedAdvancedPasteGoogleValue();
67-
static GpoRuleConfigured GetAllowedAdvancedPasteAnthropicValue();
6867
static GpoRuleConfigured GetAllowedAdvancedPasteOllamaValue();
6968
static GpoRuleConfigured GetAllowedAdvancedPasteFoundryLocalValue();
7069
static GpoRuleConfigured GetConfiguredNewPlusEnabledValue();

src/common/utils/gpo.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ namespace powertoys_gpo
8989
const std::wstring POLICY_ALLOW_ADVANCED_PASTE_AZURE_AI_INFERENCE = L"AllowAdvancedPasteAzureAIInference";
9090
const std::wstring POLICY_ALLOW_ADVANCED_PASTE_MISTRAL = L"AllowAdvancedPasteMistral";
9191
const std::wstring POLICY_ALLOW_ADVANCED_PASTE_GOOGLE = L"AllowAdvancedPasteGoogle";
92-
const std::wstring POLICY_ALLOW_ADVANCED_PASTE_ANTHROPIC = L"AllowAdvancedPasteAnthropic";
9392
const std::wstring POLICY_ALLOW_ADVANCED_PASTE_OLLAMA = L"AllowAdvancedPasteOllama";
9493
const std::wstring POLICY_ALLOW_ADVANCED_PASTE_FOUNDRY_LOCAL = L"AllowAdvancedPasteFoundryLocal";
9594
const std::wstring POLICY_MWB_CLIPBOARD_SHARING_ENABLED = L"MwbClipboardSharingEnabled";
@@ -615,11 +614,6 @@ namespace powertoys_gpo
615614
return getConfiguredValue(POLICY_ALLOW_ADVANCED_PASTE_GOOGLE);
616615
}
617616

618-
inline gpo_rule_configured_t getAllowedAdvancedPasteAnthropicValue()
619-
{
620-
return getConfiguredValue(POLICY_ALLOW_ADVANCED_PASTE_ANTHROPIC);
621-
}
622-
623617
inline gpo_rule_configured_t getAllowedAdvancedPasteOllamaValue()
624618
{
625619
return getConfiguredValue(POLICY_ALLOW_ADVANCED_PASTE_OLLAMA);

src/modules/AdvancedPaste/AdvancedPaste/AdvancedPaste.csproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,8 @@
5959
<PackageReference Include="CommunityToolkit.WinUI.Controls.Primitives" />
6060
<!-- Including MessagePack to force version, since it's used by StreamJsonRpc but contains vulnerabilities. After StreamJsonRpc updates the version of MessagePack, we can upgrade StreamJsonRpc instead. -->
6161
<PackageReference Include="MessagePack" />
62-
<PackageReference Include="Microsoft.SemanticKernel.Connectors.Amazon" />
6362
<PackageReference Include="Microsoft.SemanticKernel.Connectors.AzureAIInference" />
6463
<PackageReference Include="Microsoft.SemanticKernel.Connectors.Google" />
65-
<PackageReference Include="Microsoft.SemanticKernel.Connectors.HuggingFace" />
6664
<PackageReference Include="Microsoft.SemanticKernel.Connectors.MistralAI" />
6765
<PackageReference Include="Microsoft.SemanticKernel.Connectors.Ollama" />
6866
<PackageReference Include="Microsoft.Extensions.Hosting" />

src/modules/AdvancedPaste/AdvancedPaste/Services/AdvancedAIKernelService.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,6 @@
1111
using Microsoft.PowerToys.Settings.UI.Library;
1212
using Microsoft.SemanticKernel;
1313
using Microsoft.SemanticKernel.ChatCompletion;
14-
using Microsoft.SemanticKernel.Connectors.Amazon;
15-
using Microsoft.SemanticKernel.Connectors.AzureAIInference;
16-
using Microsoft.SemanticKernel.Connectors.Google;
17-
using Microsoft.SemanticKernel.Connectors.HuggingFace;
18-
using Microsoft.SemanticKernel.Connectors.MistralAI;
19-
using Microsoft.SemanticKernel.Connectors.Ollama;
2014
using Microsoft.SemanticKernel.Connectors.OpenAI;
2115

2216
namespace AdvancedPaste.Services;

src/modules/AdvancedPaste/AdvancedPaste/Services/CustomActions/CustomActionTransformService.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,6 @@ private static bool RequiresApiKey(AIServiceType serviceType)
181181
{
182182
AIServiceType.Onnx => false,
183183
AIServiceType.Ollama => false,
184-
AIServiceType.Anthropic => false,
185-
AIServiceType.AmazonBedrock => false,
186184
_ => true,
187185
};
188186
}

src/modules/AdvancedPaste/AdvancedPaste/Services/CustomActions/SemanticKernelPasteProvider.cs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@
1111
using Microsoft.PowerToys.Settings.UI.Library;
1212
using Microsoft.SemanticKernel;
1313
using Microsoft.SemanticKernel.ChatCompletion;
14-
using Microsoft.SemanticKernel.Connectors.Amazon;
1514
using Microsoft.SemanticKernel.Connectors.AzureAIInference;
1615
using Microsoft.SemanticKernel.Connectors.Google;
17-
using Microsoft.SemanticKernel.Connectors.HuggingFace;
1816
using Microsoft.SemanticKernel.Connectors.MistralAI;
1917
using Microsoft.SemanticKernel.Connectors.Ollama;
2018
using Microsoft.SemanticKernel.Connectors.OpenAI;
@@ -29,11 +27,8 @@ public sealed class SemanticKernelPasteProvider : IPasteAIProvider
2927
AIServiceType.AzureOpenAI,
3028
AIServiceType.Mistral,
3129
AIServiceType.Google,
32-
AIServiceType.HuggingFace,
3330
AIServiceType.AzureAIInference,
3431
AIServiceType.Ollama,
35-
AIServiceType.Anthropic,
36-
AIServiceType.AmazonBedrock,
3732
};
3833

3934
public static PasteAIProviderRegistration Registration { get; } = new(SupportedTypes, config => new SemanticKernelPasteProvider(config));
@@ -142,21 +137,12 @@ private Kernel CreateKernel()
142137
case AIServiceType.Google:
143138
kernelBuilder.AddGoogleAIGeminiChatCompletion(_config.Model, apiKey: apiKey);
144139
break;
145-
case AIServiceType.HuggingFace:
146-
kernelBuilder.AddHuggingFaceChatCompletion(_config.Model, apiKey: apiKey);
147-
break;
148140
case AIServiceType.AzureAIInference:
149141
kernelBuilder.AddAzureAIInferenceChatCompletion(_config.Model, apiKey: apiKey, endpoint: new Uri(endpoint));
150142
break;
151143
case AIServiceType.Ollama:
152144
kernelBuilder.AddOllamaChatCompletion(_config.Model, endpoint: new Uri(endpoint));
153145
break;
154-
case AIServiceType.Anthropic:
155-
kernelBuilder.AddBedrockChatCompletionService(_config.Model);
156-
break;
157-
case AIServiceType.AmazonBedrock:
158-
kernelBuilder.AddBedrockChatCompletionService(_config.Model);
159-
break;
160146

161147
default:
162148
throw new NotSupportedException($"Provider '{_config.ProviderType}' is not supported by {nameof(SemanticKernelPasteProvider)}");
@@ -184,8 +170,6 @@ private static bool RequiresApiKey(AIServiceType serviceType)
184170
return serviceType switch
185171
{
186172
AIServiceType.Ollama => false,
187-
AIServiceType.Anthropic => false,
188-
AIServiceType.AmazonBedrock => false,
189173
_ => true,
190174
};
191175
}

0 commit comments

Comments
 (0)