Skip to content

Commit 8c9f26e

Browse files
authored
Ignore DeepSeek-R1 "think" content in name/follow-up responses (#3458)
Signed-off-by: Jared Van Bortel <[email protected]>
1 parent d4e6a6e commit 8c9f26e

File tree

7 files changed

+294
-136
lines changed

7 files changed

+294
-136
lines changed

gpt4all-chat/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
99
### Fixed
1010
- Fix "index N is not a prompt" when using LocalDocs with reasoning ([#3451](https://github.com/nomic-ai/gpt4all/pull/3451)
1111
- Work around rendering artifacts on Snapdragon SoCs with Windows ([#3450](https://github.com/nomic-ai/gpt4all/pull/3450))
12+
- Prevent DeepSeek-R1 reasoning from appearing in chat names and follow-up questions ([#3458](https://github.com/nomic-ai/gpt4all/pull/3458))
1213

1314
## [3.8.0] - 2025-01-30
1415

gpt4all-chat/src/chat.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ void Chat::responseStopped(qint64 promptResponseMs)
255255

256256
ToolCallParser parser;
257257
parser.update(possibleToolcall.toUtf8());
258-
if (parser.state() == ToolEnums::ParseState::Complete && parser.startTag() != ToolCallConstants::ThinkTag)
258+
if (parser.state() == ToolEnums::ParseState::Complete && parser.startTag() != ToolCallConstants::ThinkStartTag)
259259
processToolCall(parser.toolCall());
260260
else
261261
responseComplete();
@@ -381,11 +381,8 @@ void Chat::trySwitchContextOfLoadedModel()
381381

382382
void Chat::generatedNameChanged(const QString &name)
383383
{
384-
// Only use the first three words maximum and remove newlines and extra spaces
385-
m_generatedName = name.simplified();
386-
QStringList words = m_generatedName.split(' ', Qt::SkipEmptyParts);
387-
int wordCount = qMin(7, words.size());
388-
m_name = words.mid(0, wordCount).join(' ');
384+
m_generatedName = name;
385+
m_name = name;
389386
emit nameChanged();
390387
m_needsSave = true;
391388
}

0 commit comments

Comments
 (0)