fix: extract Gemma 4 <thought> reasoning in _extract_reasoning() (#8991)

Add <thought>(.*?)</thought> to inline_patterns so Gemma 4
reasoning content is captured for /reasoning display, not just
stripped from visible output.


Closes #8891

Co-authored-by: RhushabhVaghela <rhushabhvaghela@users.noreply.github.com>
This commit is contained in:
Teknium
2026-04-13 04:59:06 -07:00
committed by GitHub
parent d8a521092b
commit 23f668d66e

View File

@ -2018,6 +2018,7 @@ class AIAgent:
inline_patterns = (
r"<think>(.*?)</think>",
r"<thinking>(.*?)</thinking>",
r"<thought>(.*?)</thought>",
r"<reasoning>(.*?)</reasoning>",
r"<REASONING_SCRATCHPAD>(.*?)</REASONING_SCRATCHPAD>",
)