Add from_file
class method to the Prompt
object
#1345
Labels
Milestone
from_file
class method to the Prompt
object
#1345
We keep coming back to the following pattern: first write the prompt in docstrings, and move it to a text file once it gets too large. It would be nice if Outlines made it easy for users to generate a prompt template from a text file. The file can contain plain text, or be written using the Jinja2 templating syntax.
I propose to add a
from_file
classmethod, which reads the file, extracts the names of the free variables (if any) in the template, and returns aPrompt
instance.The text was updated successfully, but these errors were encountered: