mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-29 05:09:46 +01:00
update:优化
This commit is contained in:
parent
c1983fdc0b
commit
cceb79b9ce
1 changed files with 2 additions and 2 deletions
|
|
@ -38,10 +38,10 @@ class LLMProvider(LLMProviderBase):
|
||||||
# 处理标签跨多个chunk的情况
|
# 处理标签跨多个chunk的情况
|
||||||
if '<think>' in content:
|
if '<think>' in content:
|
||||||
is_active = False
|
is_active = False
|
||||||
content = content.split('<think>')[0] # 保留标签前的有效内容
|
content = content.split('<think>')[0]
|
||||||
if '</think>' in content:
|
if '</think>' in content:
|
||||||
is_active = True
|
is_active = True
|
||||||
content = content.split('</think>')[-1] # 保留标签后的有效内容
|
content = content.split('</think>')[-1]
|
||||||
if is_active:
|
if is_active:
|
||||||
yield content
|
yield content
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue