Advanced Paste: AI pasting enhancement (#42374)

<!-- 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
* Add multiple endpoint support for paste with AI
* Add Local AI support for paste AI
* Advanced AI implementation

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist

- [x] Closes: #32960
- [x] **Communication:** I've discussed this with core contributors
already. If the work hasn't been agreed, this work might be rejected
- [x] **Tests:** Added/updated and all pass
- [x] **Localization:** All end-user-facing strings can be localized
- [x] **Dev docs:** Added/updated
- [x] **New binaries:** Added on the required places
- [x] [JSON for
signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json)
for new binaries
- [x] [WXS for
installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs)
for new binaries and localization folder
- [x] [YML for CI
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml)
for new test projects
- [x] [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

### GPO
- [x] Paste with AI should not be available if the original GPO for
paste AI is set to false
   - [x] Paste with AI should be controlled within endpoint granularity
- [x] Advanced Paste UI should disable AI ability if GPO is set to
disable for any llm
### Paste AI
   - [x] Every AI endpoint should work as expected
   - [x] Default prompt should be able to give a reasonable result
   - [x] Local AI should work as expected
### Advanced AI
- [x] Open AI and Azure OPENAI should be able to configure as advanced
AI endpoint
- [x] Advanced AI should be able to pick up functions correctly to do
the transformation and give reasonable result

---------

Signed-off-by: Shawn Yuan <shuaiyuan@microsoft.com>
Signed-off-by: Shuai Yuan <shuai.yuan.zju@gmail.com>
Signed-off-by: Shawn Yuan (from Dev Box) <shuaiyuan@microsoft.com>
Co-authored-by: Leilei Zhang <leilzh@microsoft.com>
Co-authored-by: Niels Laute <niels.laute@live.nl>
Co-authored-by: Kai Tao <kaitao@microsoft.com>
Co-authored-by: Kai Tao <69313318+vanzue@users.noreply.github.com>
Co-authored-by: vanzue <vanzue@outlook.com>
Co-authored-by: Gordon Lam (SH) <yeelam@microsoft.com>
This commit is contained in:
Shawn Yuan
2025-11-05 16:13:55 +08:00
committed by GitHub
parent c364aa7c70
commit a3b8dc6cb8
119 changed files with 8441 additions and 958 deletions

View File

@@ -0,0 +1,35 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Text.Json.Serialization;
namespace Microsoft.PowerToys.Settings.UI.Library
{
/// <summary>
/// Stores provider-specific configuration overrides so each AI service can keep distinct settings.
/// </summary>
public class AIProviderConfigurationSnapshot
{
[JsonPropertyName("model-name")]
public string ModelName { get; set; } = string.Empty;
[JsonPropertyName("endpoint-url")]
public string EndpointUrl { get; set; } = string.Empty;
[JsonPropertyName("api-version")]
public string ApiVersion { get; set; } = string.Empty;
[JsonPropertyName("deployment-name")]
public string DeploymentName { get; set; } = string.Empty;
[JsonPropertyName("model-path")]
public string ModelPath { get; set; } = string.Empty;
[JsonPropertyName("system-prompt")]
public string SystemPrompt { get; set; } = string.Empty;
[JsonPropertyName("moderation-enabled")]
public bool ModerationEnabled { get; set; } = true;
}
}

View File

@@ -0,0 +1,26 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
namespace Microsoft.PowerToys.Settings.UI.Library
{
/// <summary>
/// Supported AI service types for PowerToys AI experiences.
/// </summary>
public enum AIServiceType
{
Unknown = 0,
OpenAI,
AzureOpenAI,
Onnx,
ML,
FoundryLocal,
Mistral,
Google,
HuggingFace,
AzureAIInference,
Ollama,
Anthropic,
AmazonBedrock,
}
}

View File

@@ -0,0 +1,88 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
namespace Microsoft.PowerToys.Settings.UI.Library
{
public static class AIServiceTypeExtensions
{
/// <summary>
/// Convert a persisted string value into an <see cref="AIServiceType"/>.
/// Supports historical casing and aliases.
/// </summary>
public static AIServiceType ToAIServiceType(this string serviceType)
{
if (string.IsNullOrWhiteSpace(serviceType))
{
return AIServiceType.OpenAI;
}
var normalized = serviceType.Trim().ToLowerInvariant();
return normalized switch
{
"openai" => AIServiceType.OpenAI,
"azureopenai" or "azure" => AIServiceType.AzureOpenAI,
"onnx" => AIServiceType.Onnx,
"foundrylocal" or "foundry" or "fl" => AIServiceType.FoundryLocal,
"ml" or "windowsml" or "winml" => AIServiceType.ML,
"mistral" => AIServiceType.Mistral,
"google" or "googleai" or "googlegemini" => AIServiceType.Google,
"huggingface" => AIServiceType.HuggingFace,
"azureaiinference" or "azureinference" => AIServiceType.AzureAIInference,
"ollama" => AIServiceType.Ollama,
"anthropic" => AIServiceType.Anthropic,
"amazonbedrock" or "bedrock" => AIServiceType.AmazonBedrock,
_ => AIServiceType.Unknown,
};
}
/// <summary>
/// Convert an <see cref="AIServiceType"/> to the canonical string used for persistence.
/// </summary>
public static string ToConfigurationString(this AIServiceType serviceType)
{
return serviceType switch
{
AIServiceType.OpenAI => "OpenAI",
AIServiceType.AzureOpenAI => "AzureOpenAI",
AIServiceType.Onnx => "Onnx",
AIServiceType.FoundryLocal => "FoundryLocal",
AIServiceType.ML => "ML",
AIServiceType.Mistral => "Mistral",
AIServiceType.Google => "Google",
AIServiceType.HuggingFace => "HuggingFace",
AIServiceType.AzureAIInference => "AzureAIInference",
AIServiceType.Ollama => "Ollama",
AIServiceType.Anthropic => "Anthropic",
AIServiceType.AmazonBedrock => "AmazonBedrock",
AIServiceType.Unknown => string.Empty,
_ => throw new ArgumentOutOfRangeException(nameof(serviceType), serviceType, "Unsupported AI service type."),
};
}
/// <summary>
/// Convert an <see cref="AIServiceType"/> into the normalized key used internally.
/// </summary>
public static string ToNormalizedKey(this AIServiceType serviceType)
{
return serviceType switch
{
AIServiceType.OpenAI => "openai",
AIServiceType.AzureOpenAI => "azureopenai",
AIServiceType.Onnx => "onnx",
AIServiceType.FoundryLocal => "foundrylocal",
AIServiceType.ML => "ml",
AIServiceType.Mistral => "mistral",
AIServiceType.Google => "google",
AIServiceType.HuggingFace => "huggingface",
AIServiceType.AzureAIInference => "azureaiinference",
AIServiceType.Ollama => "ollama",
AIServiceType.Anthropic => "anthropic",
AIServiceType.AmazonBedrock => "amazonbedrock",
_ => string.Empty,
};
}
}
}

View File

@@ -0,0 +1,44 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.Linq;
namespace Microsoft.PowerToys.Settings.UI.Library
{
/// <summary>
/// Metadata information for an AI service type.
/// </summary>
public class AIServiceTypeMetadata
{
public AIServiceType ServiceType { get; init; }
public string DisplayName { get; init; }
public string IconPath { get; init; }
public bool IsOnlineService { get; init; }
public bool IsAvailableInUI { get; init; } = true;
public bool IsLocalModel { get; init; }
public string LegalDescription { get; init; }
public string TermsLabel { get; init; }
public Uri TermsUri { get; init; }
public string PrivacyLabel { get; init; }
public Uri PrivacyUri { get; init; }
public bool HasLegalInfo => !string.IsNullOrWhiteSpace(LegalDescription);
public bool HasTermsLink => TermsUri is not null && !string.IsNullOrEmpty(TermsLabel);
public bool HasPrivacyLink => PrivacyUri is not null && !string.IsNullOrEmpty(PrivacyLabel);
}
}

View File

@@ -0,0 +1,222 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.Linq;
namespace Microsoft.PowerToys.Settings.UI.Library;
/// <summary>
/// Centralized registry for AI service type metadata.
/// </summary>
public static class AIServiceTypeRegistry
{
private static readonly Dictionary<AIServiceType, AIServiceTypeMetadata> MetadataMap = new()
{
[AIServiceType.AmazonBedrock] = new AIServiceTypeMetadata
{
ServiceType = AIServiceType.AmazonBedrock,
DisplayName = "Amazon Bedrock",
IsAvailableInUI = false, // Currently disabled in UI
IconPath = "ms-appx:///Assets/Settings/Icons/Models/Bedrock.svg",
IsOnlineService = true,
LegalDescription = "AdvancedPaste_AmazonBedrock_LegalDescription",
TermsLabel = "AdvancedPaste_AmazonBedrock_TermsLabel",
TermsUri = new Uri("https://aws.amazon.com/service-terms/"),
PrivacyLabel = "AdvancedPaste_AmazonBedrock_PrivacyLabel",
PrivacyUri = new Uri("https://aws.amazon.com/privacy/"),
},
[AIServiceType.Anthropic] = new AIServiceTypeMetadata
{
ServiceType = AIServiceType.Anthropic,
DisplayName = "Anthropic",
IconPath = "ms-appx:///Assets/Settings/Icons/Models/Anthropic.svg",
IsOnlineService = true,
LegalDescription = "AdvancedPaste_Anthropic_LegalDescription",
TermsLabel = "AdvancedPaste_Anthropic_TermsLabel",
TermsUri = new Uri("https://www.anthropic.com/legal/terms-of-service"),
PrivacyLabel = "AdvancedPaste_Anthropic_PrivacyLabel",
PrivacyUri = new Uri("https://www.anthropic.com/legal/privacy"),
},
[AIServiceType.AzureAIInference] = new AIServiceTypeMetadata
{
ServiceType = AIServiceType.AzureAIInference,
DisplayName = "Azure AI Inference",
IconPath = "ms-appx:///Assets/Settings/Icons/Models/FoundryLocal.svg", // No icon for Azure AI Inference, use Foundry Local temporarily
IsOnlineService = true,
LegalDescription = "AdvancedPaste_AzureAIInference_LegalDescription",
TermsLabel = "AdvancedPaste_AzureAIInference_TermsLabel",
TermsUri = new Uri("https://azure.microsoft.com/support/legal/"),
PrivacyLabel = "AdvancedPaste_AzureAIInference_PrivacyLabel",
PrivacyUri = new Uri("https://privacy.microsoft.com/privacystatement"),
},
[AIServiceType.AzureOpenAI] = new AIServiceTypeMetadata
{
ServiceType = AIServiceType.AzureOpenAI,
DisplayName = "Azure OpenAI",
IconPath = "ms-appx:///Assets/Settings/Icons/Models/AzureAI.svg",
IsOnlineService = true,
LegalDescription = "AdvancedPaste_AzureOpenAI_LegalDescription",
TermsLabel = "AdvancedPaste_AzureOpenAI_TermsLabel",
TermsUri = new Uri("https://azure.microsoft.com/support/legal/"),
PrivacyLabel = "AdvancedPaste_AzureOpenAI_PrivacyLabel",
PrivacyUri = new Uri("https://privacy.microsoft.com/privacystatement"),
},
[AIServiceType.FoundryLocal] = new AIServiceTypeMetadata
{
ServiceType = AIServiceType.FoundryLocal,
DisplayName = "Foundry Local",
IconPath = "ms-appx:///Assets/Settings/Icons/Models/FoundryLocal.svg",
IsOnlineService = false,
IsLocalModel = true,
LegalDescription = "AdvancedPaste_FoundryLocal_LegalDescription", // Resource key for localized description
},
[AIServiceType.Google] = new AIServiceTypeMetadata
{
ServiceType = AIServiceType.Google,
DisplayName = "Google",
IconPath = "ms-appx:///Assets/Settings/Icons/Models/Gemini.svg",
IsOnlineService = true,
LegalDescription = "AdvancedPaste_Google_LegalDescription",
TermsLabel = "AdvancedPaste_Google_TermsLabel",
TermsUri = new Uri("https://policies.google.com/terms"),
PrivacyLabel = "AdvancedPaste_Google_PrivacyLabel",
PrivacyUri = new Uri("https://policies.google.com/privacy"),
},
[AIServiceType.HuggingFace] = new AIServiceTypeMetadata
{
ServiceType = AIServiceType.HuggingFace,
DisplayName = "Hugging Face",
IconPath = "ms-appx:///Assets/Settings/Icons/Models/HuggingFace.svg",
IsOnlineService = true,
IsAvailableInUI = false, // Currently disabled in UI
},
[AIServiceType.Mistral] = new AIServiceTypeMetadata
{
ServiceType = AIServiceType.Mistral,
DisplayName = "Mistral",
IconPath = "ms-appx:///Assets/Settings/Icons/Models/Mistral.svg",
IsOnlineService = true,
LegalDescription = "AdvancedPaste_Mistral_LegalDescription",
TermsLabel = "AdvancedPaste_Mistral_TermsLabel",
TermsUri = new Uri("https://mistral.ai/terms-of-service/"),
PrivacyLabel = "AdvancedPaste_Mistral_PrivacyLabel",
PrivacyUri = new Uri("https://mistral.ai/privacy-policy/"),
},
[AIServiceType.ML] = new AIServiceTypeMetadata
{
ServiceType = AIServiceType.ML,
DisplayName = "Windows ML",
IconPath = "ms-appx:///Assets/Settings/Icons/Models/WindowsML.svg",
LegalDescription = "AdvancedPaste_LocalModel_LegalDescription",
IsAvailableInUI = false,
IsOnlineService = false,
IsLocalModel = true,
},
[AIServiceType.Ollama] = new AIServiceTypeMetadata
{
ServiceType = AIServiceType.Ollama,
DisplayName = "Ollama",
IconPath = "ms-appx:///Assets/Settings/Icons/Models/Ollama.svg",
// Ollama provide online service, but we treat it as local model at first version since it can is known for local model.
IsOnlineService = false,
IsLocalModel = true,
LegalDescription = "AdvancedPaste_LocalModel_LegalDescription",
TermsLabel = "AdvancedPaste_Ollama_TermsLabel",
TermsUri = new Uri("https://ollama.com/terms"),
PrivacyLabel = "AdvancedPaste_Ollama_PrivacyLabel",
PrivacyUri = new Uri("https://ollama.com/privacy"),
},
[AIServiceType.Onnx] = new AIServiceTypeMetadata
{
ServiceType = AIServiceType.Onnx,
DisplayName = "ONNX",
LegalDescription = "AdvancedPaste_LocalModel_LegalDescription",
IconPath = "ms-appx:///Assets/Settings/Icons/Models/Onnx.svg",
IsOnlineService = false,
IsAvailableInUI = false,
},
[AIServiceType.OpenAI] = new AIServiceTypeMetadata
{
ServiceType = AIServiceType.OpenAI,
DisplayName = "OpenAI",
IconPath = "ms-appx:///Assets/Settings/Icons/Models/OpenAI.light.svg",
IsOnlineService = true,
LegalDescription = "AdvancedPaste_OpenAI_LegalDescription",
TermsLabel = "AdvancedPaste_OpenAI_TermsLabel",
TermsUri = new Uri("https://openai.com/terms"),
PrivacyLabel = "AdvancedPaste_OpenAI_PrivacyLabel",
PrivacyUri = new Uri("https://openai.com/privacy"),
},
[AIServiceType.Unknown] = new AIServiceTypeMetadata
{
ServiceType = AIServiceType.Unknown,
DisplayName = "Unknown",
IconPath = "ms-appx:///Assets/Settings/Icons/Models/OpenAI.light.svg",
IsOnlineService = false,
IsAvailableInUI = false,
},
};
/// <summary>
/// Get metadata for a specific service type.
/// </summary>
public static AIServiceTypeMetadata GetMetadata(AIServiceType serviceType)
{
return MetadataMap.TryGetValue(serviceType, out var metadata)
? metadata
: MetadataMap[AIServiceType.Unknown];
}
/// <summary>
/// Get metadata for a service type from its string representation.
/// </summary>
public static AIServiceTypeMetadata GetMetadata(string serviceType)
{
var type = serviceType.ToAIServiceType();
return GetMetadata(type);
}
/// <summary>
/// Get icon path for a service type.
/// </summary>
public static string GetIconPath(AIServiceType serviceType)
{
return GetMetadata(serviceType).IconPath;
}
/// <summary>
/// Get icon path for a service type from its string representation.
/// </summary>
public static string GetIconPath(string serviceType)
{
return GetMetadata(serviceType).IconPath;
}
/// <summary>
/// Get all service types available in the UI.
/// </summary>
public static IEnumerable<AIServiceTypeMetadata> GetAvailableServiceTypes()
{
return MetadataMap.Values.Where(m => m.IsAvailableInUI);
}
/// <summary>
/// Get all online service types available in the UI.
/// </summary>
public static IEnumerable<AIServiceTypeMetadata> GetOnlineServiceTypes()
{
return GetAvailableServiceTypes().Where(m => m.IsOnlineService);
}
/// <summary>
/// Get all local service types available in the UI.
/// </summary>
public static IEnumerable<AIServiceTypeMetadata> GetLocalServiceTypes()
{
return GetAvailableServiceTypes().Where(m => m.IsLocalModel);
}
}

View File

@@ -14,6 +14,7 @@ public sealed class AdvancedPasteCustomAction : Observable, IAdvancedPasteAction
{
private int _id;
private string _name = string.Empty;
private string _description = string.Empty;
private string _prompt = string.Empty;
private HotkeySettings _shortcut = new();
private bool _isShown;
@@ -43,6 +44,13 @@ public sealed class AdvancedPasteCustomAction : Observable, IAdvancedPasteAction
}
}
[JsonPropertyName("description")]
public string Description
{
get => _description;
set => Set(ref _description, value ?? string.Empty);
}
[JsonPropertyName("prompt")]
public string Prompt
{
@@ -128,6 +136,7 @@ public sealed class AdvancedPasteCustomAction : Observable, IAdvancedPasteAction
{
Id = other.Id;
Name = other.Name;
Description = other.Description;
Prompt = other.Prompt;
Shortcut = other.GetShortcutClone();
IsShown = other.IsShown;

View File

@@ -2,6 +2,7 @@
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Collections.Generic;
using System.Text.Json;
using System.Text.Json.Serialization;
@@ -23,13 +24,38 @@ namespace Microsoft.PowerToys.Settings.UI.Library
PasteAsJsonShortcut = new();
CustomActions = new();
AdditionalActions = new();
IsAdvancedAIEnabled = false;
IsAIEnabled = false;
ShowCustomPreview = true;
CloseAfterLosingFocus = false;
PasteAIConfiguration = new();
}
[JsonConverter(typeof(BoolPropertyJsonConverter))]
public bool IsAdvancedAIEnabled { get; set; }
public bool IsAIEnabled { get; set; }
[JsonExtensionData]
public Dictionary<string, JsonElement> ExtensionData
{
get => _extensionData;
set
{
_extensionData = value;
if (_extensionData != null && _extensionData.TryGetValue("IsOpenAIEnabled", out var legacyElement) && legacyElement.ValueKind == JsonValueKind.Object && legacyElement.TryGetProperty("value", out var valueElement))
{
IsAIEnabled = valueElement.ValueKind switch
{
JsonValueKind.True => true,
JsonValueKind.False => false,
_ => IsAIEnabled,
};
_extensionData.Remove("IsOpenAIEnabled");
}
}
}
private Dictionary<string, JsonElement> _extensionData;
[JsonConverter(typeof(BoolPropertyJsonConverter))]
public bool ShowCustomPreview { get; set; }
@@ -57,6 +83,10 @@ namespace Microsoft.PowerToys.Settings.UI.Library
[CmdConfigureIgnoreAttribute]
public AdvancedPasteAdditionalActions AdditionalActions { get; init; }
[JsonPropertyName("paste-ai-configuration")]
[CmdConfigureIgnoreAttribute]
public PasteAIConfiguration PasteAIConfiguration { get; set; }
public override string ToString()
=> JsonSerializer.Serialize(this);
}

View File

@@ -0,0 +1,103 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace Microsoft.PowerToys.Settings.UI.Library
{
/// <summary>
/// Configuration for Paste AI features (custom action transformations like custom prompt processing)
/// </summary>
public class PasteAIConfiguration : INotifyPropertyChanged
{
private string _activeProviderId = string.Empty;
private ObservableCollection<PasteAIProviderDefinition> _providers = new();
private bool _useSharedCredentials = true;
private Dictionary<string, AIProviderConfigurationSnapshot> _legacyProviderConfigurations;
public event PropertyChangedEventHandler PropertyChanged;
[JsonPropertyName("active-provider-id")]
public string ActiveProviderId
{
get => _activeProviderId;
set => SetProperty(ref _activeProviderId, value ?? string.Empty);
}
[JsonPropertyName("providers")]
public ObservableCollection<PasteAIProviderDefinition> Providers
{
get => _providers;
set => SetProperty(ref _providers, value ?? new ObservableCollection<PasteAIProviderDefinition>());
}
[JsonPropertyName("use-shared-credentials")]
public bool UseSharedCredentials
{
get => _useSharedCredentials;
set => SetProperty(ref _useSharedCredentials, value);
}
[JsonPropertyName("provider-configurations")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public Dictionary<string, AIProviderConfigurationSnapshot> LegacyProviderConfigurations
{
get => _legacyProviderConfigurations;
set => _legacyProviderConfigurations = value;
}
[JsonIgnore]
public PasteAIProviderDefinition ActiveProvider
{
get
{
if (_providers is null || _providers.Count == 0)
{
return null;
}
if (!string.IsNullOrWhiteSpace(_activeProviderId))
{
var match = _providers.FirstOrDefault(provider => string.Equals(provider.Id, _activeProviderId, StringComparison.OrdinalIgnoreCase));
if (match is not null)
{
return match;
}
}
return _providers[0];
}
}
[JsonIgnore]
public AIServiceType ActiveServiceTypeKind => ActiveProvider?.ServiceTypeKind ?? AIServiceType.OpenAI;
public override string ToString()
=> JsonSerializer.Serialize(this);
protected bool SetProperty<T>(ref T field, T value, [CallerMemberName] string propertyName = null)
{
if (EqualityComparer<T>.Default.Equals(field, value))
{
return false;
}
field = value;
OnPropertyChanged(propertyName);
return true;
}
protected void OnPropertyChanged(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
}

View File

@@ -0,0 +1,175 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Text.Json.Serialization;
namespace Microsoft.PowerToys.Settings.UI.Library
{
/// <summary>
/// Represents a single Paste AI provider configuration entry.
/// </summary>
public class PasteAIProviderDefinition : INotifyPropertyChanged
{
private string _id = Guid.NewGuid().ToString("N");
private string _serviceType = "OpenAI";
private string _modelName = string.Empty;
private string _endpointUrl = string.Empty;
private string _apiVersion = string.Empty;
private string _deploymentName = string.Empty;
private string _modelPath = string.Empty;
private string _systemPrompt = string.Empty;
private bool _moderationEnabled = true;
private bool _isActive;
private bool _enableAdvancedAI;
private bool _isLocalModel;
public event PropertyChangedEventHandler PropertyChanged;
[JsonPropertyName("id")]
public string Id
{
get => _id;
set => SetProperty(ref _id, value);
}
[JsonPropertyName("service-type")]
public string ServiceType
{
get => _serviceType;
set
{
if (SetProperty(ref _serviceType, string.IsNullOrWhiteSpace(value) ? "OpenAI" : value))
{
OnPropertyChanged(nameof(DisplayName));
}
}
}
[JsonIgnore]
public AIServiceType ServiceTypeKind
{
get => ServiceType.ToAIServiceType();
set => ServiceType = value.ToConfigurationString();
}
[JsonPropertyName("model-name")]
public string ModelName
{
get => _modelName;
set
{
if (SetProperty(ref _modelName, value ?? string.Empty))
{
OnPropertyChanged(nameof(DisplayName));
}
}
}
[JsonPropertyName("endpoint-url")]
public string EndpointUrl
{
get => _endpointUrl;
set => SetProperty(ref _endpointUrl, value ?? string.Empty);
}
[JsonPropertyName("api-version")]
public string ApiVersion
{
get => _apiVersion;
set => SetProperty(ref _apiVersion, value ?? string.Empty);
}
[JsonPropertyName("deployment-name")]
public string DeploymentName
{
get => _deploymentName;
set => SetProperty(ref _deploymentName, value ?? string.Empty);
}
[JsonPropertyName("model-path")]
public string ModelPath
{
get => _modelPath;
set => SetProperty(ref _modelPath, value ?? string.Empty);
}
[JsonPropertyName("system-prompt")]
public string SystemPrompt
{
get => _systemPrompt;
set => SetProperty(ref _systemPrompt, value?.Trim() ?? string.Empty);
}
[JsonPropertyName("moderation-enabled")]
public bool ModerationEnabled
{
get => _moderationEnabled;
set => SetProperty(ref _moderationEnabled, value);
}
[JsonPropertyName("enable-advanced-ai")]
public bool EnableAdvancedAI
{
get => _enableAdvancedAI;
set => SetProperty(ref _enableAdvancedAI, value);
}
[JsonPropertyName("is-local-model")]
public bool IsLocalModel
{
get => _isLocalModel;
set => SetProperty(ref _isLocalModel, value);
}
[JsonIgnore]
public bool IsActive
{
get => _isActive;
set => SetProperty(ref _isActive, value);
}
[JsonIgnore]
public string DisplayName => string.IsNullOrWhiteSpace(ModelName) ? ServiceType : ModelName;
public PasteAIProviderDefinition Clone()
{
return new PasteAIProviderDefinition
{
Id = Id,
ServiceType = ServiceType,
ModelName = ModelName,
EndpointUrl = EndpointUrl,
ApiVersion = ApiVersion,
DeploymentName = DeploymentName,
ModelPath = ModelPath,
SystemPrompt = SystemPrompt,
ModerationEnabled = ModerationEnabled,
EnableAdvancedAI = EnableAdvancedAI,
IsLocalModel = IsLocalModel,
IsActive = IsActive,
};
}
protected bool SetProperty<T>(ref T field, T value, [CallerMemberName] string propertyName = null)
{
if (EqualityComparer<T>.Default.Equals(field, value))
{
return false;
}
field = value;
OnPropertyChanged(propertyName);
return true;
}
protected void OnPropertyChanged(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
}

View File

@@ -0,0 +1,10 @@
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_2092_1822)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.718 2.34668H12.12L16.5 13.3333H14.098L9.718 2.34668ZM4.87933 2.34668H7.39067L11.7707 13.3333H9.32133L8.426 11.026H3.84467L2.94867 13.3327H0.5L4.88 2.34801L4.87933 2.34668ZM7.634 8.98601L6.13533 5.12468L4.63667 8.98668H7.63333L7.634 8.98601Z" fill="black"/>
</g>
<defs>
<clipPath id="clip0_2092_1822">
<rect width="16" height="16" fill="white" transform="translate(0.5)"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 585 B

View File

@@ -0,0 +1,23 @@
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M6.05607 1.09062H10.3957L5.89074 14.4385C5.84444 14.5756 5.75629 14.6948 5.6387 14.7792C5.52111 14.8637 5.38 14.9091 5.23524 14.9091H1.85791C1.74822 14.9091 1.64011 14.883 1.54252 14.833C1.44493 14.7829 1.36066 14.7103 1.29669 14.6212C1.23271 14.5322 1.19087 14.4291 1.17462 14.3206C1.15837 14.2122 1.16818 14.1014 1.20324 13.9975L5.40041 1.56129C5.44669 1.42407 5.53485 1.30483 5.65248 1.22037C5.7701 1.1359 5.91126 1.09063 6.05607 1.09062Z" fill="url(#paint0_linear_2092_1811)"/>
<path d="M12.3626 10.0435H5.48096C5.41698 10.0434 5.35447 10.0626 5.30156 10.0986C5.24864 10.1345 5.20779 10.1856 5.18432 10.2451C5.16085 10.3046 5.15584 10.3698 5.16996 10.4322C5.18408 10.4946 5.21666 10.5513 5.26346 10.595L9.68546 14.7223C9.81421 14.8424 9.98373 14.9092 10.1598 14.9091H14.0565L12.3626 10.0435Z" fill="#0078D4"/>
<path d="M6.05617 1.0907C5.90978 1.09014 5.76704 1.1364 5.64881 1.22273C5.53058 1.30906 5.44305 1.43093 5.399 1.57054L1.2085 13.9862C1.17108 14.0905 1.15933 14.2023 1.17425 14.3121C1.18917 14.4219 1.23031 14.5265 1.2942 14.617C1.3581 14.7076 1.44285 14.7814 1.54131 14.8323C1.63976 14.8831 1.74902 14.9095 1.85983 14.9092H5.32433C5.45337 14.8861 5.57397 14.8293 5.67382 14.7443C5.77367 14.6594 5.84919 14.5495 5.89267 14.4259L6.72833 11.963L9.71333 14.7472C9.83842 14.8507 9.99534 14.9079 10.1577 14.9092H14.0398L12.3372 10.0435L7.37367 10.0447L10.4115 1.0907H6.05617Z" fill="url(#paint1_linear_2092_1811)"/>
<path d="M11.5996 1.5607C11.5533 1.4237 11.4653 1.30466 11.3479 1.22034C11.2304 1.13603 11.0895 1.09068 10.9449 1.0907H6.1084C6.25297 1.09071 6.3939 1.13606 6.51135 1.22038C6.62879 1.30469 6.71683 1.42372 6.76307 1.5607L10.9604 13.9974C10.9955 14.1013 11.0053 14.2121 10.9891 14.3206C10.9729 14.4291 10.931 14.5322 10.867 14.6213C10.8031 14.7104 10.7188 14.7831 10.6212 14.8331C10.5236 14.8832 10.4154 14.9094 10.3057 14.9094H15.1424C15.2521 14.9093 15.3602 14.8832 15.4578 14.8331C15.5554 14.783 15.6396 14.7104 15.7036 14.6213C15.7675 14.5321 15.8094 14.4291 15.8256 14.3206C15.8418 14.2121 15.832 14.1013 15.7969 13.9974L11.5996 1.5607Z" fill="url(#paint2_linear_2092_1811)"/>
<defs>
<linearGradient id="paint0_linear_2092_1811" x1="7.63774" y1="2.11462" x2="3.1309" y2="15.429" gradientUnits="userSpaceOnUse">
<stop stop-color="#114A8B"/>
<stop offset="1" stop-color="#0669BC"/>
</linearGradient>
<linearGradient id="paint1_linear_2092_1811" x1="9.04567" y1="8.31954" x2="8.00317" y2="8.67204" gradientUnits="userSpaceOnUse">
<stop stop-opacity="0.3"/>
<stop offset="0.071" stop-opacity="0.2"/>
<stop offset="0.321" stop-opacity="0.1"/>
<stop offset="0.623" stop-opacity="0.05"/>
<stop offset="1" stop-opacity="0"/>
</linearGradient>
<linearGradient id="paint2_linear_2092_1811" x1="8.4729" y1="1.72636" x2="13.4201" y2="14.9065" gradientUnits="userSpaceOnUse">
<stop stop-color="#3CCBF4"/>
<stop offset="1" stop-color="#2892DF"/>
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@@ -0,0 +1,9 @@
<svg id="uuid-adbdae8e-5a41-46d1-8c18-aa73cdbfee32" xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18">
<defs>
<radialGradient id="uuid-2a7407aa-b787-48dd-a96a-0d81ab6e93bb" cx="-67.981" cy="793.199" r=".45" gradientTransform="translate(-17939.03 20368.029) rotate(45) scale(25.091 -34.149)" gradientUnits="userSpaceOnUse">
<stop offset="0" stop-color="#83b9f9" />
<stop offset="1" stop-color="#0078d4" />
</radialGradient>
</defs>
<path d="m0,2.7v12.6c0,1.491,1.209,2.7,2.7,2.7h12.6c1.491,0,2.7-1.209,2.7-2.7V2.7c0-1.491-1.209-2.7-2.7-2.7H2.7C1.209,0,0,1.209,0,2.7ZM10.8,0v3.6c0,3.976,3.224,7.2,7.2,7.2h-3.6c-3.976,0-7.199,3.222-7.2,7.198v-3.598c0-3.976-3.224-7.2-7.2-7.2h3.6c3.976,0,7.2-3.224,7.2-7.2Z" fill="url(#uuid-2a7407aa-b787-48dd-a96a-0d81ab6e93bb)" stroke-width="0" />
</svg>

After

Width:  |  Height:  |  Size: 826 B

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 5.7 KiB

View File

@@ -0,0 +1,59 @@
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_2092_1741)">
<mask id="mask0_2092_1741" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="0" width="17" height="16">
<path d="M16.5 0H0.5V16H16.5V0Z" fill="white"/>
</mask>
<g mask="url(#mask0_2092_1741)">
<mask id="mask1_2092_1741" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="-1" y="-2" width="19" height="20">
<path d="M17.8337 -1.33337H-0.833008V17.3333H17.8337V-1.33337Z" fill="white"/>
</mask>
<g mask="url(#mask1_2092_1741)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.1137 0.315668C11.57 0.315668 11.9744 0.657891 12.1196 1.15567C12.2648 1.65345 13.1152 4.73345 13.1152 4.73345V10.852H10.0352L10.0974 0.305298H11.1137V0.315668Z" fill="url(#paint0_linear_2092_1741)"/>
<path d="M15.6352 5.09586C15.6352 4.87808 15.4589 4.71216 15.2515 4.71216H13.4366C12.1611 4.71216 11.124 5.7492 11.124 7.02472V10.8618H13.3226C14.5982 10.8618 15.6352 9.82472 15.6352 8.54919V5.09586Z" fill="url(#paint1_linear_2092_1741)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.1133 0.315674C10.7607 0.315674 10.4807 0.595674 10.4807 0.948265L10.4185 12.5942C10.4185 14.2949 9.0392 15.6742 7.33847 15.6742H1.74885C1.47921 15.6742 1.30292 15.4149 1.38589 15.1661L5.86589 2.37938C6.30144 1.14531 7.46293 0.315674 8.7696 0.315674H11.1237H11.1133Z" fill="url(#paint2_linear_2092_1741)"/>
</g>
</g>
</g>
<defs>
<linearGradient id="paint0_linear_2092_1741" x1="12.3996" y1="11.0801" x2="9.80702" y2="0.699373" gradientUnits="userSpaceOnUse">
<stop stop-color="#712575"/>
<stop offset="0.09" stop-color="#9A2884"/>
<stop offset="0.18" stop-color="#BF2C92"/>
<stop offset="0.27" stop-color="#DA2E9C"/>
<stop offset="0.34" stop-color="#EB30A2"/>
<stop offset="0.4" stop-color="#F131A5"/>
<stop offset="0.5" stop-color="#EC30A3"/>
<stop offset="0.61" stop-color="#DF2F9E"/>
<stop offset="0.72" stop-color="#C92D96"/>
<stop offset="0.83" stop-color="#AA2A8A"/>
<stop offset="0.95" stop-color="#83267C"/>
<stop offset="1" stop-color="#712575"/>
</linearGradient>
<linearGradient id="paint1_linear_2092_1741" x1="13.3848" y1="0.532897" x2="13.3848" y2="15.1759" gradientUnits="userSpaceOnUse">
<stop stop-color="#DA7ED0"/>
<stop offset="0.08" stop-color="#B17BD5"/>
<stop offset="0.19" stop-color="#8778DB"/>
<stop offset="0.3" stop-color="#6276E1"/>
<stop offset="0.41" stop-color="#4574E5"/>
<stop offset="0.54" stop-color="#2E72E8"/>
<stop offset="0.67" stop-color="#1D71EB"/>
<stop offset="0.81" stop-color="#1471EC"/>
<stop offset="1" stop-color="#1171ED"/>
</linearGradient>
<linearGradient id="paint2_linear_2092_1741" x1="12.5029" y1="0.865306" x2="2.79625" y2="16.4313" gradientUnits="userSpaceOnUse">
<stop stop-color="#DA7ED0"/>
<stop offset="0.05" stop-color="#B77BD4"/>
<stop offset="0.11" stop-color="#9079DA"/>
<stop offset="0.18" stop-color="#6E77DF"/>
<stop offset="0.25" stop-color="#5175E3"/>
<stop offset="0.33" stop-color="#3973E7"/>
<stop offset="0.42" stop-color="#2772E9"/>
<stop offset="0.54" stop-color="#1A71EB"/>
<stop offset="0.68" stop-color="#1371EC"/>
<stop offset="1" stop-color="#1171ED"/>
</linearGradient>
<clipPath id="clip0_2092_1741">
<rect width="16" height="16" fill="white" transform="translate(0.5)"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@@ -0,0 +1,20 @@
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.2445 7.22331C13.137 6.75184 12.13 6.07273 11.2778 5.22264C10.0911 4.03353 9.2444 2.54831 8.8258 0.921308C8.80744 0.849046 8.76551 0.784967 8.70665 0.739197C8.6478 0.693428 8.57536 0.668579 8.5008 0.668579C8.42624 0.668579 8.35381 0.693428 8.29495 0.739197C8.2361 0.784967 8.19417 0.849046 8.1758 0.921308C7.75632 2.5481 6.90952 4.03315 5.72314 5.22264C4.87089 6.07263 3.8639 6.75172 2.75647 7.22331C2.32314 7.40998 1.8778 7.55998 1.4218 7.67531C1.3491 7.69317 1.28448 7.7349 1.23829 7.79382C1.1921 7.85274 1.16699 7.92544 1.16699 8.00031C1.16699 8.07518 1.1921 8.14788 1.23829 8.2068C1.28448 8.26572 1.3491 8.30744 1.4218 8.32531C1.8778 8.43998 2.3218 8.58998 2.75647 8.77664C3.86397 9.24811 4.87098 9.92722 5.72314 10.7773C6.9102 11.9666 7.75709 13.452 8.1758 15.0793C8.19367 15.152 8.2354 15.2166 8.29431 15.2628C8.35323 15.309 8.42594 15.3341 8.5008 15.3341C8.57567 15.3341 8.64838 15.309 8.7073 15.2628C8.76621 15.2166 8.80794 15.152 8.8258 15.0793C8.94047 14.6226 9.09047 14.1786 9.27714 13.744C9.74858 12.6365 10.4277 11.6294 11.2778 10.7773C12.4671 9.59052 13.9526 8.74386 15.5798 8.32531C15.6521 8.30694 15.7161 8.26502 15.7619 8.20616C15.8077 8.1473 15.8325 8.07487 15.8325 8.00031C15.8325 7.92575 15.8077 7.85332 15.7619 7.79446C15.7161 7.7356 15.6521 7.69367 15.5798 7.67531C15.1234 7.56047 14.6768 7.40932 14.2445 7.22331Z" fill="#3186FF"/>
<path d="M14.2445 7.22331C13.137 6.75184 12.13 6.07273 11.2778 5.22264C10.0911 4.03353 9.2444 2.54831 8.8258 0.921308C8.80744 0.849046 8.76551 0.784967 8.70665 0.739197C8.6478 0.693428 8.57536 0.668579 8.5008 0.668579C8.42624 0.668579 8.35381 0.693428 8.29495 0.739197C8.2361 0.784967 8.19417 0.849046 8.1758 0.921308C7.75632 2.5481 6.90952 4.03315 5.72314 5.22264C4.87089 6.07263 3.8639 6.75172 2.75647 7.22331C2.32314 7.40998 1.8778 7.55998 1.4218 7.67531C1.3491 7.69317 1.28448 7.7349 1.23829 7.79382C1.1921 7.85274 1.16699 7.92544 1.16699 8.00031C1.16699 8.07518 1.1921 8.14788 1.23829 8.2068C1.28448 8.26572 1.3491 8.30744 1.4218 8.32531C1.8778 8.43998 2.3218 8.58998 2.75647 8.77664C3.86397 9.24811 4.87098 9.92722 5.72314 10.7773C6.9102 11.9666 7.75709 13.452 8.1758 15.0793C8.19367 15.152 8.2354 15.2166 8.29431 15.2628C8.35323 15.309 8.42594 15.3341 8.5008 15.3341C8.57567 15.3341 8.64838 15.309 8.7073 15.2628C8.76621 15.2166 8.80794 15.152 8.8258 15.0793C8.94047 14.6226 9.09047 14.1786 9.27714 13.744C9.74858 12.6365 10.4277 11.6294 11.2778 10.7773C12.4671 9.59052 13.9526 8.74386 15.5798 8.32531C15.6521 8.30694 15.7161 8.26502 15.7619 8.20616C15.8077 8.1473 15.8325 8.07487 15.8325 8.00031C15.8325 7.92575 15.8077 7.85332 15.7619 7.79446C15.7161 7.7356 15.6521 7.69367 15.5798 7.67531C15.1234 7.56047 14.6768 7.40932 14.2445 7.22331Z" fill="url(#paint0_linear_2092_1806)"/>
<path d="M14.2445 7.22331C13.137 6.75184 12.13 6.07273 11.2778 5.22264C10.0911 4.03353 9.2444 2.54831 8.8258 0.921308C8.80744 0.849046 8.76551 0.784967 8.70665 0.739197C8.6478 0.693428 8.57536 0.668579 8.5008 0.668579C8.42624 0.668579 8.35381 0.693428 8.29495 0.739197C8.2361 0.784967 8.19417 0.849046 8.1758 0.921308C7.75632 2.5481 6.90952 4.03315 5.72314 5.22264C4.87089 6.07263 3.8639 6.75172 2.75647 7.22331C2.32314 7.40998 1.8778 7.55998 1.4218 7.67531C1.3491 7.69317 1.28448 7.7349 1.23829 7.79382C1.1921 7.85274 1.16699 7.92544 1.16699 8.00031C1.16699 8.07518 1.1921 8.14788 1.23829 8.2068C1.28448 8.26572 1.3491 8.30744 1.4218 8.32531C1.8778 8.43998 2.3218 8.58998 2.75647 8.77664C3.86397 9.24811 4.87098 9.92722 5.72314 10.7773C6.9102 11.9666 7.75709 13.452 8.1758 15.0793C8.19367 15.152 8.2354 15.2166 8.29431 15.2628C8.35323 15.309 8.42594 15.3341 8.5008 15.3341C8.57567 15.3341 8.64838 15.309 8.7073 15.2628C8.76621 15.2166 8.80794 15.152 8.8258 15.0793C8.94047 14.6226 9.09047 14.1786 9.27714 13.744C9.74858 12.6365 10.4277 11.6294 11.2778 10.7773C12.4671 9.59052 13.9526 8.74386 15.5798 8.32531C15.6521 8.30694 15.7161 8.26502 15.7619 8.20616C15.8077 8.1473 15.8325 8.07487 15.8325 8.00031C15.8325 7.92575 15.8077 7.85332 15.7619 7.79446C15.7161 7.7356 15.6521 7.69367 15.5798 7.67531C15.1234 7.56047 14.6768 7.40932 14.2445 7.22331Z" fill="url(#paint1_linear_2092_1806)"/>
<path d="M14.2445 7.22331C13.137 6.75184 12.13 6.07273 11.2778 5.22264C10.0911 4.03353 9.2444 2.54831 8.8258 0.921308C8.80744 0.849046 8.76551 0.784967 8.70665 0.739197C8.6478 0.693428 8.57536 0.668579 8.5008 0.668579C8.42624 0.668579 8.35381 0.693428 8.29495 0.739197C8.2361 0.784967 8.19417 0.849046 8.1758 0.921308C7.75632 2.5481 6.90952 4.03315 5.72314 5.22264C4.87089 6.07263 3.8639 6.75172 2.75647 7.22331C2.32314 7.40998 1.8778 7.55998 1.4218 7.67531C1.3491 7.69317 1.28448 7.7349 1.23829 7.79382C1.1921 7.85274 1.16699 7.92544 1.16699 8.00031C1.16699 8.07518 1.1921 8.14788 1.23829 8.2068C1.28448 8.26572 1.3491 8.30744 1.4218 8.32531C1.8778 8.43998 2.3218 8.58998 2.75647 8.77664C3.86397 9.24811 4.87098 9.92722 5.72314 10.7773C6.9102 11.9666 7.75709 13.452 8.1758 15.0793C8.19367 15.152 8.2354 15.2166 8.29431 15.2628C8.35323 15.309 8.42594 15.3341 8.5008 15.3341C8.57567 15.3341 8.64838 15.309 8.7073 15.2628C8.76621 15.2166 8.80794 15.152 8.8258 15.0793C8.94047 14.6226 9.09047 14.1786 9.27714 13.744C9.74858 12.6365 10.4277 11.6294 11.2778 10.7773C12.4671 9.59052 13.9526 8.74386 15.5798 8.32531C15.6521 8.30694 15.7161 8.26502 15.7619 8.20616C15.8077 8.1473 15.8325 8.07487 15.8325 8.00031C15.8325 7.92575 15.8077 7.85332 15.7619 7.79446C15.7161 7.7356 15.6521 7.69367 15.5798 7.67531C15.1234 7.56047 14.6768 7.40932 14.2445 7.22331Z" fill="url(#paint2_linear_2092_1806)"/>
<defs>
<linearGradient id="paint0_linear_2092_1806" x1="5.16714" y1="10.3333" x2="7.8338" y2="7.99997" gradientUnits="userSpaceOnUse">
<stop stop-color="#08B962"/>
<stop offset="1" stop-color="#08B962" stop-opacity="0"/>
</linearGradient>
<linearGradient id="paint1_linear_2092_1806" x1="5.8338" y1="3.66664" x2="8.16714" y2="7.33331" gradientUnits="userSpaceOnUse">
<stop stop-color="#F94543"/>
<stop offset="1" stop-color="#F94543" stop-opacity="0"/>
</linearGradient>
<linearGradient id="paint2_linear_2092_1806" x1="2.8338" y1="8.99998" x2="12.1671" y2="7.99998" gradientUnits="userSpaceOnUse">
<stop stop-color="#FABC12"/>
<stop offset="0.46" stop-color="#FABC12" stop-opacity="0"/>
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 6.2 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 35 KiB

View File

@@ -0,0 +1,24 @@
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_2092_1755)">
<mask id="mask0_2092_1755" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="0" width="17" height="16">
<path d="M16.428 0H0.5V16H16.428V0Z" fill="white"/>
</mask>
<g mask="url(#mask0_2092_1755)">
<path d="M5.05035 0H2.77441V3.21057H5.05035V0Z" fill="#FFD800"/>
<path d="M14.1529 0H11.877V3.21057H14.1529V0Z" fill="#FFD800"/>
<path d="M7.32555 3.21082H2.77441V6.42139H7.32555V3.21082Z" fill="#FFAF00"/>
<path d="M14.1537 3.21082H9.60254V6.42139H14.1537V3.21082Z" fill="#FFAF00"/>
<path d="M14.1519 6.41992H2.77441V9.63049H14.1519V6.41992Z" fill="#FF8205"/>
<path d="M5.05035 9.63074H2.77441V12.8414H5.05035V9.63074Z" fill="#FA500F"/>
<path d="M9.60213 9.63074H7.32617V12.8414H9.60213V9.63074Z" fill="#FA500F"/>
<path d="M14.1529 9.63074H11.877V12.8414H14.1529V9.63074Z" fill="#FA500F"/>
<path d="M7.32633 12.8402H0.5V16.0509H7.32633V12.8402Z" fill="#E10500"/>
<path d="M16.4296 12.8402H9.60254V16.0509H16.4296V12.8402Z" fill="#E10500"/>
</g>
</g>
<defs>
<clipPath id="clip0_2092_1755">
<rect width="16" height="16" fill="white" transform="translate(0.5)"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 6.7 KiB

View File

@@ -0,0 +1,18 @@
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_2092_1790)">
<path d="M15.85 7.50005H15.75L13.08 2.54505C13.1287 2.45432 13.1544 2.35303 13.155 2.25005C13.155 2.16427 13.138 2.07933 13.105 2.00014C13.072 1.92095 13.0237 1.84907 12.9628 1.78865C12.9019 1.72823 12.8297 1.68045 12.7502 1.64808C12.6708 1.61571 12.5857 1.59939 12.5 1.60005C12.4129 1.59972 12.3267 1.6173 12.2467 1.65171C12.1667 1.68612 12.0946 1.73661 12.035 1.80005L6.71496 0.740047C6.70184 0.64745 6.66874 0.558814 6.61795 0.480283C6.56716 0.401752 6.4999 0.335204 6.42084 0.285253C6.34177 0.235302 6.25279 0.203143 6.16006 0.191003C6.06733 0.178864 5.97307 0.187036 5.88381 0.214952C5.79455 0.242869 5.71243 0.289862 5.64314 0.352674C5.57385 0.415486 5.51905 0.492615 5.48253 0.578715C5.44602 0.664814 5.42867 0.757825 5.43167 0.851299C5.43468 0.944773 5.45798 1.03647 5.49996 1.12005L1.34996 7.06505C1.29477 7.04867 1.23753 7.04025 1.17996 7.04005C1.01805 7.05429 0.867358 7.12867 0.757581 7.24853C0.647805 7.36838 0.586914 7.52502 0.586914 7.68755C0.586914 7.85008 0.647805 8.00671 0.757581 8.12657C0.867358 8.24643 1.01805 8.32081 1.17996 8.33505L3.42996 13.87C3.39194 13.9551 3.37153 14.0469 3.36996 14.14C3.37128 14.3116 3.44034 14.4756 3.5621 14.5964C3.68386 14.7173 3.84843 14.7851 4.01996 14.785C4.10788 14.7861 4.19505 14.7688 4.27596 14.7344C4.35686 14.7 4.42973 14.6491 4.48996 14.585L11.21 15.24C11.2312 15.4111 11.3195 15.5667 11.4554 15.6727C11.5914 15.7787 11.7639 15.8263 11.935 15.805C12.106 15.7838 12.2617 15.6955 12.3676 15.5596C12.4736 15.4236 12.5212 15.2511 12.5 15.08C12.498 14.9264 12.4433 14.7781 12.345 14.66L15.73 8.76005H15.84C15.9253 8.76137 16.0101 8.74587 16.0895 8.71442C16.1688 8.68297 16.2412 8.63619 16.3025 8.57676C16.3638 8.51733 16.4128 8.44641 16.4467 8.36804C16.4805 8.28968 16.4987 8.20541 16.5 8.12005C16.4947 7.95205 16.4236 7.79286 16.302 7.67686C16.1804 7.56085 16.018 7.49734 15.85 7.50005ZM12 2.64505C12.0769 2.74772 12.1833 2.82448 12.305 2.86505L11.305 10.55C11.2418 10.5642 11.1811 10.5878 11.125 10.62L5.49996 5.76005C5.51878 5.70543 5.52726 5.64778 5.52496 5.59005C5.52496 5.55005 5.52496 5.50505 5.52496 5.46505L12 2.64505ZM15.235 8.30505L11.79 10.66C11.763 10.6412 11.7345 10.6245 11.705 10.61L12.725 2.84505L15.355 7.69505C15.2499 7.81343 15.1928 7.96678 15.195 8.12505L15.235 8.30505ZM4.78496 4.95005C4.63217 4.97297 4.49283 5.0504 4.39266 5.16803C4.29249 5.28566 4.23825 5.43555 4.23996 5.59005V5.63505L1.92996 7.00005L5.49996 1.87005L4.78496 4.95005ZM4.99996 6.22505C5.08363 6.20348 5.16307 6.16798 5.23496 6.12005L10.79 10.955C10.7638 11.0306 10.7502 11.11 10.75 11.19V11.225L4.54996 13.775C4.46194 13.6393 4.32644 13.5412 4.16996 13.5L4.99996 6.22505ZM10.935 11.62C11.0198 11.7179 11.1337 11.7862 11.26 11.815L11.565 14.5C11.4362 14.5671 11.3327 14.6741 11.27 14.805L4.76996 14.165L10.935 11.62ZM11.7 11.765C11.8068 11.7099 11.8967 11.6269 11.9601 11.5248C12.0235 11.4226 12.058 11.3052 12.06 11.185C12.0622 11.1306 12.0537 11.0762 12.035 11.025L15.185 8.86005L12 14.4L11.7 11.765ZM11.86 2.22505L5.28996 5.08505L5.21496 5.03505L6.04996 1.45505H6.07496C6.18268 1.45615 6.28889 1.42961 6.38342 1.37796C6.47796 1.32631 6.55768 1.25129 6.61496 1.16005L11.86 2.20505V2.22505ZM1.82996 7.69005C1.82996 7.64505 1.82996 7.60505 1.82996 7.57005L4.42496 6.04005C4.47735 6.09439 4.53812 6.13997 4.60496 6.17505L3.74996 13.43L1.60996 8.17005C1.67867 8.11029 1.73383 8.03657 1.77177 7.95379C1.80971 7.87102 1.82955 7.7811 1.82996 7.69005Z" fill="#333333"/>
<path d="M12.7446 2.84497L15.3696 7.69497C15.2665 7.81456 15.2098 7.96712 15.2096 8.12497C15.2023 8.18475 15.2023 8.24519 15.2096 8.30497L11.7696 10.66L11.6846 10.61L12.6846 2.84497H12.7446Z" fill="#DEDEDD"/>
<path d="M11.7002 11.765C11.807 11.7099 11.8969 11.6268 11.9603 11.5247C12.0237 11.4226 12.0582 11.3052 12.0602 11.185C12.0625 11.1305 12.054 11.0762 12.0352 11.025L15.1852 8.85999L12.0002 14.4L11.7002 11.765Z" fill="#B2B2B2"/>
<path d="M10.9345 11.62C11.0194 11.7179 11.1332 11.7862 11.2595 11.815L11.5645 14.5C11.4358 14.567 11.3322 14.6741 11.2695 14.805L4.76953 14.165L10.9345 11.62Z" fill="#D1D1D1"/>
<path d="M4.99992 6.225C5.08359 6.20343 5.16303 6.16793 5.23492 6.12L10.7899 10.955C10.7637 11.0306 10.7502 11.11 10.7499 11.19V11.225L4.54992 13.775C4.4619 13.6392 4.3264 13.5412 4.16992 13.5L4.99992 6.225Z" fill="#F2F2F2"/>
<path d="M1.83035 7.69004C1.83035 7.64504 1.83035 7.60504 1.83035 7.57004L4.42535 6.04004C4.47774 6.09439 4.53851 6.13997 4.60535 6.17504L3.75035 13.43L1.61035 8.17004C1.67906 8.11029 1.73422 8.03656 1.77216 7.95378C1.8101 7.87101 1.82994 7.78109 1.83035 7.69004Z" fill="#D8D8D7"/>
<path d="M4.78469 4.95C4.6319 4.97292 4.49255 5.05034 4.39238 5.16797C4.29221 5.28561 4.23798 5.4355 4.23969 5.59V5.635L1.92969 7L5.49969 1.87L4.78469 4.95Z" fill="#B2B2B2"/>
<path d="M11.8598 2.22503L5.28984 5.08503L5.21484 5.03503L6.04984 1.45503H6.07484C6.18256 1.45613 6.28877 1.42959 6.38331 1.37795C6.47785 1.3263 6.55757 1.25127 6.61484 1.16003L11.8598 2.20503V2.22503Z" fill="#D1D1D1"/>
<path d="M12 2.64502C12.0769 2.74769 12.1833 2.82445 12.305 2.86502L11.305 10.55C11.2418 10.5642 11.1811 10.5878 11.125 10.62L5.5 5.76002C5.51882 5.7054 5.5273 5.64775 5.525 5.59002C5.525 5.55002 5.525 5.50502 5.525 5.46502L12 2.64502Z" fill="white"/>
</g>
<defs>
<clipPath id="clip0_2092_1790">
<rect width="16" height="16" fill="white" transform="translate(0.5)"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

@@ -0,0 +1,15 @@
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_2092_1800)">
<mask id="mask0_2092_1800" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="0" width="17" height="16">
<path d="M16.5 0H0.5V16H16.5V0Z" fill="white"/>
</mask>
<g mask="url(#mask0_2092_1800)">
<path d="M6.63673 5.772V4.26557C6.63673 4.13867 6.68433 4.0435 6.79527 3.98013L9.8241 2.23585C10.2364 1.998 10.728 1.88706 11.2353 1.88706C13.1382 1.88706 14.3434 3.3618 14.3434 4.9316C14.3434 5.0426 14.3434 5.16947 14.3275 5.29633L11.1877 3.45687C10.9975 3.3459 10.8071 3.3459 10.6169 3.45687L6.63673 5.772ZM13.709 11.6392V8.03953C13.709 7.8175 13.6138 7.65893 13.4236 7.54793L9.44343 5.2328L10.7437 4.48747C10.8547 4.42413 10.9499 4.42413 11.0609 4.48747L14.0897 6.23177C14.9619 6.73927 15.5485 7.8175 15.5485 8.864C15.5485 10.0691 14.835 11.1793 13.709 11.6392ZM5.70117 8.46777L4.40087 7.70667C4.28993 7.64333 4.2423 7.5481 4.2423 7.42123V3.9327C4.2423 2.23602 5.5426 0.951497 7.30277 0.951497C7.96887 0.951497 8.58717 1.17355 9.1106 1.56996L5.98673 3.37773C5.7965 3.4887 5.7013 3.64723 5.7013 3.86933L5.70117 8.46777ZM8.5 10.0852L6.63673 9.03863V6.8187L8.5 5.77217L10.3631 6.8187V9.03863L8.5 10.0852ZM9.6972 14.9058C9.03113 14.9058 8.41283 14.6838 7.8894 14.2874L11.0132 12.4796C11.2035 12.3686 11.2987 12.2101 11.2987 11.988V7.3894L12.6149 8.15053C12.7258 8.21387 12.7735 8.30907 12.7735 8.43597V11.9245C12.7735 13.6212 11.4572 14.9058 9.6972 14.9058ZM5.939 11.3697L2.91018 9.62543C2.03797 9.1179 1.45133 8.0397 1.45133 6.99317C1.45133 5.77217 2.18077 4.67803 3.30657 4.21813V7.83357C3.30657 8.0556 3.40178 8.21417 3.592 8.32513L7.5564 10.6244L6.2561 11.3697C6.14517 11.433 6.04993 11.433 5.939 11.3697ZM5.76467 13.9703C3.9728 13.9703 2.6566 12.6224 2.6566 10.9574C2.6566 10.8305 2.6725 10.7036 2.68826 10.5768L5.81213 12.3845C6.00237 12.4955 6.19273 12.4955 6.38297 12.3845L10.3631 10.0853V11.5918C10.3631 11.7186 10.3155 11.8138 10.2046 11.8772L7.17577 13.6215C6.76347 13.8593 6.27203 13.9703 5.76467 13.9703ZM9.6972 15.8572C11.6159 15.8572 13.2174 14.4935 13.5823 12.6857C15.3583 12.2258 16.5 10.5608 16.5 8.86417C16.5 7.7541 16.0243 6.6759 15.168 5.89887C15.2473 5.56583 15.2949 5.2328 15.2949 4.89993C15.2949 2.6324 13.4554 0.935567 11.3305 0.935567C10.9025 0.935567 10.4902 0.99892 10.0778 1.14172C9.36417 0.443973 8.381 0 7.30277 0C5.38407 0 3.78256 1.36364 3.41771 3.17142C1.64172 3.63133 0.5 5.29633 0.5 6.993C0.5 8.10307 0.975663 9.18127 1.83198 9.9583C1.7527 10.2913 1.70511 10.6244 1.70511 10.9572C1.70511 13.2248 3.54458 14.9216 5.66947 14.9216C6.09753 14.9216 6.50983 14.8582 6.92217 14.7154C7.63567 15.4132 8.61883 15.8572 9.6972 15.8572Z" fill="white"/>
</g>
</g>
<defs>
<clipPath id="clip0_2092_1800">
<rect width="16" height="16" fill="white" transform="translate(0.5)"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@@ -0,0 +1,10 @@
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_2092_1732)">
<path d="M6.63673 5.772V4.26557C6.63673 4.13867 6.68433 4.0435 6.79527 3.98013L9.8241 2.23585C10.2364 1.998 10.728 1.88706 11.2353 1.88706C13.1382 1.88706 14.3434 3.3618 14.3434 4.9316C14.3434 5.0426 14.3434 5.16947 14.3275 5.29633L11.1877 3.45687C10.9975 3.3459 10.8071 3.3459 10.6169 3.45687L6.63673 5.772ZM13.709 11.6392V8.03953C13.709 7.8175 13.6138 7.65893 13.4236 7.54793L9.44343 5.2328L10.7437 4.48747C10.8547 4.42413 10.9499 4.42413 11.0609 4.48747L14.0897 6.23177C14.9619 6.73927 15.5485 7.8175 15.5485 8.864C15.5485 10.0691 14.835 11.1793 13.709 11.6392ZM5.70117 8.46777L4.40087 7.70667C4.28993 7.64333 4.2423 7.5481 4.2423 7.42123V3.9327C4.2423 2.23602 5.5426 0.951497 7.30277 0.951497C7.96887 0.951497 8.58717 1.17355 9.1106 1.56996L5.98673 3.37773C5.7965 3.4887 5.7013 3.64723 5.7013 3.86933L5.70117 8.46777ZM8.5 10.0852L6.63673 9.03863V6.8187L8.5 5.77217L10.3631 6.8187V9.03863L8.5 10.0852ZM9.6972 14.9058C9.03113 14.9058 8.41283 14.6838 7.8894 14.2874L11.0132 12.4796C11.2035 12.3686 11.2987 12.2101 11.2987 11.988V7.3894L12.6149 8.15053C12.7258 8.21387 12.7735 8.30907 12.7735 8.43597V11.9245C12.7735 13.6212 11.4572 14.9058 9.6972 14.9058ZM5.939 11.3697L2.91018 9.62543C2.03797 9.1179 1.45133 8.0397 1.45133 6.99317C1.45133 5.77217 2.18077 4.67803 3.30657 4.21813V7.83357C3.30657 8.0556 3.40178 8.21417 3.592 8.32513L7.5564 10.6244L6.2561 11.3697C6.14517 11.433 6.04993 11.433 5.939 11.3697ZM5.76467 13.9703C3.9728 13.9703 2.6566 12.6224 2.6566 10.9574C2.6566 10.8305 2.6725 10.7036 2.68826 10.5768L5.81213 12.3845C6.00237 12.4955 6.19273 12.4955 6.38297 12.3845L10.3631 10.0853V11.5918C10.3631 11.7186 10.3155 11.8138 10.2046 11.8772L7.17577 13.6215C6.76347 13.8593 6.27203 13.9703 5.76467 13.9703ZM9.6972 15.8572C11.6159 15.8572 13.2174 14.4935 13.5823 12.6857C15.3583 12.2258 16.5 10.5608 16.5 8.86417C16.5 7.7541 16.0243 6.6759 15.168 5.89887C15.2473 5.56583 15.2949 5.2328 15.2949 4.89993C15.2949 2.6324 13.4554 0.935567 11.3305 0.935567C10.9025 0.935567 10.4902 0.99892 10.0778 1.14172C9.36417 0.443973 8.381 0 7.30277 0C5.38407 0 3.78256 1.36364 3.41771 3.17142C1.64172 3.63133 0.5 5.29633 0.5 6.993C0.5 8.10307 0.975663 9.18127 1.83198 9.9583C1.7527 10.2913 1.70511 10.6244 1.70511 10.9572C1.70511 13.2248 3.54458 14.9216 5.66947 14.9216C6.09753 14.9216 6.50983 14.8582 6.92217 14.7154C7.63567 15.4132 8.61883 15.8572 9.6972 15.8572Z" fill="black"/>
</g>
<defs>
<clipPath id="clip0_2092_1732">
<rect width="16" height="16" fill="white" transform="translate(0.5)"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@@ -0,0 +1,74 @@
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_2092_1770)">
<mask id="mask0_2092_1770" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="0" width="17" height="16">
<path d="M16.5 0H0.5V16H16.5V0Z" fill="white"/>
</mask>
<g mask="url(#mask0_2092_1770)">
<mask id="mask1_2092_1770" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="0" width="17" height="16">
<path d="M16.5 0H0.5V16H16.5V0Z" fill="white"/>
</mask>
<g mask="url(#mask1_2092_1770)">
<path d="M16.131 10.9838L9.24712 15.124C9.02152 15.2597 8.76328 15.3313 8.5 15.3313C8.23675 15.3313 7.97846 15.2597 7.75286 15.124L0.869003 10.9838C0.640038 10.8461 0.5 10.5985 0.5 10.3313C0.5 10.0641 0.640038 9.81645 0.869003 9.67877L7.75286 5.53867C7.97846 5.40299 8.23675 5.3313 8.5 5.3313C8.76328 5.3313 9.02152 5.40299 9.24712 5.53867L16.131 9.67877C16.36 9.81645 16.5 10.0641 16.5 10.3313C16.5 10.5985 16.36 10.8461 16.131 10.9838Z" fill="url(#paint0_linear_2092_1770)"/>
<path d="M16.131 8.65256L9.24712 12.7926C9.02152 12.9283 8.76328 13 8.5 13C8.23675 13 7.97846 12.9283 7.75286 12.7926L0.869003 8.65256C0.640038 8.5148 0.5 8.2672 0.5 8C0.5 7.73282 0.640038 7.48518 0.869003 7.34746L7.75286 3.20737C7.97846 3.07168 8.23675 3 8.5 3C8.76328 3 9.02152 3.07168 9.24712 3.20737L16.131 7.34746C16.36 7.48518 16.5 7.73282 16.5 8C16.5 8.2672 16.36 8.5148 16.131 8.65256Z" fill="url(#paint1_linear_2092_1770)"/>
<path d="M16.131 6.31818L9.24712 10.4583C9.02152 10.5939 8.76328 10.6656 8.5 10.6656C8.23675 10.6656 7.97846 10.5939 7.75286 10.4583L0.869003 6.31818C0.640038 6.18046 0.5 5.93283 0.5 5.66565C0.5 5.39846 0.640038 5.15083 0.869003 5.01311L7.75286 0.873017C7.97846 0.737337 8.23675 0.665649 8.5 0.665649C8.76328 0.665649 9.02152 0.737337 9.24712 0.873017L16.131 5.01311C16.36 5.15083 16.5 5.39846 16.5 5.66565C16.5 5.93283 16.36 6.18046 16.131 6.31818Z" fill="url(#paint2_linear_2092_1770)"/>
<path d="M11.8334 7.55765C11.8334 8.29403 11.2364 8.89099 10.5 8.89099H5.83334C5.09695 8.89099 4.5 8.29403 4.5 7.55765V2.66565H11.8334V7.55765Z" fill="url(#paint3_radial_2092_1770)" fill-opacity="0.4"/>
<path d="M11.8334 7.55765C11.8334 8.29403 11.2364 8.89099 10.5 8.89099H5.83334C5.09695 8.89099 4.5 8.29403 4.5 7.55765V2.66565H11.8334V7.55765Z" fill="url(#paint4_radial_2092_1770)" fill-opacity="0.4"/>
<path d="M11.8334 7.55765C11.8334 8.29403 11.2364 8.89099 10.5 8.89099H5.83334C5.09695 8.89099 4.5 8.29403 4.5 7.55765V2.66565H11.8334V7.55765Z" fill="url(#paint5_radial_2092_1770)" fill-opacity="0.4"/>
<path d="M11.8334 7.55765C11.8334 8.29403 11.2364 8.89099 10.5 8.89099H5.83334C5.09695 8.89099 4.5 8.29403 4.5 7.55765V2.66565H11.8334V7.55765Z" fill="url(#paint6_radial_2092_1770)" fill-opacity="0.4"/>
<path d="M11.8334 7.55765C11.8334 8.29403 11.2364 8.89099 10.5 8.89099H5.83334C5.09695 8.89099 4.5 8.29403 4.5 7.55765V2.66565H11.8334V7.55765Z" fill="url(#paint7_radial_2092_1770)" fill-opacity="0.4"/>
<path d="M11.8334 7.55765C11.8334 8.29403 11.2364 8.89099 10.5 8.89099H5.83334C5.09695 8.89099 4.5 8.29403 4.5 7.55765V2.66565H11.8334V7.55765Z" fill="url(#paint8_radial_2092_1770)" fill-opacity="0.4"/>
<path d="M8.01858 3.31028L7.76982 2.80011C7.749 2.7608 7.7104 2.72675 7.65934 2.70267C7.60826 2.67859 7.54725 2.66565 7.48468 2.66565C7.42214 2.66565 7.36112 2.67859 7.31005 2.70267C7.25898 2.72675 7.22038 2.7608 7.19957 2.80011L6.9508 3.31028C6.87498 3.46428 6.74675 3.60454 6.57612 3.72002C6.40548 3.83551 6.19708 3.92314 5.9672 3.97603L5.20177 4.14185C5.14277 4.15571 5.09168 4.18143 5.05555 4.21548C5.0194 4.24951 5 4.29019 5 4.33188C5 4.37357 5.0194 4.41423 5.05555 4.44828C5.09168 4.48231 5.14277 4.50803 5.20177 4.52191L5.9672 4.68771C6.16372 4.73139 6.34502 4.80035 6.501 4.89045C6.53005 4.90723 6.55823 4.92475 6.58548 4.94297C6.72874 5.03882 6.84258 5.152 6.92118 5.27615C6.93774 5.30231 6.95274 5.32895 6.9661 5.35602L7.21486 5.86619C7.23363 5.90162 7.26685 5.93279 7.31062 5.95622C7.3154 5.95879 7.32032 5.96127 7.32535 5.96363C7.37642 5.98771 7.43743 6.00065 7.5 6.00065C7.56257 6.00065 7.62358 5.98771 7.67465 5.96363C7.72572 5.93955 7.76432 5.9055 7.78514 5.86619L8.0339 5.35602C8.11125 5.20091 8.24182 5.05999 8.41522 4.94442C8.58864 4.82885 8.80008 4.74182 9.0328 4.69027L9.79824 4.52447C9.8572 4.51059 9.90832 4.48487 9.94448 4.45083C9.98056 4.41679 10 4.37611 10 4.33443C10 4.29274 9.98056 4.25207 9.94448 4.21803C9.90832 4.18399 9.8572 4.15827 9.79824 4.1444L9.78296 4.14185L9.01752 3.97603C8.7848 3.92448 8.57328 3.83747 8.39992 3.72188C8.22652 3.60631 8.09595 3.46539 8.01858 3.31028Z" fill="url(#paint9_linear_2092_1770)"/>
<path d="M11.0775 6.78623L11.5368 6.88572L11.546 6.88725C11.5813 6.89557 11.612 6.911 11.6336 6.93143C11.6553 6.95185 11.667 6.97625 11.667 7.00126C11.667 7.02628 11.6553 7.05068 11.6336 7.0711C11.612 7.09154 11.5813 7.10697 11.546 7.11528L11.0867 7.21477C10.947 7.2457 10.8202 7.29792 10.7161 7.36726C10.6121 7.4366 10.5337 7.52117 10.4873 7.61422L10.338 7.92032C10.3256 7.94392 10.3024 7.96434 10.2718 7.97878C10.2412 7.99323 10.2045 8.00104 10.167 8.00104C10.1295 8.00104 10.0928 7.99323 10.0622 7.97878C10.0316 7.96434 10.0084 7.94392 9.99587 7.92032L9.99539 7.91937L9.84667 7.61422C9.80051 7.52088 9.72235 7.43602 9.61827 7.3664C9.51419 7.29677 9.38715 7.24434 9.24731 7.21323L8.78803 7.11375C8.75267 7.10543 8.72195 7.09 8.70035 7.06958C8.67859 7.04915 8.66699 7.02475 8.66699 6.99974C8.66699 6.97472 8.67859 6.95032 8.70035 6.9299C8.72195 6.90946 8.75267 6.89403 8.78803 6.88572L9.24731 6.78623C9.38523 6.7545 9.51027 6.70192 9.61267 6.63262C9.71499 6.56334 9.79195 6.47918 9.83747 6.38678L9.98675 6.08068C9.99923 6.05708 10.0224 6.03666 10.053 6.02222C10.0836 6.00777 10.1203 6 10.1578 6C10.1953 6 10.232 6.00777 10.2626 6.02222C10.2932 6.03666 10.3164 6.05708 10.3288 6.08068L10.4781 6.38678C10.5245 6.47983 10.6029 6.5644 10.7069 6.63375C10.811 6.70308 10.9379 6.7553 11.0775 6.78623Z" fill="url(#paint10_linear_2092_1770)"/>
</g>
</g>
</g>
<defs>
<linearGradient id="paint0_linear_2092_1770" x1="0.5" y1="5.3313" x2="9.4888" y2="19.7133" gradientUnits="userSpaceOnUse">
<stop stop-color="#004695"/>
<stop offset="1" stop-color="#0078D4"/>
</linearGradient>
<linearGradient id="paint1_linear_2092_1770" x1="0.5" y1="3" x2="9.4888" y2="17.382" gradientUnits="userSpaceOnUse">
<stop stop-color="#0078D4"/>
<stop offset="1" stop-color="#0FAFFF"/>
</linearGradient>
<linearGradient id="paint2_linear_2092_1770" x1="0.9" y1="0.66565" x2="9.8888" y2="15.0477" gradientUnits="userSpaceOnUse">
<stop stop-color="#3BD5FF"/>
<stop offset="1" stop-color="#0FAFFF"/>
</linearGradient>
<radialGradient id="paint3_radial_2092_1770" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(7.5 5.33231) rotate(90) scale(1 0.97124)">
<stop stop-color="#00204D"/>
<stop offset="1" stop-color="#00204D" stop-opacity="0"/>
</radialGradient>
<radialGradient id="paint4_radial_2092_1770" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(8.5 4.99899) rotate(-14.0362) scale(1.37437 0.380635)">
<stop stop-color="#00204D"/>
<stop offset="1" stop-color="#00204D" stop-opacity="0"/>
</radialGradient>
<radialGradient id="paint5_radial_2092_1770" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(6.5 4.99899) rotate(-165.964) scale(1.37437 0.384775)">
<stop stop-color="#00204D"/>
<stop offset="1" stop-color="#00204D" stop-opacity="0"/>
</radialGradient>
<radialGradient id="paint6_radial_2092_1770" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(9.5 7.33231) rotate(-153.435) scale(0.745357 0.359002)">
<stop stop-color="#00204D"/>
<stop offset="1" stop-color="#00204D" stop-opacity="0"/>
</radialGradient>
<radialGradient id="paint7_radial_2092_1770" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(10.8334 7.33231) rotate(-26.565) scale(0.745357 0.290223)">
<stop stop-color="#00204D"/>
<stop offset="1" stop-color="#00204D" stop-opacity="0"/>
</radialGradient>
<radialGradient id="paint8_radial_2092_1770" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(10.1666 7.66565) rotate(90) scale(0.666666 0.627526)">
<stop offset="0.0638343" stop-color="#00204D"/>
<stop offset="1" stop-color="#00204D" stop-opacity="0"/>
</radialGradient>
<linearGradient id="paint9_linear_2092_1770" x1="6.43217" y1="3.09882" x2="8.32475" y2="8.55931" gradientUnits="userSpaceOnUse">
<stop stop-color="white"/>
<stop offset="1" stop-color="#DFFAFF"/>
</linearGradient>
<linearGradient id="paint10_linear_2092_1770" x1="6.43248" y1="3.09983" x2="8.32506" y2="8.56032" gradientUnits="userSpaceOnUse">
<stop stop-color="white"/>
<stop offset="1" stop-color="#DFFAFF"/>
</linearGradient>
<clipPath id="clip0_2092_1770">
<rect width="16" height="16" fill="white" transform="translate(0.5)"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 8.7 KiB

