chore: format llm c files
C++ / fmt (pull_request) Failing after 4s
C++ / build (pull_request) Failing after 9s
JS/TS / lint (pull_request) Successful in 9s
JS/TS / fmt (pull_request) Successful in 16s
C++ / clang-tidy (pull_request) Failing after 43s
Python / static (pull_request) Failing after 57s
Rust / fmt (pull_request) Successful in 1m30s
Rust / build (pull_request) Successful in 2m5s
Rust / clippy (pull_request) Successful in 1m55s
Python / verify (pull_request) Successful in 2m23s
C++ / fmt (pull_request) Failing after 4s
C++ / build (pull_request) Failing after 9s
JS/TS / lint (pull_request) Successful in 9s
JS/TS / fmt (pull_request) Successful in 16s
C++ / clang-tidy (pull_request) Failing after 43s
Python / static (pull_request) Failing after 57s
Rust / fmt (pull_request) Successful in 1m30s
Rust / build (pull_request) Successful in 2m5s
Rust / clippy (pull_request) Successful in 1m55s
Python / verify (pull_request) Successful in 2m23s
This commit is contained in:
@@ -16,24 +16,23 @@ class ChatMessage : public QObject {
|
||||
|
||||
Q_PROPERTY(Role role READ role CONSTANT)
|
||||
Q_PROPERTY(qint64 timestamp READ timestamp CONSTANT)
|
||||
Q_PROPERTY(int generationCount READ generationCount NOTIFY generationsChanged)
|
||||
Q_PROPERTY(
|
||||
QList<ZShell::llm::ChatGeneration*> generations READ generations
|
||||
NOTIFY generationsChanged)
|
||||
int generationCount READ generationCount NOTIFY generationsChanged)
|
||||
Q_PROPERTY(
|
||||
QList<ZShell::llm::ChatGeneration*> generations READ generations NOTIFY
|
||||
generationsChanged)
|
||||
Q_PROPERTY(
|
||||
ZShell::llm::ChatGeneration* activeGeneration READ activeGeneration
|
||||
NOTIFY activeGenerationChanged)
|
||||
Q_PROPERTY(int activeGenerationIndex READ activeGenerationIndex NOTIFY activeGenerationChanged)
|
||||
Q_PROPERTY(
|
||||
int activeGenerationIndex READ activeGenerationIndex NOTIFY
|
||||
activeGenerationChanged)
|
||||
|
||||
public:
|
||||
enum class Role : int {
|
||||
User = 0,
|
||||
Assistant
|
||||
};
|
||||
enum class Role : int { User = 0, Assistant };
|
||||
Q_ENUM(Role)
|
||||
|
||||
explicit ChatMessage(
|
||||
Role role, qint64 timestamp, QObject* parent = nullptr);
|
||||
explicit ChatMessage(Role role, qint64 timestamp, QObject* parent = nullptr);
|
||||
|
||||
[[nodiscard]] Role role() const { return m_role; }
|
||||
[[nodiscard]] qint64 timestamp() const { return m_timestamp; }
|
||||
@@ -48,8 +47,7 @@ class ChatMessage : public QObject {
|
||||
}
|
||||
[[nodiscard]] int activeGenerationIndex() const { return m_active; }
|
||||
[[nodiscard]] ChatGeneration* generation(int index) const {
|
||||
if (index < 0 || index >= m_generations.size())
|
||||
return nullptr;
|
||||
if (index < 0 || index >= m_generations.size()) return nullptr;
|
||||
return m_generations.at(index);
|
||||
}
|
||||
|
||||
@@ -58,7 +56,6 @@ class ChatMessage : public QObject {
|
||||
Q_INVOKABLE void retry();
|
||||
Q_INVOKABLE void generate();
|
||||
|
||||
// Creates an empty generation; callers fill it with segments.
|
||||
ChatGeneration* addGeneration(qint64 timestamp);
|
||||
ChatGeneration* appendGeneration(qint64 timestamp);
|
||||
void removeGeneration(ChatGeneration* generation);
|
||||
|
||||
Reference in New Issue
Block a user