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

Method createResponseWithUsage

tests/utils/test_fixtures.cpp:224–232  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

222}
223
224nlohmann::json TestDataGenerator::createResponseWithUsage(
225 int prompt_tokens,
226 int completion_tokens) {
227 auto response = createMinimalValidResponse();
228 response["usage"] = {{"prompt_tokens", prompt_tokens},
229 {"completion_tokens", completion_tokens},
230 {"total_tokens", prompt_tokens + completion_tokens}};
231 return response;
232}
233
234nlohmann::json TestDataGenerator::createResponseWithMetadata() {
235 auto response = createFullValidResponse();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected