2024-07-13 08:37:57 +00:00
|
|
|
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 />
|
2024-07-13 08:37:57 +00:00
|
|
|
[JsonIgnore]
|
2024-05-04 09:11:09 +00:00
|
|
|
public bool InitialRemoteWait { get; set; } = false;
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
2024-07-13 08:37:57 +00:00
|
|
|
[JsonIgnore]
|
2024-05-04 09:11:09 +00:00
|
|
|
public bool IsStreaming { get; set; } = false;
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
2024-07-13 08:37:57 +00:00
|
|
|
[JsonIgnore]
|
2024-05-04 09:11:09 +00:00
|
|
|
public Func<Task> StreamingDone { get; set; } = () => Task.CompletedTask;
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
2024-07-13 08:37:57 +00:00
|
|
|
[JsonIgnore]
|
2024-05-04 09:11:09 +00:00
|
|
|
public Func<Task> StreamingEvent { get; set; } = () => Task.CompletedTask;
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
2025-02-10 17:49:22 +00:00
|
|
|
public Task CreateFromProviderAsync(IProvider provider, SettingsManager settings, Model chatModel, IContent? lastPrompt, ChatThread? chatChatThread, CancellationToken token = default)
|
2024-05-04 09:11:09 +00:00
|
|
|
{
|
|
|
|
throw new NotImplementedException();
|
|
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
/// <summary>
|
2025-02-10 17:49:22 +00:00
|
|
|
/// The type of the image source.
|
2024-05-04 09:11:09 +00:00
|
|
|
/// </summary>
|
2025-02-10 17:49:22 +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 17:49:22 +00:00
|
|
|
/// The image source.
|
2024-05-04 09:11:09 +00:00
|
|
|
/// </summary>
|
2025-02-10 17:49:22 +00:00
|
|
|
public required string Source { get; set; }
|
2024-05-04 09:11:09 +00:00
|
|
|
}
|