2024-07-25 13:29:44 +00:00
|
|
|
namespace AIStudio.Provider.Fireworks;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Data model for a line in the response stream, for streaming completions.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="Id">The id of the response.</param>
|
|
|
|
|
/// <param name="Object">The object describing the response.</param>
|
|
|
|
|
/// <param name="Created">The timestamp of the response.</param>
|
|
|
|
|
/// <param name="Model">The model used for the response.</param>
|
|
|
|
|
/// <param name="Choices">The choices made by the AI.</param>
|
2025-01-04 13:11:32 +00:00
|
|
|
public readonly record struct ResponseStreamLine(string Id, string Object, uint Created, string Model, IList<Choice> Choices) : IResponseStreamLine
|
|
|
|
|
{
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
|
public bool ContainsContent() => this != default && this.Choices.Count > 0;
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
2025-08-31 12:27:35 +00:00
|
|
|
public ContentStreamChunk GetContent() => new(this.Choices[0].Delta.Content, []);
|
2025-09-03 08:08:04 +00:00
|
|
|
|
|
|
|
|
#region Implementation of IAnnotationStreamLine
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// Currently, Fireworks does not provide source citations in their response stream.
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
|
public bool ContainsSources() => false;
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
|
public IList<ISource> GetSources() => [];
|
|
|
|
|
|
|
|
|
|
#endregion
|
2026-09-04 13:48:07 +00:00
|
|
|
}
|