mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-04-28 17:39:47 +00:00
Refactored image content type
This commit is contained in:
parent
017e6eb9e7
commit
53dd6a6144
@ -78,9 +78,9 @@
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case ContentType.IMAGE:
|
case ContentType.IMAGE:
|
||||||
if (this.Content is ContentImage imageContent)
|
if (this.Content is ContentImage { SourceType: ContentImageSource.URL or ContentImageSource.LOCAL_PATH } imageContent)
|
||||||
{
|
{
|
||||||
<MudImage Src="@imageContent.URL"/>
|
<MudImage Src="@imageContent.Source"/>
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -37,12 +37,15 @@ public sealed class ContentImage : IContent
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The URL of the image.
|
/// The type of the image source.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string URL { get; set; } = string.Empty;
|
/// <remarks>
|
||||||
|
/// Is the image source a URL, a local file path, a base64 string, etc.?
|
||||||
|
/// </remarks>
|
||||||
|
public required ContentImageSource SourceType { get; init; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The local path of the image.
|
/// The image source.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string LocalPath { get; set; } = string.Empty;
|
public required string Source { get; set; }
|
||||||
}
|
}
|
8
app/MindWork AI Studio/Chat/ContentImageSource.cs
Normal file
8
app/MindWork AI Studio/Chat/ContentImageSource.cs
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
namespace AIStudio.Chat;
|
||||||
|
|
||||||
|
public enum ContentImageSource
|
||||||
|
{
|
||||||
|
URL,
|
||||||
|
LOCAL_PATH,
|
||||||
|
BASE64,
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user