|
| 1 | +<?php |
| 2 | + |
| 3 | +/** |
| 4 | + * @return array<string, mixed> |
| 5 | + */ |
| 6 | +function sessionResponseResource(): array |
| 7 | +{ |
| 8 | + return [ |
| 9 | + 'client_secret' => [ |
| 10 | + 'expires_at' => 1735680000, |
| 11 | + 'value' => 'ek_secret_123', |
| 12 | + ], |
| 13 | + 'input_audio_format' => 'pcm16', |
| 14 | + 'input_audio_transcription' => null, |
| 15 | + 'instructions' => 'Your knowledge cutoff is 2023-10. You are a helpful assistant.', |
| 16 | + 'max_response_output_tokens' => 'inf', |
| 17 | + 'modalities' => [ |
| 18 | + 'audio', |
| 19 | + 'text', |
| 20 | + ], |
| 21 | + 'output_audio_format' => 'pcm16', |
| 22 | + 'temperature' => 0.7, |
| 23 | + 'tool_choice' => 'auto', |
| 24 | + 'tools' => [], |
| 25 | + 'turn_detection' => [ |
| 26 | + 'prefix_padding_ms' => 100, |
| 27 | + 'silence_duration_ms' => 500, |
| 28 | + 'threshold' => 0.5, |
| 29 | + 'type' => 'server_vad', |
| 30 | + ], |
| 31 | + 'voice' => 'alloy', |
| 32 | + ]; |
| 33 | +} |
| 34 | + |
| 35 | +/** |
| 36 | + * @return array<string, mixed> |
| 37 | + */ |
| 38 | +function transcriptionSessionResponseResource(): array |
| 39 | +{ |
| 40 | + return [ |
| 41 | + 'client_secret' => [ |
| 42 | + 'expires_at' => 1735680000, |
| 43 | + 'value' => 'ek_secret_123', |
| 44 | + ], |
| 45 | + 'input_audio_format' => 'pcm16', |
| 46 | + 'input_audio_transcription' => null, |
| 47 | + 'modalities' => null, |
| 48 | + 'turn_detection' => [ |
| 49 | + 'prefix_padding_ms' => 300, |
| 50 | + 'silence_duration_ms' => 200, |
| 51 | + 'threshold' => 0.5, |
| 52 | + 'type' => 'server_vad', |
| 53 | + ], |
| 54 | + ]; |
| 55 | +} |
0 commit comments