mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-09-18 16:40:24 +00:00
Some checks are pending
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 / 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 / Publish release (push) Blocked by required conditions
39 lines
1.4 KiB
C#
39 lines
1.4 KiB
C#
namespace AIStudio.Provider.OpenAI;
|
|
|
|
/// <summary>
|
|
/// Data model for a delta line in the Response API chat completion stream.
|
|
/// </summary>
|
|
/// <param name="Type">The type of the response.</param>
|
|
/// <param name="Delta">The delta content of the response.</param>
|
|
public record ResponsesDeltaStreamLine(
|
|
string Type,
|
|
string Delta) : IResponseStreamLine
|
|
{
|
|
#region Implementation of IResponseStreamLine
|
|
|
|
/// <inheritdoc />
|
|
public bool ContainsContent() => !string.IsNullOrWhiteSpace(this.Delta);
|
|
|
|
/// <inheritdoc />
|
|
public ContentStreamChunk GetContent() => new(this.Delta, this.GetSources());
|
|
|
|
//
|
|
// Please note that there are multiple options where LLM providers might stream sources:
|
|
//
|
|
// - As part of the delta content while streaming. That would be part of this class.
|
|
// - By using a dedicated stream event and data structure. That would be another class implementing IResponseStreamLine.
|
|
//
|
|
// Right now, OpenAI uses the latter approach, so we don't have any sources here. And
|
|
// because no other provider does it yet, we don't have any implementation here either.
|
|
//
|
|
// One example where sources are part of the delta content is the Perplexity provider.
|
|
//
|
|
|
|
/// <inheritdoc />
|
|
public bool ContainsSources() => false;
|
|
|
|
/// <inheritdoc />
|
|
public IList<ISource> GetSources() => [];
|
|
|
|
#endregion
|
|
} |