| 454 | // |
| 455 | |
| 456 | static std::string random_string() { |
| 457 | static const std::string str("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"); |
| 458 | |
| 459 | std::random_device rd; |
| 460 | std::mt19937 generator(rd()); |
| 461 | |
| 462 | std::string result(32, ' '); |
| 463 | |
| 464 | for (int i = 0; i < 32; ++i) { |
| 465 | result[i] = str[generator() % str.size()]; |
| 466 | } |
| 467 | |
| 468 | return result; |
| 469 | } |
| 470 | |
| 471 | static std::string gen_chatcmplid() { |
| 472 | return "chatcmpl-" + random_string(); |
no test coverage detected