mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-11 05: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
@@ -124,7 +124,7 @@ public sealed class ProvenanceCleanupServiceTests
|
||||
// switches it on:
|
||||
var labStore = this.CreateLabStore();
|
||||
var project = await labStore.CreateAsync("Panel");
|
||||
var location = new BflThreadLocation(project.ProjectId, BflStep.KNOWLEDGE);
|
||||
var location = new BflStepThreadLocation(project.ProjectId, BflStep.KNOWLEDGE);
|
||||
var referenced = await this.store.Client.StoreAsync(location.ChatId, ProvenanceKind.WEB_PAGE, "of a page the chat of the lab read", null, TOKEN);
|
||||
var unreferenced = await this.store.Client.StoreAsync(location.ChatId, ProvenanceKind.WEB_PAGE, "of an answer the person removed", null, TOKEN);
|
||||
var thread = BflThreadFactory.Create(location);
|
||||
@@ -142,12 +142,33 @@ public sealed class ProvenanceCleanupServiceTests
|
||||
Assert.That(entries.Keys, Is.EquivalentTo(new[] { referenced.Value }), "The chat of the lab is read like any other chat.");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task WhatTheOnboardingOfTheLabReceivedSurvivesTheCleanup()
|
||||
{
|
||||
var labStore = this.CreateLabStore();
|
||||
var location = BflOnboardingThreadLocation.INSTANCE;
|
||||
var referenced = await this.store.Client.StoreAsync(location.ChatId, ProvenanceKind.WEB_PAGE, "of a page the onboarding read", null, TOKEN);
|
||||
var thread = BflThreadFactory.Create(location);
|
||||
thread.Blocks.Add(new ContentBlock
|
||||
{
|
||||
ContentType = ContentType.TEXT,
|
||||
Role = ChatRole.AI,
|
||||
Content = new ContentText { Text = "Laut der Seite …", SourcePassages = [new SourcePassage { SourceUrl = "https://example.org/", ProvenanceId = referenced }] }
|
||||
});
|
||||
await labStore.SaveThreadAsync(location, thread);
|
||||
|
||||
await this.RunAsync(RestoreStateWith(report: null));
|
||||
|
||||
var entries = await this.store.Client.GetEntriesAsync([referenced!.Value], TOKEN);
|
||||
Assert.That(entries.Keys, Is.EquivalentTo(new[] { referenced.Value }), "The onboarding belongs to no preparation, but it is a chat of the lab all the same.");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task WhatAChatOfADeletedPreparationReceivedIsRemoved()
|
||||
{
|
||||
var labStore = this.CreateLabStore();
|
||||
var project = await labStore.CreateAsync("Panel");
|
||||
var location = new BflThreadLocation(project.ProjectId, BflStep.KNOWLEDGE);
|
||||
var location = new BflStepThreadLocation(project.ProjectId, BflStep.KNOWLEDGE);
|
||||
await labStore.SaveThreadAsync(location, BflThreadFactory.Create(location));
|
||||
var entry = await this.store.Client.StoreAsync(location.ChatId, ProvenanceKind.WEB_PAGE, "of a page the chat of the lab read", null, TOKEN);
|
||||
await labStore.DeleteAsync(project.ProjectId);
|
||||
|
||||
Reference in new issue
Block a user