You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Docstrings generation was requested by @0xGingi.
* #2746 (comment)
The following files were modified:
* `cmd/testai/main-testai.go`
* `pkg/aiusechat/usechat-mode.go`
// testNanoGPT sends a single test message to a NanoGPT endpoint using WaveAIPostMessageWrap and streams the AI response to a TestResponseWriter.
268
+
// It prints the chosen model, message, and generated chat ID to stdout. If the NANOGPT_KEY environment variable is not set, the function prints an error and exits the process.
// testAnthropic runs a streaming test against Anthropic using the given model, message, and tools.
319
+
// It requires the ANTHROPIC_APIKEY environment variable and will print an error and exit if it is unset.
320
+
// The function prints test info (model, message, chat ID) and streams the model's responses to stdout via an SSE test writer using WaveAIPostMessageWrap.
testOpenAIComp(ctx, "gpt-4o", "what is 2+2? please be brief", nil)
375
436
}
376
437
438
+
// testT4 runs a preset Gemini integration test that asks the model to compute 2+2+8 using the provider adder tool.
377
439
functestT4(ctx context.Context) {
378
440
tool:=aiusechat.GetAdderToolDefinition()
379
441
tools:= []uctypes.ToolDefinition{tool}
380
442
testGemini(ctx, DefaultGeminiModel, "what is 2+2+8, use the provider adder tool", tools)
381
443
}
382
444
445
+
// printUsage prints the program usage help including example invocations, the default model names for each supported provider, and the environment variables required for API keys.
383
446
funcprintUsage() {
384
-
fmt.Println("Usage: go run main-testai.go [--anthropic|--openaicomp|--openrouter|--gemini] [--tools] [--model <model>] [message]")
447
+
fmt.Println("Usage: go run main-testai.go [--anthropic|--openaicomp|--openrouter|--nanogpt|--gemini] [--tools] [--model <model>] [message]")
385
448
fmt.Println("Examples:")
386
449
fmt.Println(" go run main-testai.go 'What is 2+2?'")
387
450
fmt.Println(" go run main-testai.go --model o4-mini 'What is 2+2?'")
@@ -390,6 +453,8 @@ func printUsage() {
390
453
fmt.Println(" go run main-testai.go --openaicomp --model gpt-4o 'What is 2+2?'")
391
454
fmt.Println(" go run main-testai.go --openrouter 'What is 2+2?'")
392
455
fmt.Println(" go run main-testai.go --openrouter --model anthropic/claude-3.5-sonnet 'What is 2+2?'")
456
+
fmt.Println(" go run main-testai.go --nanogpt 'What is 2+2?'")
457
+
fmt.Println(" go run main-testai.go --nanogpt --model gpt-4o 'What is 2+2?'")
393
458
fmt.Println(" go run main-testai.go --gemini 'What is 2+2?'")
394
459
fmt.Println(" go run main-testai.go --gemini --model gemini-1.5-pro 'What is 2+2?'")
395
460
fmt.Println(" go run main-testai.go --tools 'Help me configure GitHub Actions monitoring'")
flag.BoolVar(&gemini, "gemini", false, "Use Google Gemini API")
418
493
flag.BoolVar(&tools, "tools", false, "Enable GitHub Actions Monitor tools for testing")
419
-
flag.StringVar(&model, "model", "", fmt.Sprintf("AI model to use (defaults: %s for OpenAI, %s for Anthropic, %s for OpenRouter, %s for Gemini)", DefaultOpenAIModel, DefaultAnthropicModel, DefaultOpenRouterModel, DefaultGeminiModel))
494
+
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))
0 commit comments