semantic-kernel icon indicating copy to clipboard operation
semantic-kernel copied to clipboard

Fix replacing for variables

Open Sy0xFF opened this issue 1 year ago • 3 comments

Motivation and Context

We had a problem with SKFunctionInput when these are arrays. For example, the output was [$variable1,$variable2]. These were not replaced with the actual values.

Description

Replaced the logic to only get one variable with a regex solution to replace all variables in the inner text. Now all values will be replaced correctly.

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 (excluding unrelated already broken unit tests)
  • [x] I didn't break anyone :smile:

Sy0xFF avatar Apr 20 '23 10:04 Sy0xFF

@microsoft-github-policy-service agree

Sy0xFF avatar Apr 20 '23 10:04 Sy0xFF

Thanks for the PR @Sy0xFF -- we're in the process of refactoring things here, see https://github.com/microsoft/semantic-kernel/pull/523. I'll incorporate this fix with those changes.

lemillermicrosoft avatar Apr 20 '23 15:04 lemillermicrosoft

as per @lemillermicrosoft the fix will be integrated into #523

dluc avatar Apr 21 '23 00:04 dluc