()
| 463 | } |
| 464 | |
| 465 | func main() { |
| 466 | var anthropic, openaicomp, openrouter, nanogpt, gemini, tools, help, t1, t2, t3, t4 bool |
| 467 | var model string |
| 468 | flag.BoolVar(&anthropic, "anthropic", false, "Use Anthropic API instead of OpenAI") |
| 469 | flag.BoolVar(&openaicomp, "openaicomp", false, "Use OpenAI Completions API") |
| 470 | flag.BoolVar(&openrouter, "openrouter", false, "Use OpenRouter API") |
| 471 | flag.BoolVar(&nanogpt, "nanogpt", false, "Use NanoGPT API") |
| 472 | flag.BoolVar(&gemini, "gemini", false, "Use Google Gemini API") |
| 473 | flag.BoolVar(&tools, "tools", false, "Enable GitHub Actions Monitor tools for testing") |
| 474 | flag.StringVar(&model, "model", "", fmt.Sprintf("AI model to use (defaults: %s for OpenAI, %s for Anthropic, %s for OpenRouter, %s for NanoGPT, %s for Gemini)", DefaultOpenAIModel, DefaultAnthropicModel, DefaultOpenRouterModel, DefaultNanoGPTModel, DefaultGeminiModel)) |
| 475 | flag.BoolVar(&help, "help", false, "Show usage information") |
| 476 | flag.BoolVar(&t1, "t1", false, fmt.Sprintf("Run preset T1 test (%s with 'what is 2+2')", DefaultAnthropicModel)) |
| 477 | flag.BoolVar(&t2, "t2", false, fmt.Sprintf("Run preset T2 test (%s with 'what is 2+2')", DefaultOpenAIModel)) |
| 478 | flag.BoolVar(&t3, "t3", false, "Run preset T3 test (OpenAI Completions API with gpt-5.1)") |
| 479 | flag.BoolVar(&t4, "t4", false, "Run preset T4 test (OpenAI Completions API with gemini-3-pro-preview)") |
| 480 | flag.Parse() |
| 481 | |
| 482 | if help { |
| 483 | printUsage() |
| 484 | os.Exit(0) |
| 485 | } |
| 486 | |
| 487 | ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second) |
| 488 | defer cancel() |
| 489 | |
| 490 | if t1 { |
| 491 | testT1(ctx) |
| 492 | return |
| 493 | } |
| 494 | if t2 { |
| 495 | testT2(ctx) |
| 496 | return |
| 497 | } |
| 498 | if t3 { |
| 499 | testT3(ctx) |
| 500 | return |
| 501 | } |
| 502 | if t4 { |
| 503 | testT4(ctx) |
| 504 | return |
| 505 | } |
| 506 | |
| 507 | // Set default model based on API type if not provided |
| 508 | if model == "" { |
| 509 | if anthropic { |
| 510 | model = DefaultAnthropicModel |
| 511 | } else if openaicomp { |
| 512 | model = "gpt-4o" |
| 513 | } else if openrouter { |
| 514 | model = DefaultOpenRouterModel |
| 515 | } else if nanogpt { |
| 516 | model = DefaultNanoGPTModel |
| 517 | } else if gemini { |
| 518 | model = DefaultGeminiModel |
| 519 | } else { |
| 520 | model = DefaultOpenAIModel |
| 521 | } |
| 522 | } |
nothing calls this directly
no test coverage detected