-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdebug_test.cpp
More file actions
39 lines (33 loc) · 1.33 KB
/
debug_test.cpp
File metadata and controls
39 lines (33 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <iostream>
#include "core/ResponseParser.h"
#include "llmcpp.h"
int main() {
// Exact same input as failing test
std::string text =
"I'll create several jazzy chord progressions...\n\n<musical_aideas-musical_sequence>\n";
text += R"([
{
"description": "Test progression",
"sequence": [
{"note": 60, "start": 0.0, "duration": 1.0, "velocity": 90},
{"note": 64, "start": 1.0, "duration": 1.0, "velocity": 90},
{"note": 67, "start": 2.0, "duration": 2.0, "velocity": 90}
]
}
])";
// Create response exactly like the test
llmcpp::LLMResponse response;
response.success = true;
response.result = nlohmann::json{{"text", text}};
// Call parseStructuredResponse exactly like aideas does
auto results = llmcpp::ResponseParser::parseStructuredResponse(
response, "Anthropic", "musical_aideas-musical_sequence");
std::cout << "Results count: " << results.size() << std::endl;
for (size_t i = 0; i < results.size(); ++i) {
std::cout << "Result " << i << ":" << std::endl;
std::cout << " source: " << results[i].source << std::endl;
std::cout << " description: " << results[i].description << std::endl;
std::cout << " data: " << results[i].data.dump(2) << std::endl;
}
return 0;
}