capture HTML tag extraction in Sentry so that we have full completion text

This commit is contained in:
Abi Raja 2024-06-27 12:25:05 +08:00
parent cda34ae642
commit 5e00b406af

View File

@ -1,5 +1,7 @@
import re
import sentry_sdk
def extract_html_content(text: str):
# Use regex to find content within <html> tags and include the tags themselves
@ -11,4 +13,7 @@ def extract_html_content(text: str):
print(
"[HTML Extraction] No <html> tags found in the generated content: " + text
)
sentry_sdk.capture_exception(
Exception(" No <html> tags found in the generated content")
)
return text