diff --git a/runtime/prompty/prompty/parsers.py b/runtime/prompty/prompty/parsers.py index 53f1d1c..f8ee876 100644 --- a/runtime/prompty/prompty/parsers.py +++ b/runtime/prompty/prompty/parsers.py @@ -1,3 +1,4 @@ +import os import re import base64 from .core import Prompty @@ -58,6 +59,9 @@ def parse_content(self, content: str): any The parsed content """ + if os.getenv("PROMPTY_CHAT_PARSER_DISABLE_IMAGE_PARSING", "false").lower() == "true": + return content + # regular expression to parse markdown images image = r"(?P!\[[^\]]*\])\((?P.*?)(?=\"|\))\)" matches = re.findall(image, content, flags=re.MULTILINE)