KTextAddons
ollamareply.h
2// SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
16 * When an LLM generates a completion, the server generally will return some information about the completion, including the
17 * duration of the completion, the number of tokens received, and the duration of the prompt evaluation. This struct encapsulates such information.
43 * If you want to stream a reply as it is written in real time, connect to contentAdded() and use readResponse() to retrieve
44 * the new content. If you prefer to wait for the entire reply before displaying anything, connect to finished(), which will
55 * This function returns what it has recieved of the response so far. Therefore, until finished() is emitted, this
56 * function may return different values. However, once finished() is emitted, the content is guaranteed to remain
66 * Messages sent by most LLMs have a context identifier that allows you to chain messages into a conversation. To create
67 * such a conversation, you need to take this context object and set it on the next KLLMRequest in the conversation.
77 * This function returns a KLLMReplyInfo object containing information about this reply. If the reply has not finished, the KLLMReplyInfo object will have
87 * If you need to know if the response has finished changing or if the context has been received yet, call this function.
99 * If you are not streaming the response live, this signal is not of importance to you. However, if you are streaming
100 * content, when this signal is emitted, you should call readResponse() to update the response that your application
108 * After this signal has emitted, the content is guaranteed to not change. At this point, you should call readResponse()
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
QObject(QObject *parent)
Q_OBJECTQ_OBJECT
Q_SIGNALSQ_SIGNALS
QObject * parent() const const
The OllamaReplyInfo class represents information about a reply from an LLM.
Definition ollamareply.h:20
std::chrono::nanoseconds totalDuration
The total time from when the request was received by the server to when the reply was returned.
Definition ollamareply.h:22
std::chrono::nanoseconds promptEvalDuration
The time spent evaluating the prompt.
Definition ollamareply.h:31
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.