FakeAudioGateway
class FakeAudioGateway implements AudioGateway
Properties
| protected int | $currentResponseIndex | ||
| protected bool | $preventStrayGenerations |
Methods
generateAudio(AudioProvider $provider, string $model, string $text, string $voice, string|null $instructions = null, int $timeout = 30, array $providerOptions = [])
Generate audio from the given text.
nextResponse(AudioProvider $provider, string $model, AudioPrompt $prompt)
Get the next response instance.
marshalResponse(mixed $response, AudioProvider $provider, string $model, AudioPrompt $prompt)
Marshal the given response into a full response instance.
preventStrayAudio(bool $prevent = true)
Indicate that an exception should be thrown if any audio generation is not faked.
Details
at line 26
__construct(Closure|array $responses = [])
Create an audio gateway with fake responses.
at line 36
AudioResponse
generateAudio(AudioProvider $provider, string $model, string $text, string $voice, string|null $instructions = null, int $timeout = 30, array $providerOptions = [])
Generate audio from the given text.
at line 53
protected AudioResponse
nextResponse(AudioProvider $provider, string $model, AudioPrompt $prompt)
Get the next response instance.
at line 73
protected AudioResponse
marshalResponse(mixed $response, AudioProvider $provider, string $model, AudioPrompt $prompt)
Marshal the given response into a full response instance.
at line 104
FakeAudioGateway
preventStrayAudio(bool $prevent = true)
Indicate that an exception should be thrown if any audio generation is not faked.
When the shared manager holds this fake gateway, the setting affects every request in the worker.