mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-13 05:33:48 +00:00
Fixed reasoning tokens inflating the exact token count
This commit is contained in:
12 files changed
+172
-104
No files matched your search
@@ -1595,7 +1595,7 @@ public partial class ChatComponent : MSGComponentBase
|
||||
{
|
||||
var provider = AIStudio.Settings.Provider.NONE;
|
||||
var parts = ConversationParts.NOTHING;
|
||||
var reported = TokenUsage.UNKNOWN;
|
||||
var reported = ReportedHistory.UNKNOWN;
|
||||
|
||||
//
|
||||
// Collected on the render thread, counted off it. Counting may take an IPC call per text,
|
||||
@@ -1614,7 +1614,7 @@ public partial class ChatComponent : MSGComponentBase
|
||||
var toolDefinitions = this.GetRunnableToolDefinitions();
|
||||
provider = this.Provider;
|
||||
parts = ConversationParts.Of(thread, this.BuildSystemPromptFor(thread, toolDefinitions), this.UserInput, this.ComposerState.FileAttachments, provider.SupportsImageInput(), toolDefinitions);
|
||||
reported = thread.ReportedUsageFor(provider.Model);
|
||||
reported = thread.ReportedHistoryFor(provider.Model);
|
||||
});
|
||||
|
||||
var counted = await this.ConversationTokenCounter.CountAsync(provider, parts, reported, token);
|
||||
|
||||
Reference in new issue
Block a user