Skip to content

.Net: Bug: System.NotSupportedException thrown when invoking plugin with OpenAIAssistantAgent while reproducing the MixedChat_Agents sample in Semantic Kernel #9245

@rogeriorfp

Description

@rogeriorfp

Describe the bug
When adding a plugin to the OpenAIAssistantAgent in the Semantic Kernel, a System.NotSupportedException exception occurs when calling chat.InvokeAsync(). The error happens specifically when the plugin is invoked in the flow. This issue does not occur with the ChatCompletionAgent.

Exception has occurred: CLR/System.NotSupportedException
An exception of type 'System.NotSupportedException' occurred in System.Private.CoreLib.dll but was not handled in user code: 'No function result provided in the tool message.'
   at Microsoft.SemanticKernel.Connectors.OpenAI.ClientCore.CreateRequestMessages(ChatMessageContent message)
   at Microsoft.SemanticKernel.Connectors.OpenAI.ClientCore.CreateChatCompletionMessages(OpenAIPromptExecutionSettings executionSettings, ChatHistory chatHistory)
   at Microsoft.SemanticKernel.Connectors.OpenAI.ClientCore.<GetChatMessageContentsAsync>d__15.MoveNext()
   at Microsoft.SemanticKernel.Agents.ChatCompletionAgent.<InvokeAsync>d__2.MoveNext()
   at Microsoft.SemanticKernel.Agents.ChatCompletionAgent.<InvokeAsync>d__2.System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult(Int16 token)
   at Microsoft.SemanticKernel.Agents.ChatHistoryChannel.<InvokeAsync>d__1.MoveNext()
   at Microsoft.SemanticKernel.Agents.ChatHistoryChannel.<InvokeAsync>d__1.MoveNext()
   at Microsoft.SemanticKernel.Agents.ChatHistoryChannel.<InvokeAsync>d__1.System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult(Int16 token)
   at Microsoft.SemanticKernel.Agents.AgentChat.<InvokeAgentAsync>d__22.MoveNext()
   at Microsoft.SemanticKernel.Agents.AgentChat.<InvokeAgentAsync>d__22.MoveNext()
   at Microsoft.SemanticKernel.Agents.AgentChat.<InvokeAgentAsync>d__22.System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult(Int16 token)
   at Microsoft.SemanticKernel.Agents.AgentGroupChat.<InvokeAsync>d__15.MoveNext()
   at Microsoft.SemanticKernel.Agents.AgentGroupChat.<InvokeAsync>d__15.MoveNext()
   at Microsoft.SemanticKernel.Agents.AgentGroupChat.<InvokeAsync>d__15.System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult(Int16 token)
   at Microsoft.SemanticKernel.Agents.AgentGroupChat.<InvokeAsync>d__13.MoveNext()
   at Microsoft.SemanticKernel.Agents.AgentGroupChat.<InvokeAsync>d__13.MoveNext()
   at Microsoft.SemanticKernel.Agents.AgentGroupChat.<InvokeAsync>d__13.System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult(Int16 token)
   at Program.<<Main>$>d__0.MoveNext() in c:\dev\projects\dotnet\sk-multiagent-verification\Program.cs:line 90
   at Program.<<Main>$>d__0.MoveNext() in c:\dev\projects\dotnet\sk-multiagent-verification\Program.cs:line 90

To Reproduce
Steps to reproduce the behavior:

  1. Go to the following Semantic Kernel sample: https://github.com/microsoft/semantic-kernel/blob/main/dotnet/samples/Concepts/Agents/MixedChat_Agents.cs
  2. Add a plugin to the OpenAIAssistantAgent.
  3. Adjust the prompt for OpenAIAssistantAgent to ensure the plugin is triggered.
  4. Run the sample

Expected behavior
The expected behavior is that the agent group successfully concludes the conversation by calling the plugin, without throwing a System.NotSupportedException when invoking chat.InvokeAsync().

Screenshots
If applicable, add screenshots to help explain your problem.

Platform

  • OS: Windows 11
  • IDE: Visual Studio, VS Code
  • Language: C#
  • Source:
    • Microsoft.SemanticKernel version 1.22.0
    • Microsoft.SemanticKernel.Agents.Core version 1.22.0-alpha
    • Microsoft.SemanticKernel.Agents.OpenAI version 1.22.0-alpha

Metadata

Metadata

Assignees

Labels

.NETIssue or Pull requests regarding .NET codePR: ready for reviewAll feedback addressed, ready for reviewsagentsbugSomething isn't workingexperimentalAssociated with an experimental feature

Type

Projects

Status

Sprint: Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions