@@ -2,13 +2,14 @@ import mcpplibs.llmapi;
22import std;
33
44#include < cassert>
5+ #include " ../test_print.hpp"
56
67using namespace mcpplibs ::llmapi;
78
89int main () {
910 auto apiKey = std::getenv (" OPENAI_API_KEY" );
1011 if (!apiKey) {
11- std:: println (" OPENAI_API_KEY not set, skipping live test" );
12+ println (" OPENAI_API_KEY not set, skipping live test" );
1213 return 0 ;
1314 }
1415
@@ -19,7 +20,7 @@ int main() {
1920
2021 // Test 1: basic chat
2122 auto resp = client.chat (" Say exactly: HELLO_TEST_OK" );
22- std:: println (" Response: {} " , resp.text ());
23+ println (" Response: " , resp.text ());
2324 assert (!resp.text ().empty ());
2425 assert (resp.usage .totalTokens > 0 );
2526 assert (resp.stopReason == StopReason::EndOfTurn);
@@ -29,16 +30,16 @@ int main() {
2930 std::string streamed;
3031 auto resp2 = client.chat_stream (" Say exactly: STREAM_OK" , [&](std::string_view chunk) {
3132 streamed += chunk;
32- std:: print (" {} " , chunk);
33+ print (chunk);
3334 });
34- std:: println (" " );
35+ println ();
3536 assert (!streamed.empty ());
3637
3738 // Test 3: conversation continuity
3839 auto resp3 = client.chat (" What did I just ask you to say?" );
3940 assert (!resp3.text ().empty ());
4041 assert (client.conversation ().messages .size () == 4 ); // 2 user + 2 assistant
4142
42- std:: println (" test_openai_live: ALL PASSED" );
43+ println (" test_openai_live: ALL PASSED" );
4344 return 0 ;
4445}
0 commit comments