Added the exact token count for Anthropic

This commit is contained in:
Thorsten Sommer committed 2026-09-24 12:49:21 +02:00
1 parent a4ac6bc5a0
commit 4becb98ee2
10 files changed
+387 -8

No files matched your search

@@ -9,4 +9,14 @@ namespace AIStudio.Provider.Anthropic;
/// <param name="Index">Which content block the event belongs to; blocks are correlated by it.</param>
/// <param name="ContentBlock">The block as it opens, for a content block start.</param>
/// <param name="Delta">The piece this event adds, for a content block delta or a message delta.</param>
public readonly record struct AnthropicStreamLine(string? Type, int Index, JsonElement ContentBlock, AnthropicStreamDelta Delta);
public readonly record struct AnthropicStreamLine(string? Type, int Index, JsonElement ContentBlock, AnthropicStreamDelta Delta)
{
/// <summary>
/// The message the stream opens with, for a message start.
/// </summary>
/// <remarks>
/// Not a positional parameter, because nobody but the serializer ever builds this line with
/// one. It is what states the usage, for the reason given at ResponseStreamLine.GetUsage.
/// </remarks>
public AnthropicStreamMessage? Message { get; init; }
}