-
We are using Semantic Kernel (C# NuGet 1.55.0) to integrate Azure OpenAI with our application. We have given our AI a tool to launch modal dialogs in our application. This tool works except that Semantic Kernel times out after about 100 seconds. We need Semantic Kernel to wait until the dialog closes and the tool that launched the dialog returns. This could be forever. We would like to do this while continuing to leverage the very convenient plugin orchestration provided by Semantic Kernel. That is, we add our method using I have poked around, but I cannot find any way to control this. Some observations:
Is there a way to control this that I am missing? Would this be an appropriate feature request? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
I tried reproducing the issue using Semantic Kernel 1.61.0, but I wasn’t able to observe the same timeout behavior. The plugin function continued running beyond 100 seconds without interruption. To help investigate further, could you share:
Here’s the code I used for testing: using Azure.Identity;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.SemanticKernel;
using Microsoft.SemanticKernel.ChatCompletion;
using Microsoft.SemanticKernel.Connectors.AzureOpenAI;
using Microsoft.SemanticKernel.Connectors.OpenAI;
using System.ComponentModel;
var builder = Kernel.CreateBuilder();
builder.AddAzureOpenAIChatCompletion(
"gpt-4.1",
"https://xxxxxx.azure.com/",
new AzureCliCredential());
builder.Plugins.AddFromType<SomePlugin>();
var kernel = builder.Build();
var client = kernel.Services.GetRequiredService<IChatCompletionService>();
var result = await client.GetChatMessageContentAsync("Add 'go for a walk with the dog' to the task database.",
new AzureOpenAIPromptExecutionSettings
{
ToolCallBehavior = ToolCallBehavior.AutoInvokeKernelFunctions,
},
kernel);
Console.WriteLine(result.Content);
class SomePlugin
{
[KernelFunction, Description("Add task to database.")]
public async Task AddTaskAsync(string task)
{
for (int i = 0; i < 110; i++)
{
Console.WriteLine($"Adding task: {task} - Attempt {i + 1}");
await Task.Delay(1000); // Simulate some work
}
Console.WriteLine("Task added successfully.");
}
} Here's the execution result I observed.
|
Beta Was this translation helpful? Give feedback.
-
I tried updating to 1.61.0. The timeout still occurs on cue. Although I have not wended my way through the orchestrator code yet, I had assumed the 100-second timeout was standard in Semantic Kernel because I found things like these:
I realize that these are not identical to my situation, but it left me thinking the 100-second timeout made sense, so I started spelunking here. The big thing I take from your answer is that you do not think Semantic Kernel should be timing out on tool calls. I will take a step out and review exactly how we are invoking our dialog. I may be barking up the wrong tree. |
Beta Was this translation helpful? Give feedback.
-
OK. I tried a simple case like yours: I just sleep for 200 seconds, and Semantic Kernel is not timing out at 100 seconds. My simple methods waits until the 200 seconds expire. We apparently have a timeout I was not aware of lower down in our stack. Thank you very much for your help. |
Beta Was this translation helpful? Give feedback.
I tried reproducing the issue using Semantic Kernel 1.61.0, but I wasn’t able to observe the same timeout behavior. The plugin function continued running beyond 100 seconds without interruption.
To help investigate further, could you share:
Here’s the code I used for testing: