MCPcopy Create free account
hub / github.com/ClickHouse/ai-sdk-cpp / generate_tool_call_id

Function generate_tool_call_id

src/tools/tool_executor.cpp:264–281  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

262}
263
264std::string generate_tool_call_id() {
265 // Generate a unique ID for tool calls
266 static std::random_device rd;
267 static std::mt19937 gen(rd());
268 static std::uniform_int_distribution<> dis(0, 15);
269
270 std::string id = "call_";
271 for (int i = 0; i < 24; ++i) {
272 int val = dis(gen);
273 if (val < 10) {
274 id += static_cast<char>('0' + val);
275 } else {
276 id += static_cast<char>('a' + val - 10);
277 }
278 }
279
280 return id;
281}
282
283} // namespace ai

Callers 1

create_tool_callFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected