fix: should not include reasoning text in the chat completion request
This commit is contained in:
parent
4727132d3c
commit
804b0f0116
@ -102,6 +102,15 @@ export class CompletionMessagesBuilder {
|
||||
content = content.slice(splitIndex).trim()
|
||||
}
|
||||
}
|
||||
if (content.includes('<|channel|>analysis<|message|>')) {
|
||||
const match = content.match(
|
||||
/<\|channel\|>analysis<\|message\|>([\s\S]*?)<\|start\|>assistant<\|channel\|>final<\|message\|>/
|
||||
)
|
||||
if (match?.index !== undefined) {
|
||||
const splitIndex = match.index + match[0].length
|
||||
content = content.slice(splitIndex).trim()
|
||||
}
|
||||
}
|
||||
return content
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user