-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Description
Describe the bug
Using KernelFunctionYaml.FromPromptYaml()
to deserialize YAML to an SK function in an existing codebase, with an existing dependency on YamlDotNet
latest version (16.1.3).
The call to KernelFunctionYaml.FromPromptYaml()
results in a TypeLoadException
with the message:
Method 'ReadYaml' in type 'Microsoft.SemanticKernel.PromptExecutionSettingsTypeConverter' from assembly 'Microsoft.SemanticKernel.Yaml, Version=1.20.0.0, Culture=neutral, PublicKeyToken=f300afd708cefcd3' does not have an implementation.
It appears to be a breaking change with YamlDotNet 16.0.0, released 7/14/2024, specifically a change to the method signature of IYamlTypeConverter.ReadYaml()
To Reproduce
Steps to reproduce the behavior:
- Have a project that references
YamlDotNet
16.1.3 andMicrosoft.SemanticKernel.Yaml
- Call
KernelFunctionYaml.FromPromptYaml()
with valid (or invalid) YAML. - The
TypeLoadException
is thrown.
Expected behavior
The call to KernelFunctionYaml.FromPromptYaml()
should parse the YAML and if it is valid, return a valid KernelFunction object.
Screenshots
N/A
Platform
- OS: Windows
- IDE: Visual Studio 2022
- Language: .NET 8, C#
- Source: YamlDotNet 16.1.3, Microsoft.SemanticKernel.Yaml 1.20.0 - 1.21.1
Additional context
The problem occurred while using Microsoft.SemanticKernel.Yaml < 1.20.0 but was not investigated until now.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status