Check that we're not null. This is necessary because the loop can make us recursive. Need to fix that.

This commit is contained in:
Adam Treat 2023-07-10 17:29:21 -04:00
parent 99cd555743
commit 8467e69f24

View File

@ -134,7 +134,8 @@ void ChatGPT::prompt(const std::string &prompt,
qDebug() << "ChatGPT::prompt end network request";
#endif
m_ctx->n_past += 1;
if (m_ctx)
m_ctx->n_past += 1;
m_context.append(QString::fromStdString(prompt));
m_context.append(m_currentResponse);