Commit c75a2e7f authored by jan.koester's avatar jan.koester
Browse files

test

parent 130841df
Loading
Loading
Loading
Loading
+10 −8
Changes for editor/src/webedit_api.cpp: 10 added lines, 8 removed lines.
Original line number Diff line number Diff line
@@ -3745,10 +3745,11 @@ void webedit::Api::handleAiPrompt(libhttppp::HttpRequest &curreq,
                const char *aiReqStr = json_object_to_json_string_ext(aiReq, JSON_C_TO_STRING_NOSLASHESCAPE);

                libhttppp::HttpUrl url(fullUrl);
                libhttppp::HttpClient client(url);
                // Generous: a cold model load/swap on the AI backend can
                // stall well past a minute before the first byte comes back.
                client.setTimeout(300);
                // Generous: a cold model load/swap, or the AI backend being
                // unreachable outright, can both stall well past a minute --
                // passed to the constructor since it connects eagerly, before
                // a later setTimeout() call would have any effect.
                libhttppp::HttpClient client(url, /*vers=*/2, /*timeoutSec=*/300);

                libhttppp::HttpRequest apiReq;
                apiReq.setRequestType(POSTREQUEST);
@@ -3926,10 +3927,11 @@ void webedit::Api::handleAiPrompt(libhttppp::HttpRequest &curreq,
            json_object_put(aiReq);

            libhttppp::HttpUrl url(fullUrl);
            libhttppp::HttpClient client(url);
            // Generous: a cold model load/swap on the AI backend can stall
            // well past a minute before the first SSE byte comes back.
            client.setTimeout(300);
            // Generous: a cold model load/swap, or the AI backend being
            // unreachable outright, can both stall well past a minute --
            // passed to the constructor since it connects eagerly, before
            // a later setTimeout() call would have any effect.
            libhttppp::HttpClient client(url, /*vers=*/2, /*timeoutSec=*/300);

            libhttppp::HttpRequest apiReq;
            apiReq.setRequestType(POSTREQUEST);