Skip to content
This repository was archived by the owner on Jul 16, 2025. It is now read-only.

Commit 35c00e9

Browse files
committed
-
1 parent 97d899c commit 35c00e9

File tree

4 files changed

+16
-18
lines changed

4 files changed

+16
-18
lines changed

examples/fabric/summarize.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
require_once dirname(__DIR__).'/../vendor/autoload.php';
1212

1313
if (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
1919
if (!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

@@ -50,6 +50,6 @@
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;

examples/fabric/with-processor.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
require_once dirname(__DIR__).'/../vendor/autoload.php';
1313

1414
if (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
2020
if (!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;

src/Platform/Fabric/FabricInputProcessor.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,9 @@
1818
*/
1919
final 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

src/Platform/Fabric/FabricPrompt.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
final 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(

0 commit comments

Comments
 (0)