forked from microsoft/semantic-kernel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBedrockAgentInvokeTests.cs
48 lines (39 loc) · 1.79 KB
/
BedrockAgentInvokeTests.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Copyright (c) Microsoft. All rights reserved.
using System.Linq;
using System.Threading.Tasks;
using Microsoft.SemanticKernel;
using Microsoft.SemanticKernel.ChatCompletion;
using Xunit;
namespace SemanticKernel.IntegrationTests.Agents.CommonInterfaceConformance.InvokeConformance;
public class BedrockAgentInvokeTests() : InvokeTests(() => new BedrockAgentFixture())
{
[Fact(Skip = "This test is for manual verification.")]
public override async Task ConversationMaintainsHistoryAsync()
{
var q1 = "What is the capital of France.";
var q2 = "What is the tallest building in that city?";
var agent = this.Fixture.Agent;
var asyncResults1 = agent.InvokeAsync(new ChatMessageContent(AuthorRole.User, q1), this.Fixture.AgentThread);
var result1 = await asyncResults1.FirstAsync();
var asyncResults2 = agent.InvokeAsync(new ChatMessageContent(AuthorRole.User, q2), result1.Thread);
var result2 = await asyncResults2.FirstAsync();
Assert.Contains("Paris", result1.Message.Content);
Assert.Contains("Eiffel", result2.Message.Content);
// The BedrockAgentThread cannot read messages from the thread. This is a limitation of Bedrock Sessions.
}
[Fact(Skip = "This test is for manual verification.")]
public override Task InvokeReturnsResultAsync()
{
return base.InvokeReturnsResultAsync();
}
[Fact(Skip = "This test is for manual verification.")]
public override Task InvokeWithoutThreadCreatesThreadAsync()
{
return base.InvokeWithoutThreadCreatesThreadAsync();
}
[Fact(Skip = "This test is for manual verification.")]
public override Task MultiStepInvokeWithPluginAndArgOverridesAsync()
{
return base.MultiStepInvokeWithPluginAndArgOverridesAsync();
}
}