From a07c2edf3b62379cf37014c5825bc1952c1c592a Mon Sep 17 00:00:00 2001 From: Denis Zunke Date: Tue, 12 Nov 2024 20:15:14 +0100 Subject: [PATCH] Add interface to final readonly chain for testability --- src/Chain.php | 2 +- src/ChainInterface.php | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 src/ChainInterface.php diff --git a/src/Chain.php b/src/Chain.php index 0705c8ad..4c27c036 100644 --- a/src/Chain.php +++ b/src/Chain.php @@ -14,7 +14,7 @@ use PhpLlm\LlmChain\Message\MessageBag; use PhpLlm\LlmChain\Response\ResponseInterface; -final readonly class Chain +final readonly class Chain implements ChainInterface { /** * @var InputProcessor[] diff --git a/src/ChainInterface.php b/src/ChainInterface.php new file mode 100644 index 00000000..c8815e1d --- /dev/null +++ b/src/ChainInterface.php @@ -0,0 +1,16 @@ + $options + */ + public function call(MessageBag $messages, array $options = []): ResponseInterface; +}