View File

@@ -0,0 +1,30 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using Microsoft.PowerToys.Settings.UI.Library;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Data;
using Microsoft.UI.Xaml.Media.Imaging;
namespace Microsoft.PowerToys.Settings.UI.Converters;
public partial class ServiceTypeToIconConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language)
{
if (value is not string serviceType || string.IsNullOrWhiteSpace(serviceType))
{
return new ImageIcon { Source = new SvgImageSource(new Uri(AIServiceTypeRegistry.GetIconPath(AIServiceType.OpenAI))) };
}
var iconPath = AIServiceTypeRegistry.GetIconPath(serviceType);
return new ImageIcon { Source = new SvgImageSource(new Uri(iconPath)) };
}
public object ConvertBack(object value, Type targetType, object parameter, string language)
{
throw new NotImplementedException();
}
}

View File

@@ -20,6 +20,12 @@
<ProjectPriFileName>PowerToys.Settings.pri</ProjectPriFileName>
</PropertyGroup>
<ItemGroup>
<None Remove="Assets\Settings\Icons\Models\Azure.svg" />
<None Remove="Assets\Settings\Icons\Models\FoundryLocal.svg" />
<None Remove="Assets\Settings\Icons\Models\Onnx.svg" />
<None Remove="Assets\Settings\Icons\Models\OpenAI.dark.svg" />
<None Remove="Assets\Settings\Icons\Models\OpenAI.light.svg" />
<None Remove="Assets\Settings\Icons\Models\WindowsML.svg" />
<None Remove="Assets\Settings\Modules\APDialog.dark.png" />
<None Remove="Assets\Settings\Modules\APDialog.light.png" />
<None Remove="Assets\Settings\Modules\LightSwitch.png" />
@@ -53,6 +59,13 @@
<Content Include="Assets\Settings\Wide310x150Logo.scale-200.png" />
</ItemGroup>
<ItemGroup>
<!-- AI Model Provider Icons - SVG files -->
<Content Include="Assets\Settings\Icons\Models\*.svg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Images\MouseJump-Desktop.png" />
</ItemGroup>
@@ -105,6 +118,7 @@
<ProjectReference Include="..\..\modules\ZoomIt\ZoomItSettingsInterop\ZoomItSettingsInterop.vcxproj" />
<ProjectReference Include="..\..\common\ManagedCommon\ManagedCommon.csproj" />
<ProjectReference Include="..\..\common\ManagedTelemetry\Telemetry\ManagedTelemetry.csproj" />
<ProjectReference Include="..\..\common\LanguageModelProvider\LanguageModelProvider.csproj" />
<ProjectReference Include="..\..\modules\MouseUtils\MouseJump.Common\MouseJump.Common.csproj" />
<ProjectReference Include="..\Settings.UI.Library\Settings.UI.Library.csproj" />
</ItemGroup>
@@ -197,4 +211,4 @@
<Message Importance="high" Text="[Settings] Building XamlIndexBuilder prior to compile. Views='$(MSBuildProjectDirectory)\SettingsXAML\Views' Out='$(GeneratedJsonFile)'" />
<MSBuild Projects="..\Settings.UI.XamlIndexBuilder\Settings.UI.XamlIndexBuilder.csproj" Targets="Build" Properties="Configuration=$(Configuration);Platform=Any CPU;TargetFramework=net9.0;XamlViewsDir=$(MSBuildProjectDirectory)\SettingsXAML\Views;GeneratedJsonFile=$(GeneratedJsonFile)" />
</Target>
</Project>
</Project>

