.Net: Bug: .NET, OpenAI Assistant An item with the same key has already been added. Key: step_
After upgrading to the latest version of SK 1.2.8.0 and OpenAi SDK 2.1.0 - beta.2 we start getting the following error message:
System.ArgumentException: An item with the same key has already been added.
Key: step_nZg6g0H4Z6tF043ZgJNhiR5B
at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
at Microsoft.SemanticKernel.Agents.OpenAI.Internal.AssistantThreadActions.InvokeStreamingAsync(OpenAIAssistantAgent agent,
AssistantClient client, String threadId, IList`1 messages, OpenAIAssistantInvocationOptions invocationOptions, ILogger logger, Kernel kernel, KernelArguments arguments, CancellationToken cancellationToken)+MoveNext()
at Microsoft.SemanticKernel.Agents.OpenAI.Internal.AssistantThreadActions.InvokeStreamingAsync(OpenAIAssistantAgent agent, AssistantClient client, String threadId, IList`1 messages, OpenAIAssistantInvocationOptions invocationOptions, ILogger logger,
Kernel kernel, KernelArguments arguments, CancellationToken cancellationToken)+System.Threading.Tasks.Sources.IValueTaskSource.GetResult()
at AiEngine.SemanticKernel.SemanticKernelService.GetChatMessageContentStreamingAssistantAsync(RequestModel requestModel, OpenAIAssistantAgent assistant, String threadId, List`1 images) in
This happens from time to time, we can't catch the exact pattern.
@JP-droidic - Thanks for reporting this. Can you please confirm on whether you are using any plugins or functions with this agent, or is this entirely message generation? In the meantime, I'll setup a local stress test to see if I can't reproduce this error for additional insight.
@crickman Hi Chris
thank you!. Yes, the kernel has 10ish plugins added
Ok, I have a hypothesis on what may be occurring here. Moving from stress-test to a targeted scenario.
Thank you @crickman !