Read the reported token usage in one place

This commit is contained in:
Thorsten Sommer committed 2026-09-23 18:26:18 +02:00
1 parent bbd73f389b
commit ceb78ff9b7
7 files changed
+23 -31

No files matched your search

@@ -18,18 +18,16 @@ public interface IResponseStreamLine : IAnnotationStreamLine
public ContentStreamChunk GetContent();
/// <summary>
/// Checks whether the response line states what the request cost.
/// Gets what the provider said the request cost.
/// </summary>
/// <remarks>
/// Answered here for every wire format which says nothing about it, which is most of them: a
/// provider who reports no usage is the normal case, not a gap somebody has to fill in.
///
/// Unlike content and sources, there is no separate check for whether a line carries it. This
/// never fails on a line without one, and whether the answer means anything is what IsKnown of
/// the returned usage says.
/// </remarks>
/// <returns>True when the response line carries a token usage, false otherwise.</returns>
public bool ContainsUsage() => false;
/// <summary>
/// Gets what the provider said the request cost.
/// </summary>
/// <returns>The usage, or TokenUsage.UNKNOWN when the line carries none.</returns>
public TokenUsage GetUsage() => TokenUsage.UNKNOWN;
}