Skip to content

Commit e27a6e1

Browse files
authored
docs: fix messages example (#222)
1 parent 374bf2a commit e27a6e1

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

README.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -84,16 +84,15 @@ have different content types, like `Text`, `Image` or `Audio`.
8484

8585
```php
8686
use PhpLlm\LlmChain\Chain;
87+
use PhpLlm\LlmChain\Model\Message\Message;
8788
use PhpLlm\LlmChain\Model\Message\MessageBag;
88-
use PhpLlm\LlmChain\Model\Message\SystemMessage;
89-
use PhpLlm\LlmChain\Model\Message\UserMessage;
9089

9190
// Platform & LLM instantiation
9291

9392
$chain = new Chain($platform, $llm);
9493
$messages = new MessageBag(
95-
new SystemMessage('You are a helpful chatbot answering questions about LLM Chain.'),
96-
new UserMessage('Hello, how are you?'),
94+
Message::forSystem('You are a helpful chatbot answering questions about LLM Chain.'),
95+
Message::ofUser('Hello, how are you?'),
9796
);
9897
$response = $chain->call($messages);
9998

0 commit comments

Comments
 (0)