* @brief Appends streamed text and schedules a coalesced UI refresh. */
| 335 | * @brief Appends streamed text and schedules a coalesced UI refresh. |
| 336 | */ |
| 337 | void AI::Conversation::onPartialText(const QString& chunk) |
| 338 | { |
| 339 | if (m_cancelled || m_assistantIndex < 0) |
| 340 | return; |
| 341 | |
| 342 | if (m_thinkingIsSynthetic && !m_assistantThinking.isEmpty()) { |
| 343 | m_assistantThinking.clear(); |
| 344 | m_thinkingIsSynthetic = false; |
| 345 | } |
| 346 | |
| 347 | m_assistantText.append(chunk); |
| 348 | m_streamDirty = true; |
| 349 | if (!m_streamFlushTimer->isActive()) |
| 350 | m_streamFlushTimer->start(); |
| 351 | } |
| 352 | |
| 353 | /** |
| 354 | * @brief Appends streamed thinking text to the live assistant preamble. |