| 537 | } |
| 538 | |
| 539 | void ChatModel::addRedactedThinkingBlock(const QString &requestId, const QString &signature) |
| 540 | { |
| 541 | LOG_MESSAGE( |
| 542 | QString("Adding redacted thinking block: requestId=%1, signature length=%2") |
| 543 | .arg(requestId) |
| 544 | .arg(signature.length())); |
| 545 | |
| 546 | QString displayContent = "[Thinking content redacted by safety systems]"; |
| 547 | if (!signature.isEmpty()) { |
| 548 | displayContent += "\n[Signature: " + signature.left(40) + "...]"; |
| 549 | } |
| 550 | |
| 551 | beginInsertRows(QModelIndex(), m_messages.size(), m_messages.size()); |
| 552 | Message thinkingMessage; |
| 553 | thinkingMessage.role = ChatRole::Thinking; |
| 554 | thinkingMessage.content = displayContent; |
| 555 | thinkingMessage.id = requestId; |
| 556 | thinkingMessage.isRedacted = true; |
| 557 | thinkingMessage.signature = signature; |
| 558 | m_messages.append(thinkingMessage); |
| 559 | endInsertRows(); |
| 560 | LOG_MESSAGE(QString("Added redacted thinking message at index %1 with signature length=%2") |
| 561 | .arg(m_messages.size() - 1).arg(signature.length())); |
| 562 | } |
| 563 | |
| 564 | void ChatModel::updateMessageContent(const QString &messageId, const QString &newContent) |
| 565 | { |
no test coverage detected