Files
AI-Studio/app/MindWork AI Studio/Provider/Anthropic/ResponseStreamLine.cs
T

32 lines
1.0 KiB
C#
Raw Normal View History

2024-06-30 20:56:08 +02:00
// 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>
2025-01-04 14:11:32 +01:00
public readonly record struct ResponseStreamLine(string Type, int Index, Delta Delta) : IResponseStreamLine
{
/// <inheritdoc />
public bool ContainsContent() => this != default && !string.IsNullOrWhiteSpace(this.Delta.Text);
/// <inheritdoc />
2025-08-31 14:27:35 +02:00
public ContentStreamChunk GetContent() => new(this.Delta.Text, []);
2025-09-03 10:08:04 +02:00
#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
2026-09-04 15:48:07 +02:00
}