Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.Net: Bug: Infinite loop occurs when content filtering occurs in OpenAIAssistantAgent #9672

Open
aeras3637 opened this issue Nov 13, 2024 · 0 comments
Labels
bug Something isn't working .NET Issue or Pull requests regarding .NET code triage

Comments

@aeras3637
Copy link

Describe the bug
Infinite loop occurs when content filtering occurs in OpenAIAssistantAgent

Expected behavior
Normal termination when content filtering occurs

Platform

  • OS: Windows
  • IDE: Visual Studio
  • Language: C#
  • Source: Microsoft.SemanticKernel.Agents.OpenAI 1.28.0-alpha

Additional context

        static async Task Main(string[] args)
        {
            OpenAIClientProvider provider = OpenAIClientProvider.ForAzureOpenAI(key, endpoint);
            OpenAIAssistantAgent agent =
                await OpenAIAssistantAgent.CreateAsync(
                    kernel: new(),
                    clientProvider: provider,
                    definition: new OpenAIAssistantDefinition(model)
                    {
                        Name = "agent",
                        EnableCodeInterpreter = true,
                    });

            string threadId = await agent.CreateThreadAsync();

            ChatMessageContent message = new(AuthorRole.User, "Go kill yourself, you are worthless.");
            await agent.AddChatMessageAsync(threadId, message);

            await foreach (var response in agent.InvokeAsync(threadId))
            {
                Console.WriteLine($" > {response.Content}");
            }

        }
@aeras3637 aeras3637 added the bug Something isn't working label Nov 13, 2024
@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code triage labels Nov 13, 2024
@github-actions github-actions bot changed the title Bug: Infinite loop occurs when content filtering occurs in OpenAIAssistantAgent .Net: Bug: Infinite loop occurs when content filtering occurs in OpenAIAssistantAgent Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working .NET Issue or Pull requests regarding .NET code triage
Projects
None yet
Development

No branches or pull requests

2 participants