From 3e1d1719684b939c2251be0da9cb1b1cc28ebd81 Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Sun, 19 May 2024 16:06:35 +0200 Subject: [PATCH] Override the ToString method for models --- app/MindWork AI Studio/Provider/Model.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/MindWork AI Studio/Provider/Model.cs b/app/MindWork AI Studio/Provider/Model.cs index d8f8d05..af39709 100644 --- a/app/MindWork AI Studio/Provider/Model.cs +++ b/app/MindWork AI Studio/Provider/Model.cs @@ -4,4 +4,11 @@ namespace AIStudio.Provider; /// The data model for the model to use. /// /// The model's ID. -public readonly record struct Model(string Id); \ No newline at end of file +public readonly record struct Model(string Id) +{ + #region Overrides of ValueType + + public override string ToString() => string.IsNullOrWhiteSpace(this.Id) ? "no model selected" : this.Id; + + #endregion +} \ No newline at end of file