mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-10 12:33:48 +00:00
Add per-answer thinking disclosure
This commit is contained in:
1 parent
c7b42bee96
commit
bbbcdddc91
29 files changed
+360
-37
No files matched your search
@@ -10,10 +10,15 @@ namespace AIStudio.Provider.Anthropic;
|
||||
public readonly record struct ResponseStreamLine(string Type, int Index, Delta Delta) : IResponseStreamLine
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public bool ContainsContent() => this != default && !string.IsNullOrWhiteSpace(this.Delta.Text);
|
||||
public bool ContainsContent() => this != default &&
|
||||
(!string.IsNullOrEmpty(this.Delta.Text) || !string.IsNullOrEmpty(this.Delta.Thinking));
|
||||
|
||||
/// <inheritdoc />
|
||||
public ContentStreamChunk GetContent() => new(this.Delta.Text, []);
|
||||
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
|
||||
|
||||
@@ -29,4 +34,4 @@ public readonly record struct ResponseStreamLine(string Type, int Index, Delta D
|
||||
public IList<ISource> GetSources() => [];
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user