Moved goals and roles before knowledge in the BeyondFacts Lab (#1214)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2026-11-20 19:33:04 +01:00
1 parent 761ec7001d
commit 6cdb0bc551
38 files changed
+334 -186

No files matched your search

@@ -6,12 +6,13 @@ namespace AIStudio.Assistants.BeyondFactsLab;
/// <summary>
/// Tells the person that files in the test folder replace prompts of the lab, so that nobody mistakes the answers of
/// experimental prompts for those of the lab.
/// experimental prompts for those of the lab, and names the files there which replace no prompt, so that nobody
/// takes the answers of the lab for those of their experimental prompts.
/// </summary>
/// <remarks>
/// It checks the folder when it appears, e.g., for every step the person opens, and whenever a setting changes. It
/// shows nothing while the setting does not allow prompt overrides, or while every file in the folder matches the
/// prompt it replaces.
/// prompt it replaces and every Markdown file there has the name of a prompt.
/// </remarks>
public partial class BflPromptOverrideNotice : MSGComponentBase
{
@@ -32,6 +33,11 @@ public partial class BflPromptOverrideNotice : MSGComponentBase
/// </summary>
private bool usesPromptOverrides;
/// <summary>
/// The Markdown files in the test folder which replace no prompt of the lab, relative to the folder.
/// </summary>
private IReadOnlyList<string> unknownFiles = [];
/// <inheritdoc />
protected override async Task OnInitializedAsync()
{
@@ -54,19 +60,21 @@ public partial class BflPromptOverrideNotice : MSGComponentBase
}
/// <summary>
/// Checks whether files in the test folder replace prompts of the lab.
/// Checks whether files in the test folder replace prompts of the lab, and which files there replace none.
/// </summary>
private async Task CheckAsync()
{
try
{
this.usesPromptOverrides = await this.ConversationService.UsesPromptOverridesAsync();
this.unknownFiles = this.ConversationService.FindUnknownPromptOverrides();
}
catch (Exception exception) when (exception is IOException or UnauthorizedAccessException)
{
// Sending reports a problem with the prompts; the notice only stays hidden:
this.Logger.LogDebug(exception, "Could not check the test folder of the BeyondFacts Lab.");
this.usesPromptOverrides = false;
this.unknownFiles = [];
}
}
}