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

Method firstUserText

app/src/AI/Conversation.cpp:2522–2530  ·  view source on GitHub ↗

* @brief Returns the text of the first user row, used to title a chat. */

Source from the content-addressed store, hash-verified

2520 * @brief Returns the text of the first user row, used to title a chat.
2521 */
2522QString AI::Conversation::firstUserText() const
2523{
2524 for (const auto& row : m_uiMessages) {
2525 const auto map = row.toMap();
2526 if (map.value(QStringLiteral("role")).toString() == QStringLiteral("user"))
2527 return map.value(QStringLiteral("text")).toString();
2528 }
2529 return {};
2530}
2531
2532/**
2533 * @brief Returns the number of UI message rows in the conversation.

Callers 2

~AssistantMethod · 0.80
persistActiveChatMethod · 0.80

Calls 1

valueMethod · 0.45

Tested by

no test coverage detected