wxMaxima
Loading...
Searching...
No Matches
Public Member Functions
AiChatSidebar Class Reference

A sidebar to chat with an external AI about the current worksheet (follow-up to the MCP server, GH request: "a de facto standard AI sidebar that ... gives it access to a worksheet"). More...

#include <AiChatSidebar.h>

Inheritance diagram for AiChatSidebar:
[legend]
Collaboration diagram for AiChatSidebar:
[legend]

Public Member Functions

 AiChatSidebar (wxWindow *parent, Configuration *configuration, Worksheet *worksheet, Variablespane *variablesPane, wxWindowID id=wxID_ANY)
 
void ReloadProviderFromConfig ()
 Re-reads Configuration for the selected provider/API key/model and rebuilds this sidebar's provider accordingly. Call after the Options dialog closes, in case the AI settings changed. Safe to call even while a request is in flight – see AiProvider::SendChat()'s own shared_ptr-based lifetime handling for why that's safe.
 
void ClearConversation ()
 Clears the conversation history (but not the provider/API key setup).
 

Detailed Description

A sidebar to chat with an external AI about the current worksheet (follow-up to the MCP server, GH request: "a de facto standard AI sidebar that ... gives it access to a worksheet").

Safety scope, same as the MCP server's (see McpTools.h): every message sent to the AI is accompanied by a read-only worksheet snapshot (built via McpTools, the same tool logic the MCP server itself uses), refreshed before each turn – but this first pass does NOT give the AI any tool- calling ability to actively request a specific cell/section/variable mid-conversation, and it cannot insert, edit, or evaluate anything in the worksheet. It is a read-only-context chat, not an agent. A real tool-calling loop (the AI deciding for itself to call read_cell/ read_section/watch_variable) is a natural follow-up once this ships, since McpTools already implements every tool such a loop would need – it just isn't wired up to a provider's function-calling API yet.

Needs an internet connection and an API key the user pastes into Options for one of a handful of providers (AiProvider.h) – unlike the MCP server, which is entirely local. Requires wxUSE_WEBREQUEST (wxWidgets >= 3.1.5 with a working backend); says so plainly and refuses to send anything if that's not available in this build, rather than silently failing.


The documentation for this class was generated from the following files: