Skip to content

Commit 04edf87

Browse files
authored
refactor: fix plural of chain processor vars (#190)
1 parent e4863e5 commit 04edf87

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

src/Chain.php

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,26 +26,26 @@
2626
/**
2727
* @var InputProcessor[]
2828
*/
29-
private array $inputProcessor;
29+
private array $inputProcessors;
3030

3131
/**
3232
* @var OutputProcessor[]
3333
*/
34-
private array $outputProcessor;
34+
private array $outputProcessors;
3535

3636
/**
37-
* @param InputProcessor[] $inputProcessor
38-
* @param OutputProcessor[] $outputProcessor
37+
* @param InputProcessor[] $inputProcessors
38+
* @param OutputProcessor[] $outputProcessors
3939
*/
4040
public function __construct(
4141
private PlatformInterface $platform,
4242
private LanguageModel $llm,
43-
iterable $inputProcessor = [],
44-
iterable $outputProcessor = [],
43+
iterable $inputProcessors = [],
44+
iterable $outputProcessors = [],
4545
private LoggerInterface $logger = new NullLogger(),
4646
) {
47-
$this->inputProcessor = $this->initializeProcessors($inputProcessor, InputProcessor::class);
48-
$this->outputProcessor = $this->initializeProcessors($outputProcessor, OutputProcessor::class);
47+
$this->inputProcessors = $this->initializeProcessors($inputProcessors, InputProcessor::class);
48+
$this->outputProcessors = $this->initializeProcessors($outputProcessors, OutputProcessor::class);
4949
}
5050

5151
/**
@@ -54,7 +54,7 @@ public function __construct(
5454
public function call(MessageBagInterface $messages, array $options = []): ResponseInterface
5555
{
5656
$input = new Input($this->llm, $messages, $options);
57-
array_map(fn (InputProcessor $processor) => $processor->processInput($input), $this->inputProcessor);
57+
array_map(fn (InputProcessor $processor) => $processor->processInput($input), $this->inputProcessors);
5858

5959
$llm = $input->llm;
6060
$messages = $input->messages;
@@ -82,13 +82,14 @@ public function call(MessageBagInterface $messages, array $options = []): Respon
8282
}
8383

8484
$output = new Output($llm, $response, $messages, $options);
85-
array_map(fn (OutputProcessor $processor) => $processor->processOutput($output), $this->outputProcessor);
85+
array_map(fn (OutputProcessor $processor) => $processor->processOutput($output), $this->outputProcessors);
8686

8787
return $output->response;
8888
}
8989

9090
/**
9191
* @param InputProcessor[]|OutputProcessor[] $processors
92+
* @param class-string $interface
9293
*
9394
* @return InputProcessor[]|OutputProcessor[]
9495
*/

0 commit comments

Comments
 (0)