From 38f9413dfc614537de065be338901379b2fad214 Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Sat, 9 Mar 2024 16:55:05 -0800 Subject: [PATCH] (fix) python 3.8 bug --- litellm/llms/prompt_templates/factory.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/litellm/llms/prompt_templates/factory.py b/litellm/llms/prompt_templates/factory.py index a13130c62a8..dc4207a0510 100644 --- a/litellm/llms/prompt_templates/factory.py +++ b/litellm/llms/prompt_templates/factory.py @@ -4,6 +4,7 @@ import json, re, xml.etree.ElementTree as ET from jinja2 import Template, exceptions, Environment, meta from typing import Optional, Any import imghdr, base64 +from typing import List def default_pt(messages): @@ -633,7 +634,7 @@ def anthropic_messages_pt(messages: list): return new_messages -def extract_between_tags(tag: str, string: str, strip: bool = False) -> list[str]: +def extract_between_tags(tag: str, string: str, strip: bool = False) -> List[str]: ext_list = re.findall(f"<{tag}>(.+?)", string, re.DOTALL) if strip: ext_list = [e.strip() for e in ext_list]