The model of the conversation data in the ui. More...
#include </home/runner/work/yarp-documentation/yarp-documentation/yarp/src/guis/yarpllmgui/ConversationModel.h>
Public Types | |
enum | ConversationRoles { TypeRole = Qt::UserRole + 1 , ContentRole } |
Public Slots | |
void | refreshConversation () |
Deletes and reuploads the conversation. | |
Public Member Functions | |
ConversationModel (QObject *parent=nullptr) | |
~ConversationModel () | |
bool | configure (const std::string &remote_rpc, const std::string &streaming_port_name) |
Configures the remote rpc and streaming port. | |
QVariant | data (const QModelIndex &index, int role) const override |
int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
Q_INVOKABLE void | deleteConversation () |
Deletes the conversation. | |
Q_INVOKABLE void | eraseMessage (const int &index) |
Q_INVOKABLE void | sendMessage (const QString &message) |
Sends a message. | |
Q_INVOKABLE void | configure (const QString &remote_rpc, const QString &streaming_port_name) |
Configures the rpc and streaming port. | |
Protected Member Functions | |
QHash< int, QByteArray > | roleNames () const override |
The model of the conversation data in the ui.
It calls the llm_nwc functions in a way that allows the user to modify the conversation.
It allows the user to modify the configuration from the UI.
It has an inner callback mechanism that refreshes the UI if the conversation is changed outside of it.
Definition at line 59 of file ConversationModel.h.
Enumerator | |
---|---|
TypeRole | |
ContentRole |
Definition at line 64 of file ConversationModel.h.
|
inlineexplicit |
Definition at line 70 of file ConversationModel.h.
|
inline |
Definition at line 77 of file ConversationModel.h.
void ConversationModel::configure | ( | const QString & | remote_rpc, |
const QString & | streaming_port_name | ||
) |
Configures the rpc and streaming port.
Invokable from the ui.
remoteRpc | name of the rpc port opened by the llm_nws |
remote_streaming_port_name | name of the streaming port opened by the llm nws. |
Definition at line 71 of file ConversationModel.cpp.
bool ConversationModel::configure | ( | const std::string & | remote_rpc, |
const std::string & | streaming_port_name | ||
) |
Configures the remote rpc and streaming port.
remoteRpc | name of the rpc port opened by the llm_nws |
remote_streaming_port_name | name of the streaming port opened by the llm nws. It is used by the model callback. |
Definition at line 46 of file ConversationModel.cpp.
|
override |
Definition at line 76 of file ConversationModel.cpp.
void ConversationModel::deleteConversation | ( | ) |
Deletes the conversation.
Invokable from the ui.
Definition at line 114 of file ConversationModel.cpp.
void ConversationModel::eraseMessage | ( | const int & | index | ) |
Definition at line 175 of file ConversationModel.cpp.
|
slot |
Deletes and reuploads the conversation.
This way the data that we keep locally is always fully synchronized with the nws.
Definition at line 125 of file ConversationModel.cpp.
|
overrideprotected |
Definition at line 99 of file ConversationModel.cpp.
|
override |
Definition at line 93 of file ConversationModel.cpp.
void ConversationModel::sendMessage | ( | const QString & | message | ) |
Sends a message.
Invokable from the ui.
message. | The message to send |
Definition at line 154 of file ConversationModel.cpp.