Think Split Plugin is a plugin designed to handle thinking processes in AI model responses. It automatically identifies and separates <think> tag content in responses, extracting the thinking process from the main answer into a separate reasoning_content field, allowing AI's thinking process and final answer to be displayed and processed separately.
<think>...</think> tags in responsesreasoning_content fieldThe plugin recognizes thinking content in the following formats:
<think>
AI's thinking process here...
</think>
or
\n<think>
AI's thinking process here...
</think>\n
Before:
{
"choices": [{
"message": {
"content": "\n<think>\nThis is a math question...\n</think>\nThe answer is 42."
}
}]
}
After:
{
"choices": [{
"message": {
"content": "The answer is 42.",
"reasoning_content": "This is a math question..."
}
}]
}
{
"model": "gpt-4",
"type": 1,
"plugin": {
"think-split": {
"enable": true
}
}
}
{
"model": "claude-3-opus",
"type": 1,
"retry_times": 3,
"plugin": {
"think-split": {
"enable": true
}
}
}
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
enable |
bool | Yes | false | Whether to enable Think Split plugin |
Think Split Plugin can work together with other plugins:
{
"model": "gpt-4",
"plugin": {
"think-split": {
"enable": true
},
"cache": {
"enable": true,
"ttl": 300
},
"web-search": {
"enable": true
}
}
}
<think> tags are properly closed, otherwise recognition may fail<think> tags are not supportedreasoning_content field, it will be overwrittenenable is set to true<think> tags<think> tag format is correctreasoning_content field is in delta{
"id": "chatcmpl-123",
"object": "chat.completion",
"created": 1677652288,
"model": "gpt-4",
"choices": [{
"index": 0,
"message": {
"role": "assistant",
"content": "Quantum entanglement is a phenomenon in quantum mechanics...",
"reasoning_content": "The user is asking about quantum entanglement, which is a core concept in quantum physics..."
},
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 9,
"completion_tokens": 12,
"total_tokens": 21
}
}
data: {"id":"chatcmpl-123","object":"chat.completion.chunk","created":1677652288,"model":"gpt-4","choices":[{"index":0,"delta":{"reasoning_content":"Starting to think about the problem..."},"finish_reason":null}]}
data: {"id":"chatcmpl-123","object":"chat.completion.chunk","created":1677652288,"model":"gpt-4","choices":[{"index":0,"delta":{"content":"Quantum entanglement is"},"finish_reason":null}]}
data: [DONE]