add markdown parsing + latex + tree-sitter highlighting for codeblocks in llm responses

This commit is contained in:
2026-08-24 23:55:51 +02:00
parent aae3757daf
commit e18875a752
53 changed files with 5043 additions and 618 deletions
+2 -11
View File
@@ -18,16 +18,8 @@ ChatSession* sessionOf(const ChatMessage* message) {
ChatMessage::ChatMessage(Role role, qint64 timestamp, QObject* parent)
: QObject(parent), m_role(role), m_timestamp(timestamp) {}
ChatGeneration* ChatMessage::addGeneration(
qint64 timestamp,
const QString& content,
const QString& reasoning,
qint64 reasoningElapsedMs,
qint64 contentElapsedMs) {
ChatGeneration* ChatMessage::addGeneration(qint64 timestamp) {
auto* generation = new ChatGeneration(timestamp, this);
generation->setContent(content);
generation->setReasoning(reasoning);
generation->setElapsedMs(reasoningElapsedMs, contentElapsedMs);
m_generations.append(generation);
if (m_active < 0)
m_active = static_cast<int>(m_generations.size() - 1);
@@ -36,8 +28,7 @@ ChatGeneration* ChatMessage::addGeneration(
}
ChatGeneration* ChatMessage::appendGeneration(qint64 timestamp) {
auto* generation =
addGeneration(timestamp, QString(), QString(), 0, 0);
auto* generation = addGeneration(timestamp);
setActiveInternal(static_cast<int>(m_generations.size() - 1));
return generation;
}