Files
AI-Studio/app/MindWork AI Studio/Provider/ContentStreamChunk.cs
T

21 lines
879 B
C#
Raw Normal View History

2025-08-31 14:27:35 +02:00
namespace AIStudio.Provider;
/// <summary>
/// A chunk of content from a content stream, along with its associated sources.
/// </summary>
/// <param name="Content">The text content of the chunk.</param>
2026-09-10 15:37:43 +02:00
/// <param name="Thinking">The provider-exposed thinking content of the chunk.</param>
2025-08-31 14:27:35 +02:00
/// <param name="Sources">The list of sources associated with the chunk.</param>
2026-09-10 15:37:43 +02:00
public sealed record ContentStreamChunk(string Content, string Thinking, IList<ISource> Sources)
2025-08-31 14:27:35 +02:00
{
2026-09-10 15:37:43 +02:00
public ContentStreamChunk(string content, IList<ISource> sources) : this(content, string.Empty, sources)
{
}
2025-08-31 14:27:35 +02:00
/// <summary>
/// Implicit conversion to string.
/// </summary>
/// <param name="chunk">The content stream chunk.</param>
/// <returns>The text content of the chunk.</returns>
public static implicit operator string(ContentStreamChunk chunk) => chunk.Content;
2026-09-10 15:37:43 +02:00
}