Only generate three words max.

This commit is contained in:
Adam Treat 2023-05-08 12:02:31 -04:00
parent 49a6a6ed65
commit 40b976436a

View File

@ -356,9 +356,13 @@ bool ChatLLM::handleNamePrompt(int32_t token)
bool ChatLLM::handleNameResponse(int32_t token, const std::string &response)
{
Q_UNUSED(token);
m_nameResponse.append(response);
emit generatedNameChanged();
return true;
QString gen = QString::fromStdString(m_nameResponse).simplified();
QStringList words = gen.split(' ', Qt::SkipEmptyParts);
int wordCount = words.size();
return words.size() <= 3;
}
bool ChatLLM::handleNameRecalculate(bool isRecalc)