AI-Studio/app/MindWork AI Studio/Chat/ContentImage.cs

51 lines
1.3 KiB
C#
Raw Normal View History

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