mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-09-02 22:02:56 +00:00
Some checks are pending
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-apple-darwin, osx-x64, macos-latest, x86_64-apple-darwin, dmg updater) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-pc-windows-msvc.exe, win-x64, windows-latest, x86_64-pc-windows-msvc, nsis updater) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-unknown-linux-gnu, linux-x64, ubuntu-22.04, x86_64-unknown-linux-gnu, appimage deb updater) (push) Blocked by required conditions
Build and Release / Prepare & create release (push) Blocked by required conditions
Build and Release / Read metadata (push) Waiting to run
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-apple-darwin, osx-arm64, macos-latest, aarch64-apple-darwin, dmg updater) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-pc-windows-msvc.exe, win-arm64, windows-latest, aarch64-pc-windows-msvc, nsis updater) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-unknown-linux-gnu, linux-arm64, ubuntu-22.04-arm, aarch64-unknown-linux-gnu, appimage deb updater) (push) Blocked by required conditions
Build and Release / Publish release (push) Blocked by required conditions
Co-authored-by: Thorsten Sommer <mail@tsommer.org>
62 lines
1.6 KiB
C#
62 lines
1.6 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; }
|
|
|
|
/// <inheritdoc />
|
|
[JsonIgnore]
|
|
public bool IsStreaming { get; set; }
|
|
|
|
/// <inheritdoc />
|
|
[JsonIgnore]
|
|
public Func<Task> StreamingDone { get; set; } = () => Task.CompletedTask;
|
|
|
|
/// <inheritdoc />
|
|
[JsonIgnore]
|
|
public Func<Task> StreamingEvent { get; set; } = () => Task.CompletedTask;
|
|
|
|
/// <inheritdoc />
|
|
public List<Source> Sources { get; set; } = [];
|
|
|
|
/// <inheritdoc />
|
|
public Task<ChatThread> CreateFromProviderAsync(IProvider provider, Model chatModel, IContent? lastPrompt, ChatThread? chatChatThread, CancellationToken token = default)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
public IContent DeepClone() => new ContentImage
|
|
{
|
|
Source = this.Source,
|
|
InitialRemoteWait = this.InitialRemoteWait,
|
|
IsStreaming = this.IsStreaming,
|
|
SourceType = this.SourceType,
|
|
};
|
|
|
|
#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; }
|
|
} |