KTextAddons
ollamareply.cpp
2// SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
19 // Normally, we could assume that the tokens will never be empty once the request finishes, but it could be possible
24 mInfo.totalDuration = std::chrono::nanoseconds{finalResponse["total_duration"_L1].toVariant().toULongLong()};
25 mInfo.loadDuration = std::chrono::nanoseconds{finalResponse["load_duration"_L1].toVariant().toULongLong()};
27 mInfo.promptEvalDuration = std::chrono::nanoseconds{finalResponse["prompt_eval_duration"_L1].toVariant().toULongLong()};
29 mInfo.duration = std::chrono::nanoseconds{finalResponse["eval_duration"_L1].toVariant().toULongLong()};
39 connect(mReply, &QNetworkReply::downloadProgress, mReply, [this](qint64 received, qint64 /*total*/) {
const TextAutogenerateText::TextAutogenerateTextContext & context() const
Get the context token for this response.
Definition ollamareply.cpp:68
const OllamaReplyInfo & info() const
Get extra information about the reply.
Definition ollamareply.cpp:73
QJsonDocument fromJson(const QByteArray &json, QJsonParseError *error)
NetworkError
void downloadProgress(qint64 bytesReceived, qint64 bytesTotal)
void errorOccurred(QNetworkReply::NetworkError code)
void finished()
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
The OllamaReplyInfo class represents information about a reply from an LLM.
Definition ollamareply.h:20
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Apr 18 2025 12:00:52 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Apr 18 2025 12:00:52 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.