Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat minimax tts #400

Merged
merged 3 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
182 changes: 182 additions & 0 deletions agents/property.json
Original file line number Diff line number Diff line change
Expand Up @@ -4575,6 +4575,188 @@
]
}
]
},
{
"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",
"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": 30,
"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"
}
]
}
]
}
]
}
]
}
Expand Down
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=
59 changes: 59 additions & 0 deletions agents/ten_packages/extension/minimax_tts/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"type": "extension",
"name": "minimax_tts",
"version": "0.4.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"
},
"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