AnthropicResponseBuilder implementation
| 186 | |
| 187 | // AnthropicResponseBuilder implementation |
| 188 | std::string AnthropicResponseBuilder::buildSuccessResponse( |
| 189 | const std::string& content, |
| 190 | const std::string& model, |
| 191 | int input_tokens, |
| 192 | int output_tokens) { |
| 193 | nlohmann::json response = { |
| 194 | {"id", "msg_test123"}, |
| 195 | {"type", "message"}, |
| 196 | {"role", "assistant"}, |
| 197 | {"content", |
| 198 | nlohmann::json::array({{{"type", "text"}, {"text", content}}})}, |
| 199 | {"model", model}, |
| 200 | {"stop_reason", "end_turn"}, |
| 201 | {"stop_sequence", nullptr}, |
| 202 | {"usage", |
| 203 | {{"input_tokens", input_tokens}, {"output_tokens", output_tokens}}}}; |
| 204 | return response.dump(); |
| 205 | } |
| 206 | |
| 207 | std::string AnthropicResponseBuilder::buildErrorResponse( |
| 208 | int /* status_code */, |
nothing calls this directly
no outgoing calls
no test coverage detected