[#110] Add AI client with multi-provider support and UI #113

Manually merged
jabber.developer merged 64 commits from feat/ai into master 2026-05-15 02:22:56 +00:00
67 changed files with 3203 additions and 13818 deletions
Showing only changes of commit da0bf43d73 - Show all commits

View File

@@ -10855,7 +10855,9 @@ gboolean
cmd_ai_correct(ProfWin* window, const char* const command, gchar** args)
{
// /ai correct <message>
if (args[1] == NULL) {
// Join all arguments from args[1] onwards to support multi-word prompts
auto_gchar gchar* prompt = g_strjoinv(" ", &args[1]);
if (prompt == NULL || strlen(prompt) == 0) {
cons_bad_cmd_usage(command);
return TRUE;
}
@@ -10892,11 +10894,11 @@ cmd_ai_correct(ProfWin* window, const char* const command, gchar** args)
// Replace the last user message
AIMessage* msg = last_user_msg->data;
g_free(msg->content);
msg->content = g_strdup(args[1]);
msg->content = g_strdup(prompt);
// Resend the prompt
cons_show("Correcting message...");
ai_send_prompt(aiwin->session, args[1], aiwin);
ai_send_prompt(aiwin->session, prompt, aiwin);
return TRUE;
}