[#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
22 changed files with 3907 additions and 8 deletions
Showing only changes of commit b1dbe714e8 - Show all commits

View File

@@ -205,7 +205,7 @@ ai_provider_new(const gchar* name, const gchar* api_url, const gchar* org_id)
return provider;
}
static AIProvider*
AIProvider*
ai_provider_ref(AIProvider* provider)
{
if (provider) {

View File

@@ -78,6 +78,13 @@ AIProvider* ai_add_provider(const gchar* name, const gchar* api_url, const gchar
*/
gboolean ai_remove_provider(const gchar* name);
/**
* Increment the reference count of a provider.
* @param provider The provider to reference
* @return The same provider pointer
*/
AIProvider* ai_provider_ref(AIProvider* provider);
/**
* Decrement the reference count of a provider.
* @param provider The provider to unreference

View File

@@ -11115,7 +11115,7 @@ cmd_ai_switch(ProfWin* window, const char* const command, gchar** args)
aiwin->session->provider_name = g_strdup(provider_name);
ai_provider_unref(aiwin->session->provider);
aiwin->session->provider = new_provider;
aiwin->session->provider->ref_count++;
ai_provider_ref(aiwin->session->provider);
}
g_free(aiwin->session->model);
aiwin->session->model = g_strdup(model);