| 62 | // |
| 63 | |
| 64 | std::string random_string() { |
| 65 | static const std::string str("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"); |
| 66 | |
| 67 | std::random_device rd; |
| 68 | std::mt19937 generator(rd()); |
| 69 | |
| 70 | std::string result(32, ' '); |
| 71 | |
| 72 | for (int i = 0; i < 32; ++i) { |
| 73 | result[i] = str[generator() % str.size()]; |
| 74 | } |
| 75 | |
| 76 | return result; |
| 77 | } |
| 78 | |
| 79 | std::string gen_chatcmplid() { |
| 80 | return "chatcmpl-" + random_string(); |
no test coverage detected