mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-24 01:36:21 +00:00
ref(ai): add stub, fix includes, move aiwin_send_message location
This commit is contained in:
@@ -808,12 +808,10 @@ _ai_request_thread(gpointer data)
|
||||
}
|
||||
|
||||
gboolean
|
||||
ai_send_prompt(AISession* session, const gchar* prompt,
|
||||
ai_response_cb response_cb, ai_error_cb error_cb,
|
||||
gpointer user_data)
|
||||
ai_send_prompt(AISession* session, const gchar* prompt, gpointer user_data)
|
||||
{
|
||||
log_debug("[AI-PROMPT] ENTER: session=%p, prompt='%s', response_cb=%p, error_cb=%p, user_data=%p",
|
||||
(void*)session, prompt, (void*)response_cb, (void*)error_cb, user_data);
|
||||
log_debug("[AI-PROMPT] ENTER: session=%p, prompt='%s', user_data=%p",
|
||||
(void*)session, prompt, user_data);
|
||||
|
||||
if (!session || !prompt) {
|
||||
log_error("[AI-PROMPT] FAIL: invalid session or prompt");
|
||||
@@ -824,8 +822,8 @@ ai_send_prompt(AISession* session, const gchar* prompt,
|
||||
gpointer* args = g_new0(gpointer, 6);
|
||||
args[0] = ai_session_ref(session);
|
||||
args[1] = g_strdup(prompt);
|
||||
args[2] = (gpointer)response_cb;
|
||||
args[3] = (gpointer)error_cb;
|
||||
args[2] = (ai_response_cb)aiwin_display_response;
|
||||
args[3] = (ai_error_cb)aiwin_display_error;
|
||||
args[4] = user_data;
|
||||
args[5] = NULL; /* placeholder for built payload */
|
||||
log_debug("[AI-PROMPT] Prepared args, creating thread...");
|
||||
@@ -842,4 +840,4 @@ ai_send_prompt(AISession* session, const gchar* prompt,
|
||||
log_debug("[AI-PROMPT] Thread created successfully: %p", (void*)thread);
|
||||
g_thread_unref(thread);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -185,13 +185,10 @@ void ai_session_set_model(AISession* session, const gchar* model);
|
||||
* Send a prompt to the AI provider asynchronously.
|
||||
* @param session The AI session containing provider and model
|
||||
* @param prompt The prompt to send
|
||||
* @param response_cb Callback function for successful responses
|
||||
* @param error_cb Callback function for error handling
|
||||
* @param user_data User data to be passed to the callbacks
|
||||
* @return TRUE if the request was successfully queued, FALSE otherwise
|
||||
*/
|
||||
gboolean ai_send_prompt(AISession* session, const gchar* prompt,
|
||||
ai_response_cb response_cb, ai_error_cb error_cb,
|
||||
gpointer user_data);
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user