mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-09-22 11:58:55 +00:00
chatmodel: remove the 'prompt' field from ChatItem (#3016)
Signed-off-by: Adam Treat <treat.adam@gmail.com>
This commit is contained in:
@@ -240,7 +240,7 @@ void Chat::newPromptResponsePair(const QString &prompt)
|
||||
m_chatModel->updateCurrentResponse(m_chatModel->count() - 1, false);
|
||||
// the prompt is passed as the prompt item's value and the response item's prompt
|
||||
m_chatModel->appendPrompt("Prompt: ", prompt);
|
||||
m_chatModel->appendResponse("Response: ", prompt);
|
||||
m_chatModel->appendResponse("Response: ");
|
||||
emit resetResponseRequested();
|
||||
}
|
||||
|
||||
@@ -251,7 +251,7 @@ void Chat::serverNewPromptResponsePair(const QString &prompt)
|
||||
m_chatModel->updateCurrentResponse(m_chatModel->count() - 1, false);
|
||||
// the prompt is passed as the prompt item's value and the response item's prompt
|
||||
m_chatModel->appendPrompt("Prompt: ", prompt);
|
||||
m_chatModel->appendResponse("Response: ", prompt);
|
||||
m_chatModel->appendResponse("Response: ");
|
||||
}
|
||||
|
||||
bool Chat::restoringFromText() const
|
||||
|
@@ -19,7 +19,7 @@
|
||||
#include <algorithm>
|
||||
|
||||
#define CHAT_FORMAT_MAGIC 0xF5D553CC
|
||||
#define CHAT_FORMAT_VERSION 9
|
||||
#define CHAT_FORMAT_VERSION 10
|
||||
|
||||
class MyChatListModel: public ChatListModel { };
|
||||
Q_GLOBAL_STATIC(MyChatListModel, chatListModelInstance)
|
||||
|
@@ -22,7 +22,6 @@ struct ChatItem
|
||||
Q_PROPERTY(int id MEMBER id)
|
||||
Q_PROPERTY(QString name MEMBER name)
|
||||
Q_PROPERTY(QString value MEMBER value)
|
||||
Q_PROPERTY(QString prompt MEMBER prompt)
|
||||
Q_PROPERTY(QString newResponse MEMBER newResponse)
|
||||
Q_PROPERTY(bool currentResponse MEMBER currentResponse)
|
||||
Q_PROPERTY(bool stopped MEMBER stopped)
|
||||
@@ -36,7 +35,6 @@ public:
|
||||
int id = 0;
|
||||
QString name;
|
||||
QString value;
|
||||
QString prompt;
|
||||
QString newResponse;
|
||||
QList<ResultInfo> sources;
|
||||
QList<ResultInfo> consolidatedSources;
|
||||
@@ -59,7 +57,6 @@ public:
|
||||
IdRole = Qt::UserRole + 1,
|
||||
NameRole,
|
||||
ValueRole,
|
||||
PromptRole,
|
||||
NewResponseRole,
|
||||
CurrentResponseRole,
|
||||
StoppedRole,
|
||||
@@ -88,8 +85,6 @@ public:
|
||||
return item.name;
|
||||
case ValueRole:
|
||||
return item.value;
|
||||
case PromptRole:
|
||||
return item.prompt;
|
||||
case NewResponseRole:
|
||||
return item.newResponse;
|
||||
case CurrentResponseRole:
|
||||
@@ -115,7 +110,6 @@ public:
|
||||
roles[IdRole] = "id";
|
||||
roles[NameRole] = "name";
|
||||
roles[ValueRole] = "value";
|
||||
roles[PromptRole] = "prompt";
|
||||
roles[NewResponseRole] = "newResponse";
|
||||
roles[CurrentResponseRole] = "currentResponse";
|
||||
roles[StoppedRole] = "stopped";
|
||||
@@ -137,12 +131,11 @@ public:
|
||||
emit countChanged();
|
||||
}
|
||||
|
||||
void appendResponse(const QString &name, const QString &prompt)
|
||||
void appendResponse(const QString &name)
|
||||
{
|
||||
ChatItem item;
|
||||
item.id = m_chatItems.count(); // This is only relevant for responses
|
||||
item.name = name;
|
||||
item.prompt = prompt;
|
||||
item.currentResponse = true;
|
||||
beginInsertRows(QModelIndex(), m_chatItems.size(), m_chatItems.size());
|
||||
m_chatItems.append(item);
|
||||
@@ -266,7 +259,6 @@ public:
|
||||
stream << c.id;
|
||||
stream << c.name;
|
||||
stream << c.value;
|
||||
stream << c.prompt;
|
||||
stream << c.newResponse;
|
||||
stream << c.currentResponse;
|
||||
stream << c.stopped;
|
||||
@@ -336,7 +328,11 @@ public:
|
||||
stream >> c.id;
|
||||
stream >> c.name;
|
||||
stream >> c.value;
|
||||
stream >> c.prompt;
|
||||
if (version < 10) {
|
||||
// This is deprecated and no longer used
|
||||
QString prompt;
|
||||
stream >> prompt;
|
||||
}
|
||||
stream >> c.newResponse;
|
||||
stream >> c.currentResponse;
|
||||
stream >> c.stopped;
|
||||
|
Reference in New Issue
Block a user