AI-Studio/app/MindWork AI Studio/Chat/ContentImage.cs
2025-03-08 13:56:38 +01:00

50 lines
1.3 KiB
C#

using System.Text.Json.Serialization;
using AIStudio.Provider;
namespace AIStudio.Chat;
/// <summary>
/// Represents an image inside the chat.
/// </summary>
public sealed class ContentImage : IContent, IImageSource
{
#region Implementation of IContent
/// <inheritdoc />
[JsonIgnore]
public bool InitialRemoteWait { get; set; } = false;
/// <inheritdoc />
[JsonIgnore]
public bool IsStreaming { get; set; } = false;
/// <inheritdoc />
[JsonIgnore]
public Func<Task> StreamingDone { get; set; } = () => Task.CompletedTask;
/// <inheritdoc />
[JsonIgnore]
public Func<Task> StreamingEvent { get; set; } = () => Task.CompletedTask;
/// <inheritdoc />
public Task<ChatThread> CreateFromProviderAsync(IProvider provider, Model chatModel, IContent? lastPrompt, ChatThread? chatChatThread, CancellationToken token = default)
{
throw new NotImplementedException();
}
#endregion
/// <summary>
/// The type of the image source.
/// </summary>
/// <remarks>
/// Is the image source a URL, a local file path, a base64 string, etc.?
/// </remarks>
public required ContentImageSource SourceType { get; init; }
/// <summary>
/// The image source.
/// </summary>
public required string Source { get; set; }
}