mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-11 07:47:21 +00:00
Added an introduction and an onboarding chat to the BeyondFacts Lab (#1178)
This commit is contained in:
1 parent
79e0c80031
commit
22d94eb8fd
35 files changed
+1377
-361
No files matched your search
@@ -24,6 +24,16 @@ public sealed class BflPromptLibraryTests
|
||||
/// </remarks>
|
||||
private const int MAX_FIXED_PROMPT_CHARACTERS = 90_000;
|
||||
|
||||
/// <summary>
|
||||
/// How many characters the fixed part of the prompt of the onboarding may have: the prompt and the longest form of
|
||||
/// address.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// About 4,000 tokens. The onboarding asks for no minimum context window, unlike the steps, so it has to leave room
|
||||
/// for a conversation in small models as well.
|
||||
/// </remarks>
|
||||
private const int MAX_ONBOARDING_PROMPT_CHARACTERS = 16_000;
|
||||
|
||||
[Test]
|
||||
public async Task EveryPromptComesWithTheApp()
|
||||
{
|
||||
@@ -66,4 +76,30 @@ public sealed class BflPromptLibraryTests
|
||||
|
||||
Assert.That(core.Length + knowledge.Length + longestStep + longestAddress, Is.LessThanOrEqualTo(MAX_FIXED_PROMPT_CHARACTERS));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task EveryOpeningRequestNamesASectionOfItsPrompt()
|
||||
{
|
||||
var core = (await BflPromptLibrary.ReadAsync(BflPromptLibrary.CORE_PATH)).ReplaceLineEndings("\n");
|
||||
var onboarding = (await BflPromptLibrary.ReadAsync(BflPromptLibrary.ONBOARDING_PATH)).ReplaceLineEndings("\n");
|
||||
|
||||
using (Assert.EnterMultipleScope())
|
||||
{
|
||||
Assert.That(BflConversationService.OpeningRequestFor(new BflStepThreadLocation(Guid.NewGuid(), BflStep.FRAMEWORK)), Does.Contain("„Dieser Schritt“"));
|
||||
Assert.That(core, Does.Contain("\n# Dieser Schritt\n"));
|
||||
Assert.That(BflConversationService.OpeningRequestFor(BflOnboardingThreadLocation.INSTANCE), Does.Contain("„Gesprächsführung“"));
|
||||
Assert.That(onboarding, Does.Contain("\n# Gesprächsführung\n"));
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task ThePromptOfTheOnboardingStaysShort()
|
||||
{
|
||||
var onboarding = await BflPromptLibrary.ReadAsync(BflPromptLibrary.ONBOARDING_PATH);
|
||||
var longestAddress = 0;
|
||||
foreach (var addressForm in Enum.GetValues<AddressForm>())
|
||||
longestAddress = Math.Max(longestAddress, (await BflPromptLibrary.ReadAsync(BflPromptLibrary.AddressPath(addressForm))).Length);
|
||||
|
||||
Assert.That(onboarding.Length + longestAddress, Is.LessThanOrEqualTo(MAX_ONBOARDING_PROMPT_CHARACTERS));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user