mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-13 00:14:26 +00:00
Rebuilt how AI Studio knows what a model can do (#960)
Build and Release / Determine run mode (push) Waiting to run
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 / 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
This commit is contained in:
1 parent
d21e09dd1e
commit
d85b4e71b6
287 files changed
+18341
-3677
No files matched your search
@@ -0,0 +1,68 @@
|
||||
using AIStudio.Models;
|
||||
using AIStudio.Provider;
|
||||
|
||||
namespace AIStudio.Tests.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Checks the two things about the capability enum which the rest of the app relies on.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Capabilities became a set carried in one value, which only works while each member owns a bit of
|
||||
/// its own. And the names are what an override written years ago addresses, so a member which is no
|
||||
/// longer handed out still has to answer to its name.
|
||||
/// </remarks>
|
||||
[TestFixture]
|
||||
public sealed class CapabilityTests
|
||||
{
|
||||
/// <summary>
|
||||
/// Every capability the app has ever written into a configuration.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Deliberately spelled out instead of read from the enum: a test which asks the enum about
|
||||
/// itself would agree with any change made to it, including a member being deleted. Removing
|
||||
/// one of these names silently drops the override an organization wrote for it.
|
||||
/// </remarks>
|
||||
private static readonly string[] NAMES_THAT_MUST_KEEP_WORKING =
|
||||
[
|
||||
"NONE", "UNKNOWN",
|
||||
"TEXT_INPUT", "AUDIO_INPUT", "SINGLE_IMAGE_INPUT", "MULTIPLE_IMAGE_INPUT", "SPEECH_INPUT", "VIDEO_INPUT",
|
||||
"TEXT_OUTPUT", "AUDIO_OUTPUT", "IMAGE_OUTPUT", "SPEECH_OUTPUT", "VIDEO_OUTPUT",
|
||||
"OPTIONAL_REASONING", "ALWAYS_REASONING", "REASONING_BY_DEFAULT",
|
||||
"EMBEDDING", "REALTIME", "FUNCTION_CALLING", "WEB_SEARCH",
|
||||
"CHAT_COMPLETION_API", "RESPONSES_API",
|
||||
];
|
||||
|
||||
[Test]
|
||||
public void EveryCapabilityOwnsOneBitOfItsOwn()
|
||||
{
|
||||
var bits = new Dictionary<ulong, Capability>();
|
||||
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
foreach (var capability in Enum.GetValues<Capability>())
|
||||
{
|
||||
if (capability is Capability.NONE)
|
||||
continue;
|
||||
|
||||
var value = (ulong) capability;
|
||||
Assert.That(ulong.IsPow2(value), Is.True, $"{capability} is not a single bit, so it cannot be part of a set.");
|
||||
|
||||
if (bits.TryGetValue(value, out var other))
|
||||
Assert.Fail($"{capability} and {other} share a bit, so the app cannot tell them apart.");
|
||||
|
||||
bits[value] = capability;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void NoCapabilityLostItsName() => Assert.That(Enum.GetNames<Capability>(), Is.SupersetOf(NAMES_THAT_MUST_KEEP_WORKING));
|
||||
|
||||
[Test]
|
||||
public void TheReasoningVocabularyIsExactlyTheThreeReasoningMembers()
|
||||
{
|
||||
const Capability THE_THREE = Capability.OPTIONAL_REASONING | Capability.ALWAYS_REASONING | Capability.REASONING_BY_DEFAULT;
|
||||
|
||||
Assert.That(ModelProfile.REASONING_VOCABULARY, Is.EqualTo(THE_THREE));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user