mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-11 21:07:21 +00:00
Added confirmed work states to the BeyondFacts Lab (#1182)
This commit is contained in:
1 parent
6d0052ecdf
commit
a9579dd282
39 files changed
+3160
-16
No files matched your search
@@ -0,0 +1,72 @@
|
||||
using AIStudio.Assistants.BeyondFactsLab;
|
||||
|
||||
namespace AIStudio.Tests.BeyondFactsLab;
|
||||
|
||||
/// <summary>
|
||||
/// Checks the request which lets the model write the work state of a step in the BeyondFacts Lab.
|
||||
/// </summary>
|
||||
[TestFixture]
|
||||
public sealed class BflWorkStateRequestTests
|
||||
{
|
||||
[Test]
|
||||
public async Task TheRequestOfEveryStepNamesEachOfItsSectionsWithItsHeading()
|
||||
{
|
||||
var template = await BflPromptLibrary.ReadAsync(BflPromptLibrary.WORK_STATE_PATH);
|
||||
foreach (var step in BflStep.All)
|
||||
{
|
||||
var request = BflPromptComposer.ComposeWorkStateRequest(template, step, new BflStepFormData());
|
||||
|
||||
using (Assert.EnterMultipleScope())
|
||||
{
|
||||
Assert.That(request, Does.Not.Contain("{{"), step.ToString());
|
||||
foreach (var section in BflWorkStateSections.ForStep(step))
|
||||
Assert.That(request, Does.Contain($"## [{section.Key}] {section.Title}"), $"{step}: {section.Key}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TheRequestOffersSuggestionsOnlyForEmptyTextFields()
|
||||
{
|
||||
var form = new BflStepFormData();
|
||||
form.Set(BflFieldCatalog.FORMAT, "Podium");
|
||||
|
||||
var request = BflPromptComposer.ComposeWorkStateRequest("{{SECTIONS}}\n{{FIELDS}}", BflStep.FRAMEWORK, form);
|
||||
|
||||
using (Assert.EnterMultipleScope())
|
||||
{
|
||||
Assert.That(request, Does.Contain($"[{BflMarkdownSections.FIELD_PREFIX}{BflFieldCatalog.AUDIENCE}]"));
|
||||
Assert.That(request, Does.Contain($"[{BflMarkdownSections.FIELD_PREFIX}{BflFieldCatalog.EVENT_LINK}]"));
|
||||
Assert.That(request, Does.Not.Contain($"[{BflMarkdownSections.FIELD_PREFIX}{BflFieldCatalog.FORMAT}]"));
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ARequestWithoutEmptyFieldsAsksForNoSuggestions()
|
||||
{
|
||||
var form = new BflStepFormData();
|
||||
form.Set(BflFieldCatalog.COMMUNICATION_WORRIES, "Sorge");
|
||||
|
||||
var request = BflPromptComposer.ComposeWorkStateRequest("{{FIELDS}}", BflStep.STRATEGY, form);
|
||||
|
||||
Assert.That(request, Does.Not.Contain(BflMarkdownSections.FIELD_PREFIX));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TheRequestToCorrectAWorkStateNamesEveryProblem()
|
||||
{
|
||||
var request = BflPromptComposer.ComposeWorkStateRepairRequest(["Der Abschnitt [GOAL] fehlt.", "Den Abschnitt [X] gibt es in diesem Schritt nicht."]);
|
||||
|
||||
using (Assert.EnterMultipleScope())
|
||||
{
|
||||
Assert.That(request, Does.Contain("- Der Abschnitt [GOAL] fehlt."));
|
||||
Assert.That(request, Does.Contain("- Den Abschnitt [X] gibt es in diesem Schritt nicht."));
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TheBuiltInRequestIsAPromptTheTestFolderMayReplace()
|
||||
{
|
||||
Assert.That(BflPromptLibrary.AllPaths, Does.Contain(BflPromptLibrary.WORK_STATE_PATH));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user