Repository: nomic-ai/gpt4all
File: gpt4all-chat/chat.h (C/C++)

Code before:
    };
    Q_ENUM(ResponseState)

    explicit Chat(QObject *parent = nullptr);
    explicit Chat(bool isServer, QObject *parent = nullptr);
    virtual ~Chat();
    void connectLLM();

    QString id() const { return m_id; }
    QString name() const { return m_userName.isEmpty() ? m_name : m_userName; }
    void setName(const QString &name)
    {
        m_userName = name;
        emit nameChanged();
    }
    ChatModel *chatModel() { return m_chatModel; }

    Q_INVOKABLE void reset();
    Q_INVOKABLE bool isModelLoaded() const;
    Q_INVOKABLE void prompt(const QString &prompt, const QString &prompt_template, int32_t n_predict,
        int32_t top_k, float top_p, float temp, int32_t n_batch, float repeat_penalty, int32_t repeat_penalty_tokens);
    Q_INVOKABLE void regenerateResponse();
    Q_INVOKABLE void stopGenerating();
    Q_INVOKABLE void newPromptResponsePair(const QString &prompt);

    QList<ResultInfo> results() const;

    QString response() const;
    bool responseInProgress() const { return m_responseInProgress; }
    QString responseState() const;
    QString modelName() const;
    void setModelName(const QString &modelName);
    bool isRecalc() const;

    void loadDefaultModel();
    void loadModel(const QString &modelName);
    void unloadModel();
    void reloadModel();
    void unloadAndDeleteLater();

    qint64 creationDate() const { return m_creationDate; }
    bool serialize(QDataStream &stream, int version) const;
    bool deserialize(QDataStream &stream, int version);

    QList<QString> modelList() const;
    bool isServer() const { return m_isServer; }

    QList<QString> collectionList() const;

    Q_INVOKABLE bool hasCollection(const QString &collection) const;
    Q_INVOKABLE void addCollection(const QString &collection);

Review comment (suggestion):
I know this was already here and is just being made public , but since it is public I think it'd be nicer for the name to be a bit more descriptive than `results`, if I'm not familiar with the localdocs stuff I wouldn't necessary guess this was related to localdocs

Code after:
    };
    Q_ENUM(ResponseState)

    explicit Chat(QObject *parent = nullptr);
    explicit Chat(bool isServer, QObject *parent = nullptr);
    virtual ~Chat();
    void connectLLM();

    QString id() const { return m_id; }
    QString name() const { return m_userName.isEmpty() ? m_name : m_userName; }
    void setName(const QString &name)
    {
        m_userName = name;
        emit nameChanged();
    }
    ChatModel *chatModel() { return m_chatModel; }

    Q_INVOKABLE void reset();
    Q_INVOKABLE bool isModelLoaded() const;
    Q_INVOKABLE void prompt(const QString &prompt, const QString &prompt_template, int32_t n_predict,
        int32_t top_k, float top_p, float temp, int32_t n_batch, float repeat_penalty, int32_t repeat_penalty_tokens);
    Q_INVOKABLE void regenerateResponse();
    Q_INVOKABLE void stopGenerating();
    Q_INVOKABLE void newPromptResponsePair(const QString &prompt);

    QList<ResultInfo> databaseResults() const;

    QString response() const;
    bool responseInProgress() const { return m_responseInProgress; }
    QString responseState() const;
    QString modelName() const;
    void setModelName(const QString &modelName);
    bool isRecalc() const;

    void loadDefaultModel();
    void loadModel(const QString &modelName);
    void unloadModel();
    void reloadModel();
    void unloadAndDeleteLater();

    qint64 creationDate() const { return m_creationDate; }
    bool serialize(QDataStream &stream, int version) const;
    bool deserialize(QDataStream &stream, int version);

    QList<QString> modelList() const;
    bool isServer() const { return m_isServer; }

    QList<QString> collectionList() const;

    Q_INVOKABLE bool hasCollection(const QString &collection) const;
    Q_INVOKABLE void addCollection(const QString &collection);