-
-
Notifications
You must be signed in to change notification settings - Fork 243
Open
Description
I trying the tests in documentation, but assertions does not works.
use Prism\Prism\Enums\FinishReason;
use Prism\Prism\Facades\Prism;
use Prism\Prism\Testing\TextResponseFake;
use Prism\Prism\ValueObjects\Usage;
it('stores a custom prompt and saves the output text and credits used', function () {
$fakeResponse = TextResponseFake::make()
->withText('This is my mobile device and I adore it.')
->withUsage(new Usage(10, 20));
$fake = Prism::fake([$fakeResponse]);
$text = Prism::text()
->using('anthropic', 'claude-3-sonnet')
->withPrompt('What is the meaning of life?')
->asStream();
$fake->assertCallCount(1);
$fake->assertRequest(function ($requests) {
dd($requests);
});
});Tests\Feature\V1\CustomPromptTest > it stores a custom prompt and saves the output text and credits used
Expected 1 calls, got 0
Failed asserting that 0 is identical to 1.
dd($requests); Return null
Metadata
Metadata
Assignees
Labels
No labels