test3.ps1
$env:OPENAI_API_KEY = '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' ipmo .\PSOpenAI.psd1 -Force Connect-RealtimeSession -Model gpt-4o-mini-realtime-preview Set-RealtimeSessionConfiguration ` -Modalities 'text' , 'audio' ` -Instructions '日本語で応答してください' ` -Temperature 0.6 -EnableInputAudioTranscription $true -EnableTurnDetection $true $job = Register-EngineEvent -SourceIdentifier 'PSOpenAI.Realtime.ReceiveMessage' -Action { $o = $Event.SourceArgs[0] $o | Format-Table -Property type, delta, transcript | Out-Default } $job2 = Register-EngineEvent -SourceIdentifier 'PSOpenAI.Realtime.SendMessage' -Action { $o = $Event.SourceArgs[0] | ConvertFrom-Json -Depth 10 $o | Format-Table -Property type, delta, transcript | Out-Default } Start-RealtimeSessionAudioOutput Start-RealtimeSessionAudioInput Add-RealtimeSessionItem -Role 'user' -Message 'こんにちは' -TriggerResponse |