diff --git a/.env.example b/.env.example index 5c9037e1..cea81be1 100644 --- a/.env.example +++ b/.env.example @@ -99,6 +99,9 @@ OPENAI_MODEL=gpt-4o-mini # OpenAI API key for realtime API OPENAI_REALTIME_API_KEY= +# Azure OPENAI API key & Base URI for realtime API +AZURE_OPENAI_REALTIME_API_KEY= +AZURE_OPENAI_REALTIME_BASE_URI= # OpenAI proxy URL OPENAI_PROXY_URL= diff --git a/agents/property.json b/agents/property.json index b90ade72..769ddde9 100644 --- a/agents/property.json +++ b/agents/property.json @@ -2520,7 +2520,126 @@ ] } ] - }, + }, + { + "name": "va_simple_azure_openai_v2v", + "auto_start": false, + "nodes": [ + { + "type": "extension", + "extension_group": "rtc", + "addon": "agora_rtc", + "name": "agora_rtc", + "property": { + "app_id": "${env:AGORA_APP_ID}", + "token": "", + "channel": "ten_agent_test", + "stream_id": 1234, + "remote_stream_id": 123, + "subscribe_audio": true, + "publish_audio": true, + "publish_data": true, + "subscribe_audio_sample_rate": 24000 + } + }, + { + "type": "extension", + "extension_group": "llm", + "addon": "openai_v2v_python", + "name": "openai_v2v_python", + "property": { + "api_key": "${env:AZURE_OPENAI_REALTIME_API_KEY}", + "temperature": 0.9, + "model": "gpt-4o-realtime-preview", + "max_tokens": 2048, + "voice": "alloy", + "language": "en-US", + "server_vad": true, + "dump": true, + "history": 10, + "vendor": "azure", + "base_uri": "${env:AZURE_OPENAI_REALTIME_BASE_URI}", + "path": "/openai/realtime?api-version=2024-10-01-preview&deployment=gpt-4o-realtime-preview", + "system_message": "" + } + }, + { + "type": "extension", + "extension_group": "transcriber", + "addon": "message_collector", + "name": "message_collector" + } + ], + "connections": [ + { + "extension_group": "rtc", + "extension": "agora_rtc", + "audio_frame": [ + { + "name": "pcm_frame", + "dest": [ + { + "extension_group": "llm", + "extension": "openai_v2v_python" + } + ] + } + ] + }, + { + "extension_group": "llm", + "extension": "openai_v2v_python", + "audio_frame": [ + { + "name": "pcm_frame", + "dest": [ + { + "extension_group": "rtc", + "extension": "agora_rtc" + } + ] + } + ], + "data": [ + { + "name": "text_data", + "dest": [ + { + "extension_group": "transcriber", + "extension": "message_collector" + } + ] + } + ], + "cmd": [ + { + "name": "flush", + "dest": [ + { + "extension_group": "rtc", + "extension": "agora_rtc" + } + ] + } + ] + }, + { + "extension_group": "transcriber", + "extension": "message_collector", + "data": [ + { + "name": "data", + "dest": [ + { + "extension_group": "rtc", + "extension": "agora_rtc" + } + ] + } + ] + } + ] + }, { "name": "va_openai_v2v", "auto_start": true,