FakeTranscriptionGateway
class FakeTranscriptionGateway implements TranscriptionGateway
Properties
| protected int | $currentResponseIndex | ||
| protected bool | $preventStrayGenerations |
Methods
generateTranscription(TranscriptionProvider $provider, string $model, TranscribableAudio $audio, string|null $language = null, bool $diarize = false, int $timeout = 30, array $providerOptions = [])
Generate text from the given audio.
nextResponse(TranscriptionProvider $provider, string $model, TranscriptionPrompt $prompt)
Get the next response instance.
marshalResponse(mixed $response, TranscriptionProvider $provider, string $model, TranscriptionPrompt $prompt)
Marshal the given response into a full response instance.
preventStrayTranscriptions(bool $prevent = true)
Indicate that an exception should be thrown if any transcription generation is not faked.
Details
at line 29
__construct(Closure|array $responses = [])
Create a transcription gateway with fake responses.
at line 39
TranscriptionResponse
generateTranscription(TranscriptionProvider $provider, string $model, TranscribableAudio $audio, string|null $language = null, bool $diarize = false, int $timeout = 30, array $providerOptions = [])
Generate text from the given audio.
at line 56
protected TranscriptionResponse
nextResponse(TranscriptionProvider $provider, string $model, TranscriptionPrompt $prompt)
Get the next response instance.
at line 76
protected TranscriptionResponse
marshalResponse(mixed $response, TranscriptionProvider $provider, string $model, TranscriptionPrompt $prompt)
Marshal the given response into a full response instance.
at line 114
FakeTranscriptionGateway
preventStrayTranscriptions(bool $prevent = true)
Indicate that an exception should be thrown if any transcription generation is not faked.
When the shared manager holds this fake gateway, the setting affects every request in the worker.