Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing logic in custom or HB helper #4804

Merged
merged 10 commits into from
Feb 1, 2024

Conversation

teresaqhoang
Copy link
Contributor

@teresaqhoang teresaqhoang commented Jan 31, 2024

Motivation and Context

The custom or helper had a bug where it was checking for null values, rather than checking for non-null values. This PR changes the condition to not null.

Also, renamed a heading in the CreatePlan prompt to better guide the model in identifying Handlebars built-in block helpers.

Description

Additional changes to the GetArgumentValue method in KernelHelperUtils.cs to return null if variable isn't defined.

Before, if the template referenced a variable that wasn't defined in KernelArguments, the method would just return the key as a string. Now, it just returns null (as expected).

I had it returning a string before because I thought Handlebars would default the argument to its string representation since it templates regular text, but I double checked HB docs, and generally, string literals are surrounded by quotes when a raw value is passed as an argument.

Should resolve these issues:

Contribution Checklist

@teresaqhoang teresaqhoang added bug Something isn't working planner Anything related to planner or plans labels Jan 31, 2024
@teresaqhoang teresaqhoang self-assigned this Jan 31, 2024
@teresaqhoang teresaqhoang requested a review from a team as a code owner January 31, 2024 17:51
@shawncal shawncal added .NET Issue or Pull requests regarding .NET code kernel Issues or pull requests impacting the core kernel labels Jan 31, 2024
@github-actions github-actions bot changed the title Fixing logic in custom or HB helper .Net: Fixing logic in custom or HB helper Jan 31, 2024
@teresaqhoang teresaqhoang changed the title .Net: Fixing logic in custom or HB helper Fixing logic in custom or HB helper Jan 31, 2024
@teresaqhoang teresaqhoang added this pull request to the merge queue Feb 1, 2024
Merged via the queue into microsoft:main with commit 52e317a Feb 1, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working kernel Issues or pull requests impacting the core kernel .NET Issue or Pull requests regarding .NET code planner Anything related to planner or plans
Projects
Archived in project
4 participants