|
|
@ -11,6 +11,17 @@ Chat::Chat(QObject *parent)
|
|
|
|
, m_responseInProgress(false)
|
|
|
|
, m_responseInProgress(false)
|
|
|
|
, m_creationDate(QDateTime::currentSecsSinceEpoch())
|
|
|
|
, m_creationDate(QDateTime::currentSecsSinceEpoch())
|
|
|
|
, m_llmodel(new ChatLLM(this))
|
|
|
|
, m_llmodel(new ChatLLM(this))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
connectLLM();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Chat::~Chat()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
delete m_llmodel;
|
|
|
|
|
|
|
|
m_llmodel = nullptr;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Chat::connectLLM()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Should be in same thread
|
|
|
|
// Should be in same thread
|
|
|
|
connect(Download::globalInstance(), &Download::modelListChanged, this, &Chat::modelListChanged, Qt::DirectConnection);
|
|
|
|
connect(Download::globalInstance(), &Download::modelListChanged, this, &Chat::modelListChanged, Qt::DirectConnection);
|
|
|
|