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

Method createChat

app/src/AI/ChatStore.cpp:144–155  ·  view source on GitHub ↗

* @brief Creates a new untitled chat and returns its id. */

Source from the content-addressed store, hash-verified

142 * @brief Creates a new untitled chat and returns its id.
143 */
144QString AI::ChatStore::createChat()
145{
146 Meta meta;
147 meta.id = QUuid::createUuid().toString(QUuid::WithoutBraces);
148 meta.createdAt = QDateTime::currentMSecsSinceEpoch();
149 meta.updatedAt = meta.createdAt;
150 Q_ASSERT(!meta.id.isEmpty());
151
152 m_chats.prepend(meta);
153 writeIndex();
154 return meta.id;
155}
156
157/**
158 * @brief Reads one chat's snapshot, or an empty object when missing/corrupt.

Callers 3

newChatMethod · 0.80
deleteChatMethod · 0.80
initChatsMethod · 0.80

Calls 1

isEmptyMethod · 0.80

Tested by

no test coverage detected