new chatlistview component, file attachments, performance & primitive test
This commit is contained in:
@@ -39,16 +39,20 @@ class LlmClient : public QObject {
|
||||
}
|
||||
[[nodiscard]] int contextSize() const { return m_contextSize; }
|
||||
[[nodiscard]] ToolRegistry* tools() const { return m_tools; }
|
||||
[[nodiscard]] QString serverError() const { return m_serverError; }
|
||||
void setEndpoint(const QString& value);
|
||||
void setModel(const QString& value);
|
||||
void setTemperature(double value);
|
||||
void setContextSize(int size);
|
||||
void probeContextSize(std::function<void()> done = {});
|
||||
Q_INVOKABLE void refreshFromServer();
|
||||
void refreshAllStates();
|
||||
|
||||
[[nodiscard]] bool busy() const { return m_busy; }
|
||||
[[nodiscard]] bool toolsEnabled() const { return m_tools->enabled(); }
|
||||
void setToolsEnabled(bool value) { m_tools->setEnabled(value); }
|
||||
[[nodiscard]] bool sandboxEnabled() const { return m_sandboxEnabled; }
|
||||
void setSandboxEnabled(bool value);
|
||||
[[nodiscard]] QString activeWorkspace() const;
|
||||
[[nodiscard]] QString streamingChatId() const { return m_streamingChatId; }
|
||||
[[nodiscard]] ChatSession* streamingSession() const { return m_active; }
|
||||
|
||||
@@ -74,6 +78,7 @@ class LlmClient : public QObject {
|
||||
void toolsEnabledChanged();
|
||||
void streamingChatIdChanged();
|
||||
void errorOccurred(const QString& message);
|
||||
void serverErrorChanged();
|
||||
void titleSuggested(ZShell::llm::ChatSession* session, const QString& title);
|
||||
void iconSuggested(ZShell::llm::ChatSession* session, const QString& icon);
|
||||
|
||||
@@ -89,6 +94,7 @@ class LlmClient : public QObject {
|
||||
void sendRound();
|
||||
QJsonArray buildContextMessages(
|
||||
ChatSession* session, int stopBeforeRow, int extraReserveTokens) const;
|
||||
void appendSandboxPreamble(QJsonArray& messages);
|
||||
void applyToolCallDelta(const QJsonObject& call);
|
||||
void roundFinished();
|
||||
void executeAllCalls();
|
||||
@@ -102,6 +108,7 @@ class LlmClient : public QObject {
|
||||
void updateTokenUsage(const QJsonObject& data);
|
||||
void setBusy(bool value);
|
||||
void setStreamingChatId(const QString& id);
|
||||
void setServerError(const QString& value);
|
||||
void shortRequest(
|
||||
const QString& tag,
|
||||
const QString& systemPrompt,
|
||||
@@ -109,6 +116,7 @@ class LlmClient : public QObject {
|
||||
std::function<void(QString result)> onResult);
|
||||
static QString completionsPath(
|
||||
const QString& endpoint, const QString& subpath);
|
||||
static QString jsonErrorMessage(const QByteArray& body);
|
||||
static QString serverErrorMessage(
|
||||
const QByteArray& body, const QString& fallback);
|
||||
|
||||
@@ -125,6 +133,7 @@ class LlmClient : public QObject {
|
||||
QString m_endpoint;
|
||||
QString m_model;
|
||||
QStringList m_availableModels;
|
||||
QString m_serverError;
|
||||
double m_temperature = 0.7;
|
||||
int m_contextSize = 0;
|
||||
|
||||
@@ -139,7 +148,9 @@ class LlmClient : public QObject {
|
||||
int m_round = 0;
|
||||
qsizetype m_contentMark = 0;
|
||||
qsizetype m_reasoningMark = 0;
|
||||
bool m_sandboxEnabled = true;
|
||||
bool m_roundDone = false;
|
||||
bool m_streamDone = false;
|
||||
bool m_toolPhase = false;
|
||||
bool m_approvalPending = false;
|
||||
bool m_contextRetryUsed = false;
|
||||
|
||||
Reference in New Issue
Block a user