Added the Google provider (#201)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2024-11-09 22:04:00 +01:00
1 parent 2ae40c59a3
commit 826d15729b
13 files changed
+264 -16

No files matched your search

+24 -2
View File
@@ -4,11 +4,33 @@ namespace AIStudio.Provider;
/// The data model for the model to use.
/// </summary>
/// <param name="Id">The model's ID.</param>
public readonly record struct Model(string Id)
/// <param name="DisplayName">The model's display name.</param>
public readonly record struct Model(string Id, string? DisplayName)
{
#region Overrides of ValueType
public override string ToString() => string.IsNullOrWhiteSpace(this.Id) ? "no model selected" : this.Id;
public override string ToString()
{
if(!string.IsNullOrWhiteSpace(this.DisplayName))
return this.DisplayName;
if(!string.IsNullOrWhiteSpace(this.Id))
return this.Id;
return "no model selected";
}
#endregion
#region Implementation of IEquatable<Model?>
public bool Equals(Model? other)
{
if(other is null)
return false;
return this.Id == other.Value.Id;
}
#endregion
}