Skip to content

Allow specifying parameters in the RealtimeApi constructor#22

Merged
thekid merged 1 commit intomainfrom
feature/realtime-parameters
Jan 24, 2026
Merged

Allow specifying parameters in the RealtimeApi constructor#22
thekid merged 1 commit intomainfrom
feature/realtime-parameters

Conversation

@thekid
Copy link
Copy Markdown
Member

@thekid thekid commented Jan 17, 2026

Parameters can now (also) be passed as a map instead of having to supply them all inside the URI string, which becomes hard to read when lengthy.

use com\openai\realtime\RealtimeApi;
use util\cmd\Console;

$api= new RealtimeApi('wss://example.openai.azure.com/openai/realtime', [
  'api-version' => '2024-10-01-preview',
  'deployment'  => 'gpt-4o-realtime-preview',
]);
$session= $api->connect(['api-key' => getenv('AZUREAI_API_KEY')]);

@thekid thekid added documentation Improvements or additions to documentation enhancement New feature or request labels Jan 17, 2026
@thekid thekid merged commit 016eaa1 into main Jan 24, 2026
16 checks passed
@thekid thekid deleted the feature/realtime-parameters branch January 24, 2026 08:25
@thekid
Copy link
Copy Markdown
Member Author

thekid commented Jan 24, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant