mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-09-10 12:59:09 +00:00
Display DeepSeek-R1 thinking like Reasoner (#3440)
Signed-off-by: Adam Treat <treat.adam@gmail.com> Signed-off-by: Jared Van Bortel <jared@nomic.ai> Co-authored-by: Jared Van Bortel <jared@nomic.ai>
This commit is contained in:
@@ -13,6 +13,8 @@ ColumnLayout {
|
||||
property alias textContent: innerTextItem.textContent
|
||||
property bool isCurrent: false
|
||||
property bool isError: false
|
||||
property bool isThinking: false
|
||||
property int thinkingTime: 0
|
||||
|
||||
Layout.topMargin: 10
|
||||
Layout.bottomMargin: 10
|
||||
@@ -26,16 +28,20 @@ ColumnLayout {
|
||||
anchors.bottom: parent.bottom
|
||||
|
||||
Item {
|
||||
width: myTextArea.width
|
||||
height: myTextArea.height
|
||||
Layout.preferredWidth: myTextArea.implicitWidth
|
||||
Layout.preferredHeight: myTextArea.implicitHeight
|
||||
TextArea {
|
||||
id: myTextArea
|
||||
text: {
|
||||
if (isError)
|
||||
return qsTr("Analysis encountered error");
|
||||
if (isCurrent)
|
||||
return qsTr("Analyzing");
|
||||
return qsTr("Analyzed");
|
||||
return isThinking ? qsTr("Thinking") : qsTr("Analyzing");
|
||||
return isThinking
|
||||
? qsTr("Thought for %1 %2")
|
||||
.arg(Math.ceil(thinkingTime / 1000.0))
|
||||
.arg(Math.ceil(thinkingTime / 1000.0) === 1 ? qsTr("second") : qsTr("seconds"))
|
||||
: qsTr("Analyzed");
|
||||
}
|
||||
padding: 0
|
||||
font.pixelSize: theme.fontSizeLarger
|
||||
|
@@ -189,6 +189,17 @@ GridLayout {
|
||||
isError: modelData.isToolCallError
|
||||
}
|
||||
}
|
||||
DelegateChoice {
|
||||
roleValue: "Think: ";
|
||||
ChatCollapsibleItem {
|
||||
Layout.fillWidth: true
|
||||
textContent: modelData.content
|
||||
isCurrent: modelData.isCurrentResponse
|
||||
isError: false
|
||||
isThinking: true
|
||||
thinkingTime: modelData.thinkingTime
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
delegate: chooser
|
||||
|
Reference in New Issue
Block a user