This repository was archived by the owner on Jul 16, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -46,10 +46,19 @@ $app = (new SingleCommandApplication('LLM Chain Example Runner'))
4646 sleep (1 );
4747 foreach ($ exampleRuns as $ run ) {
4848 if ('running ' === $ run ['state ' ] && !$ run ['process ' ]->isRunning ()) {
49- $ result = $ run ['process ' ]->isSuccessful () ? '<info>Finished</info> '
50- : (1 === $ run ['process ' ]->getExitCode () ? '<error>Failed</error> ' : '<comment>Skipped</comment> ' );
49+ $ emptyOutput = 0 === strlen (trim ($ run ['process ' ]->getOutput ()));
50+ $ success = $ run ['process ' ]->isSuccessful () && !$ emptyOutput ;
51+ $ result = $ success ? '<info>Finished</info> '
52+ : (1 === $ run ['process ' ]->getExitCode () || $ emptyOutput ? '<error>Failed</error> ' : '<comment>Skipped</comment> ' );
5153 $ run ['section ' ]->overwrite (sprintf ('Example %s: %s ' , $ run ['example ' ]->getFilename (), $ result ));
5254 $ run ['state ' ] = 'finished ' ;
55+ if ($ output ->isVerbose ()) {
56+ $ exampleOutput = $ emptyOutput ? 'Output was empty ' : $ run ['process ' ]->getOutput ();
57+ $ exampleOutput = strlen ($ exampleOutput ) <= 100 ? $ exampleOutput : substr ($ exampleOutput , 0 , 100 ).'... ' ;
58+ $ run ['section ' ]->writeln (
59+ sprintf ('<%s>%s</> ' , $ success ? 'fg=#999999 ' : 'fg=red ' , trim ($ exampleOutput ))
60+ );
61+ }
5362 }
5463 }
5564 }
You can’t perform that action at this time.
0 commit comments