View File

@@ -0,0 +1,192 @@
<?xml version="1.0" encoding="utf-8" ?>
<UserControl
x:Class="Microsoft.PowerToys.Settings.UI.Controls.FoundryLocalModelPicker"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Controls"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:models="using:LanguageModelProvider"
xmlns:tkconverters="using:CommunityToolkit.WinUI.Converters"
xmlns:toolkit="using:CommunityToolkit.WinUI.Controls"
x:Name="Root"
mc:Ignorable="d">
<UserControl.Resources>
<tkconverters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
<Style x:Key="TagBorderStyle" TargetType="Border">
<Setter Property="Background" Value="{ThemeResource LayerFillColorDefaultBrush}" />
<Setter Property="BorderBrush" Value="{ThemeResource ControlStrongStrokeColorDefaultBrush}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="CornerRadius" Value="8" />
<Setter Property="Padding" Value="8,2" />
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
<Style x:Key="TagTextStyle" TargetType="TextBlock">
<Setter Property="FontSize" Value="12" />
<Setter Property="Foreground" Value="{ThemeResource TextFillColorPrimaryBrush}" />
<Setter Property="TextWrapping" Value="NoWrap" />
</Style>
</UserControl.Resources>
<Grid>
<StackPanel
x:Name="LoadingPanel"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Spacing="12">
<ProgressRing
x:Name="LoadingIndicator"
Width="36"
Height="36"
HorizontalAlignment="Center" />
<TextBlock
x:Name="LoadingStatusTextBlock"
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
Text="Loading Foundry Local status..."
TextAlignment="Center"
TextWrapping="Wrap" />
</StackPanel>
<ScrollViewer x:Name="ModelsView" Visibility="Collapsed">
<Grid Padding="0,12,0,16">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<StackPanel
x:Name="NoModelsPanel"
Grid.Row="0"
Margin="0,0,0,16"
HorizontalAlignment="Center"
Orientation="Vertical"
Spacing="4">
<FontIcon FontSize="24" Glyph="&#xE74E;" />
<TextBlock
HorizontalAlignment="Center"
Style="{StaticResource BodyStrongTextBlockStyle}"
Text="No models downloaded"
TextAlignment="Center" />
<TextBlock
HorizontalAlignment="Center"
FontSize="12"
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
Text="Run Foundry Local to download or add a local model below."
TextAlignment="Center"
TextWrapping="Wrap" />
<Button
x:Name="LaunchFoundryModelListButton"
HorizontalAlignment="Center"
Click="LaunchFoundryModelListButton_Click"
Content="Open Foundry model list"
Style="{StaticResource AccentButtonStyle}" />
</StackPanel>
<StackPanel Grid.Row="1" Spacing="12">
<Grid ColumnSpacing="4">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<ComboBox
x:Name="CachedModelsComboBox"
Grid.Column="0"
HorizontalAlignment="Stretch"
DisplayMemberPath="Name"
ItemsSource="{x:Bind CachedModels, Mode=OneWay}"
SelectedItem="{x:Bind SelectedModel, Mode=TwoWay}"
SelectionChanged="CachedModelsComboBox_SelectionChanged">
<ComboBox.Header>
<TextBlock>
<Run Text="Foundry Local model" /><LineBreak /><Run
FontSize="12"
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
Text="Use the Foundry Local CLI to download models that run locally on-device. They'll appear here." />
</TextBlock>
</ComboBox.Header>
</ComboBox>
<Button
x:Name="RefreshModelsButton"
Grid.Column="1"
MinHeight="32"
VerticalAlignment="Bottom"
Click="RefreshModelsButton_Click"
Style="{StaticResource SubtleButtonStyle}"
ToolTipService.ToolTip="Refresh model list">
<FontIcon FontSize="16" Glyph="&#xE72C;" />
</Button>
</Grid>
<StackPanel
x:Name="SelectedModelDetailsPanel"
Spacing="8"
Visibility="Collapsed">
<TextBlock
x:Name="SelectedModelDescriptionText"
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
TextWrapping="Wrap" />
<toolkit:WrapPanel
x:Name="SelectedModelTagsPanel"
HorizontalSpacing="4"
VerticalSpacing="4"
Visibility="Collapsed" />
</StackPanel>
</StackPanel>
</Grid>
</ScrollViewer>
<Grid x:Name="NotAvailableGrid" Visibility="Collapsed">
<StackPanel
Margin="48,0,48,48"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Orientation="Vertical"
Spacing="8">
<Image Width="36" Source="ms-appx:///Assets/Settings/Icons/Models/FoundryLocal.svg" />
<TextBlock
FontWeight="SemiBold"
Text="Foundry Local is not available on this device yet."
TextAlignment="Center"
TextWrapping="Wrap" />
<TextBlock
FontSize="12"
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
IsTextSelectionEnabled="True"
TextAlignment="Center"
TextWrapping="Wrap">
<Run Text="Start the Foundry Local service before returning to PowerToys." />
</TextBlock>
<HyperlinkButton Content="Follow the Foundry Local CLI guide" NavigateUri="https://learn.microsoft.com/en-us/azure/ai-foundry/foundry-local/get-started" />
<TextBlock
x:Uid="FoundryLocal_RestartRequiredNote"
FontSize="12"
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
Text="Note: After installing the Foundry Local CLI, restart PowerToys to use it."
TextAlignment="Center"
TextWrapping="Wrap" />
</StackPanel>
</Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="StateGroup">
<VisualState x:Name="ShowLoading" />
<VisualState x:Name="ShowModels">
<VisualState.Setters>
<Setter Target="LoadingPanel.Visibility" Value="Collapsed" />
<Setter Target="NotAvailableGrid.Visibility" Value="Collapsed" />
<Setter Target="ModelsView.Visibility" Value="Visible" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="ShowNotAvailable">
<VisualState.Setters>
<Setter Target="LoadingPanel.Visibility" Value="Collapsed" />
<Setter Target="NotAvailableGrid.Visibility" Value="Visible" />
<Setter Target="ModelsView.Visibility" Value="Collapsed" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</Grid>
</UserControl>

