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

Commit 1116782

Browse files
authored
refactor: Add interface to final readonly chain for testability (#144)
1 parent 2d243e8 commit 1116782

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

src/Chain.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use PhpLlm\LlmChain\Message\MessageBag;
1515
use PhpLlm\LlmChain\Response\ResponseInterface;
1616

17-
final readonly class Chain
17+
final readonly class Chain implements ChainInterface
1818
{
1919
/**
2020
* @var InputProcessor[]

src/ChainInterface.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace PhpLlm\LlmChain;
6+
7+
use PhpLlm\LlmChain\Message\MessageBag;
8+
use PhpLlm\LlmChain\Response\ResponseInterface;
9+
10+
interface ChainInterface
11+
{
12+
/**
13+
* @param array<string, mixed> $options
14+
*/
15+
public function call(MessageBag $messages, array $options = []): ResponseInterface;
16+
}

0 commit comments

Comments
 (0)