For quick processing of special requests
| 287 | |
| 288 | //For quick processing of special requests |
| 289 | QString ChatManager::requestSync(const QString &prompt) |
| 290 | { |
| 291 | QEventLoop loop; |
| 292 | QString response; |
| 293 | connect(liteLLM, &AbstractLLM::dataReceived, &loop, [=, &loop, &response](const QString &data, AbstractLLM::ResponseState state) { |
| 294 | response = data; |
| 295 | loop.exit(); |
| 296 | }); |
| 297 | // use liteLLM to handle request. quickly get the response |
| 298 | liteLLM->request(prompt); |
| 299 | loop.exec(); |
| 300 | return response; |
| 301 | } |
| 302 | |
| 303 | void ChatManager::slotSendSyncRequest(const QJsonObject &obj) |
| 304 | { |