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: Monitor & Troubleshoot the Semantic Kernel C# SDK using the KernelFunction #9666

Open
markbartolocodit opened this issue Nov 12, 2024 · 2 comments
Assignees
Labels
.NET Issue or Pull requests regarding .NET code question Further information is requested

Comments

@markbartolocodit
Copy link

.Net: Observability

We are using the Semantic Kernel C# SDK, but having some troubles identifying the possibilities to monitor & troubleshoot this solution.

We are using a KernelFunction using OpenAI and within that, the Azure OpenAI is throwing 429's.

Nevertheless, it seems that this is captured within the code of the Semantic Kernel & we cannot distinguish the issues when we get back the result from the kernel.

So we have a few questions:

  • Are we missing a functionality in that regard?
  • If Yes, where?
  • If No, is this something considered in the roadmap?

Thanks for the feedback!

@moonbox3 moonbox3 added .NET Issue or Pull requests regarding .NET code triage labels Nov 12, 2024
@moonbox3 moonbox3 changed the title Monitor & Troubleshoot the Semantic Kernel C# SDK using the KernelFunction .Net: Monitor & Troubleshoot the Semantic Kernel C# SDK using the KernelFunction Nov 12, 2024
@markwallace-microsoft markwallace-microsoft self-assigned this Nov 12, 2024
@markwallace-microsoft markwallace-microsoft added question Further information is requested and removed triage labels Nov 12, 2024
@markwallace-microsoft markwallace-microsoft moved this to Sprint: In Review in Semantic Kernel Nov 12, 2024
@markwallace-microsoft
Copy link
Member

Hi @markbartolocodit
what exception are you seeing? Also can you provide some sample code and a stack trace for the issue. Thanks!

@markbartolocodit
Copy link
Author

Semantic Kernel is being initialised in an ASP.NET Core App as folllows:

 var kernel = Kernel.CreateBuilder()
        .AddAzureOpenAIChatCompletion(
          myConfig.KernelMemory.DefaultOverrides.ChatModelDeployment,
          myConfig.KernelMemory.Services.OpenAIService.Endpoint,
          myConfig.KernelMemory.Services.OpenAIService.ApiKey
        )
        .Build();

The code that is using the semantic kernel in a Controller is the following:

Microsoft.SemanticKernel.Kernel kernel;
...
KernelFunction? myFunction = kernel.CreateFunctionFromPrompt(finalPrompt);
FunctionResult? result = await myFunction.InvokeAsync(kernel, arguments).ConfigureAwait(false); 

The exception is occuring in myFunction.InvokeAsync

In AppInsights I'm seeing:
Image

There is no way to interfere to see any exception happening from within the Kernel.

The main goal would be for the 429 to bubble up in the myFunction.InvokeAsync.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
.NET Issue or Pull requests regarding .NET code question Further information is requested
Projects
Status: Sprint: In Review
Development

No branches or pull requests

3 participants