-
I'm writing a test for my app which uses the Does anyone have a simple example they can share of how they're doing it? I tried doing something like this, but obviously it's not working since it doesn't conform to the right interface: OpenAI::fake([
new AudioTestResource(
new ClientFake(
['audio' => 'some text to pretend is an m3'],
['model' => 'gpt-4o-mini-tts', 'voice' => $voice, 'text' => $text]
)
)
]); For context, this is the method that I'm trying to test: public function generate(string $base_text, string $voice): string
{
return OpenAI::audio()->speech([
'model' => 'gpt-4o-mini-tts',
'response_format' => 'mp3',
'voice' => $voice,
'instructions' => $this->systemPrompt(),
'input' => $base_text,
]);
} I've tried searching Google for |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Ok, I was making it way too difficult on myself. All I did was this, and it worked fine: OpenAI::fake([
'audio.speech' => 'faking some binary data'
]); |
Beta Was this translation helpful? Give feedback.
Ok, I was making it way too difficult on myself.
All I did was this, and it worked fine: