Skip to content

Commit

Permalink
Merge pull request #400 from TEN-framework/feat_minimax_tts
Browse files Browse the repository at this point in the history
Feat minimax tts
  • Loading branch information
sunshinexcode authored Nov 14, 2024
2 parents df965d2 + 3df22f5 commit 9b47b06
Show file tree
Hide file tree
Showing 16 changed files with 1,269 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ GEMINI_API_KEY=
# AWS_REGION_NAME=<aws-region-name>
LITELLM_MODEL=gpt-4o-mini

# Extension: minimax_tts
# Minimax TTS key
MINIMAX_TTS_API_KEY=
MINIMAX_TTS_GROUP_ID=

# Extension: openai_chatgpt
# OpenAI API key
OPENAI_API_BASE=https://api.openai.com/v1
Expand Down
185 changes: 184 additions & 1 deletion agents/property.json
Original file line number Diff line number Diff line change
Expand Up @@ -4575,7 +4575,190 @@
]
}
]
},
{
"name": "va_openai_minimax",
"auto_start": false,
"nodes": [
{
"type": "extension",
"extension_group": "default",
"addon": "agora_rtc",
"name": "agora_rtc",
"property": {
"app_id": "${env:AGORA_APP_ID}",
"token": "<agora_token>",
"channel": "ten_agents_test",
"stream_id": 1234,
"remote_stream_id": 123,
"subscribe_audio": true,
"publish_audio": true,
"publish_data": true,
"enable_agora_asr": true,
"agora_asr_vendor_name": "microsoft",
"agora_asr_language": "en-US",
"agora_asr_vendor_key": "${env:AZURE_STT_KEY}",
"agora_asr_vendor_region": "${env:AZURE_STT_REGION}",
"agora_asr_session_control_file_path": "session_control.conf"
}
},
{
"type": "extension",
"extension_group": "default",
"addon": "interrupt_detector",
"name": "interrupt_detector"
},
{
"type": "extension",
"extension_group": "chatgpt",
"addon": "openai_chatgpt",
"name": "openai_chatgpt",
"property": {
"base_url": "${env:OPENAI_API_BASE}",
"api_key": "${env:OPENAI_API_KEY}",
"frequency_penalty": 0.9,
"model": "${env:OPENAI_MODEL}",
"max_tokens": 512,
"prompt": "",
"proxy_url": "${env:OPENAI_PROXY_URL}",
"greeting": "TEN Agent connected. How can I help you today?",
"max_memory_length": 10
}
},
{
"type": "extension",
"extension_group": "transcriber",
"addon": "message_collector",
"name": "message_collector"
},
{
"type": "extension",
"extension_group": "tts",
"addon": "minimax_tts_python",
"name": "minimax_tts",
"property": {
"api_key": "${env:MINIMAX_TTS_API_KEY}",
"group_id": "${env:MINIMAX_TTS_GROUP_ID}",
"model": "speech-01-turbo",
"request_timeout_seconds": 10,
"sample_rate": 32000,
"url": "https://api.minimax.chat/v1/t2a_v2",
"voice_id": "male-qn-qingse"
}
}
],
"connections": [
{
"extension_group": "default",
"extension": "agora_rtc",
"data": [
{
"name": "text_data",
"dest": [
{
"extension_group": "default",
"extension": "interrupt_detector"
},
{
"extension_group": "chatgpt",
"extension": "openai_chatgpt"
},
{
"extension_group": "transcriber",
"extension": "message_collector"
}
]
}
]
},
{
"extension_group": "chatgpt",
"extension": "openai_chatgpt",
"data": [
{
"name": "text_data",
"dest": [
{
"extension_group": "tts",
"extension": "minimax_tts"
},
{
"extension_group": "transcriber",
"extension": "message_collector"
}
]
}
],
"cmd": [
{
"name": "flush",
"dest": [
{
"extension_group": "tts",
"extension": "minimax_tts"
}
]
}
]
},
{
"extension_group": "tts",
"extension": "minimax_tts",
"audio_frame": [
{
"name": "pcm_frame",
"dest": [
{
"extension_group": "default",
"extension": "agora_rtc"
}
]
}
],
"cmd": [
{
"name": "flush",
"dest": [
{
"extension_group": "default",
"extension": "agora_rtc"
}
]
}
]
},
{
"extension_group": "transcriber",
"extension": "message_collector",
"data": [
{
"name": "data",
"dest": [
{
"extension_group": "default",
"extension": "agora_rtc"
}
]
}
]
},
{
"extension_group": "default",
"extension": "interrupt_detector",
"cmd": [
{
"name": "flush",
"dest": [
{
"extension_group": "chatgpt",
"extension": "openai_chatgpt"
}
]
}
]
}
]
}
]
}
}
}
12 changes: 12 additions & 0 deletions agents/ten_packages/extension/minimax_tts/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module minimax_tts

go 1.20

replace ten_framework => ../../system/ten_runtime_go/interface

require (
github.com/go-resty/resty/v2 v2.16.0
ten_framework v0.0.0-00010101000000-000000000000
)

require golang.org/x/net v0.27.0 // indirect
5 changes: 5 additions & 0 deletions agents/ten_packages/extension/minimax_tts/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
github.com/go-resty/resty/v2 v2.16.0 h1:qpKalHWI2bpp9BIKlyT8TYWEJXOk1NuKbfiT3RRnzWc=
github.com/go-resty/resty/v2 v2.16.0/go.mod h1:0fHAoK7JoBy/Ch36N8VFeMsK7xQOHhvWaC3iOktwmIU=
golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U=
62 changes: 62 additions & 0 deletions agents/ten_packages/extension/minimax_tts/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"type": "extension",
"name": "minimax_tts",
"version": "0.1.0",
"dependencies": [
{
"type": "system",
"name": "ten_runtime_go",
"version": "0.3"
}
],
"api": {
"property": {
"api_key": {
"type": "string"
},
"group_id": {
"type": "string"
},
"model": {
"type": "string"
},
"request_timeout_seconds": {
"type": "int64"
},
"sample_rate": {
"type": "int64"
},
"url": {
"type": "string"
},
"voice_id": {
"type": "string"
}
},
"data_in": [
{
"name": "text_data",
"property": {
"text": {
"type": "string"
}
}
}
],
"cmd_in": [
{
"name": "flush"
}
],
"cmd_out": [
{
"name": "flush"
}
],
"audio_frame_out": [
{
"name": "pcm_frame"
}
]
}
}
Loading

0 comments on commit 9b47b06

Please sign in to comment.