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

Method buildErrorResponse

tests/utils/mock_openai_client.cpp:190–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

188}
189
190std::string ResponseBuilder::buildErrorResponse(int status_code,
191 const std::string& error_type,
192 const std::string& message) {
193 nlohmann::json error_response = {{"error",
194 {{"message", message},
195 {"type", error_type},
196 {"param", nullptr},
197 {"code", nullptr}}}};
198
199 return error_response.dump();
200}
201
202std::string ResponseBuilder::buildPartialResponse() {
203 return R"({"id":"incomplete","choices":[{"message":{"content":"partial)"; // Deliberately incomplete

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected