martinezjandrew commited on
Commit
69d3b98
·
1 Parent(s): b79cefc

Fix Update Outline

Browse files
app.py CHANGED
@@ -76,6 +76,7 @@ async def update_script(req: ScriptUpdate):
76
  "prompt_builder": {
77
  "script": req.script,
78
  "notes": req.notes,
 
79
  },
80
  }
81
  )
 
76
  "prompt_builder": {
77
  "script": req.script,
78
  "notes": req.notes,
79
+ "schema": CourseOutline.model_json_schema(),
80
  },
81
  }
82
  )
generate_module_content.png CHANGED
pipelines/update_outline.py CHANGED
@@ -23,6 +23,7 @@ You are a training manager tasked with creating an online, asynchronous course f
23
  - Put this string: "<start>" right before the JSON object.
24
  - Put this string: "<stop>" right after the JSON object.
25
  - Ensure the response is unique and does not repeat any previous content.
 
26
  **Example Format**:
27
  <start>
28
  {
 
23
  - Put this string: "<start>" right before the JSON object.
24
  - Put this string: "<stop>" right after the JSON object.
25
  - Ensure the response is unique and does not repeat any previous content.
26
+ - You can only choose one of "video", "image", or "interactive" for the key "features" in "modules".
27
  **Example Format**:
28
  <start>
29
  {
pipelines/update_outline.yml CHANGED
@@ -35,20 +35,22 @@ components:
35
  \ not include the schema in your response.\n- Put this string: \"<start>\"\
36
  \ right before the JSON object.\n- Put this string: \"<stop>\" right after\
37
  \ the JSON object.\n- Ensure the response is unique and does not repeat any\
38
- \ previous content.\n**Example Format**:\n<start>\n{\n \"title\": \"Example\
39
- \ Title\",\n \"objectives\": [\"Objective 1\", \"Objective 2\"],\n \"\
40
- duration\": \"1 hour\",\n \"modules\": [\n {\n \"name\"\
41
- : \"Module 1\",\n \"duration\": \"10 minutes\",\n \"\
42
- subtopics\": [\"Subtopic 1\", \"Subtopic 2\"],\n \"features\":\
43
- \ [\"video\"]\n }\n ],\n \"summary\": \"Example summary.\"\n\
44
- }\n<stop>\n**Schema Reference**:\n{{schema}}\n{% if invalid_replies and error_message\
45
- \ %}\n You already created the following output in a previous attempt: {{invalid_replies}}\n\
46
- \ However, this doesn't comply with the format requirements from above and\
47
- \ triggered this Python exception: {{error_message}}\n Correct the output\
48
- \ and try again. Just return the corrected output without any extra explanations.\n\
49
- {% endif %}\n"
 
50
  variables: null
51
  type: haystack.components.builders.prompt_builder.PromptBuilder
 
52
  connections:
53
  - receiver: llm.prompt
54
  sender: prompt_builder.prompt
 
35
  \ not include the schema in your response.\n- Put this string: \"<start>\"\
36
  \ right before the JSON object.\n- Put this string: \"<stop>\" right after\
37
  \ the JSON object.\n- Ensure the response is unique and does not repeat any\
38
+ \ previous content.\n- You can only choose one of \"video\", \"image\", or\
39
+ \ \"interactive\" for the key \"features\" in \"modules\".\n**Example Format**:\n\
40
+ <start>\n{\n \"title\": \"Example Title\",\n \"objectives\": [\"Objective\
41
+ \ 1\", \"Objective 2\"],\n \"duration\": \"1 hour\",\n \"modules\":\
42
+ \ [\n {\n \"name\": \"Module 1\",\n \"duration\"\
43
+ : \"10 minutes\",\n \"subtopics\": [\"Subtopic 1\", \"Subtopic\
44
+ \ 2\"],\n \"features\": [\"video\"]\n }\n ],\n \"\
45
+ summary\": \"Example summary.\"\n}\n<stop>\n**Schema Reference**:\n{{schema}}\n\
46
+ {% if invalid_replies and error_message %}\n You already created the following\
47
+ \ output in a previous attempt: {{invalid_replies}}\n However, this doesn't\
48
+ \ comply with the format requirements from above and triggered this Python\
49
+ \ exception: {{error_message}}\n Correct the output and try again. Just return\
50
+ \ the corrected output without any extra explanations.\n{% endif %}\n"
51
  variables: null
52
  type: haystack.components.builders.prompt_builder.PromptBuilder
53
+ connection_type_validation: true
54
  connections:
55
  - receiver: llm.prompt
56
  sender: prompt_builder.prompt