mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-05-20 07:32:14 +00:00
Improved null handling
This commit is contained in:
parent
3202b8b629
commit
db295e5259
@ -7,7 +7,7 @@ namespace AIStudio.Provider.OpenAI;
|
|||||||
/// <param name="Delta">The delta content of the response.</param>
|
/// <param name="Delta">The delta content of the response.</param>
|
||||||
public record ResponsesDeltaStreamLine(
|
public record ResponsesDeltaStreamLine(
|
||||||
string Type,
|
string Type,
|
||||||
string Delta) : IResponseStreamLine
|
string? Delta) : IResponseStreamLine
|
||||||
{
|
{
|
||||||
#region Implementation of IResponseStreamLine
|
#region Implementation of IResponseStreamLine
|
||||||
|
|
||||||
@ -15,7 +15,7 @@ public record ResponsesDeltaStreamLine(
|
|||||||
public bool ContainsContent() => this.Delta is not null;
|
public bool ContainsContent() => this.Delta is not null;
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public ContentStreamChunk GetContent() => new(this.Delta, this.GetSources());
|
public ContentStreamChunk GetContent() => new(this.Delta ?? string.Empty, this.GetSources());
|
||||||
|
|
||||||
//
|
//
|
||||||
// Please note that there are multiple options where LLM providers might stream sources:
|
// Please note that there are multiple options where LLM providers might stream sources:
|
||||||
@ -36,4 +36,4 @@ public record ResponsesDeltaStreamLine(
|
|||||||
public IList<ISource> GetSources() => [];
|
public IList<ISource> GetSources() => [];
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user