Skip to content

Conversation

eiriktsarpalis
Copy link
Member

@eiriktsarpalis eiriktsarpalis commented Jul 2, 2025

Under certain circumstances, SK kernels can pass KernelArguments with parameters formatted as JSON strings to AIFunctions created by AIFunctionFactory, resulting in argument exceptions. This PR updates AIFunctionFactory so that JSON strings are tolerated as function parameters.

FYI @rogerbarreto @SergeyMenshykh

Fix #6544.

Microsoft Reviewers: Open in CodeFlow

@eiriktsarpalis eiriktsarpalis requested a review from a team as a code owner July 2, 2025 17:47
@github-actions github-actions bot added the area-ai Microsoft.Extensions.AI libraries label Jul 2, 2025
@eiriktsarpalis eiriktsarpalis enabled auto-merge (squash) July 3, 2025 10:31
@eiriktsarpalis eiriktsarpalis merged commit 2c2f51f into dotnet:main Jul 3, 2025
6 checks passed
joperezr pushed a commit that referenced this pull request Jul 8, 2025
* AIFunctionFactory: tolerate JSON string function parameters.

* Add debug assertion.

* Update src/Libraries/Microsoft.Extensions.AI.Abstractions/Functions/AIFunctionFactory.cs

Co-authored-by: Stephen Toub <[email protected]>

* Add regex-based JSON string recognition and add more tests.

---------

Co-authored-by: Stephen Toub <[email protected]>
@github-actions github-actions bot locked and limited conversation to collaborators Aug 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-ai Microsoft.Extensions.AI libraries
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Complex AIFunction Arguments
2 participants