Skip to content

Commit deaf3d4

Browse files
committed
Fix setting the tools on initial startup
when the setting was set to on, the chat input would mark it as green, but the value would not be set.
1 parent 859d369 commit deaf3d4

5 files changed

Lines changed: 1 addition & 16 deletions

File tree

llamachateditor.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,6 @@ ChatEditor::ChatEditor()
151151
connect(m_input, &ChatInput::stopRequested, this, &ChatEditor::onStopRequested);
152152
connect(m_input, &ChatInput::fileDropped, this, &ChatEditor::onFileDropped);
153153
connect(m_input, &ChatInput::editingCancelled, this, &ChatEditor::onEditingCancelled);
154-
connect(m_input,
155-
&ChatInput::toolsSupportEnabled,
156-
&ChatManager::instance(),
157-
&ChatManager::onToolsSupportEnabled);
158154

159155
// Connect to the document to get the conversation id
160156
connect(EditorManager::instance(),

llamachatinput.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ void ChatInput::buildUI()
9595

9696
m_toolsButton->setToolTip(checked ? Tr::tr("Disable Tools usage")
9797
: Tr::tr("Enable Tools usage"));
98-
emit toolsSupportEnabled(checked);
9998
});
10099

101100
m_attachButton = new QToolButton(this);

llamachatinput.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ class ChatInput : public QWidget
2929
void fileDropped(const QStringList &filePaths);
3030
void pasteLongText(const QString &text);
3131
void pasteFiles(const QStringList &filePaths);
32-
void toolsSupportEnabled(bool enabled);
3332

3433
private:
3534
void buildUI();

llamachatmanager.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ void ChatManager::generateMessage(const QString &convId,
262262
convId,
263263
[leafMsgs, this](QJsonObject &payload) {
264264
payload["messages"] = normalizeMsgsForAPI(leafMsgs);
265-
if (m_toolsSupport)
265+
if (settings().toolsEnabled())
266266
addToolsToPayload(payload);
267267

268268
// custom JSON from settings (if any)
@@ -865,11 +865,6 @@ void ChatManager::executeToolAndSendResult(const QString &convId,
865865
}
866866
}
867867

868-
void ChatManager::onToolsSupportEnabled(bool enabled)
869-
{
870-
m_toolsSupport = enabled;
871-
}
872-
873868
void ChatManager::deleteConversation(const QString &convId)
874869
{
875870
m_storage->deleteConversation(convId);

llamachatmanager.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,6 @@ class ChatManager : public QObject
8989
const QStringList &quetions);
9090
void messageExtraUpdated(const LlamaCpp::Message &msg, const QList<QVariantMap> &newExtra);
9191

92-
public slots:
93-
void onToolsSupportEnabled(bool enabled);
94-
9592
private:
9693
explicit ChatManager(QObject *parent = nullptr);
9794
void initServerProps();
@@ -115,6 +112,5 @@ public slots:
115112
QHash<QString, QNetworkReply *> m_titleSummaryReplies;
116113
QHash<QString, QNetworkReply *> m_followUpReplies;
117114
QVector<ToolCall> m_toolCalls;
118-
bool m_toolsSupport{false};
119115
};
120116
} // namespace LlamaCpp

0 commit comments

Comments
 (0)