You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.Net: Fix bug where invoking with no message throws for some agents. (microsoft#11217)
### Motivation and Context
We were relying on the thread being created when we added messages to it
the first time, but in some cases no messages will be added, since the
agent could be invoked with no messages.
### Description
Fix bug where invoking with no message throws for some agents.
### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [ ] The code builds clean without any errors or warnings
- [ ] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
Copy file name to clipboardExpand all lines: dotnet/src/Agents/Abstractions/AgentThread.cs
+1-1
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,7 @@ public abstract class AgentThread
32
32
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
33
33
/// <returns>A task that completes when the thread has been created.</returns>
34
34
/// <exception cref="InvalidOperationException">The thread has been deleted.</exception>
Copy file name to clipboardExpand all lines: dotnet/src/IntegrationTests/Agents/CommonInterfaceConformance/InvokeConformance/BedrockAgentInvokeTests.cs
+8
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,6 @@
1
1
// Copyright (c) Microsoft. All rights reserved.
2
2
3
+
usingSystem;
3
4
usingSystem.Linq;
4
5
usingSystem.Threading.Tasks;
5
6
usingMicrosoft.SemanticKernel;
@@ -40,6 +41,13 @@ public override Task InvokeWithoutThreadCreatesThreadAsync()
Copy file name to clipboardExpand all lines: dotnet/src/IntegrationTests/Agents/CommonInterfaceConformance/InvokeStreamingConformance/InvokeStreamingTests.cs
+19
Original file line number
Diff line number
Diff line change
@@ -62,6 +62,25 @@ public virtual async Task InvokeStreamingAsyncWithoutThreadCreatesThreadAsync()
0 commit comments