support new openai package

This commit is contained in:
seehi 2023-12-05 15:27:57 +08:00
parent eaf531e0ac
commit 09134c9c72
8 changed files with 73 additions and 15 deletions

View file

@ -305,3 +305,9 @@ def parse_recipient(text):
pattern = r"## Send To:\s*([A-Za-z]+)\s*?" # hard code for now
recipient = re.search(pattern, text)
return recipient.group(1) if recipient else ""
def ensure_trailing_slash(url):
if not url:
return url
return url if url.endswith("/") else url + "/"