v0.6.0: Merge pull request #10 from narenaryan/feat/xml-serialize
YAML & XML serialization support
- Now serialize PromptML prompt to XML & YAML with methods like to_xml() and to_yaml() on prompt parser
Deprecated
serialize_*
methodsdeserialize_*
methods
Example usage:
from promptml.parser import PromptParserFromFile
p1 = PromptParserFromFile('prompt.pml')
# parse the prompt
p1.parse()
# serialize prompt to XML
print(p1.to_xml())
# serialize prompt to YAML
print(p1.to_yaml())
# serialize prompt to JSON
print(p1.to_json(indent=4))