mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-05 04:27:21 +00:00
Added a SWOT analysis assistant (#1122)
Co-authored-by: hart_s3 <sabrina.hartmann@dlr.de>
This commit is contained in:
1 parent
6cb20fd75a
commit
060a2a5734
87 files changed
+4601
-45
No files matched your search
@@ -0,0 +1,45 @@
|
||||
using AIStudio.Assistants.SWOTAnalysis;
|
||||
using AIStudio.Chat;
|
||||
|
||||
namespace AIStudio.Tests.Assistants.SWOTAnalysis;
|
||||
|
||||
[TestFixture]
|
||||
public sealed class SwotContextualKnowledgeTests
|
||||
{
|
||||
private const string DOCUMENTS = "The following files are attached to this message: annual-report.pdf";
|
||||
|
||||
[Test]
|
||||
public void WithoutMaterialTheSectionSaysSo() =>
|
||||
Assert.That(SwotContextualKnowledge.NONE.Describe(), Is.EqualTo("No additional contextual knowledge was provided."));
|
||||
|
||||
[Test]
|
||||
public void DocumentsAloneAreTheSection() =>
|
||||
Assert.That(new SwotContextualKnowledge(DOCUMENTS, []).Describe(), Is.EqualTo(DOCUMENTS));
|
||||
|
||||
[Test]
|
||||
public void ImagesAloneAreNamedByTheirCount()
|
||||
{
|
||||
var oneImage = new SwotContextualKnowledge(string.Empty, [Image("chart.png")]);
|
||||
var twoImages = new SwotContextualKnowledge(string.Empty, [Image("chart.png"), Image("photo.jpg")]);
|
||||
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
Assert.That(oneImage.Describe(), Is.EqualTo("The image attached to this message belongs to the contextual knowledge."));
|
||||
Assert.That(twoImages.Describe(), Is.EqualTo("The 2 images attached to this message belong to the contextual knowledge."));
|
||||
});
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ImagesFollowTheDocuments()
|
||||
{
|
||||
var description = new SwotContextualKnowledge(DOCUMENTS, [Image("chart.png")]).Describe();
|
||||
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
Assert.That(description, Does.StartWith(DOCUMENTS));
|
||||
Assert.That(description, Does.EndWith("The image attached to this message belongs to the contextual knowledge."));
|
||||
});
|
||||
}
|
||||
|
||||
private static FileAttachmentImage Image(string fileName) => new(fileName, $"/tmp/{fileName}", 1024);
|
||||
}
|
||||
Reference in new issue
Block a user