mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-06 23:49:40 +00:00
Fixed attached files silently reaching the AI as empty documents (#904)
This commit is contained in:
1 parent
b9ec13edcf
commit
8f8f788896
31 files changed
+1730
-285
No files matched your search
@@ -0,0 +1,23 @@
|
||||
namespace AIStudio.Tools;
|
||||
|
||||
/// <summary>
|
||||
/// The outcome of processing one content stream event: either content to append, or a reported
|
||||
/// failure.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Content and error are kept apart on purpose. A reported failure must never be appended as
|
||||
/// content, because that would hand the failure to the AI as if it were part of the document.
|
||||
/// </remarks>
|
||||
/// <param name="Content">The content to append, or null when this event carries none.</param>
|
||||
/// <param name="Error">The reported failure, or null when the event was processed successfully.</param>
|
||||
public readonly record struct ContentStreamProcessedEvent(string? Content, ContentStreamErrorDetails? Error)
|
||||
{
|
||||
/// <summary>
|
||||
/// An event which neither produced content nor reported a failure.
|
||||
/// </summary>
|
||||
public static readonly ContentStreamProcessedEvent NOTHING = new(null, null);
|
||||
|
||||
public static ContentStreamProcessedEvent FromContent(string? content) => new(content, null);
|
||||
|
||||
public static ContentStreamProcessedEvent FromError(ContentStreamErrorDetails? error) => new(null, error);
|
||||
}
|
||||
Reference in new issue
Block a user