Merge pull request #7720 from QianKuang8/qian/fix-incorrect-tool-call-content
fix: Prevent tool content with <think> tags from triggering incorrect tool calls
This commit is contained in:
commit
9310b44614
1 changed files with 2 additions and 2 deletions
|
|
@ -545,7 +545,7 @@ export const sessionSlice = createSlice({
|
|||
|
||||
// OpenAI-compatible models in agent mode sometimes send
|
||||
// all of their data in one message, so we handle that case early.
|
||||
if (messageContent) {
|
||||
if (messageContent && message.role !== "tool") {
|
||||
const thinkMatches = messageContent.match(
|
||||
/<think>([\s\S]*)<\/think>([\s\S]*)/,
|
||||
);
|
||||
|
|
@ -605,7 +605,7 @@ export const sessionSlice = createSlice({
|
|||
|
||||
// Add to the existing message
|
||||
if (messageContent) {
|
||||
if (messageContent.includes("<think>")) {
|
||||
if (messageContent.includes("<think>") && message.role !== "tool") {
|
||||
lastItem.reasoning = {
|
||||
startAt: Date.now(),
|
||||
active: true,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue