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

Method createValidChatCompletionResponse

tests/utils/test_fixtures.cpp:39–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37}
38
39nlohmann::json OpenAITestFixture::createValidChatCompletionResponse() {
40 return nlohmann::json{
41 {"id", "chatcmpl-test123"},
42 {"object", "chat.completion"},
43 {"created", 1234567890},
44 {"model", kTestModel},
45 {"system_fingerprint", "fp_test123"},
46 {"choices", nlohmann::json::array(
47 {{{"index", 0},
48 {"message",
49 {{"role", "assistant"},
50 {"content", "Hello! How can I help you today?"}}},
51 {"finish_reason", "stop"}}})},
52 {"usage",
53 {{"prompt_tokens", 10},
54 {"completion_tokens", 20},
55 {"total_tokens", 30}}}};
56}
57
58nlohmann::json OpenAITestFixture::createErrorResponse(
59 int /* status_code */,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected