Repository navigation
Using CLR types that have both async and non-async method implementations, Semantic Kernel throws an error regarding duplicate functions. This happens in two specific scenarios:
- When a type contains both an async method and a non-async method where the only difference is the 'Async' suffix (e.g., GetData() and GetDataAsync()). Semantic Kernel removes the 'Async' suffix during registration, causing a duplicate method error.
- When methods differ only by having a CancellationToken parameter (e.g., GetData() and GetData(CancellationToken)). Semantic Kernel removes the CancellationToken parameter in the KernelFunctionMetadata, again resulting in duplicate method errors.
This release fixes the issue by selecting the function preferably with cancellation token if none of them has it then the function with async suffix, otherwise picks up the first one.