Skip to content

Commit 76750ac

Browse files
committed
Disable GPT audio example and capability
Since we're migrating to the Responses API (from chat completions), and that API doesn't support audio yet. It should be added back when it does ("coming soon", apparently) See: https://platform.openai.com/docs/guides/migrate-to-responses
1 parent 04ab137 commit 76750ac

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

examples/openai/audio-input.php

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,15 @@
1616

1717
require_once dirname(__DIR__).'/bootstrap.php';
1818

19-
$platform = PlatformFactory::create(env('OPENAI_API_KEY'), http_client());
20-
21-
$messages = new MessageBag(
22-
Message::ofUser(
23-
'What is this recording about?',
24-
Audio::fromFile(dirname(__DIR__, 2).'/fixtures/audio.mp3'),
25-
),
26-
);
27-
$result = $platform->invoke('gpt-4o-audio-preview', $messages);
28-
29-
echo $result->asText().\PHP_EOL;
19+
throw new RuntimeException('This example is temporarily unavailable due to migration to Responses API (which does not support audio yet)');
20+
// $platform = PlatformFactory::create(env('OPENAI_API_KEY'), http_client());
21+
//
22+
// $messages = new MessageBag(
23+
// Message::ofUser(
24+
// 'What is this recording about?',
25+
// Audio::fromFile(dirname(__DIR__, 2).'/fixtures/audio.mp3'),
26+
// ),
27+
// );
28+
// $result = $platform->invoke('gpt-4o-audio-preview', $messages);
29+
//
30+
// echo $result->asText().\PHP_EOL;

src/platform/src/Bridge/OpenAi/ModelCatalog.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ public function __construct(array $additionalModels = [])
9191
Capability::OUTPUT_TEXT,
9292
Capability::OUTPUT_STREAMING,
9393
Capability::TOOL_CALLING,
94-
Capability::INPUT_AUDIO,
9594
Capability::INPUT_IMAGE,
9695
Capability::OUTPUT_STRUCTURED,
9796
],
@@ -114,6 +113,10 @@ public function __construct(array $additionalModels = [])
114113
Capability::OUTPUT_STREAMING,
115114
Capability::TOOL_CALLING,
116115
Capability::INPUT_IMAGE,
116+
// Audio is unsupported temporarily due to migration to Responses API;
117+
// Capability will be reintroduced when Responses API supports audio ("coming soon")
118+
// See: https://platform.openai.com/docs/guides/migrate-to-responses#responses-benefits
119+
// Capability::INPUT_AUDIO,
117120
],
118121
],
119122
'o3-mini' => [

0 commit comments

Comments
 (0)