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

feat: Load Jinja template from external file location #189

Merged
merged 6 commits into from
Jun 21, 2024

Conversation

SoloSynth1
Copy link
Collaborator

@SoloSynth1 SoloSynth1 commented Jun 21, 2024

This PR:

  • adds TemplateLoader.load_from_external() for loading external template with optional validation logic
  • adds optional argument in ResponseParser to allow use of non-default template when exporting EvaluationResponse.
  • adds tests for TemplateLoader

@SoloSynth1 SoloSynth1 self-assigned this Jun 21, 2024
Copy link
Collaborator

@JohnShiuMK JohnShiuMK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @SoloSynth1. But I think the export_template.filename is empty.
Screenshot 2024-06-21 at 1 42 21 AM
Screenshot 2024-06-21 at 1 42 28 AM

Do you think it's better to use Environment(loader=FileSystemLoader(...)) in the load_from_external?

Copy link
Collaborator

@JohnShiuMK JohnShiuMK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

@JohnShiuMK JohnShiuMK merged commit efea363 into main Jun 21, 2024
2 checks passed
@JohnShiuMK JohnShiuMK deleted the external-template branch June 21, 2024 18:54
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.

2 participants