-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
103 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
Context: {{ prompt.context }} | ||
|
||
Domain: {{ prompt.metadata.domain }} | ||
|
||
Task Difficulty: {{ prompt.constraints.difficulty }} | ||
|
||
Reply in tone: {{ prompt.constraints.tone }} | ||
|
||
Follow the below instructions step-by-step for objective: | ||
{% for instruction in prompt.instructions -%} | ||
{{loop.index}}. {{ instruction }} | ||
{% endfor %} | ||
|
||
Audience: {{ prompt.metadata.domain }} | ||
Task Difficulty: {{ prompt.metadata.difficulty }} | ||
Reply in tone: {{ prompt.constraints.tone }} | ||
|
||
Objective: {{ prompt.objective }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from promptml.parser import PromptParserFromFile | ||
from jinja2 import Environment, FileSystemLoader | ||
|
||
|
||
def main(): | ||
template_loader = FileSystemLoader(searchpath="./") | ||
template_env = Environment(loader=template_loader) | ||
template_file = "recommend.jinja2" | ||
template = template_env.get_template(template_file) | ||
|
||
# Parse PromptML code and generate context | ||
prompt_parser = PromptParserFromFile('recommend.pml') | ||
prompt = prompt_parser.parse() | ||
|
||
# Render the template with the prompt context | ||
template_output = template.render(prompt=prompt) | ||
print(template_output) | ||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Context: {{ prompt.context }} | ||
|
||
Objective: {{ prompt.objective }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
@prompt | ||
@context | ||
You are an experienced Python trainer. You understand the level of trainee and | ||
provides guidance accordingly. | ||
@end | ||
|
||
@objective | ||
Provide three Python take home challenges which have a combination of following aspects: | ||
1. Conditional statements | ||
2. Loops | ||
3. User input | ||
Return the challenges in form of a table. | ||
@end | ||
|
||
@category | ||
Education & Programming | ||
@end | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
jinja2 | ||
promptml |