feat: Improve showing tools in chat (#235)

This commit is contained in:
Petr Mironychev
2025-10-10 10:03:22 +02:00
committed by GitHub
parent bde58fb9aa
commit d2b28093a6
26 changed files with 464 additions and 59 deletions

View File

@ -37,10 +37,11 @@ class ChatModel : public QAbstractListModel
QML_ELEMENT
public:
enum ChatRole { System, User, Assistant };
enum ChatRole { System, User, Assistant, Tool };
Q_ENUM(ChatRole)
enum Roles { RoleType = Qt::UserRole, Content, Attachments };
Q_ENUM(Roles)
struct Message
{
@ -75,6 +76,13 @@ public:
Q_INVOKABLE void resetModelTo(int index);
void addToolExecutionStatus(
const QString &requestId, const QString &toolId, const QString &toolName);
void updateToolResult(
const QString &requestId,
const QString &toolId,
const QString &toolName,
const QString &result);
signals:
void tokensThresholdChanged();
void modelReseted();