feat: Add Claude extended thinking (#254)

* feat: Add Claude extended thinking
* fix: Set 1.0 temperature for thinking mode
This commit is contained in:
Petr Mironychev
2025-11-12 18:33:15 +01:00
committed by GitHub
parent 89797639cf
commit 161d77ac04
23 changed files with 745 additions and 40 deletions

View File

@ -91,6 +91,13 @@ ChatRootView {
root.isAgentMode = agentModeSwitch.checked
}
}
thinkingMode {
checked: root.isThinkingMode
enabled: root.isThinkingSupport
onCheckedChanged: {
root.isThinkingMode = thinkingMode.checked
}
}
}
ListView {
@ -116,6 +123,8 @@ ChatRootView {
return toolMessageComponent
} else if (model.roleType === ChatModel.FileEdit) {
return fileEditMessageComponent
} else if (model.roleType === ChatModel.Thinking) {
return thinkingMessageComponent
} else {
return chatItemComponent
}
@ -199,6 +208,35 @@ ChatRootView {
}
}
}
Component {
id: thinkingMessageComponent
ThinkingStatusItem {
width: parent.width
thinkingContent: {
// Extract thinking content and signature
let content = model.content
let signatureStart = content.indexOf("\n[Signature:")
if (signatureStart >= 0) {
return content.substring(0, signatureStart)
}
return content
}
signature: {
let content = model.content
let signatureStart = content.indexOf("\n[Signature: ")
if (signatureStart >= 0) {
let signatureEnd = content.indexOf("...]", signatureStart)
if (signatureEnd >= 0) {
return content.substring(signatureStart + 13, signatureEnd)
}
}
return ""
}
isRedacted: model.isRedacted !== undefined ? model.isRedacted : false
}
}
}
ScrollView {