| 74 | } |
| 75 | |
| 76 | int main() { |
| 77 | std::cout << "AI SDK C++ - Multi-Provider Comparison\n"; |
| 78 | std::cout << "======================================\n\n"; |
| 79 | |
| 80 | // Test 1: Simple question comparison |
| 81 | std::cout << "Test 1: Simple factual question\n"; |
| 82 | std::cout << "Question: What is the largest planet in our solar system?\n\n"; |
| 83 | |
| 84 | std::string simple_question = |
| 85 | "What is the largest planet in our solar system? Give a brief answer."; |
| 86 | |
| 87 | std::vector<ProviderResult> results1; |
| 88 | |
| 89 | // Test OpenAI models |
| 90 | results1.push_back( |
| 91 | test_provider("OpenAI", ai::openai::models::kGpt54, simple_question)); |
| 92 | results1.push_back( |
| 93 | test_provider("OpenAI", ai::openai::models::kGpt54Mini, simple_question)); |
| 94 | |
| 95 | // Test Anthropic models |
| 96 | results1.push_back(test_provider( |
| 97 | "Anthropic", ai::anthropic::models::kClaudeSonnet46, simple_question)); |
| 98 | results1.push_back(test_provider( |
| 99 | "Anthropic", ai::anthropic::models::kClaudeHaiku45, simple_question)); |
| 100 | |
| 101 | for (const auto& result : results1) { |
| 102 | print_result(result); |
| 103 | } |
| 104 | |
| 105 | // Test 2: Creative writing comparison |
| 106 | std::cout << "Test 2: Creative writing task\n"; |
| 107 | std::cout |
| 108 | << "Prompt: Write a creative short story opening about time travel.\n\n"; |
| 109 | |
| 110 | std::string creative_prompt = |
| 111 | "Write a creative opening paragraph for a short story about someone who " |
| 112 | "discovers they can time travel, but only to the exact same location 24 " |
| 113 | "hours in the past."; |
| 114 | |
| 115 | std::vector<ProviderResult> results2; |
| 116 | |
| 117 | // Test with different providers for creativity |
| 118 | results2.push_back( |
| 119 | test_provider("OpenAI", ai::openai::models::kGpt54, creative_prompt)); |
| 120 | results2.push_back(test_provider( |
| 121 | "Anthropic", ai::anthropic::models::kClaudeSonnet46, creative_prompt)); |
| 122 | |
| 123 | for (const auto& result : results2) { |
| 124 | print_result(result); |
| 125 | } |
| 126 | |
| 127 | // Test 3: Technical explanation comparison |
| 128 | std::cout << "Test 3: Technical explanation\n"; |
| 129 | std::cout << "Prompt: Explain the concept of RAII in C++.\n\n"; |
| 130 | |
| 131 | std::string technical_prompt = |
| 132 | "Explain the concept of RAII (Resource Acquisition Is Initialization) in " |
| 133 | "C++ with a simple example."; |
nothing calls this directly
no test coverage detected