-
-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathllamachatinput.h
More file actions
56 lines (44 loc) · 1.4 KB
/
llamachatinput.h
File metadata and controls
56 lines (44 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#pragma once
#include <QWidget>
#include <utils/filepath.h>
class QTabBar;
class QTextEdit;
class QToolButton;
namespace LlamaCpp {
class ChatInput : public QWidget
{
Q_OBJECT
public:
explicit ChatInput(QWidget *parent = nullptr);
void setIsGenerating(bool newIsGenerating);
bool isGenerating() const;
void setEditingText(const QString &editingText, const QList<QVariantMap> &extra);
void updateMaximumHeight();
QList<QVariantMap> getExtraFromAttachedFiles();
signals:
void sendRequested(const QString &text, const QList<QVariantMap> &extra);
void editingCancelled();
void stopRequested();
void fileDropped(const QStringList &filePaths);
void pasteLongText(const QString &text);
void pasteFiles(const QStringList &filePaths);
private:
void buildUI();
void updateUI();
void onSendClicked();
void onStopClicked();
void applyStyleSheet();
void cleanUp();
void addFilesFromLocalPaths(const QStringList &filePaths);
void dragEnterEvent(QDragEnterEvent *e) override;
void dropEvent(QDropEvent *e) override;
bool eventFilter(QObject *obj, QEvent *event) override;
QTextEdit *m_txt;
QToolButton *m_sendStopButton;
QToolButton *m_attachButton;
QToolButton *m_toolsButton;
QTabBar *m_attachedFilesBar;
bool m_isGenerating{false};
QList<QPair<QString, QByteArray>> m_attachedFiles;
};
} // namespace LlamaCpp