From 041456aa6208a5eb0b01d0062b67341fb118b7a3 Mon Sep 17 00:00:00 2001 From: sunshinexcode <24xinhui@163.com> Date: Wed, 4 Dec 2024 18:20:57 +0800 Subject: [PATCH] fix(): use agents/examples/demo for building agents --- Dockerfile | 2 +- Taskfile.yml | 4 +- agents/examples/demo/property.json | 195 +++++++++++++++++++++++++++++ 3 files changed, 198 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7383768c..0fe1b899 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ WORKDIR /app COPY . . COPY agents/${SESSION_CONTROL_CONF} agents/session_control.conf -RUN task clean && task use && \ +RUN task clean && task use AGENT=agents/examples/demo && \ cd agents && ./scripts/package.sh FROM ubuntu:22.04 diff --git a/Taskfile.yml b/Taskfile.yml index e401461d..a83a47c4 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -14,7 +14,7 @@ tasks: - task: build-server use: - desc: use agent, default 'agents/examples/demo' + desc: use agent, default 'agents/examples/default' vars: AGENT: '{{.AGENT| default "agents/examples/default"}}' cmds: @@ -64,4 +64,4 @@ tasks: dir: ./server internal: true cmds: - - rm -rf bin \ No newline at end of file + - rm -rf bin diff --git a/agents/examples/demo/property.json b/agents/examples/demo/property.json index 98c4f950..60669034 100644 --- a/agents/examples/demo/property.json +++ b/agents/examples/demo/property.json @@ -1278,6 +1278,201 @@ ] } ] + }, + { + "name": "va_coze_azure", + "auto_start": false, + "nodes": [ + { + "type": "extension", + "extension_group": "default", + "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, + "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": "glue", + "addon": "coze_python_async", + "name": "coze_python_async", + "property": { + "token": "", + "bot_id": "", + "base_url": "https://api.coze.cn", + "prompt": "", + "greeting": "TEN Agent connected. How can I help you today?" + } + }, + { + "type": "extension", + "extension_group": "tts", + "addon": "azure_tts", + "name": "azure_tts", + "property": { + "azure_subscription_key": "${env:AZURE_TTS_KEY}", + "azure_subscription_region": "${env:AZURE_TTS_REGION}", + "azure_synthesis_voice_name": "en-US-AndrewMultilingualNeural" + } + }, + { + "type": "extension", + "extension_group": "transcriber", + "addon": "message_collector", + "name": "message_collector" + } + ], + "connections": [ + { + "extension_group": "default", + "extension": "agora_rtc", + "data": [ + { + "name": "text_data", + "dest": [ + { + "extension_group": "default", + "extension": "interrupt_detector" + }, + { + "extension_group": "glue", + "extension": "coze_python_async" + }, + { + "extension_group": "transcriber", + "extension": "message_collector" + } + ] + } + ], + "cmd": [ + { + "name": "on_user_joined", + "dest": [ + { + "extension_group": "glue", + "extension": "coze_python_async" + } + ] + }, + { + "name": "on_user_left", + "dest": [ + { + "extension_group": "glue", + "extension": "coze_python_async" + } + ] + } + ] + }, + { + "extension_group": "glue", + "extension": "coze_python_async", + "data": [ + { + "name": "text_data", + "dest": [ + { + "extension_group": "tts", + "extension": "azure_tts" + }, + { + "extension_group": "transcriber", + "extension": "message_collector" + } + ] + } + ], + "cmd": [ + { + "name": "flush", + "dest": [ + { + "extension_group": "tts", + "extension": "azure_tts" + } + ] + } + ] + }, + { + "extension_group": "tts", + "extension": "azure_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": "glue", + "extension": "coze_python_async" + } + ] + } + ] + } + ] } ] }