mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-08 23:09:40 +00:00
Read the reported token usage in one place
This commit is contained in:
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;
|
||||
}
|
||||
Reference in new issue
Block a user