View File

@@ -0,0 +1,457 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Diagnostics;
using System.Linq;
using LanguageModelProvider;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
namespace Microsoft.PowerToys.Settings.UI.Controls;
public sealed partial class FoundryLocalModelPicker : UserControl
{
private INotifyCollectionChanged _cachedModelsSubscription;
private INotifyCollectionChanged _downloadableModelsSubscription;
private bool _suppressSelection;
public FoundryLocalModelPicker()
{
InitializeComponent();
Loaded += (_, _) => UpdateVisualStates();
}
public delegate void ModelSelectionChangedEventHandler(object sender, ModelDetails model);
public delegate void DownloadRequestedEventHandler(object sender, object payload);
public delegate void LoadRequestedEventHandler(object sender, FoundryLoadRequestedEventArgs args);
public event ModelSelectionChangedEventHandler SelectionChanged;
public event LoadRequestedEventHandler LoadRequested;
public IEnumerable<ModelDetails> CachedModels
{
get => (IEnumerable<ModelDetails>)GetValue(CachedModelsProperty);
set => SetValue(CachedModelsProperty, value);
}
public static readonly DependencyProperty CachedModelsProperty =
DependencyProperty.Register(nameof(CachedModels), typeof(IEnumerable<ModelDetails>), typeof(FoundryLocalModelPicker), new PropertyMetadata(null, OnCachedModelsChanged));
public IEnumerable DownloadableModels
{
get => (IEnumerable)GetValue(DownloadableModelsProperty);
set => SetValue(DownloadableModelsProperty, value);
}
public static readonly DependencyProperty DownloadableModelsProperty =
DependencyProperty.Register(nameof(DownloadableModels), typeof(IEnumerable), typeof(FoundryLocalModelPicker), new PropertyMetadata(null, OnDownloadableModelsChanged));
public ModelDetails SelectedModel
{
get => (ModelDetails)GetValue(SelectedModelProperty);
set => SetValue(SelectedModelProperty, value);
}
public static readonly DependencyProperty SelectedModelProperty =
DependencyProperty.Register(nameof(SelectedModel), typeof(ModelDetails), typeof(FoundryLocalModelPicker), new PropertyMetadata(null, OnSelectedModelChanged));
public bool IsLoading
{
get => (bool)GetValue(IsLoadingProperty);
set => SetValue(IsLoadingProperty, value);
}
public static readonly DependencyProperty IsLoadingProperty =
DependencyProperty.Register(nameof(IsLoading), typeof(bool), typeof(FoundryLocalModelPicker), new PropertyMetadata(false, OnStatePropertyChanged));
public bool IsAvailable
{
get => (bool)GetValue(IsAvailableProperty);
set => SetValue(IsAvailableProperty, value);
}
public static readonly DependencyProperty IsAvailableProperty =
DependencyProperty.Register(nameof(IsAvailable), typeof(bool), typeof(FoundryLocalModelPicker), new PropertyMetadata(false, OnStatePropertyChanged));
public string StatusText
{
get => (string)GetValue(StatusTextProperty);
set => SetValue(StatusTextProperty, value);
}
public static readonly DependencyProperty StatusTextProperty =
DependencyProperty.Register(nameof(StatusText), typeof(string), typeof(FoundryLocalModelPicker), new PropertyMetadata(string.Empty, OnStatePropertyChanged));
public bool HasCachedModels => CachedModels?.Any() ?? false;
public bool HasDownloadableModels => DownloadableModels?.Cast<object>().Any() ?? false;
public void RequestLoad(bool refresh)
{
if (IsLoading)
{
// Allow refresh requests to continue even if already loading by cancelling via host.
}
else
{
IsLoading = true;
}
IsAvailable = false;
StatusText = "Loading Foundry Local status...";
LoadRequested?.Invoke(this, new FoundryLoadRequestedEventArgs(refresh));
}
private static void OnCachedModelsChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var control = (FoundryLocalModelPicker)d;
control.SubscribeToCachedModels(e.OldValue as IEnumerable<ModelDetails>, e.NewValue as IEnumerable<ModelDetails>);
control.UpdateVisualStates();
}
private static void OnDownloadableModelsChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var control = (FoundryLocalModelPicker)d;
control.SubscribeToDownloadableModels(e.OldValue as IEnumerable, e.NewValue as IEnumerable);
control.UpdateVisualStates();
}
private static void OnSelectedModelChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var control = (FoundryLocalModelPicker)d;
if (control._suppressSelection)
{
return;
}
try
{
control._suppressSelection = true;
if (control.CachedModelsComboBox is not null)
{
control.CachedModelsComboBox.SelectedItem = e.NewValue;
}
}
finally
{
control._suppressSelection = false;
}
control.UpdateSelectedModelDetails();
}
private static void OnStatePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var control = (FoundryLocalModelPicker)d;
control.UpdateVisualStates();
}
private void SubscribeToCachedModels(IEnumerable<ModelDetails> oldValue, IEnumerable<ModelDetails> newValue)
{
if (_cachedModelsSubscription is not null)
{
_cachedModelsSubscription.CollectionChanged -= CachedModels_CollectionChanged;
_cachedModelsSubscription = null;
}
if (newValue is INotifyCollectionChanged observable)
{
observable.CollectionChanged += CachedModels_CollectionChanged;
_cachedModelsSubscription = observable;
}
}
private void SubscribeToDownloadableModels(IEnumerable oldValue, IEnumerable newValue)
{
if (_downloadableModelsSubscription is not null)
{
_downloadableModelsSubscription.CollectionChanged -= DownloadableModels_CollectionChanged;
_downloadableModelsSubscription = null;
}
if (newValue is INotifyCollectionChanged observable)
{
observable.CollectionChanged += DownloadableModels_CollectionChanged;
_downloadableModelsSubscription = observable;
}
}
private void CachedModels_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
{
UpdateVisualStates();
}
private void DownloadableModels_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
{
UpdateVisualStates();
}
private void CachedModelsComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (_suppressSelection)
{
return;
}
try
{
_suppressSelection = true;
var selected = CachedModelsComboBox.SelectedItem as ModelDetails;
SetValue(SelectedModelProperty, selected);
SelectionChanged?.Invoke(this, selected);
}
finally
{
_suppressSelection = false;
}
UpdateSelectedModelDetails();
}
private void UpdateSelectedModelDetails()
{
if (SelectedModelDetailsPanel is null || SelectedModelDescriptionText is null || SelectedModelTagsPanel is null)
{
return;
}
if (!HasCachedModels || SelectedModel is not ModelDetails model)
{
SelectedModelDetailsPanel.Visibility = Visibility.Collapsed;
SelectedModelDescriptionText.Text = string.Empty;
SelectedModelTagsPanel.Children.Clear();
SelectedModelTagsPanel.Visibility = Visibility.Collapsed;
return;
}
SelectedModelDetailsPanel.Visibility = Visibility.Visible;
SelectedModelDescriptionText.Text = string.IsNullOrWhiteSpace(model.Description)
? "No description provided."
: model.Description;
SelectedModelTagsPanel.Children.Clear();
AddTag(GetModelSizeText(model.Size));
AddTag(GetLicenseShortText(model.License), model.License);
foreach (var deviceTag in GetDeviceTags(model.HardwareAccelerators))
{
AddTag(deviceTag);
}
SelectedModelTagsPanel.Visibility = SelectedModelTagsPanel.Children.Count > 0 ? Visibility.Visible : Visibility.Collapsed;
void AddTag(string text, string tooltip = null)
{
if (string.IsNullOrWhiteSpace(text) || SelectedModelTagsPanel is null)
{
return;
}
Border tag = new();
if (Resources.TryGetValue("TagBorderStyle", out var borderStyleObj) && borderStyleObj is Style borderStyle)
{
tag.Style = borderStyle;
}
TextBlock label = new()
{
Text = text,
};
if (Resources.TryGetValue("TagTextStyle", out var textStyleObj) && textStyleObj is Style textStyle)
{
label.Style = textStyle;
}
tag.Child = label;
if (!string.IsNullOrWhiteSpace(tooltip))
{
ToolTipService.SetToolTip(tag, new TextBlock
{
Text = tooltip,
TextWrapping = TextWrapping.Wrap,
});
}
SelectedModelTagsPanel.Children.Add(tag);
}
}
private void LaunchFoundryModelListButton_Click(object sender, RoutedEventArgs e)
{
try
{
ProcessStartInfo processInfo = new()
{
FileName = "powershell.exe",
Arguments = "-NoExit -Command \"foundry model list\"",
UseShellExecute = true,
};
Process.Start(processInfo);
StatusText = "Opening PowerShell and running 'foundry model list'...";
}
catch (Exception ex)
{
StatusText = $"Unable to start PowerShell. {ex.Message}";
Debug.WriteLine($"[FoundryLocalModelPicker] Failed to run 'foundry model list': {ex}");
}
}
private void RefreshModelsButton_Click(object sender, RoutedEventArgs e)
{
RequestLoad(refresh: true);
}
private void UpdateVisualStates()
{
LoadingIndicator.IsActive = IsLoading;
if (IsLoading)
{
VisualStateManager.GoToState(this, "ShowLoading", true);
}
else if (!IsAvailable)
{
VisualStateManager.GoToState(this, "ShowNotAvailable", true);
}
else
{
VisualStateManager.GoToState(this, "ShowModels", true);
}
if (LoadingStatusTextBlock is not null)
{
LoadingStatusTextBlock.Text = string.IsNullOrWhiteSpace(StatusText)
? "Loading Foundry Local status..."
: StatusText;
}
NoModelsPanel.Visibility = HasCachedModels ? Visibility.Collapsed : Visibility.Visible;
if (CachedModelsComboBox is not null)
{
CachedModelsComboBox.Visibility = HasCachedModels ? Visibility.Visible : Visibility.Collapsed;
CachedModelsComboBox.IsEnabled = HasCachedModels;
}
UpdateSelectedModelDetails();
Bindings.Update();
}
public static string GetModelSizeText(long size)
{
if (size <= 0)
{
return string.Empty;
}
const long kiloByte = 1024;
const long megaByte = kiloByte * 1024;
const long gigaByte = megaByte * 1024;
if (size >= gigaByte)
{
return $"{size / (double)gigaByte:0.##} GB";
}
if (size >= megaByte)
{
return $"{size / (double)megaByte:0.##} MB";
}
if (size >= kiloByte)
{
return $"{size / (double)kiloByte:0.##} KB";
}
return $"{size} B";
}
public static Visibility GetModelSizeVisibility(long size)
{
return size > 0 ? Visibility.Visible : Visibility.Collapsed;
}
public static IEnumerable<string> GetDeviceTags(IReadOnlyCollection<HardwareAccelerator> accelerators)
{
if (accelerators is null || accelerators.Count == 0)
{
return Array.Empty<string>();
}
HashSet<string> tags = new(StringComparer.OrdinalIgnoreCase);
foreach (var accelerator in accelerators)
{
switch (accelerator)
{
case HardwareAccelerator.CPU:
tags.Add("CPU");
break;
case HardwareAccelerator.GPU:
case HardwareAccelerator.DML:
tags.Add("GPU");
break;
case HardwareAccelerator.NPU:
case HardwareAccelerator.QNN:
tags.Add("NPU");
break;
}
}
return tags.Count > 0 ? tags.ToArray() : Array.Empty<string>();
}
public static Visibility GetDeviceVisibility(IReadOnlyCollection<HardwareAccelerator> accelerators)
{
return GetDeviceTags(accelerators).Any() ? Visibility.Visible : Visibility.Collapsed;
}
public static string GetLicenseShortText(string license)
{
if (string.IsNullOrWhiteSpace(license))
{
return string.Empty;
}
var trimmed = license.Trim();
int separatorIndex = trimmed.IndexOfAny(['(', '[', ':']);
if (separatorIndex > 0)
{
trimmed = trimmed[..separatorIndex].Trim();
}
if (trimmed.Length > 24)
{
trimmed = $"{trimmed[..24].TrimEnd()}…";
}
return trimmed;
}
public static Visibility GetLicenseVisibility(string license)
{
return string.IsNullOrWhiteSpace(license) ? Visibility.Collapsed : Visibility.Visible;
}
public sealed class FoundryLoadRequestedEventArgs : EventArgs
{
public FoundryLoadRequestedEventArgs(bool refresh)
{
Refresh = refresh;
}
public bool Refresh { get; }
}
}

