[#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 3148 additions and 13818 deletions
Showing only changes of commit cfe6ea46e2 - Show all commits

View File

@@ -546,8 +546,9 @@ static gchar*
_build_json_payload(AISession* session, const gchar* prompt)
{
/* OpenAI-compatible format with messages array:
* {"model": "...", "messages": [...], "stream": false} */
/* OpenAI-compatible Responses API format:
* {"model": "...", "input": [...], "stream": false, "store": false}
* store:false prevents providers from storing/using requests for training */
GString* messages_json = g_string_new("");
GList* curr = session->history;
@@ -574,7 +575,7 @@ _build_json_payload(AISession* session, const gchar* prompt)
auto_gchar gchar* escaped_model = ai_json_escape(session->model);
gchar* json_payload = g_strdup_printf(
"{\"model\":\"%s\",\"input\":[%s],\"stream\":false}",
"{\"model\":\"%s\",\"input\":[%s],\"stream\":false,\"store\":false}",
escaped_model, messages_json->str);
g_string_free(messages_json, TRUE);