; We can define a function expected by the prompt template ; after importing it, because the template will be evaluated by `llm` (= (topic) (let (user $topic) (messages) (user ("Compose a short description for adventure on " $topic)))) ; We can reuse the prompt with different parameters. ; Replacing its value can be done via states. !(bind! &story (new-state None)) (= (story) (get-state &story)) ; Let's generate the first part !(change-state! &story (llm (Script 05_nested_prompt.mps))) !(println! "======== STORY ========") !(println! (story)) ; Now, let's generate the next piece !(println! "======== LOCATION ========") !(println! (llm (Script 05_nested_prompt.mps) (user "Please compose a very short description of the first location of the adventure"))) !(Response "DONE")