general ui work
This commit is contained in:
parent
8a26f9e1e4
commit
b111e15fd5
8 changed files with 272 additions and 47 deletions
15
kateai.h
15
kateai.h
|
|
@ -52,23 +52,28 @@ private:
|
|||
|
||||
KTextEditor::MainWindow *m_mainWindow;
|
||||
inline static QPointer<AiBackend> m_ai;
|
||||
bool m_useInstruct = false;
|
||||
inline static bool m_useInstruct = false;
|
||||
inline static QString m_systemPrompt;
|
||||
inline static int m_maxContext;
|
||||
inline static QString m_lastInstruct;
|
||||
|
||||
private:
|
||||
void generate();
|
||||
void gotResponse(AiBackend::Response respons);
|
||||
static QStringList getIncludePaths(const QString& text);
|
||||
QString assembleContext(QPointer<KTextEditor::Document> document, const KTextEditor::Cursor& cursor);
|
||||
QString assembleContext(QPointer<KTextEditor::Document> document, const KTextEditor::Cursor& cursor, const QString& instruction = QString());
|
||||
|
||||
QPointer<KTextEditor::Document> activeDocument() const;
|
||||
KTextEditor::Cursor getCurrentCursor() const;
|
||||
QHash<uint32_t, Request> m_requests;
|
||||
|
||||
public:
|
||||
KateAiPluginView(KateAiPlugin *plugin, KTextEditor::MainWindow *mainwindow, bool instruct = false);
|
||||
KateAiPluginView(KateAiPlugin *plugin, KTextEditor::MainWindow *mainwindow);
|
||||
~KateAiPluginView() override;
|
||||
void setInstruct(bool instruct);
|
||||
static void setAi(QPointer<AiBackend> ai){m_ai = ai;}
|
||||
static void setInstruct(bool instruct);
|
||||
static void setSystemPrompt(const QString& in);
|
||||
static void setMaxContext(int maxContext);
|
||||
static void setAi(QPointer<AiBackend> ai);
|
||||
|
||||
Q_SIGNAL void reconnect();
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue