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

fix: Handlebars sample #202

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

rwoll
Copy link

@rwoll rwoll commented Feb 7, 2025

When following this tutorial I encountered two issues:

The template from the documentation was rendering but missing substitutions for the customer's first and last name:

         # Customer Context
          First Name: 
          Last Name: 
          Age: 30
          Membership Status: Gold

In the above, which was the result of running the sample code, the Age (30) and Membership (Gold) variables worked.

After debugging, it looks like this was a result of the sample code with the input variables using different casing:

                { "customer", new
                    {
                        firstName = "John",
                        lastName = "Doe",
                        age = 30,
                        membership = "Gold",
                    }
                },

first_name v. firstName

The second issue was the for-loop did not properly work. The sample was rendering as:

      {% for item in history %}
      <message role="">
          
      </message>
      {% endfor %}

with the {% etc. literlly in the rendered output.

@rwoll rwoll changed the title Update handlebars-prompt-templates.md fix: Handlebars sample Feb 7, 2025
Copy link
Contributor

Learn Build status updates of commit 566d591:

✅ Validation status: passed

File Status Preview URL Details
semantic-kernel/concepts/prompts/handlebars-prompt-templates.md ✅Succeeded

For more details, please refer to the build report.

For any questions, please:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant