feat: add thinking display

This commit is contained in:
Tadashi 2025-02-05 13:42:13 +07:00
parent e90f89577e
commit 9286bbbba6
No known key found for this signature in database
GPG Key ID: 399380A00CC9028D

View File

@ -80,3 +80,18 @@ def find_start_end_phrase(
final_match = None
return final_match, matched_length
def replace_think_tag_with_details(text):
text = text.replace(
"<think>",
'<details><summary><span style="color:grey">Thought</span></summary><blockquote>', # noqa
)
text = text.replace("</think>", "</blockquote></details>")
return text
def strip_think_tag(text):
if "</think>" in text:
text = text.split("</think>")[1]
return text