// ReSharper disable NotAccessedPositionalProperty.Global
namespace AIStudio.Provider.Anthropic;
///
/// Represents a response stream line.
///
/// The type of the response line.
/// The index of the response line.
/// The delta of the response line.
public readonly record struct ResponseStreamLine(string Type, int Index, Delta Delta) : IResponseStreamLine
{
///
public bool ContainsContent() => this != default &&
(!string.IsNullOrEmpty(this.Delta.Text) || !string.IsNullOrEmpty(this.Delta.Thinking));
///
public ContentStreamChunk GetContent() => this.Delta.Type switch
{
"thinking_delta" => new(string.Empty, this.Delta.Thinking, []),
_ => new(this.Delta.Text, string.Empty, []),
};
#region Implementation of IAnnotationStreamLine
//
// Please note: Anthropic's API does not currently support sources in their
// OpenAI-compatible response stream.
//
///
public bool ContainsSources() => false;
///
public IList GetSources() => [];
#endregion
}