mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-14 21:28:27 +00:00
Added the Model Comparison assistant for blind comparisons of two models (#1009)
Co-authored-by: Thorsten Sommer <SommerEngineering@users.noreply.github.com>
This commit is contained in:
1 parent
12f26445ba
commit
b7255694cd
221 files changed
+19989
-90
No files matched your search
@@ -0,0 +1,34 @@
|
||||
using AIStudio.Tools.PluginSystem;
|
||||
|
||||
namespace AIStudio.Provider;
|
||||
|
||||
/// <summary>
|
||||
/// How messages to the user name a provider and its model, see IProvider.HidesIdentity.
|
||||
/// </summary>
|
||||
public static class ProviderIdentityExtensions
|
||||
{
|
||||
private static string TB(string fallbackEN) => I18N.I.T(fallbackEN, typeof(ProviderIdentityExtensions).Namespace, nameof(ProviderIdentityExtensions));
|
||||
|
||||
/// <param name="provider">The provider of a request.</param>
|
||||
extension(IProvider provider)
|
||||
{
|
||||
/// <summary>
|
||||
/// The name of the provider in a message to the user: its instance name, or a neutral word while it hides
|
||||
/// which provider it is.
|
||||
/// </summary>
|
||||
public string NameForUser => provider.HidesIdentity ? TB("hidden") : provider.InstanceName;
|
||||
|
||||
/// <summary>
|
||||
/// The type of the provider in a message to the user, or a neutral word while it hides which provider it is.
|
||||
/// </summary>
|
||||
public string TypeForUser => provider.HidesIdentity ? TB("hidden") : provider.Provider.ToString();
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name of a model in a message to the user, or a neutral word while the provider hides which
|
||||
/// provider it is.
|
||||
/// </summary>
|
||||
/// <param name="model">The model of the request.</param>
|
||||
/// <returns>The name of the model to show.</returns>
|
||||
public string ModelNameForUser(Model model) => provider.HidesIdentity ? TB("hidden") : model.Id;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user