Skip to content

Commit

Permalink
tests: Extend test to ensure ToolCallMessages are not part of the Mes…
Browse files Browse the repository at this point in the history
…sageBag (#165)
  • Loading branch information
OskarStark authored Dec 21, 2024
1 parent 204fed6 commit cb2c967
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/Model/Message/MessageBagTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use PhpLlm\LlmChain\Model\Message\MessageBag;
use PhpLlm\LlmChain\Model\Message\SystemMessage;
use PhpLlm\LlmChain\Model\Message\UserMessage;
use PhpLlm\LlmChain\Model\Response\ToolCall;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\Test;
Expand All @@ -34,6 +35,7 @@ public function getSystemMessage(): void
Message::forSystem('My amazing system prompt.'),
Message::ofAssistant('It is time to sleep.'),
Message::ofUser('Hello, world!'),
Message::ofToolCall(new ToolCall('tool', 'tool_name', ['param' => 'value']), 'Yes, go sleeping.'),
);

$systemMessage = $messageBag->getSystemMessage();
Expand All @@ -47,6 +49,7 @@ public function getSystemMessageWithoutSystemMessage(): void
$messageBag = new MessageBag(
Message::ofAssistant('It is time to sleep.'),
Message::ofUser('Hello, world!'),
Message::ofToolCall(new ToolCall('tool', 'tool_name', ['param' => 'value']), 'Yes, go sleeping.'),
);

self::assertNull($messageBag->getSystemMessage());
Expand Down

0 comments on commit cb2c967

Please sign in to comment.