* @brief Returns the text of the first user row, used to title a chat. */
| 2520 | * @brief Returns the text of the first user row, used to title a chat. |
| 2521 | */ |
| 2522 | QString 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. |
no test coverage detected