fix: Documentation AI not working correctly often

Fixes #1375
This commit is contained in:
WerWolv 2023-10-26 17:19:23 +02:00
parent f94c23d64d
commit e63af24626
1 changed files with 3 additions and 0 deletions

View File

@ -81,6 +81,9 @@ namespace hex::plugin::builtin {
auto request = HttpRequest("POST", hex::format("https://api.gitbook.com/v1/spaces/{}/search/ask", space));
// Documentation API often takes a long time to respond, so we set a timeout of 30 seconds
request.setTimeout(30'000);
const nlohmann::json body = { { "query", input } };
request.setBody(body.dump());
request.addHeader("Content-Type", "application/json");