From 3cffde2cd59d415de59790531961f90be34401d6 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Tue, 30 Dec 2025 21:53:37 +0000 Subject: [PATCH] fix(gallery agent): skip model selection if only one Signed-off-by: Ettore Di Giacinto --- .github/gallery-agent/main.go | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/gallery-agent/main.go b/.github/gallery-agent/main.go index ebef996ec..7233c140b 100644 --- a/.github/gallery-agent/main.go +++ b/.github/gallery-agent/main.go @@ -120,13 +120,22 @@ func main() { fmt.Println(result.FormattedOutput) - // Use AI agent to select the most interesting models - fmt.Println("Using AI agent to select the most interesting models...") - models, err := selectMostInterestingModels(context.Background(), result) - if err != nil { - fmt.Fprintf(os.Stderr, "Error in model selection: %v\n", err) - // Continue with original result if selection fails + if len(result.Models) > 1 { + fmt.Println("More than one model found (", len(result.Models), "), using AI agent to select the most interesting models") + for _, model := range result.Models { + fmt.Println("Model: ", model.ModelID) + } + // Use AI agent to select the most interesting models + fmt.Println("Using AI agent to select the most interesting models...") + models, err := selectMostInterestingModels(context.Background(), result) + if err != nil { + fmt.Fprintf(os.Stderr, "Error in model selection: %v\n", err) + // Continue with original result if selection fails + models = result.Models + } + } else { models = result.Models + fmt.Println("Only one model found, using it directly") } fmt.Print(models)