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

.Net: Include output scheme in functions manual for HandlebarsPlanner #4732

Closed
gitri-ms opened this issue Jan 24, 2024 · 0 comments · Fixed by #4804
Closed

.Net: Include output scheme in functions manual for HandlebarsPlanner #4732

gitri-ms opened this issue Jan 24, 2024 · 0 comments · Fixed by #4804
Assignees
Labels
.NET Issue or Pull requests regarding .NET code planner Anything related to planner or plans sk team issue A tag to denote issues that where created by the Semantic Kernel team (i.e., not the community)

Comments

@gitri-ms
Copy link
Contributor

The function descriptions in the handlebars planner prompt should include the scheme of the output. This would make it possible for the planner to generate a plan that can parse or extract data from an output object.

@gitri-ms gitri-ms added .NET Issue or Pull requests regarding .NET code planner Anything related to planner or plans sk team issue A tag to denote issues that where created by the Semantic Kernel team (i.e., not the community) labels Jan 24, 2024
@gitri-ms gitri-ms self-assigned this Jan 24, 2024
@github-actions github-actions bot changed the title Include output scheme in functions manual for HandlebarsPlanner .Net: Include output scheme in functions manual for HandlebarsPlanner Jan 24, 2024
@gitri-ms gitri-ms linked a pull request Jan 30, 2024 that will close this issue
4 tasks
@gitri-ms gitri-ms linked a pull request Feb 1, 2024 that will close this issue
4 tasks
github-merge-queue bot pushed a commit that referenced this issue Feb 1, 2024
### Motivation and Context

<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->

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](https://handlebarsjs.com/guide/expressions.html#helpers-with-multiple-parameters),
and generally, string literals are surrounded by quotes when a raw value
is passed as an argument.

Should resolve these issues:
- #4661
- #4732

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [x] The code builds clean without any errors or warnings
- [x] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [x] All unit tests pass, and I have added new tests where possible
- [x] I didn't break anyone 😄

---------

Co-authored-by: Gina Triolo <51341242+gitri-ms@users.noreply.github.com>
Bryan-Roe pushed a commit to Bryan-Roe/semantic-kernel that referenced this issue Oct 6, 2024
### Motivation and Context

<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->

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](https://handlebarsjs.com/guide/expressions.html#helpers-with-multiple-parameters),
and generally, string literals are surrounded by quotes when a raw value
is passed as an argument.

Should resolve these issues:
- microsoft#4661
- microsoft#4732

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [x] The code builds clean without any errors or warnings
- [x] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [x] All unit tests pass, and I have added new tests where possible
- [x] I didn't break anyone 😄

---------

Co-authored-by: Gina Triolo <51341242+gitri-ms@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
.NET Issue or Pull requests regarding .NET code planner Anything related to planner or plans sk team issue A tag to denote issues that where created by the Semantic Kernel team (i.e., not the community)
Projects
Archived in project
4 participants