xiaozhi-esp32-server/main/xiaozhi-server/core/providers/llm/openai
Brad Shannon d46a4f6006 fix(llm/openai): strip <think> tags against the original chunk
Reasoning models often emit both <think> and </think> in a single streamed
chunk. The previous code truncated `content` at <think> first, then tested
the already-truncated string for </think>. The closing tag was gone, so
`is_active` was never restored to True and the entire post-</think> answer
was dropped — the user received silence.

Snapshot the chunk as `original_content` and test both tags against the
snapshot so the closing tag is still detectable after truncation.
2026-06-18 11:01:04 -04:00
..
openai.py fix(llm/openai): strip <think> tags against the original chunk 2026-06-18 11:01:04 -04:00