22#ifndef AICHATSIDEBAR_H
23#define AICHATSIDEBAR_H
27#include "mcp/McpTools.h"
69 wxWindowID
id = wxID_ANY);
90 void OnSend(wxCommandEvent &event);
91 void OnInputKeyDown(wxKeyEvent &event);
108 void ScrollHistoryToEnd();
117 void OnOpenOptions(wxCommandEvent &event);
118 void AppendToHistory(
const wxString &speaker,
const wxString &text);
119 void SetBusy(
bool busy);
123 wxString BuildContextSnapshot()
const;
124 void UpdateStatusText();
128 void UpdateAiStatusIcon();
133 void OnLongWaitTimer(wxTimerEvent &event);
137 std::shared_ptr<AiProvider> m_provider;
138 std::vector<AiChatMessage> m_history;
139 bool m_requestInFlight =
false;
157 bool m_interruptRequested =
false;
161 bool m_lastRequestFailed =
false;
164 wxString m_lastErrorDetail;
171 wxString m_providerConfigProblem;
178 wxString m_reportedConfigProblem;
183 wxTimer m_longWaitTimer;
185 static constexpr int LONG_WAIT_MS = 10000;
187 wxTextCtrl *m_historyCtrl;
188 wxTextCtrl *m_inputCtrl;
189 wxButton *m_sendButton;
199 wxButton *m_interruptButton;
200 wxButton *m_clearButton;
201 wxStaticText *m_statusText;
202 wxButton *m_openOptionsButton;
209 static constexpr std::size_t MAX_CONTEXT_LENGTH = 8000;
Talks to one of a handful of external AI chat APIs for the AI chat sidebar (AiChatSidebar).
std::function< void()> AiRequestCanceller
Cancels the one chat request it was handed out for, and does nothing at all once that request has fin...
Definition: AiProvider.h:256
A sidebar that shows the raw HTTP traffic between wxMaxima and the configured AI provider – the AI Ch...
Definition: AiConnectionMonitor.h:45
The configuration storage for the current worksheet.
Definition: Configuration.h:100
The class that draws the status bar.
Definition: StatusBar.h:47
A "variables" sidepane.
Definition: VariablesPane.h:45
The canvas that contains the spreadsheet the whole program is about.
Definition: Worksheet.h:118