This repository was archived by the owner on Jul 16, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +16
-18
lines changed
Expand file tree Collapse file tree 4 files changed +16
-18
lines changed Original file line number Diff line number Diff line change 1111require_once dirname (__DIR__ ).'/../vendor/autoload.php ' ;
1212
1313if (empty ($ _ENV ['OPENAI_API_KEY ' ])) {
14- echo 'Please set the OPENAI_API_KEY environment variable. ' .PHP_EOL ;
14+ echo 'Please set the OPENAI_API_KEY environment variable. ' .\ PHP_EOL ;
1515 exit (1 );
1616}
1717
1818// Check if Fabric patterns package is installed
1919if (!is_dir (dirname (__DIR__ , 2 ).'/vendor/php-llm/fabric-pattern ' )) {
20- echo 'Fabric patterns are not installed. ' .PHP_EOL ;
21- echo 'Please install them with: composer require php-llm/fabric-pattern ' .PHP_EOL ;
20+ echo 'Fabric patterns are not installed. ' .\ PHP_EOL ;
21+ echo 'Please install them with: composer require php-llm/fabric-pattern ' .\ PHP_EOL ;
2222 exit (1 );
2323}
2424
5050// Call the chain
5151$ response = $ chain ->call ($ messages );
5252
53- echo 'Summary using Fabric pattern "create_summary": ' .PHP_EOL ;
54- echo '============================================== ' .PHP_EOL ;
55- echo $ response ->getContent ().PHP_EOL ;
53+ echo 'Summary using Fabric pattern "create_summary": ' .\ PHP_EOL ;
54+ echo '============================================== ' .\ PHP_EOL ;
55+ echo $ response ->getContent ().\ PHP_EOL ;
Original file line number Diff line number Diff line change 1212require_once dirname (__DIR__ ).'/../vendor/autoload.php ' ;
1313
1414if (empty ($ _ENV ['OPENAI_API_KEY ' ])) {
15- echo 'Please set the OPENAI_API_KEY environment variable. ' .PHP_EOL ;
15+ echo 'Please set the OPENAI_API_KEY environment variable. ' .\ PHP_EOL ;
1616 exit (1 );
1717}
1818
1919// Check if Fabric patterns package is installed
2020if (!is_dir (dirname (__DIR__ , 2 ).'/vendor/php-llm/fabric-pattern ' )) {
21- echo 'Fabric patterns are not installed. ' .PHP_EOL ;
22- echo 'Please install them with: composer require php-llm/fabric-pattern ' .PHP_EOL ;
21+ echo 'Fabric patterns are not installed. ' .\ PHP_EOL ;
22+ echo 'Please install them with: composer require php-llm/fabric-pattern ' .\ PHP_EOL ;
2323 exit (1 );
2424}
2525
@@ -51,6 +51,6 @@ function processUserData($data) {
5151// Call with Fabric pattern
5252$ response = $ chain ->call ($ messages , ['fabric_pattern ' => 'analyze_code ' ]);
5353
54- echo 'Code Analysis using Fabric pattern "analyze_code": ' .PHP_EOL ;
55- echo '================================================== ' .PHP_EOL ;
56- echo $ response ->getContent ().PHP_EOL ;
54+ echo 'Code Analysis using Fabric pattern "analyze_code": ' .\ PHP_EOL ;
55+ echo '================================================== ' .\ PHP_EOL ;
56+ echo $ response ->getContent ().\ PHP_EOL ;
Original file line number Diff line number Diff line change 1818 */
1919final readonly class FabricInputProcessor implements InputProcessorInterface
2020{
21- private FabricRepository $ repository ;
22-
23- public function __construct (?FabricRepository $ repository = null )
24- {
25- $ this ->repository = $ repository ?? new FabricRepository ();
21+ public function __construct (
22+ private FabricRepository $ repository = new FabricRepository (),
23+ ) {
2624 }
2725
2826 public function processInput (Input $ input ): void
Original file line number Diff line number Diff line change 1010final readonly class FabricPrompt implements FabricPromptInterface
1111{
1212 /**
13- * @param non-empty-string $pattern
13+ * @param non-empty-string $pattern
1414 * @param array<string, mixed> $metadata
1515 */
1616 public function __construct (
You can’t perform that action at this time.
0 commit comments