mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-13 05:13:47 +00:00
Added the exact token count where the provider reports it (#989)
Build and Release / Determine run mode (push) Waiting to run
Build and Release / Read metadata (push) Blocked by required conditions
Build and Release / Sync Flatpak repo (push) Blocked by required conditions
Build and Release / Collect Flatpak artifacts (push) Blocked by required conditions
Build and Release / Verify (push) Waiting to run
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-apple-darwin, osx-arm64, macos-latest, aarch64-apple-darwin, dmg,app,updater, dmg) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-pc-windows-msvc.exe, win-arm64, windows-latest, aarch64-pc-windows-msvc, nsis,updater, nsis) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-unknown-linux-gnu, linux-arm64, ubuntu-22.04-arm, aarch64-unknown-linux-gnu, appimage,updater, appimage) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-apple-darwin, osx-x64, macos-latest, x86_64-apple-darwin, dmg,app,updater, dmg) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-pc-windows-msvc.exe, win-x64, windows-latest, x86_64-pc-windows-msvc, nsis,updater, nsis) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-unknown-linux-gnu, linux-x64, ubuntu-22.04, x86_64-unknown-linux-gnu, appimage,updater, appimage) (push) Blocked by required conditions
Build and Release / Prepare & create release (push) Blocked by required conditions
Build and Release / Publish release (push) Blocked by required conditions
Build and Release / Determine run mode (push) Waiting to run
Build and Release / Read metadata (push) Blocked by required conditions
Build and Release / Sync Flatpak repo (push) Blocked by required conditions
Build and Release / Collect Flatpak artifacts (push) Blocked by required conditions
Build and Release / Verify (push) Waiting to run
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-apple-darwin, osx-arm64, macos-latest, aarch64-apple-darwin, dmg,app,updater, dmg) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-pc-windows-msvc.exe, win-arm64, windows-latest, aarch64-pc-windows-msvc, nsis,updater, nsis) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-unknown-linux-gnu, linux-arm64, ubuntu-22.04-arm, aarch64-unknown-linux-gnu, appimage,updater, appimage) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-apple-darwin, osx-x64, macos-latest, x86_64-apple-darwin, dmg,app,updater, dmg) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-pc-windows-msvc.exe, win-x64, windows-latest, x86_64-pc-windows-msvc, nsis,updater, nsis) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-unknown-linux-gnu, linux-x64, ubuntu-22.04, x86_64-unknown-linux-gnu, appimage,updater, appimage) (push) Blocked by required conditions
Build and Release / Prepare & create release (push) Blocked by required conditions
Build and Release / Publish release (push) Blocked by required conditions
Co-authored-by: Thorsten Sommer <SommerEngineering@users.noreply.github.com>
This commit is contained in:
1 parent
82986afe62
commit
be1e6532fb
34 files changed
+1360
-104
No files matched your search
@@ -25,7 +25,7 @@ public sealed class ConversationTokensTests
|
||||
var counted = new ConversationTokens
|
||||
{
|
||||
IsKnown = true,
|
||||
UncountedImages = images,
|
||||
Images = images,
|
||||
ImageLimits = new ImageLimits(null, allowed),
|
||||
};
|
||||
|
||||
@@ -42,7 +42,7 @@ public sealed class ConversationTokensTests
|
||||
var counted = new ConversationTokens
|
||||
{
|
||||
IsKnown = true,
|
||||
UncountedImages = 500,
|
||||
Images = 500,
|
||||
ImageLimits = ImageLimits.UNKNOWN,
|
||||
};
|
||||
|
||||
@@ -60,7 +60,7 @@ public sealed class ConversationTokensTests
|
||||
var counted = new ConversationTokens
|
||||
{
|
||||
IsKnown = true,
|
||||
UncountedImages = 20,
|
||||
Images = 20,
|
||||
ImageLimits = new ImageLimits(8, 100),
|
||||
};
|
||||
|
||||
@@ -77,7 +77,7 @@ public sealed class ConversationTokensTests
|
||||
var counted = new ConversationTokens
|
||||
{
|
||||
IsKnown = true,
|
||||
UncountedImages = 0,
|
||||
Images = 0,
|
||||
ImageLimits = new ImageLimits(null, 0),
|
||||
};
|
||||
|
||||
@@ -93,4 +93,64 @@ public sealed class ConversationTokensTests
|
||||
//
|
||||
Assert.That(ConversationTokens.UNAVAILABLE.TooManyImages, Is.False);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void PicturesAProviderCountedAreNotCalledUncounted()
|
||||
{
|
||||
//
|
||||
// What the provider reported for the conversation so far includes its pictures, however
|
||||
// it charges them. Only those still waiting in the composer are left for nobody to count.
|
||||
//
|
||||
var reported = new ConversationTokens
|
||||
{
|
||||
IsKnown = true,
|
||||
HistoryIsReported = true,
|
||||
Images = 3,
|
||||
DraftImages = 1,
|
||||
};
|
||||
|
||||
var estimated = reported with { HistoryIsReported = false };
|
||||
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
Assert.That(reported.UncountedImages, Is.EqualTo(1), "The provider counted the two which were sent.");
|
||||
Assert.That(estimated.UncountedImages, Is.EqualTo(3), "Without a report, nobody counted any of them.");
|
||||
});
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TooManyPicturesStaysTooManyWhenTheProviderCountedThem()
|
||||
{
|
||||
//
|
||||
// The limit is on how many pictures travel, not on what they cost. A provider which has
|
||||
// counted them still refuses the request which carries one too many.
|
||||
//
|
||||
var counted = new ConversationTokens
|
||||
{
|
||||
IsKnown = true,
|
||||
HistoryIsReported = true,
|
||||
Images = 10,
|
||||
ImageLimits = new ImageLimits(8, null),
|
||||
};
|
||||
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
Assert.That(counted.UncountedImages, Is.Zero);
|
||||
Assert.That(counted.TooManyImages, Is.True);
|
||||
});
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TheWholeNumberIsTheConversationAndTheDraft()
|
||||
{
|
||||
var counted = new ConversationTokens
|
||||
{
|
||||
IsKnown = true,
|
||||
HistoryTokens = 12_400,
|
||||
ToolTokens = 9_000,
|
||||
DraftTokens = 340,
|
||||
};
|
||||
|
||||
Assert.That(counted.Tokens, Is.EqualTo(12_740), "The tools' share is part of the conversation, not added on top of it.");
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user