mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-09-13 21:13:37 +00:00
Co-authored-by: krut_ni <nils.kruthoff@dlr.de> Co-authored-by: Thorsten Sommer <SommerEngineering@users.noreply.github.com>
32 lines
1.0 KiB
C#
32 lines
1.0 KiB
C#
// ReSharper disable NotAccessedPositionalProperty.Global
|
|
namespace AIStudio.Provider.Anthropic;
|
|
|
|
/// <summary>
|
|
/// Represents a response stream line.
|
|
/// </summary>
|
|
/// <param name="Type">The type of the response line.</param>
|
|
/// <param name="Index">The index of the response line.</param>
|
|
/// <param name="Delta">The delta of the response line.</param>
|
|
public readonly record struct ResponseStreamLine(string Type, int Index, Delta Delta) : IResponseStreamLine
|
|
{
|
|
/// <inheritdoc />
|
|
public bool ContainsContent() => this != default && !string.IsNullOrWhiteSpace(this.Delta.Text);
|
|
|
|
/// <inheritdoc />
|
|
public ContentStreamChunk GetContent() => new(this.Delta.Text, []);
|
|
|
|
#region Implementation of IAnnotationStreamLine
|
|
|
|
//
|
|
// Please note: Anthropic's API does not currently support sources in their
|
|
// OpenAI-compatible response stream.
|
|
//
|
|
|
|
/// <inheritdoc />
|
|
public bool ContainsSources() => false;
|
|
|
|
/// <inheritdoc />
|
|
public IList<ISource> GetSources() => [];
|
|
|
|
#endregion
|
|
} |