View File

@@ -3,28 +3,43 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
xmlns:converters="using:Microsoft.PowerToys.Settings.UI.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Helpers"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:models="using:Microsoft.PowerToys.Settings.UI.Library"
xmlns:tkcontrols="using:CommunityToolkit.WinUI.Controls"
xmlns:ui="using:CommunityToolkit.WinUI"
xmlns:viewmodels="using:Microsoft.PowerToys.Settings.UI.ViewModels"
x:Name="RootPage"
AutomationProperties.LandmarkType="Main"
mc:Ignorable="d">
<local:NavigablePage.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="ms-appx:///CommunityToolkit.WinUI.Controls.SettingsControls/SettingsExpander/SettingsExpander.xaml" />
</ResourceDictionary.MergedDictionaries>
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Default">
<ImageSource x:Key="DialogHeaderImage">ms-appx:///Assets/Settings/Modules/APDialog.dark.png</ImageSource>
<ImageSource x:Key="OpenAIIconImage">ms-appx:///Assets/Settings/Icons/Models/OpenAI.dark.svg</ImageSource>
</ResourceDictionary>
<ResourceDictionary x:Key="Light">
<ImageSource x:Key="DialogHeaderImage">ms-appx:///Assets/Settings/Modules/APDialog.light.png</ImageSource>
<ImageSource x:Key="OpenAIIconImage">ms-appx:///Assets/Settings/Icons/Models/OpenAI.light.svg</ImageSource>
</ResourceDictionary>
<ResourceDictionary x:Key="HighContrast">
<ImageSource x:Key="DialogHeaderImage">ms-appx:///Assets/Settings/Modules/APDialog.light.png</ImageSource>
<ImageSource x:Key="OpenAIIconImage">ms-appx:///Assets/Settings/Icons/Models/OpenAI.light.svg</ImageSource>
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
<Style x:Key="MenuFlyoutItemHeaderStyle" TargetType="MenuFlyoutItem">
<Setter Property="FontSize" Value="12" />
<Setter Property="IsEnabled" Value="False" />
<Setter Property="IsHitTestVisible" Value="False" />
</Style>
<converters:ServiceTypeToIconConverter x:Key="ServiceTypeToIconConverter" />
<DataTemplate x:Key="AdditionalActionTemplate" x:DataType="models:AdvancedPasteAdditionalAction">
<StackPanel Orientation="Horizontal" Spacing="4">
<controls:ShortcutControl
@@ -65,171 +80,144 @@
<FontIconSource FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE72E;" />
</InfoBar.IconSource>
</InfoBar>
<tkcontrols:SettingsCard
<!-- Paste with AI -->
<tkcontrols:SettingsExpander
Name="AdvancedPasteEnableAISettingsCard"
x:Uid="AdvancedPaste_EnableAISettingsCard"
IsEnabled="{x:Bind ViewModel.IsOnlineAIModelsDisallowedByGPO, Mode=OneWay, Converter={StaticResource BoolNegationConverter}}">
<tkcontrols:SettingsCard.HeaderIcon>
IsEnabled="{x:Bind ViewModel.IsOnlineAIModelsDisallowedByGPO, Mode=OneWay, Converter={StaticResource BoolNegationConverter}}"
IsExpanded="{x:Bind ViewModel.IsAIEnabled, Mode=OneWay}"
ItemsSource="{x:Bind ViewModel.PasteAIConfiguration.Providers, Mode=OneWay}">
<tkcontrols:SettingsExpander.HeaderIcon>
<PathIcon Data="M128 766q0-42 24-77t65-48l178-57q32-11 61-30t52-42q50-50 71-114l58-179q13-40 48-65t78-26q42 0 77 24t50 65l58 177q21 66 72 117 49 50 117 72l176 58q43 14 69 48t26 80q0 41-25 76t-64 49l-178 58q-66 21-117 72-32 32-51 73t-33 84-26 83-30 73-45 51-71 20q-42 0-77-24t-49-65l-58-178q-8-25-19-47t-28-43q-34-43-77-68t-89-41-89-27-78-29-55-45-21-75zm1149 7q-76-29-145-53t-129-60-104-88-73-138l-57-176-67 176q-18 48-42 89t-60 78q-34 34-76 61t-89 43l-177 57q75 29 144 53t127 60 103 89 73 137l57 176 67-176q37-97 103-168t168-103l177-57zm-125 759q0-31 20-57t49-36l99-32q34-11 53-34t30-51 20-59 20-54 33-41 58-16q32 0 59 19t38 50q6 20 11 40t13 40 17 38 25 34q16 17 39 26t48 18 49 16 44 20 31 32 12 50q0 33-18 60t-51 38q-19 6-39 11t-41 13-39 17-34 25q-24 25-35 62t-24 73-35 61-68 25q-32 0-59-19t-38-50q-6-18-11-39t-13-41-17-40-24-33q-18-17-41-27t-47-17-49-15-43-20-30-33-12-54zm583 4q-43-13-74-30t-55-41-40-55-32-74q-12 41-29 72t-42 55-55 42-71 31q81 23 128 71t71 129q15-43 31-74t40-54 53-40 75-32z" />
</tkcontrols:SettingsCard.HeaderIcon>
<tkcontrols:SwitchPresenter TargetType="x:Boolean" Value="{x:Bind ViewModel.IsOpenAIEnabled, Mode=OneWay}">
<tkcontrols:Case Value="True">
<Button x:Uid="AdvancedPaste_DisableAIButton" Click="AdvancedPaste_DisableAIButton_Click" />
</tkcontrols:Case>
<tkcontrols:Case Value="False">
<Button
x:Uid="AdvancedPaste_EnableAIButton"
Click="AdvancedPaste_EnableAIButton_Click"
Style="{StaticResource AccentButtonStyle}" />
</tkcontrols:Case>
</tkcontrols:SwitchPresenter>
<tkcontrols:SettingsCard.Description>
</tkcontrols:SettingsExpander.HeaderIcon>
<ToggleSwitch
x:Name="AdvancedPaste_EnableAIToggle"
x:Uid="AdvancedPaste_EnableAIToggle"
IsOn="{x:Bind ViewModel.IsAIEnabled, Mode=OneWay}"
Toggled="AdvancedPaste_EnableAIToggle_Toggled" />
<tkcontrols:SettingsExpander.Description>
<StackPanel Orientation="Vertical">
<TextBlock x:Uid="AdvancedPaste_EnableAISettingsCardDescription" />
<HyperlinkButton x:Uid="AdvancedPaste_EnableAISettingsCardDescriptionLearnMore" NavigateUri="https://learn.microsoft.com/windows/powertoys/advanced-paste" />
</StackPanel>
</tkcontrols:SettingsCard.Description>
</tkcontrols:SettingsCard>
<tkcontrols:SettingsCard
Name="AdvancedPasteEnableAdvancedAI"
x:Uid="AdvancedPaste_EnableAdvancedAI"
HeaderIcon="{ui:BitmapIcon Source=/Assets/Settings/Icons/SemanticKernel.png}"
IsEnabled="{x:Bind ViewModel.IsOpenAIEnabled, Mode=OneWay}">
<ToggleSwitch IsOn="{x:Bind ViewModel.IsAdvancedAIEnabled, Mode=TwoWay}" />
</tkcontrols:SettingsCard>
</tkcontrols:SettingsExpander.Description>
<tkcontrols:SettingsExpander.ItemsHeader>
<tkcontrols:SettingsCard
Description="Add online or local models"
Header="Model providers"
Style="{StaticResource DefaultSettingsExpanderItemStyle}">
<Button Content="Add model" Style="{StaticResource AccentButtonStyle}">
<Button.Flyout>
<MenuFlyout x:Name="AddProviderMenuFlyout" Opening="AddProviderMenuFlyout_Opening" />
</Button.Flyout>
</Button>
</tkcontrols:SettingsCard>
</tkcontrols:SettingsExpander.ItemsHeader>
<tkcontrols:SettingsExpander.ItemTemplate>
<DataTemplate x:DataType="models:PasteAIProviderDefinition">
<tkcontrols:SettingsCard
Description="{x:Bind ServiceType, Mode=OneWay}"
Header="{x:Bind ModelName, Mode=OneWay}"
HeaderIcon="{x:Bind ServiceType, Mode=OneWay, Converter={StaticResource ServiceTypeToIconConverter}}">
<StackPanel Orientation="Horizontal" Spacing="8">
<Button
Padding="8"
Background="Transparent"
BorderThickness="0"
Tag="{x:Bind}">
<FontIcon FontSize="16" Glyph="&#xE712;" />
<Button.Flyout>
<MenuFlyout>
<MenuFlyoutItem
Click="EditPasteAIProviderButton_Click"
Icon="{ui:FontIcon Glyph=&#xE70F;}"
Tag="{x:Bind}"
Text="Edit" />
<MenuFlyoutSeparator />
<MenuFlyoutItem
Click="RemovePasteAIProviderButton_Click"
Icon="{ui:FontIcon Glyph=&#xE74D;}"
Tag="{x:Bind}"
Text="Remove" />
</MenuFlyout>
</Button.Flyout>
</Button>
</StackPanel>
</tkcontrols:SettingsCard>
</DataTemplate>
</tkcontrols:SettingsExpander.ItemTemplate>
</tkcontrols:SettingsExpander>
</controls:SettingsGroup>
<!-- Activation and behavior -->
<controls:SettingsGroup x:Uid="AdvancedPaste_BehaviorSettingsGroup" IsEnabled="{x:Bind ViewModel.IsEnabled, Mode=OneWay}">
<controls:GPOInfoControl ShowWarning="{x:Bind ViewModel.ShowClipboardHistoryIsGpoConfiguredInfoBar, Mode=OneWay}">
<tkcontrols:SettingsCard
Name="AdvancedPasteClipboardHistoryEnabledSettingsCard"
x:Uid="AdvancedPaste_Clipboard_History_Enabled_SettingsCard"
HeaderIcon="{ui:FontIcon Glyph=&#xF0E3;}">
<ToggleSwitch IsOn="{x:Bind ViewModel.ClipboardHistoryEnabled, Mode=TwoWay}" />
</tkcontrols:SettingsCard>
</controls:GPOInfoControl>
<tkcontrols:SettingsCard Name="AdvancedPasteCloseAfterLosingFocus" x:Uid="AdvancedPaste_CloseAfterLosingFocus">
<tkcontrols:SettingsCard.HeaderIcon>
<PathIcon Data="M 4 16.284 C 1 22.284 29 59.284 71 101.284 L 143 174.284 L 101 220.284 C 54 271.284 5 367.284 14 390.284 C 23 416.284 40 406.284 56 367.284 C 64 347.284 76 320.284 82 307.284 C 97 278.284 160 215.284 175 215.284 C 181 215.284 199 228.284 214 243.284 C 239 270.284 240 273.284 224 286.284 C 202 304.284 180 357.284 180 392.284 C 180 430.284 213 481.284 252 505.284 C 297 532.284 349 531.284 394 500.284 C 414 486.284 434 475.284 438 475.284 C 442 475.284 484 514.284 532 562.284 C 602 631.284 622 647.284 632 637.284 C 642 627.284 581 561.284 335 315.284 C 164 144.284 22 5.284 18 5.284 C 14 5.284 8 10.284 4 16.284 Z M 337 367.284 C 372 401.284 400 435.284 400 442.284 C 400 457.284 349 485.284 321 485.284 C 269 485.284 220 437.284 220 385.284 C 220 357.284 248 305.284 262 305.284 C 269 305.284 303 333.284 337 367.284 Z M 248 132.284 C 228 137.284 225 151.284 241 161.284 C 247 164.284 284 168.284 324 169.284 C 393 171.284 442 188.284 491 227.284 C 522 252.284 578 335.284 585 364.284 C 592 399.284 607 412.284 622 397.284 C 629 390.284 627 370.284 615 333.284 C 590 260.284 506 176.284 427 147.284 C 373 127.284 293 120.284 248 132.284 Z" />
</tkcontrols:SettingsCard.HeaderIcon>
<ToggleSwitch IsOn="{x:Bind ViewModel.CloseAfterLosingFocus, Mode=TwoWay}" />
</tkcontrols:SettingsCard>
<tkcontrols:SettingsCard
Name="AdvancedPasteShowCustomPreviewSettingsCard"
x:Uid="AdvancedPaste_ShowCustomPreviewSettingsCard"
HeaderIcon="{ui:FontIcon Glyph=&#xE71E;}">
<ToggleSwitch IsOn="{x:Bind ViewModel.ShowCustomPreview, Mode=TwoWay}" />
</tkcontrols:SettingsCard>
</controls:SettingsGroup>
<controls:SettingsGroup x:Uid="AdvancedPaste_Direct_Access_Hotkeys_GroupSettings" IsEnabled="{x:Bind ViewModel.IsEnabled, Mode=OneWay}">
<tkcontrols:SettingsCard
Name="AdvancedPasteUIActions"
x:Uid="AdvancedPasteUI_Actions"
HeaderIcon="{ui:FontIcon Glyph=&#xE792;}"
IsEnabled="{x:Bind ViewModel.IsOpenAIEnabled, Mode=OneWay}">
<Button
x:Uid="AdvancedPasteUI_AddCustomActionButton"
Click="AddCustomActionButton_Click"
Style="{ThemeResource AccentButtonStyle}" />
</tkcontrols:SettingsCard>
<tkcontrols:SettingsCard
<tkcontrols:SettingsExpander
Name="AdvancedPasteUIShortcut"
x:Uid="AdvancedPasteUI_Shortcut"
HeaderIcon="{ui:FontIcon Glyph=&#xEDA7;}">
HeaderIcon="{ui:FontIcon Glyph=&#xEDA7;}"
IsExpanded="True">
<controls:ShortcutControl MinWidth="{StaticResource SettingActionControlMinWidth}" HotkeySettings="{x:Bind Path=ViewModel.AdvancedPasteUIShortcut, Mode=TwoWay}" />
</tkcontrols:SettingsCard>
<tkcontrols:SettingsCard Name="PasteAsPlainTextShortcut" x:Uid="PasteAsPlainText_Shortcut">
<tkcontrols:SettingsExpander.ItemsHeader>
<InfoBar
x:Uid="GPO_SettingIsManaged"
IsClosable="False"
IsOpen="{x:Bind ViewModel.ShowClipboardHistoryIsGpoConfiguredInfoBar, Mode=OneWay}"
IsTabStop="{x:Bind ViewModel.ShowClipboardHistoryIsGpoConfiguredInfoBar, Mode=OneWay}"
Severity="Informational">
<InfoBar.IconSource>
<FontIconSource FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE72E;" />
</InfoBar.IconSource>
</InfoBar>
</tkcontrols:SettingsExpander.ItemsHeader>
<tkcontrols:SettingsExpander.Items>
<tkcontrols:SettingsCard
Name="AdvancedPasteClipboardHistoryEnabledSettingsCard"
ContentAlignment="Left"
IsEnabled="{x:Bind ViewModel.ClipboardHistoryEnabled, Mode=OneWay}">
<controls:CheckBoxWithDescriptionControl x:Uid="AdvancedPaste_Clipboard_History_Enabled_SettingsCard" IsChecked="{x:Bind ViewModel.ClipboardHistoryEnabled, Mode=TwoWay}" />
</tkcontrols:SettingsCard>
<tkcontrols:SettingsCard Name="AdvancedPasteCloseAfterLosingFocus" ContentAlignment="Left">
<CheckBox x:Uid="AdvancedPaste_CloseAfterLosingFocus" IsChecked="{x:Bind ViewModel.CloseAfterLosingFocus, Mode=TwoWay}" />
</tkcontrols:SettingsCard>
<tkcontrols:SettingsCard Name="AdvancedPasteShowCustomPreviewSettingsCard" ContentAlignment="Left">
<controls:CheckBoxWithDescriptionControl x:Uid="AdvancedPaste_ShowCustomPreviewSettingsCard" IsChecked="{x:Bind ViewModel.ShowCustomPreview, Mode=TwoWay}" />
</tkcontrols:SettingsCard>
</tkcontrols:SettingsExpander.Items>
</tkcontrols:SettingsExpander>
</controls:SettingsGroup>
<!-- Built-in actions -->
<controls:SettingsGroup x:Uid="AdvancedPaste_Direct_Access_Hotkeys_GroupSettings" IsEnabled="{x:Bind ViewModel.IsEnabled, Mode=OneWay}">
<tkcontrols:SettingsCard
Name="PasteAsPlainTextShortcut"
x:Uid="PasteAsPlainText_Shortcut"
HeaderIcon="{ui:FontIcon Glyph=&#xE8E9;}">
<controls:ShortcutControl MinWidth="{StaticResource SettingActionControlMinWidth}" HotkeySettings="{x:Bind Path=ViewModel.PasteAsPlainTextShortcut, Mode=TwoWay}" />
</tkcontrols:SettingsCard>
<tkcontrols:SettingsCard Name="PasteAsMarkdownShortcut" x:Uid="PasteAsMarkdown_Shortcut">
<tkcontrols:SettingsCard
Name="PasteAsMarkdownShortcut"
x:Uid="PasteAsMarkdown_Shortcut"
HeaderIcon="{ui:FontIcon Glyph=&#xe8a5;}">
<controls:ShortcutControl
MinWidth="{StaticResource SettingActionControlMinWidth}"
AllowDisable="True"
HotkeySettings="{x:Bind Path=ViewModel.PasteAsMarkdownShortcut, Mode=TwoWay}" />
</tkcontrols:SettingsCard>
<tkcontrols:SettingsCard Name="PasteAsJsonShortcut" x:Uid="PasteAsJson_Shortcut">
<tkcontrols:SettingsCard
Name="PasteAsJsonShortcut"
x:Uid="PasteAsJson_Shortcut"
HeaderIcon="{ui:FontIcon Glyph=&#xE943;}">
<controls:ShortcutControl
MinWidth="{StaticResource SettingActionControlMinWidth}"
AllowDisable="True"
HotkeySettings="{x:Bind Path=ViewModel.PasteAsJsonShortcut, Mode=TwoWay}" />
</tkcontrols:SettingsCard>
<ItemsControl
x:Name="CustomActions"
x:Uid="CustomActions"
HorizontalAlignment="Stretch"
IsEnabled="{x:Bind ViewModel.IsOpenAIEnabled, Mode=OneWay}"
IsTabStop="False"
ItemsSource="{x:Bind ViewModel.CustomActions, Mode=OneWay}">
<ItemsControl.ItemTemplate>
<DataTemplate x:DataType="models:AdvancedPasteCustomAction">
<tkcontrols:SettingsCard
Margin="0,0,0,2"
Click="EditCustomActionButton_Click"
Description="{x:Bind Prompt, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Header="{x:Bind Name, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
IsActionIconVisible="False"
IsClickEnabled="True">
<tkcontrols:SettingsCard.Resources>
<x:Double x:Key="SettingsCardActionButtonWidth">0</x:Double>
</tkcontrols:SettingsCard.Resources>
<StackPanel Orientation="Horizontal" Spacing="4">
<controls:ShortcutControl
MinWidth="{StaticResource SettingActionControlMinWidth}"
AllowDisable="True"
HotkeySettings="{x:Bind Path=Shortcut, Mode=TwoWay}" />
<ToggleSwitch
x:Uid="Enable_CustomAction"
AutomationProperties.HelpText="{x:Bind Name, Mode=OneWay}"
IsOn="{x:Bind IsShown, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
OffContent=""
OnContent="" />
<Button
x:Uid="More_Options_Button"
Grid.Column="1"
VerticalAlignment="Center"
Content="&#xE712;"
FontFamily="{ThemeResource SymbolThemeFontFamily}"
Style="{StaticResource SubtleButtonStyle}">
<Button.Flyout>
<MenuFlyout>
<MenuFlyoutItem
x:Uid="MoveUp"
Click="ReorderButtonUp_Click"
Icon="{ui:FontIcon Glyph=&#xE74A;}"
IsEnabled="{x:Bind CanMoveUp, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
<MenuFlyoutItem
x:Uid="MoveDown"
Click="ReorderButtonDown_Click"
Icon="{ui:FontIcon Glyph=&#xE74B;}"
IsEnabled="{x:Bind CanMoveDown, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
<MenuFlyoutSeparator />
<MenuFlyoutItem
x:Uid="RemoveItem"
Click="DeleteCustomActionButton_Click"
Icon="{ui:FontIcon Glyph=&#xE74D;}"
IsEnabled="true" />
</MenuFlyout>
</Button.Flyout>
<ToolTipService.ToolTip>
<TextBlock x:Uid="More_Options_ButtonTooltip" />
</ToolTipService.ToolTip>
</Button>
</StackPanel>
</tkcontrols:SettingsCard>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<InfoBar
x:Uid="AdvancedPaste_ShortcutWarning"
IsClosable="False"
IsOpen="{x:Bind ViewModel.IsConflictingCopyShortcut, Mode=OneWay}"
IsTabStop="{x:Bind ViewModel.IsConflictingCopyShortcut, Mode=OneWay}"
Severity="Warning" />
</controls:SettingsGroup>
<controls:SettingsGroup x:Uid="AdvancedPaste_Additional_Actions_GroupSettings" IsEnabled="{x:Bind ViewModel.IsEnabled, Mode=OneWay}">
<tkcontrols:SettingsCard
Name="ImageToText"
x:Uid="ImageToText"
DataContext="{x:Bind ViewModel.AdditionalActions.ImageToText, Mode=OneWay}">
DataContext="{x:Bind ViewModel.AdditionalActions.ImageToText, Mode=OneWay}"
HeaderIcon="{ui:FontIcon Glyph=&#xE91B;}">
<ContentControl ContentTemplate="{StaticResource AdditionalActionTemplate}" />
</tkcontrols:SettingsCard>
<tkcontrols:SettingsExpander
@@ -312,74 +300,100 @@
IsTabStop="{x:Bind ViewModel.IsAdditionalActionConflictingCopyShortcut, Mode=OneWay}"
Severity="Warning" />
</controls:SettingsGroup>
<!-- Custom actions -->
<controls:SettingsGroup x:Uid="AdvancedPaste_Additional_Actions_GroupSettings" IsEnabled="{x:Bind ViewModel.IsEnabled, Mode=OneWay}">
<tkcontrols:SettingsExpander
Name="AdvancedPasteUIActions"
x:Uid="AdvancedPasteUI_Actions"
HeaderIcon="{ui:FontIcon Glyph=&#xE792;}"
IsEnabled="{x:Bind ViewModel.IsAIEnabled, Mode=OneWay}"
IsExpanded="True"
ItemsSource="{x:Bind ViewModel.CustomActions, Mode=OneWay}">
<Button
x:Uid="AdvancedPasteUI_AddCustomActionButton"
Click="AddCustomActionButton_Click"
Style="{ThemeResource AccentButtonStyle}" />
<tkcontrols:SettingsExpander.ItemTemplate>
<DataTemplate x:DataType="models:AdvancedPasteCustomAction">
<tkcontrols:SettingsCard
Margin="0,0,0,2"
Click="EditCustomActionButton_Click"
Description="{x:Bind Description, Mode=OneWay}"
Header="{x:Bind Name, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
IsActionIconVisible="False"
IsClickEnabled="True"
Tag="{x:Bind}">
<tkcontrols:SettingsCard.Resources>
<x:Double x:Key="SettingsCardActionButtonWidth">0</x:Double>
</tkcontrols:SettingsCard.Resources>
<ToolTipService.ToolTip>
<TextBlock Text="{x:Bind Prompt, Mode=OneWay}" TextWrapping="Wrap" />
</ToolTipService.ToolTip>
<StackPanel Orientation="Horizontal" Spacing="4">
<controls:ShortcutControl
MinWidth="{StaticResource SettingActionControlMinWidth}"
AllowDisable="True"
HotkeySettings="{x:Bind Path=Shortcut, Mode=TwoWay}" />
<ToggleSwitch
x:Uid="Enable_CustomAction"
AutomationProperties.HelpText="{x:Bind Name, Mode=OneWay}"
IsOn="{x:Bind IsShown, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
OffContent=""
OnContent="" />
<Button
x:Uid="More_Options_Button"
Grid.Column="1"
VerticalAlignment="Center"
Content="&#xE712;"
FontFamily="{ThemeResource SymbolThemeFontFamily}"
Style="{StaticResource SubtleButtonStyle}"
Tag="{x:Bind}">
<Button.Flyout>
<MenuFlyout>
<MenuFlyoutItem
x:Uid="MoveUp"
Click="ReorderButtonUp_Click"
Icon="{ui:FontIcon Glyph=&#xE74A;}"
IsEnabled="{x:Bind CanMoveUp, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Tag="{x:Bind}" />
<MenuFlyoutItem
x:Uid="MoveDown"
Click="ReorderButtonDown_Click"
Icon="{ui:FontIcon Glyph=&#xE74B;}"
IsEnabled="{x:Bind CanMoveDown, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Tag="{x:Bind}" />
<MenuFlyoutSeparator />
<MenuFlyoutItem
x:Uid="RemoveItem"
Click="DeleteCustomActionButton_Click"
Icon="{ui:FontIcon Glyph=&#xE74D;}"
IsEnabled="true"
Tag="{x:Bind}" />
</MenuFlyout>
</Button.Flyout>
<ToolTipService.ToolTip>
<TextBlock x:Uid="More_Options_ButtonTooltip" />
</ToolTipService.ToolTip>
</Button>
</StackPanel>
</tkcontrols:SettingsCard>
</DataTemplate>
</tkcontrols:SettingsExpander.ItemTemplate>
</tkcontrols:SettingsExpander>
<InfoBar
x:Uid="AdvancedPaste_ShortcutWarning"
IsClosable="False"
IsOpen="{x:Bind ViewModel.IsConflictingCopyShortcut, Mode=OneWay}"
IsTabStop="{x:Bind ViewModel.IsConflictingCopyShortcut, Mode=OneWay}"
Severity="Warning" />
</controls:SettingsGroup>
</StackPanel>
</controls:SettingsPageControl.ModuleContent>
<controls:SettingsPageControl.PrimaryLinks>
<controls:PageLink x:Uid="LearnMore_AdvancedPaste" Link="https://aka.ms/PowerToysOverview_AdvancedPaste" />
</controls:SettingsPageControl.PrimaryLinks>
</controls:SettingsPageControl>
<ContentDialog
x:Name="EnableAIDialog"
x:Uid="EnableAIDialog"
IsPrimaryButtonEnabled="False"
IsSecondaryButtonEnabled="True"
PrimaryButtonStyle="{StaticResource AccentButtonStyle}">
<ScrollViewer VerticalScrollBarVisibility="Auto">
<Grid RowSpacing="24">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Image Margin="-24,-24,-24,0" Source="{ThemeResource DialogHeaderImage}" />
<TextBlock
Grid.Row="1"
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
TextWrapping="Wrap">
<Run x:Uid="AdvancedPaste_EnableAIDialog_Description" />
<Hyperlink NavigateUri="https://openai.com/policies/terms-of-use" TabIndex="3">
<Run x:Uid="TermsLink" />
</Hyperlink>
<Run x:Uid="AIFooterSeparator" Foreground="{ThemeResource TextFillColorSecondaryBrush}">|</Run>
<Hyperlink NavigateUri="https://openai.com/policies/privacy-policy" TabIndex="3">
<Run x:Uid="PrivacyLink" />
</Hyperlink>
</TextBlock>
<StackPanel Grid.Row="2" Orientation="Vertical">
<TextBlock x:Uid="AdvancedPaste_EnableAIDialog_ConfigureOpenAIKey" FontWeight="SemiBold" />
<TextBlock Grid.Row="2" TextWrapping="Wrap">
<Run x:Uid="AdvancedPaste_EnableAIDialog_LoginIntoText" />
<Hyperlink NavigateUri="https://platform.openai.com/api-keys">
<Run x:Uid="AdvancedPaste_EnableAIDialog_OpenAIApiKeysOverviewText" />
</Hyperlink>
<LineBreak />
<Run x:Uid="AdvancedPaste_EnableAIDialog_CreateNewKeyText" />
<LineBreak />
<Run x:Uid="AdvancedPaste_EnableAIDialog_NoteAICreditsText" />
</TextBlock>
</StackPanel>
<Grid Grid.Row="3" ColumnSpacing="8">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock
x:Uid="AdvancedPaste_EnableAIDialogOpenAIApiKey"
VerticalAlignment="Center"
TextWrapping="Wrap" />
<TextBox
x:Name="AdvancedPaste_EnableAIDialogOpenAIApiKey"
Grid.Column="1"
MinWidth="248"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Stretch"
TextChanged="AdvancedPaste_EnableAIDialogOpenAIApiKey_TextChanged" />
</Grid>
</Grid>
</ScrollViewer>
</ContentDialog>
<ContentDialog
x:Name="CustomActionDialog"
x:Uid="CustomActionDialog"
@@ -396,6 +410,11 @@
Width="340"
HorizontalAlignment="Left"
Text="{Binding Name, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
<TextBox
x:Uid="AdvancedPasteUI_CustomAction_Description"
Width="340"
HorizontalAlignment="Left"
Text="{Binding Description, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
<TextBox
x:Uid="AdvancedPasteUI_CustomAction_Prompt"
Width="340"
@@ -406,5 +425,169 @@
TextWrapping="Wrap" />
</StackPanel>
</ContentDialog>
<!-- Paste AI provider dialog -->
<ContentDialog
x:Name="PasteAIProviderConfigurationDialog"
Title="Paste with AI provider configuration"
Closed="PasteAIProviderConfigurationDialog_Closed"
PrimaryButtonClick="PasteAIProviderConfigurationDialog_PrimaryButtonClick"
PrimaryButtonStyle="{ThemeResource AccentButtonStyle}"
PrimaryButtonText="Save"
SecondaryButtonText="Cancel">
<ContentDialog.Resources>
<x:Double x:Key="ContentDialogMaxWidth">900</x:Double>
<x:Double x:Key="ContentDialogMaxHeight">700</x:Double>
<StaticResource x:Key="ContentDialogTopOverlay" ResourceKey="NavigationViewContentBackground" />
</ContentDialog.Resources>
<ScrollViewer
MaxHeight="550"
Margin="-16,0,-24,-24"
HorizontalScrollBarVisibility="Disabled"
VerticalScrollBarVisibility="Auto">
<StackPanel
MinWidth="640"
Padding="16,0,16,16"
Spacing="16">
<InfoBar
x:Name="PasteAIProviderGpoInfoBar"
x:Uid="GPO_SettingIsManaged"
Margin="0,12,0,0"
IsClosable="False"
IsOpen="{x:Bind ViewModel.ShowPasteAIProviderGpoConfiguredInfoBar, Mode=OneWay}"
IsTabStop="{x:Bind ViewModel.ShowPasteAIProviderGpoConfiguredInfoBar, Mode=OneWay}"
Severity="Informational">
<InfoBar.IconSource>
<FontIconSource FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE72E;" />
</InfoBar.IconSource>
</InfoBar>
<StackPanel
Margin="0,12,0,0"
Orientation="Vertical"
Spacing="8"
Visibility="{x:Bind GetServiceLegalVisibility(ViewModel.PasteAIProviderDraft?.ServiceType), Mode=OneWay}">
<TextBlock
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
Style="{StaticResource CaptionTextBlockStyle}"
Text="{x:Bind GetServiceLegalDescription(ViewModel.PasteAIProviderDraft?.ServiceType), Mode=OneWay}"
TextWrapping="Wrap" />
<StackPanel
Margin="0,0,0,0"
Orientation="Horizontal"
Spacing="8">
<HyperlinkButton
Padding="0"
Content="{x:Bind GetServiceTermsLabel(ViewModel.PasteAIProviderDraft?.ServiceType), Mode=OneWay}"
FontSize="12"
NavigateUri="{x:Bind GetServiceTermsUri(ViewModel.PasteAIProviderDraft?.ServiceType), Mode=OneWay}"
Visibility="{x:Bind GetServiceTermsVisibility(ViewModel.PasteAIProviderDraft?.ServiceType), Mode=OneWay}" />
<HyperlinkButton
Padding="0"
Content="{x:Bind GetServicePrivacyLabel(ViewModel.PasteAIProviderDraft?.ServiceType), Mode=OneWay}"
FontSize="12"
NavigateUri="{x:Bind GetServicePrivacyUri(ViewModel.PasteAIProviderDraft?.ServiceType), Mode=OneWay}"
Visibility="{x:Bind GetServicePrivacyVisibility(ViewModel.PasteAIProviderDraft?.ServiceType), Mode=OneWay}" />
</StackPanel>
</StackPanel>
<Rectangle Height="1" Fill="{ThemeResource DividerStrokeColorDefaultBrush}" />
<StackPanel
Margin="0,8,0,48"
Orientation="Vertical"
Spacing="16">
<TextBox
x:Name="PasteAIModelNameTextBox"
MinWidth="200"
HorizontalAlignment="Stretch"
Header="Model name"
PlaceholderText="gpt-4"
Text="{x:Bind ViewModel.PasteAIProviderDraft.ModelName, Mode=TwoWay}" />
<TextBox
x:Name="PasteAIEndpointUrlTextBox"
MinWidth="200"
HorizontalAlignment="Stretch"
Header="Endpoint URL"
PlaceholderText="https://your-resource.openai.azure.com/"
Text="{x:Bind ViewModel.PasteAIProviderDraft.EndpointUrl, Mode=TwoWay}" />
<PasswordBox
x:Name="PasteAIApiKeyPasswordBox"
MinWidth="200"
Header="API key"
PlaceholderText="Enter API Key" />
<TextBox
x:Name="PasteAIApiVersionTextBox"
MinWidth="200"
HorizontalAlignment="Stretch"
Header="API version"
PlaceholderText="2024-10-01"
Text="{x:Bind ViewModel.PasteAIProviderDraft.ApiVersion, Mode=TwoWay}"
Visibility="Collapsed" />
<TextBox
x:Name="PasteAIDeploymentNameTextBox"
MinWidth="200"
Header="Deployment name"
PlaceholderText="gpt-4"
Text="{x:Bind ViewModel.PasteAIProviderDraft.DeploymentName, Mode=TwoWay}" />
<TextBox
x:Name="PasteAISystemPromptTextBox"
MinWidth="200"
MinHeight="76"
HorizontalAlignment="Stretch"
AcceptsReturn="True"
Header="System prompt"
PlaceholderText="You are tasked with reformatting user's clipboard data. Use the user's instructions, and the content of their clipboard below to edit their clipboard content as they have requested it. Do not output anything else besides the reformatted clipboard content."
Text="{x:Bind ViewModel.PasteAIProviderDraft.SystemPrompt, Mode=TwoWay}"
TextWrapping="Wrap" />
<Grid
x:Name="FoundryLocalPanel"
Margin="0,8,0,0"
Visibility="Collapsed">
<controls:FoundryLocalModelPicker x:Name="FoundryLocalPicker" />
</Grid>
<StackPanel
x:Name="PasteAIModelPanel"
Orientation="Horizontal"
Spacing="8">
<TextBox
x:Name="PasteAIModelPathTextBox"
MinWidth="200"
HorizontalAlignment="Stretch"
Header="Model path"
PlaceholderText="C:\Models\phi-3.onnx"
Text="{x:Bind ViewModel.PasteAIProviderDraft.ModelPath, Mode=TwoWay}" />
<Button
VerticalAlignment="Bottom"
Click="BrowsePasteAIModelPath_Click"
Content="{ui:FontIcon Glyph=&#xE8DA;,
FontSize=16}"
Style="{StaticResource SubtleButtonStyle}" />
</StackPanel>
<ToggleSwitch
x:Name="PasteAIModerationToggle"
x:Uid="AdvancedPaste_EnablePasteAIModerationToggle"
IsOn="{x:Bind ViewModel.PasteAIProviderDraft.ModerationEnabled, Mode=TwoWay}"
Visibility="Collapsed" />
<ToggleSwitch
x:Name="PasteAIEnableAdvancedAICheckBox"
IsOn="{x:Bind ViewModel.PasteAIProviderDraft.EnableAdvancedAI, Mode=TwoWay}"
Toggled="PasteAIEnableAdvancedAICheckBox_Toggled"
Visibility="Collapsed">
<ToolTipService.ToolTip>
<TextBlock Text="" TextWrapping="Wrap" />
</ToolTipService.ToolTip>
<ToggleSwitch.Header>
<TextBlock>
<Run Text="Enable Advanced AI" /> <LineBreak />
<Run Foreground="{ThemeResource TextFillColorSecondaryBrush}" Text="Use built-in functions to handle complex tasks. Token consumption may increase." />
</TextBlock>
</ToggleSwitch.Header>
</ToggleSwitch>
</StackPanel>
</StackPanel>
</ScrollViewer>
</ContentDialog>
</Grid>
</local:NavigablePage>

