semantic-kernel
semantic-kernel copied to clipboard
Fix to log more details about failed function execution.
Motivation and Context
This change is required to allow SK SDK client code/hosting app to get more details about SK function execution failures.
Open issue: Important Error Message from Azure OpenAI service is ignored
Description
This change does two things:
- Passes a logger instance as an argument of Kernel.FromSemanticConfig method so that the method can write logs at all.
- Adds AIException details to the warning message logged by SKFunction when handling the function execution failure.
Contribution Checklist
- [x] The code builds clean without any errors or warnings
- [x] The PR follows SK Contribution Guidelines (https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
- [x] The code follows the .NET coding conventions (https://learn.microsoft.com/dotnet/csharp/fundamentals/coding-style/coding-conventions) verified with
dotnet format - [x] All unit tests pass, and I have added new tests where possible
- [] I didn't break anyone :smile: