MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / switchChat

Method switchChat

app/src/AI/Assistant.cpp:551–567  ·  view source on GitHub ↗

* @brief Persists the current chat and loads another saved chat into the conversation. */

Source from the content-addressed store, hash-verified

549 * @brief Persists the current chat and loads another saved chat into the conversation.
550 */
551void AI::Assistant::switchChat(const QString& id)
552{
553 if (id == m_activeChatId || !m_chats.contains(id))
554 return;
555
556 if (m_conversation && m_conversation->busy())
557 m_conversation->cancel();
558
559 persistActiveChat();
560
561 m_activeChatId = id;
562 m_chats.setLastActiveId(id);
563 loadActiveSnapshot();
564
565 AI::FileSandbox::instance().clearDroppedPaths();
566 Q_EMIT activeChatChanged();
567}
568
569/**
570 * @brief Deletes a chat; if it was active, falls back to the newest remaining (or a new) chat.

Callers

nothing calls this directly

Calls 5

setLastActiveIdMethod · 0.80
containsMethod · 0.45
busyMethod · 0.45
cancelMethod · 0.45
clearDroppedPathsMethod · 0.45

Tested by

no test coverage detected