mirror of
https://github.com/Geckon01/JsonFicatorPHP.git
synced 2026-10-11 14:05:14 +00:00
32 lines
679 B
PHP
32 lines
679 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace JsonFicator\Tests\Fixtures;
|
|
|
|
use JsonFicator\JsonFicatorOptions;
|
|
use JsonFicator\Provider\LLMProviderInterface;
|
|
use JsonFicator\Schema\JsonFicatorSchema;
|
|
|
|
/**
|
|
* A fake LLM provider for unit tests that returns a pre-configured array.
|
|
*/
|
|
final class FakeProvider implements LLMProviderInterface
|
|
{
|
|
/**
|
|
* @param array<string, mixed> $response
|
|
*/
|
|
public function __construct(
|
|
private readonly array $response,
|
|
) {
|
|
}
|
|
|
|
public function generate(
|
|
string $input,
|
|
JsonFicatorSchema $schema,
|
|
?JsonFicatorOptions $options = null,
|
|
): array {
|
|
return $this->response;
|
|
}
|
|
}
|