The Message class represents a chat message.
More...
#include <message.h>
|
| | Message (const QString text, const bool is_user, const QVector< QVariant > &context, const bool in_progress=false, QObject *parent=nullptr) |
| | Constructs a new Message object.
|
| |
| QString | text () const |
| | Returns the text of the message.
|
| |
| void | setText (const QString text) |
| | Sets the text of the message.
|
| |
| bool | isUser () const |
| | Returns true if the message was sent by the user, false otherwise.
|
| |
| QVector< QVariant > | context () const |
| | Returns the context of the message.
|
| |
| void | setContext (const QVector< QVariant > &context) |
| | Sets the context of the message.
|
| |
| bool | inProgress () const |
| | Gets the in progress flag of the message.
|
| |
| void | setInProgress (const bool in_progress) |
| | Sets the in progress flag of the message.
|
| |
| void | updateFromJson (const QJsonObject &json) |
| | Updates the message from a JSON object.
|
| |
The Message class represents a chat message.
◆ Message()
| llm_chat::Message::Message |
( |
const QString | text, |
|
|
const bool | is_user, |
|
|
const QVector< QVariant > & | context, |
|
|
const bool | in_progress = false, |
|
|
QObject * | parent = nullptr ) |
Constructs a new Message object.
- Parameters
-
| text | The text of the message. |
| is_user | True if the message was sent by the user, false otherwise. |
| context | The context of the message. |
| in_progress | Whether the message is in progress. |
| parent | The parent object. |
◆ context()
| QVector< QVariant > llm_chat::Message::context |
( |
| ) |
const |
|
nodiscard |
Returns the context of the message.
This is used to provide additional information to the LLM.
- Returns
- The context of the message.
◆ inProgress()
| bool llm_chat::Message::inProgress |
( |
| ) |
const |
|
nodiscard |
Gets the in progress flag of the message.
- Returns
- True if the message is in progress, false otherwise.
◆ isUser()
| bool llm_chat::Message::isUser |
( |
| ) |
const |
|
nodiscard |
Returns true if the message was sent by the user, false otherwise.
- Returns
- True if the message was sent by the user, false otherwise.
◆ setContext()
| void llm_chat::Message::setContext |
( |
const QVector< QVariant > & | context | ) |
|
Sets the context of the message.
- Parameters
-
| context | The new context of the message. |
◆ setInProgress()
| void llm_chat::Message::setInProgress |
( |
const bool | in_progress | ) |
|
Sets the in progress flag of the message.
- Parameters
-
| in_progress | The new in progress flag of the message. |
◆ setText()
| void llm_chat::Message::setText |
( |
const QString | text | ) |
|
Sets the text of the message.
- Parameters
-
| text | The new text of the message. |
◆ text()
| QString llm_chat::Message::text |
( |
| ) |
const |
|
nodiscard |
Returns the text of the message.
- Returns
- The text of the message.
◆ updateFromJson()
| void llm_chat::Message::updateFromJson |
( |
const QJsonObject & | json | ) |
|
Updates the message from a JSON object.
- Parameters
-
| json | The JSON object to update the message from. |
◆ context
| QVector<QVariant> llm_chat::Message::context |
|
read |
◆ inProgress
| bool llm_chat::Message::inProgress |
|
read |
◆ isUser
| bool llm_chat::Message::isUser |
|
read |
◆ text
| QString llm_chat::Message::text |
|
read |
The documentation for this class was generated from the following files: