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

Method newChat

app/src/AI/Assistant.cpp:527–546  ·  view source on GitHub ↗

* @brief Persists the current chat, then opens a new empty one and switches to it. */

Source from the content-addressed store, hash-verified

525 * @brief Persists the current chat, then opens a new empty one and switches to it.
526 */
527void AI::Assistant::newChat()
528{
529 if (m_conversation && m_conversation->messageCount() == 0 && !m_activeChatId.isEmpty())
530 return;
531
532 if (m_conversation && m_conversation->busy())
533 m_conversation->cancel();
534
535 persistActiveChat();
536
537 m_activeChatId = m_chats.createChat();
538 m_chats.setLastActiveId(m_activeChatId);
539 if (m_conversation)
540 m_conversation->clear();
541
542 AI::FileSandbox::instance().clearDroppedPaths();
543
544 Q_EMIT chatListChanged();
545 Q_EMIT activeChatChanged();
546}
547
548/**
549 * @brief Persists the current chat and loads another saved chat into the conversation.

Callers

nothing calls this directly

Calls 8

isEmptyMethod · 0.80
createChatMethod · 0.80
setLastActiveIdMethod · 0.80
messageCountMethod · 0.45
busyMethod · 0.45
cancelMethod · 0.45
clearMethod · 0.45
clearDroppedPathsMethod · 0.45

Tested by

no test coverage detected