diff --git a/app/Console/Commands/AI/AnalyzeAllArtworks.php b/app/Console/Commands/AI/AnalyzeAllArtworks.php index 008181ab..a4eeb52e 100644 --- a/app/Console/Commands/AI/AnalyzeAllArtworks.php +++ b/app/Console/Commands/AI/AnalyzeAllArtworks.php @@ -40,7 +40,7 @@ public function handle(): int $artworks = $this->getArtworksToProcess($cutoffDate); $total = $artworks->count(); - + if ($total === 0) { $this->info("No artworks need processing at this time."); return 0; @@ -48,7 +48,7 @@ public function handle(): int $this->info("Found {$total} artworks to process"); $bar = $this->output->createProgressBar($total); - + $processed = 0; $skipped = 0; $errors = 0; @@ -69,12 +69,12 @@ public function handle(): int 'trace' => $e->getTraceAsString() ]); } - + $bar->advance(); } $bar->finish(); - + $this->newLine(2); $this->table( ['Metric', 'Count'], @@ -221,4 +221,4 @@ protected function saveTextEmbeddings( ] ); } -} \ No newline at end of file +} diff --git a/app/Console/Commands/AI/SummarizeDescription.php b/app/Console/Commands/AI/SummarizeDescription.php index a7159217..ddc02547 100644 --- a/app/Console/Commands/AI/SummarizeDescription.php +++ b/app/Console/Commands/AI/SummarizeDescription.php @@ -41,14 +41,14 @@ public function handle(): int try { // Get artwork and embeddings - $artwork = $this->option('random') + $artwork = $this->option('random') ? $this->getRandomArtwork() : Artwork::findOrFail($this->option('id') ?? $this->ask('Enter artwork ID:')); $imageEmbedding = ImageEmbedding::where('model_name', 'artworks') ->where('model_id', $artwork->id) ->first(); - + $textEmbedding = TextEmbedding::where('model_name', 'artworks') ->where('model_id', $artwork->id) ->first(); @@ -176,4 +176,4 @@ protected function saveResults($artwork, $imageEmbedding, $textEmbedding, $newSu file_put_contents($filename, json_encode($data, JSON_PRETTY_PRINT)); $this->info("\nResults saved to: " . $filename); } -} \ No newline at end of file +}