prompts
Harrison Chase 1 year ago
parent 10cc7c5267
commit a7a97f96de

@ -7,14 +7,13 @@ folders = BASE_FOLDER.glob("**")
def check_files(files): def check_files(files):
if len(files) != 2:
raise ValueError(f"Each directory should have two files, got {len(files)}")
file_names = [f.name for f in files] file_names = [f.name for f in files]
if "README.md" not in file_names: if "README.md" not in file_names:
raise ValueError(f"Expected to find a README.md file, but found {files}") raise ValueError(f"Expected to find a README.md file, but found {files}")
other_file = [file for file in files if file.name != "README.md"][0] other_files = [file for file in files if file.name != "README.md"]
if other_file.suffix in (".json", ".yaml"): for other_file in other_files:
load_prompt(other_file) if other_file.suffix in (".json", ".yaml"):
load_prompt(other_file)
# TODO: testing for python files # TODO: testing for python files

@ -1,6 +1,6 @@
input_variables: [existing_answer, text] input_variables: [existing_answer, text]
output_parser: null output_parser: null
template: ' template: "
Your job is to produce a final summary\n Your job is to produce a final summary\n
We have provided an existing summary up to a certain point: {existing_answer}\n We have provided an existing summary up to a certain point: {existing_answer}\n
We have the opportunity to refine the existing summary We have the opportunity to refine the existing summary
@ -9,5 +9,5 @@ template: '
{text}\n {text}\n
------------\n ------------\n
Given the new context, refine the original summary Given the new context, refine the original summary
If the context isn't useful, return the original summary.' If the context isn't useful, return the original summary."
template_format: f-string template_format: f-string

Loading…
Cancel
Save