add markdown parsing + latex + tree-sitter highlighting for codeblocks in llm responses
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user