Skip to content

Commit

Permalink
add another test
Browse files Browse the repository at this point in the history
  • Loading branch information
alnutile committed Apr 27, 2023
1 parent 17500fa commit d772495
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions tests/PromptTemplateTest.php
Expand Up @@ -24,3 +24,32 @@
assertEquals('I want you to act as a naming consultant for new companies.
What is a good name for a company that makes colorful socks?', $dto->format());
});

it('can replace multiple items', function () {
$template = <<<'EOD'
I want you to act as a naming consultant for new companies.
What is a good name for a company that makes {product1}, {product2} and {product3}?
EOD;

$input_variables = [
new PromptToken(
'product1',
'colorful socks'
),
new PromptToken(
'product2',
'colorful hats'
),
new PromptToken(
'product3',
'colorful headbands'
)
];
$dto = new PromptTemplate(
$input_variables,
$template
);

assertEquals('I want you to act as a naming consultant for new companies.
What is a good name for a company that makes colorful socks, colorful hats and colorful headbands?', $dto->format());
});

0 comments on commit d772495

Please sign in to comment.