Skip to content

Commit

Permalink
Merge pull request #379 from TEN-framework/feat/azure-openai
Browse files Browse the repository at this point in the history
feat: support azure openai graph
  • Loading branch information
TomasBack2Future authored Nov 5, 2024
2 parents 9e523d6 + bc34169 commit 5009793
Show file tree
Hide file tree
Showing 2 changed files with 123 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
121 changes: 120 additions & 1 deletion agents/property.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 5009793

Please sign in to comment.