add think tag
This commit is contained in:
parent
bcd1b7cc9d
commit
be264884a2
@ -126,7 +126,13 @@ Action: Provide concise, friendly, and personified natural responses.
|
||||
config={"callbacks": [ThinkingCallbackHandler()]}
|
||||
)
|
||||
|
||||
response.additional_kwargs["thinking"] = response.content
|
||||
# 提取<think>与</think>之间的内容作为thinking
|
||||
import re
|
||||
match = re.search(r'<think>(.*?)</think>', response.content, re.DOTALL)
|
||||
if match:
|
||||
response.additional_kwargs["thinking"] = match.group(1).strip()
|
||||
else:
|
||||
response.additional_kwargs["thinking"] = response.content
|
||||
|
||||
messages = state['messages']+[response]
|
||||
return {
|
||||
|
||||
@ -56,8 +56,9 @@
|
||||
**语言要求**:所有用户交互和结果输出,必须使用[{language}]
|
||||
|
||||
## 输出格式
|
||||
按顺序输出执行步骤:
|
||||
按顺序输出执行步骤, 用<think>和</think>标签包裹,输出格式如下:
|
||||
|
||||
<think>
|
||||
### 🎯 核心目标
|
||||
[简洁描述用户的主要目标]
|
||||
|
||||
@ -70,4 +71,4 @@
|
||||
**执行步骤**:
|
||||
[按1,2,3...n顺序列出执行步骤]
|
||||
|
||||
我现在将根据以上分析,按照计划阶段的执行步骤,开始执行任务。
|
||||
</think>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user