View File

@@ -626,17 +626,120 @@ opera.exe</value>
<data name="AdvancedPaste_EnableAISettingsCard.Header" xml:space="preserve">
<value>Enable Paste with AI</value>
</data>
<data name="AdvancedPaste_EnableAIDialogMarkdown.Text" xml:space="preserve">
<value>## Preview Terms
Please review the placeholder content that represents the final terms and usage guidance for Advanced Paste.
1. This is sample information.
2. Real policy content will be provided later.
3. Continue only if you are comfortable with the above.</value>
</data>
<data name="AdvancedPaste_EnableAIDialogAcceptanceCheckBox.Content" xml:space="preserve">
<value>I have read and accept the information above.</value>
</data>
<data name="AdvancedPaste_EnableAdvancedAIModerationToggle.Content" xml:space="preserve">
<value>Enable OpenAI content moderation</value>
</data>
<data name="AdvancedPaste_EnablePasteAIModerationToggle.Header" xml:space="preserve">
<value>Enable OpenAI content moderation</value>
</data>
<data name="AdvancedPaste_EnableAdvancedAI_SettingsCard.Header" xml:space="preserve">
<value>Enable Advanced AI</value>
</data>
<data name="AdvancedPaste_EnableAdvancedAI_SettingsCard.Description" xml:space="preserve">
<value>Use built-in functions to handle complex tasks. Token consumption may increase.</value>
</data>
<data name="AdvancedPaste_Clipboard_History_Enabled_SettingsCard.Header" xml:space="preserve">
<value>Clipboard history</value>
<value>Access Clipboard History</value>
</data>
<data name="AdvancedPaste_Clipboard_History_Enabled_SettingsCard.Description" xml:space="preserve">
<value>Save multiple items to your clipboard. This is an OS feature.</value>
<value>Clipboard History shows a list of previously copied items.</value>
</data>
<data name="AdvancedPaste_Direct_Access_Hotkeys_GroupSettings.Header" xml:space="preserve">
<value>Actions</value>
</data>
<data name="AdvancedPaste_Additional_Actions_GroupSettings.Header" xml:space="preserve">
<value>Additional actions</value>
<value>Custom actions</value>
</data>
<data name="AdvancedPaste_FoundryLocal_LegalDescription" xml:space="preserve">
<value>You're running local models directly on your device. Their behavior may vary or be unpredictable.</value>
</data>
<data name="FoundryLocal_RestartRequiredNote.Text" xml:space="preserve">
<value>Note: After installing the Foundry Local CLI, restart PowerToys to use it.</value>
<comment>Message informing users that PowerToys needs to be restarted after installing Foundry Local CLI</comment>
</data>
<data name="AdvancedPaste_LocalModel_LegalDescription" xml:space="preserve">
<value>You're running local models directly on your device. Their behavior may vary or be unpredictable.</value>
</data>
<data name="AdvancedPaste_OpenAI_LegalDescription" xml:space="preserve">
<value>Your API key connects directly to OpenAI services. By setting up this provider, you agree to comply with OpenAI's usage policies and data handling practices.</value>
</data>
<data name="AdvancedPaste_OpenAI_TermsLabel" xml:space="preserve">
<value>Terms of Use</value>
</data>
<data name="AdvancedPaste_OpenAI_PrivacyLabel" xml:space="preserve">
<value>Privacy Policy</value>
</data>
<data name="AdvancedPaste_AzureOpenAI_LegalDescription" xml:space="preserve">
<value>Your API key connects directly to Microsoft Azure services. By setting up this provider, you agree to comply with Microsoft Azure's usage policies and data handling practices.</value>
</data>
<data name="AdvancedPaste_AzureOpenAI_TermsLabel" xml:space="preserve">
<value>Microsoft Azure Terms of Service</value>
</data>
<data name="AdvancedPaste_AzureOpenAI_PrivacyLabel" xml:space="preserve">
<value>Microsoft Privacy Statement</value>
</data>
<data name="AdvancedPaste_AzureAIInference_LegalDescription" xml:space="preserve">
<value>Your API key connects directly to Microsoft Azure services. By setting up this provider, you agree to comply with Microsoft Azure's usage policies and data handling practices.</value>
</data>
<data name="AdvancedPaste_AzureAIInference_TermsLabel" xml:space="preserve">
<value>Microsoft Azure Terms of Service</value>
</data>
<data name="AdvancedPaste_AzureAIInference_PrivacyLabel" xml:space="preserve">
<value>Microsoft Privacy Statement</value>
</data>
<data name="AdvancedPaste_Google_LegalDescription" xml:space="preserve">
<value>Your API key connects directly to Google services. By setting up this provider, you agree to comply with Google's usage policies and data handling practices.</value>
</data>
<data name="AdvancedPaste_Google_TermsLabel" xml:space="preserve">
<value>Google Terms of Service</value>
</data>
<data name="AdvancedPaste_Google_PrivacyLabel" xml:space="preserve">
<value>Google Privacy Policy</value>
</data>
<data name="AdvancedPaste_Anthropic_LegalDescription" xml:space="preserve">
<value>Your API key connects directly to Anthropic services. By setting up this provider, you agree to comply with Anthropic's usage policies and data handling practices.</value>
</data>
<data name="AdvancedPaste_Anthropic_TermsLabel" xml:space="preserve">
<value>Anthropic Terms of Service</value>
</data>
<data name="AdvancedPaste_Anthropic_PrivacyLabel" xml:space="preserve">
<value>Anthropic Privacy Policy</value>
</data>
<data name="AdvancedPaste_Mistral_LegalDescription" xml:space="preserve">
<value>Your API key connects directly to Mistral services. By setting up this provider, you agree to comply with Mistral's usage policies and data handling practices.</value>
</data>
<data name="AdvancedPaste_Mistral_TermsLabel" xml:space="preserve">
<value>Mistral Terms of Use</value>
</data>
<data name="AdvancedPaste_Mistral_PrivacyLabel" xml:space="preserve">
<value>Mistral Privacy Policy</value>
</data>
<data name="AdvancedPaste_AmazonBedrock_LegalDescription" xml:space="preserve">
<value>Your API key connects directly to Amazon services. By setting up this provider, you agree to comply with Amazon's usage policies and data handling practices.</value>
</data>
<data name="AdvancedPaste_AmazonBedrock_TermsLabel" xml:space="preserve">
<value>AWS Service Terms</value>
</data>
<data name="AdvancedPaste_AmazonBedrock_PrivacyLabel" xml:space="preserve">
<value>AWS Privacy Notice</value>
</data>
<data name="AdvancedPaste_Ollama_TermsLabel" xml:space="preserve">
<value>Ollama Terms of Service</value>
</data>
<data name="AdvancedPaste_Ollama_PrivacyLabel" xml:space="preserve">
<value>Ollama Privacy Policy</value>
</data>
<data name="RemapKeysList.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Current key remappings</value>
@@ -1956,6 +2059,9 @@ Made with 💗 by Microsoft and the PowerToys community.</value>
<data name="AdvancedPasteUI_CustomAction_Name.Header" xml:space="preserve">
<value>Name</value>
</data>
<data name="AdvancedPasteUI_CustomAction_Description.Header" xml:space="preserve">
<value>Description</value>
</data>
<data name="AdvancedPasteUI_CustomAction_Prompt.Header" xml:space="preserve">
<value>Prompt</value>
</data>
@@ -3301,7 +3407,7 @@ Activate by holding the key for the character you want to add an accent to, then
<value>An AI powered tool to put your clipboard content into any format you need, focused towards developer workflows.</value>
</data>
<data name="AdvancedPaste_EnableAISettingsCardDescription.Text" xml:space="preserve">
<value>This feature allows you to format your clipboard content with the power of AI. An OpenAI API key is required.</value>
<value>Transform your clipboard content with the power of AI. An cloud or local endpoint is required.</value>
</data>
<data name="AdvancedPaste_EnableAISettingsCardDescriptionLearnMore.Content" xml:space="preserve">
<value>Learn more</value>
@@ -3935,7 +4041,7 @@ Activate by holding the key for the character you want to add an accent to, then
<value>Paste with AI</value>
</data>
<data name="AdvancedPaste_BehaviorSettingsGroup.Header" xml:space="preserve">
<value>Behavior</value>
<value>Activation &amp; behavior</value>
</data>
<data name="AdvancedPaste_ShowCustomPreviewSettingsCard.Header" xml:space="preserve">
<value>Custom format preview</value>
@@ -3944,10 +4050,10 @@ Activate by holding the key for the character you want to add an accent to, then
<value>Preview the output of AI formats and Image to text before pasting</value>
</data>
<data name="AdvancedPaste_EnableAdvancedAI.Header" xml:space="preserve">
<value>Enable advanced AI</value>
<value>Advanced AI</value>
</data>
<data name="AdvancedPaste_EnableAdvancedAI.Description" xml:space="preserve">
<value>Add advanced capabilities when using 'Paste with AI' including the power to 'chain' multiple transformations together and work with images and files. This feature may consume more API credits when used.</value>
<value>Supports advanced workflows by chaining transformations and working with files and images. May use additional API credits.</value>
</data>
<data name="Oobe_AdvancedPaste.Description" xml:space="preserve">
<value>Advanced Paste is a tool to put your clipboard content into any format you need, focused towards developer workflows. It can paste as plain text, markdown, or json directly with the UX or with a direct keystroke invoke. These are fully locally executed. In addition, it has an AI powered option that is 100% opt-in and requires an Open AI key. Note: this will replace the formatted text in your clipboard with the selected format.</value>
@@ -4476,9 +4582,9 @@ Activate by holding the key for the character you want to add an accent to, then
<data name="AdvancedPaste_EnableAIDialog_NoteAICreditsErrorText.Text" xml:space="preserve">
<value>If you do not have credits you will see an 'API key quota exceeded' error</value>
</data>
<data name="AdvancedPaste_CloseAfterLosingFocus.Header" xml:space="preserve">
<value>Automatically close the AdvancedPaste window after it loses focus</value>
<comment>AdvancedPaste is a product name, do not loc</comment>
<data name="AdvancedPaste_CloseAfterLosingFocus.Content" xml:space="preserve">
<value>Automatically close the Advanced Paste window after it loses focus</value>
<comment>Advanced Paste is a product name, do not loc</comment>
</data>
<data name="GPO_CommandNotFound_ForceDisabled.Title" xml:space="preserve">
<value>The Command Not Found module is disabled by your organization.</value>