From d279616bee7b53aa17d2be3978b82f71e0600dbf Mon Sep 17 00:00:00 2001 From: Jay Zhang Date: Sun, 1 Dec 2024 07:16:15 +0000 Subject: [PATCH 1/5] fix: remove BUILD.gn for python extensions --- .../extension/bingsearch_tool_python/BUILD.gn | 21 ------------------ .../extension/cartesia_tts/BUILD.gn | 19 ---------------- .../extension/cosy_tts_python/BUILD.gn | 19 ---------------- .../extension/elevenlabs_tts_python/BUILD.gn | 19 ---------------- .../ten_packages/extension/fashionai/BUILD.gn | 22 ------------------- .../extension/glue_python_async/BUILD.gn | 20 ----------------- .../extension/message_collector/BUILD.gn | 22 ------------------- .../extension/message_collector_rtm/BUILD.gn | 22 ------------------- .../extension/minimax_tts_python/BUILD.gn | 19 ---------------- .../extension/openai_chatgpt_python/BUILD.gn | 21 ------------------ .../extension/openai_v2v_python/BUILD.gn | 21 ------------------ .../ten_packages/extension/polly_tts/BUILD.gn | 19 ---------------- .../extension/tsdb_firestore/BUILD.gn | 21 ------------------ .../vision_analyze_tool_python/BUILD.gn | 20 ----------------- .../extension/vision_tool_python/BUILD.gn | 20 ----------------- .../extension/weatherapi_tool_python/BUILD.gn | 21 ------------------ 16 files changed, 326 deletions(-) delete mode 100644 agents/ten_packages/extension/bingsearch_tool_python/BUILD.gn delete mode 100644 agents/ten_packages/extension/cartesia_tts/BUILD.gn delete mode 100644 agents/ten_packages/extension/cosy_tts_python/BUILD.gn delete mode 100644 agents/ten_packages/extension/elevenlabs_tts_python/BUILD.gn delete mode 100644 agents/ten_packages/extension/fashionai/BUILD.gn delete mode 100644 agents/ten_packages/extension/glue_python_async/BUILD.gn delete mode 100644 agents/ten_packages/extension/message_collector/BUILD.gn delete mode 100644 agents/ten_packages/extension/message_collector_rtm/BUILD.gn delete mode 100644 agents/ten_packages/extension/minimax_tts_python/BUILD.gn delete mode 100644 agents/ten_packages/extension/openai_chatgpt_python/BUILD.gn delete mode 100644 agents/ten_packages/extension/openai_v2v_python/BUILD.gn delete mode 100644 agents/ten_packages/extension/polly_tts/BUILD.gn delete mode 100644 agents/ten_packages/extension/tsdb_firestore/BUILD.gn delete mode 100644 agents/ten_packages/extension/vision_analyze_tool_python/BUILD.gn delete mode 100644 agents/ten_packages/extension/vision_tool_python/BUILD.gn delete mode 100644 agents/ten_packages/extension/weatherapi_tool_python/BUILD.gn diff --git a/agents/ten_packages/extension/bingsearch_tool_python/BUILD.gn b/agents/ten_packages/extension/bingsearch_tool_python/BUILD.gn deleted file mode 100644 index 6fe94dbb..00000000 --- a/agents/ten_packages/extension/bingsearch_tool_python/BUILD.gn +++ /dev/null @@ -1,21 +0,0 @@ -# -# -# Agora Real Time Engagement -# Created by Wei Hu in 2022-11. -# Copyright (c) 2024 Agora IO. All rights reserved. -# -# -import("//build/feature/ten_package.gni") - -ten_package("bingsearch_tool_python") { - package_kind = "extension" - - resources = [ - "__init__.py", - "addon.py", - "extension.py", - "log.py", - "manifest.json", - "property.json", - ] -} diff --git a/agents/ten_packages/extension/cartesia_tts/BUILD.gn b/agents/ten_packages/extension/cartesia_tts/BUILD.gn deleted file mode 100644 index 4e409853..00000000 --- a/agents/ten_packages/extension/cartesia_tts/BUILD.gn +++ /dev/null @@ -1,19 +0,0 @@ -# -# This file is part of TEN Framework, an open source project. -# Licensed under the Apache License, Version 2.0. -# See the LICENSE file for more information. -# -import("//build/feature/ten_package.gni") - -ten_package("cartesia_tts") { - package_kind = "extension" - - resources = [ - "__init__.py", - "addon.py", - "extension.py", - "manifest.json", - "property.json", - "tests", - ] -} diff --git a/agents/ten_packages/extension/cosy_tts_python/BUILD.gn b/agents/ten_packages/extension/cosy_tts_python/BUILD.gn deleted file mode 100644 index 40bb6dd4..00000000 --- a/agents/ten_packages/extension/cosy_tts_python/BUILD.gn +++ /dev/null @@ -1,19 +0,0 @@ -# -# This file is part of TEN Framework, an open source project. -# Licensed under the Apache License, Version 2.0. -# See the LICENSE file for more information. -# -import("//build/feature/ten_package.gni") - -ten_package("cosy_tts_python") { - package_kind = "extension" - - resources = [ - "__init__.py", - "addon.py", - "extension.py", - "manifest.json", - "property.json", - "tests", - ] -} diff --git a/agents/ten_packages/extension/elevenlabs_tts_python/BUILD.gn b/agents/ten_packages/extension/elevenlabs_tts_python/BUILD.gn deleted file mode 100644 index 008eed3d..00000000 --- a/agents/ten_packages/extension/elevenlabs_tts_python/BUILD.gn +++ /dev/null @@ -1,19 +0,0 @@ -# -# This file is part of TEN Framework, an open source project. -# Licensed under the Apache License, Version 2.0. -# See the LICENSE file for more information. -# -import("//build/feature/ten_package.gni") - -ten_package("elevenlabs_tts_python") { - package_kind = "extension" - - resources = [ - "__init__.py", - "addon.py", - "extension.py", - "manifest.json", - "property.json", - "tests", - ] -} diff --git a/agents/ten_packages/extension/fashionai/BUILD.gn b/agents/ten_packages/extension/fashionai/BUILD.gn deleted file mode 100644 index 6a6765bb..00000000 --- a/agents/ten_packages/extension/fashionai/BUILD.gn +++ /dev/null @@ -1,22 +0,0 @@ -# -# -# Agora Real Time Engagement -# Created by Wei Hu in 2022-11. -# Copyright (c) 2024 Agora IO. All rights reserved. -# -# -import("//build/feature/ten_package.gni") - -ten_package("fashionai") { - package_kind = "extension" - - resources = [ - "__init__.py", - "manifest.json", - "property.json", - "src/__init__.py", - "src/addon.py", - "src/extension.py", - "src/log.py", - ] -} diff --git a/agents/ten_packages/extension/glue_python_async/BUILD.gn b/agents/ten_packages/extension/glue_python_async/BUILD.gn deleted file mode 100644 index c0ccf4d5..00000000 --- a/agents/ten_packages/extension/glue_python_async/BUILD.gn +++ /dev/null @@ -1,20 +0,0 @@ -# -# This file is part of TEN Framework, an open source project. -# Licensed under the Apache License, Version 2.0. -# See the LICENSE file for more information. -# -import("//build/feature/ten_package.gni") - -ten_package("glue_python_async") { - package_kind = "extension" - - resources = [ - "__init__.py", - "addon.py", - "extension.py", - "log.py", - "manifest.json", - "property.json", - "tests", - ] -} diff --git a/agents/ten_packages/extension/message_collector/BUILD.gn b/agents/ten_packages/extension/message_collector/BUILD.gn deleted file mode 100644 index 555cf959..00000000 --- a/agents/ten_packages/extension/message_collector/BUILD.gn +++ /dev/null @@ -1,22 +0,0 @@ -# -# -# Agora Real Time Engagement -# Created by Wei Hu in 2022-11. -# Copyright (c) 2024 Agora IO. All rights reserved. -# -# -import("//build/feature/ten_package.gni") - -ten_package("message_collector") { - package_kind = "extension" - - resources = [ - "__init__.py", - "manifest.json", - "property.json", - "src/__init__.py", - "src/addon.py", - "src/extension.py", - "src/log.py", - ] -} diff --git a/agents/ten_packages/extension/message_collector_rtm/BUILD.gn b/agents/ten_packages/extension/message_collector_rtm/BUILD.gn deleted file mode 100644 index 7a89eef0..00000000 --- a/agents/ten_packages/extension/message_collector_rtm/BUILD.gn +++ /dev/null @@ -1,22 +0,0 @@ -# -# -# Agora Real Time Engagement -# Created by Wei Hu in 2022-11. -# Copyright (c) 2024 Agora IO. All rights reserved. -# -# -import("//build/feature/ten_package.gni") - -ten_package("message_collector_rtm") { - package_kind = "extension" - - resources = [ - "__init__.py", - "manifest.json", - "property.json", - "src/__init__.py", - "src/addon.py", - "src/extension.py", - "src/log.py", - ] -} diff --git a/agents/ten_packages/extension/minimax_tts_python/BUILD.gn b/agents/ten_packages/extension/minimax_tts_python/BUILD.gn deleted file mode 100644 index 02a50c6e..00000000 --- a/agents/ten_packages/extension/minimax_tts_python/BUILD.gn +++ /dev/null @@ -1,19 +0,0 @@ -# -# This file is part of TEN Framework, an open source project. -# Licensed under the Apache License, Version 2.0. -# See the LICENSE file for more information. -# -import("//build/feature/ten_package.gni") - -ten_package("minimax_tts_python") { - package_kind = "extension" - - resources = [ - "__init__.py", - "addon.py", - "extension.py", - "manifest.json", - "property.json", - "tests", - ] -} diff --git a/agents/ten_packages/extension/openai_chatgpt_python/BUILD.gn b/agents/ten_packages/extension/openai_chatgpt_python/BUILD.gn deleted file mode 100644 index 23f06108..00000000 --- a/agents/ten_packages/extension/openai_chatgpt_python/BUILD.gn +++ /dev/null @@ -1,21 +0,0 @@ -# -# -# Agora Real Time Engagement -# Created by Wei Hu in 2022-11. -# Copyright (c) 2024 Agora IO. All rights reserved. -# -# -import("//build/feature/ten_package.gni") - -ten_package("openai_chatgpt_python") { - package_kind = "extension" - - resources = [ - "__init__.py", - "addon.py", - "extension.py", - "log.py", - "manifest.json", - "property.json", - ] -} diff --git a/agents/ten_packages/extension/openai_v2v_python/BUILD.gn b/agents/ten_packages/extension/openai_v2v_python/BUILD.gn deleted file mode 100644 index 1a40f3c2..00000000 --- a/agents/ten_packages/extension/openai_v2v_python/BUILD.gn +++ /dev/null @@ -1,21 +0,0 @@ -# -# -# Agora Real Time Engagement -# Created by Wei Hu in 2022-11. -# Copyright (c) 2024 Agora IO. All rights reserved. -# -# -import("//build/feature/ten_package.gni") - -ten_package("openai_v2v_python") { - package_kind = "extension" - - resources = [ - "__init__.py", - "addon.py", - "extension.py", - "log.py", - "manifest.json", - "property.json", - ] -} diff --git a/agents/ten_packages/extension/polly_tts/BUILD.gn b/agents/ten_packages/extension/polly_tts/BUILD.gn deleted file mode 100644 index 16a3f9f3..00000000 --- a/agents/ten_packages/extension/polly_tts/BUILD.gn +++ /dev/null @@ -1,19 +0,0 @@ -# -# This file is part of TEN Framework, an open source project. -# Licensed under the Apache License, Version 2.0. -# See the LICENSE file for more information. -# -import("//build/feature/ten_package.gni") - -ten_package("polly_tts") { - package_kind = "extension" - - resources = [ - "__init__.py", - "addon.py", - "extension.py", - "manifest.json", - "property.json", - "tests", - ] -} \ No newline at end of file diff --git a/agents/ten_packages/extension/tsdb_firestore/BUILD.gn b/agents/ten_packages/extension/tsdb_firestore/BUILD.gn deleted file mode 100644 index 66830a25..00000000 --- a/agents/ten_packages/extension/tsdb_firestore/BUILD.gn +++ /dev/null @@ -1,21 +0,0 @@ -# -# -# Agora Real Time Engagement -# Created by Wei Hu in 2022-11. -# Copyright (c) 2024 Agora IO. All rights reserved. -# -# -import("//build/feature/ten_package.gni") - -ten_package("tsdb_firestore") { - package_kind = "extension" - - resources = [ - "__init__.py", - "addon.py", - "extension.py", - "log.py", - "manifest.json", - "property.json", - ] -} diff --git a/agents/ten_packages/extension/vision_analyze_tool_python/BUILD.gn b/agents/ten_packages/extension/vision_analyze_tool_python/BUILD.gn deleted file mode 100644 index dd6d6380..00000000 --- a/agents/ten_packages/extension/vision_analyze_tool_python/BUILD.gn +++ /dev/null @@ -1,20 +0,0 @@ -# -# This file is part of TEN Framework, an open source project. -# Licensed under the Apache License, Version 2.0. -# See the LICENSE file for more information. -# -import("//build/feature/ten_package.gni") - -ten_package("vision_analyze_tool_python") { - package_kind = "extension" - - resources = [ - "__init__.py", - "addon.py", - "extension.py", - "log.py", - "manifest.json", - "property.json", - "tests", - ] -} diff --git a/agents/ten_packages/extension/vision_tool_python/BUILD.gn b/agents/ten_packages/extension/vision_tool_python/BUILD.gn deleted file mode 100644 index 284103e8..00000000 --- a/agents/ten_packages/extension/vision_tool_python/BUILD.gn +++ /dev/null @@ -1,20 +0,0 @@ -# -# This file is part of TEN Framework, an open source project. -# Licensed under the Apache License, Version 2.0. -# See the LICENSE file for more information. -# -import("//build/feature/ten_package.gni") - -ten_package("vision_tool_python") { - package_kind = "extension" - - resources = [ - "__init__.py", - "addon.py", - "extension.py", - "log.py", - "manifest.json", - "property.json", - "tests", - ] -} diff --git a/agents/ten_packages/extension/weatherapi_tool_python/BUILD.gn b/agents/ten_packages/extension/weatherapi_tool_python/BUILD.gn deleted file mode 100644 index 15a31a94..00000000 --- a/agents/ten_packages/extension/weatherapi_tool_python/BUILD.gn +++ /dev/null @@ -1,21 +0,0 @@ -# -# -# Agora Real Time Engagement -# Created by Wei Hu in 2022-11. -# Copyright (c) 2024 Agora IO. All rights reserved. -# -# -import("//build/feature/ten_package.gni") - -ten_package("weatherapi_tool_python") { - package_kind = "extension" - - resources = [ - "__init__.py", - "addon.py", - "extension.py", - "log.py", - "manifest.json", - "property.json", - ] -} From 16dc140faf24e1412f0700b43030b29f3cfd1b15 Mon Sep 17 00:00:00 2001 From: Jay Zhang Date: Sun, 1 Dec 2024 07:20:16 +0000 Subject: [PATCH 2/5] feat: only install requirements if extension exists in manifest --- agents/scripts/install_deps_and_build.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/agents/scripts/install_deps_and_build.sh b/agents/scripts/install_deps_and_build.sh index 0a19b753..b2c2fef3 100755 --- a/agents/scripts/install_deps_and_build.sh +++ b/agents/scripts/install_deps_and_build.sh @@ -60,7 +60,11 @@ install_python_requirements() { if [[ -d "ten_packages/extension" ]]; then for extension in ten_packages/extension/*; do if [[ -f "$extension/requirements.txt" ]]; then - pip install -r $extension/requirements.txt + local extension_name=$(basename $extension) + local exists_in_manifest=$(cat manifest.json | jq --arg ext_name "${extension_name}" 'any(.dependencies[].name == $ext_name ; .)' ) + if [[ "$exists_in_manifest" == "true" ]]; then + pip install -r $extension/requirements.txt + fi fi done fi From 3aeff79123c71359aedc36da3024f44d09516c2e Mon Sep 17 00:00:00 2001 From: Jay Zhang Date: Sun, 1 Dec 2024 07:20:42 +0000 Subject: [PATCH 3/5] fix: remove llama index preload --- agents/scripts/install_deps_and_build.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/agents/scripts/install_deps_and_build.sh b/agents/scripts/install_deps_and_build.sh index b2c2fef3..b9c8cefb 100755 --- a/agents/scripts/install_deps_and_build.sh +++ b/agents/scripts/install_deps_and_build.sh @@ -77,10 +77,6 @@ install_python_requirements() { fi done fi - - # pre-import llama-index as it cloud download additional resources during the first import - echo "pre-import python modules..." - python3.10 -c "import llama_index.core;" } build_go_app() { From 417c5fb1496216199f5b113894c02f619325c97c Mon Sep 17 00:00:00 2001 From: Jay Zhang Date: Sun, 1 Dec 2024 07:26:31 +0000 Subject: [PATCH 4/5] feat: reset in repo python extension versions to 0.1.0 --- .../extension/aliyun_analyticdb_vector_storage/manifest.json | 2 +- .../ten_packages/extension/aliyun_text_embedding/manifest.json | 2 +- agents/ten_packages/extension/bedrock_llm_python/manifest.json | 2 +- agents/ten_packages/extension/cartesia_tts/manifest.json | 2 +- agents/ten_packages/extension/cosy_tts_python/manifest.json | 2 +- .../ten_packages/extension/elevenlabs_tts_python/manifest.json | 2 +- agents/ten_packages/extension/file_chunker/manifest.json | 2 +- agents/ten_packages/extension/fish_audio_tts/manifest.json | 2 +- agents/ten_packages/extension/gemini_llm_python/manifest.json | 2 +- agents/ten_packages/extension/glue_python_async/manifest.json | 2 +- .../extension/interrupt_detector_python/manifest.json | 2 +- .../extension/llama_index_chat_engine/manifest.json | 2 +- agents/ten_packages/extension/minimax_tts_python/manifest.json | 2 +- agents/ten_packages/extension/polly_tts/manifest.json | 2 +- agents/ten_packages/extension/qwen_llm_python/manifest.json | 2 +- .../ten_packages/extension/transcribe_asr_python/manifest.json | 2 +- .../extension/vision_analyze_tool_python/manifest.json | 2 +- agents/ten_packages/extension/vision_tool_python/manifest.json | 2 +- 18 files changed, 18 insertions(+), 18 deletions(-) diff --git a/agents/ten_packages/extension/aliyun_analyticdb_vector_storage/manifest.json b/agents/ten_packages/extension/aliyun_analyticdb_vector_storage/manifest.json index 05cf24ba..c175f7db 100644 --- a/agents/ten_packages/extension/aliyun_analyticdb_vector_storage/manifest.json +++ b/agents/ten_packages/extension/aliyun_analyticdb_vector_storage/manifest.json @@ -1,7 +1,7 @@ { "type": "extension", "name": "aliyun_analyticdb_vector_storage", - "version": "0.4.0", + "version": "0.1.0", "dependencies": [ { "type": "system", diff --git a/agents/ten_packages/extension/aliyun_text_embedding/manifest.json b/agents/ten_packages/extension/aliyun_text_embedding/manifest.json index 86b8de32..c9c059d6 100644 --- a/agents/ten_packages/extension/aliyun_text_embedding/manifest.json +++ b/agents/ten_packages/extension/aliyun_text_embedding/manifest.json @@ -1,7 +1,7 @@ { "type": "extension", "name": "aliyun_text_embedding", - "version": "0.4.0", + "version": "0.1.0", "dependencies": [ { "type": "system", diff --git a/agents/ten_packages/extension/bedrock_llm_python/manifest.json b/agents/ten_packages/extension/bedrock_llm_python/manifest.json index a031ec3d..591a7bd3 100644 --- a/agents/ten_packages/extension/bedrock_llm_python/manifest.json +++ b/agents/ten_packages/extension/bedrock_llm_python/manifest.json @@ -1,7 +1,7 @@ { "type": "extension", "name": "bedrock_llm_python", - "version": "0.4.0", + "version": "0.1.0", "dependencies": [ { "type": "system", diff --git a/agents/ten_packages/extension/cartesia_tts/manifest.json b/agents/ten_packages/extension/cartesia_tts/manifest.json index 85912f14..4d567fea 100644 --- a/agents/ten_packages/extension/cartesia_tts/manifest.json +++ b/agents/ten_packages/extension/cartesia_tts/manifest.json @@ -1,7 +1,7 @@ { "type": "extension", "name": "cartesia_tts", - "version": "0.4.2", + "version": "0.1.0", "dependencies": [ { "type": "system", diff --git a/agents/ten_packages/extension/cosy_tts_python/manifest.json b/agents/ten_packages/extension/cosy_tts_python/manifest.json index d32d2d2c..d45c678c 100644 --- a/agents/ten_packages/extension/cosy_tts_python/manifest.json +++ b/agents/ten_packages/extension/cosy_tts_python/manifest.json @@ -1,7 +1,7 @@ { "type": "extension", "name": "cosy_tts_python", - "version": "0.4.2", + "version": "0.1.0", "dependencies": [ { "type": "system", diff --git a/agents/ten_packages/extension/elevenlabs_tts_python/manifest.json b/agents/ten_packages/extension/elevenlabs_tts_python/manifest.json index 2a24022c..abac9a73 100644 --- a/agents/ten_packages/extension/elevenlabs_tts_python/manifest.json +++ b/agents/ten_packages/extension/elevenlabs_tts_python/manifest.json @@ -1,7 +1,7 @@ { "type": "extension", "name": "elevenlabs_tts_python", - "version": "0.4.2", + "version": "0.1.0", "dependencies": [ { "type": "system", diff --git a/agents/ten_packages/extension/file_chunker/manifest.json b/agents/ten_packages/extension/file_chunker/manifest.json index 460c4382..a29fdd01 100644 --- a/agents/ten_packages/extension/file_chunker/manifest.json +++ b/agents/ten_packages/extension/file_chunker/manifest.json @@ -1,7 +1,7 @@ { "type": "extension", "name": "file_chunker", - "version": "0.4.0", + "version": "0.1.0", "dependencies": [ { "type": "system", diff --git a/agents/ten_packages/extension/fish_audio_tts/manifest.json b/agents/ten_packages/extension/fish_audio_tts/manifest.json index b5befbf4..d8dee21f 100644 --- a/agents/ten_packages/extension/fish_audio_tts/manifest.json +++ b/agents/ten_packages/extension/fish_audio_tts/manifest.json @@ -1,7 +1,7 @@ { "type": "extension", "name": "fish_audio_tts", - "version": "0.4.0", + "version": "0.1.0", "dependencies": [ { "type": "system", diff --git a/agents/ten_packages/extension/gemini_llm_python/manifest.json b/agents/ten_packages/extension/gemini_llm_python/manifest.json index 2d9f51b8..86ae20a6 100644 --- a/agents/ten_packages/extension/gemini_llm_python/manifest.json +++ b/agents/ten_packages/extension/gemini_llm_python/manifest.json @@ -1,7 +1,7 @@ { "type": "extension", "name": "gemini_llm_python", - "version": "0.4.0", + "version": "0.1.0", "dependencies": [ { "type": "system", diff --git a/agents/ten_packages/extension/glue_python_async/manifest.json b/agents/ten_packages/extension/glue_python_async/manifest.json index c772f171..51b8f0f9 100644 --- a/agents/ten_packages/extension/glue_python_async/manifest.json +++ b/agents/ten_packages/extension/glue_python_async/manifest.json @@ -1,7 +1,7 @@ { "type": "extension", "name": "glue_python_async", - "version": "0.3.1", + "version": "0.1.0", "dependencies": [ { "type": "system", diff --git a/agents/ten_packages/extension/interrupt_detector_python/manifest.json b/agents/ten_packages/extension/interrupt_detector_python/manifest.json index 92b70555..721a40c0 100644 --- a/agents/ten_packages/extension/interrupt_detector_python/manifest.json +++ b/agents/ten_packages/extension/interrupt_detector_python/manifest.json @@ -1,7 +1,7 @@ { "type": "extension", "name": "interrupt_detector_python", - "version": "0.4.0", + "version": "0.1.0", "dependencies": [ { "type": "system", diff --git a/agents/ten_packages/extension/llama_index_chat_engine/manifest.json b/agents/ten_packages/extension/llama_index_chat_engine/manifest.json index 08a0c643..b394375b 100644 --- a/agents/ten_packages/extension/llama_index_chat_engine/manifest.json +++ b/agents/ten_packages/extension/llama_index_chat_engine/manifest.json @@ -1,7 +1,7 @@ { "type": "extension", "name": "llama_index_chat_engine", - "version": "0.4.0", + "version": "0.1.0", "dependencies": [ { "type": "system", diff --git a/agents/ten_packages/extension/minimax_tts_python/manifest.json b/agents/ten_packages/extension/minimax_tts_python/manifest.json index 12913aa9..455b7701 100644 --- a/agents/ten_packages/extension/minimax_tts_python/manifest.json +++ b/agents/ten_packages/extension/minimax_tts_python/manifest.json @@ -1,7 +1,7 @@ { "type": "extension", "name": "minimax_tts_python", - "version": "0.4.2", + "version": "0.1.0", "dependencies": [ { "type": "system", diff --git a/agents/ten_packages/extension/polly_tts/manifest.json b/agents/ten_packages/extension/polly_tts/manifest.json index 30c3d478..02575eee 100644 --- a/agents/ten_packages/extension/polly_tts/manifest.json +++ b/agents/ten_packages/extension/polly_tts/manifest.json @@ -1,7 +1,7 @@ { "type": "extension", "name": "polly_tts", - "version": "0.4.0", + "version": "0.1.0", "dependencies": [ { "type": "system", diff --git a/agents/ten_packages/extension/qwen_llm_python/manifest.json b/agents/ten_packages/extension/qwen_llm_python/manifest.json index 1227bd78..b157ab8c 100644 --- a/agents/ten_packages/extension/qwen_llm_python/manifest.json +++ b/agents/ten_packages/extension/qwen_llm_python/manifest.json @@ -1,7 +1,7 @@ { "type": "extension", "name": "qwen_llm_python", - "version": "0.4.0", + "version": "0.1.0", "dependencies": [ { "type": "system", diff --git a/agents/ten_packages/extension/transcribe_asr_python/manifest.json b/agents/ten_packages/extension/transcribe_asr_python/manifest.json index 95403cc8..399bcaef 100644 --- a/agents/ten_packages/extension/transcribe_asr_python/manifest.json +++ b/agents/ten_packages/extension/transcribe_asr_python/manifest.json @@ -1,7 +1,7 @@ { "type": "extension", "name": "transcribe_asr_python", - "version": "0.4.0", + "version": "0.1.0", "dependencies": [ { "type": "system", diff --git a/agents/ten_packages/extension/vision_analyze_tool_python/manifest.json b/agents/ten_packages/extension/vision_analyze_tool_python/manifest.json index 8e9ead2a..8555935e 100644 --- a/agents/ten_packages/extension/vision_analyze_tool_python/manifest.json +++ b/agents/ten_packages/extension/vision_analyze_tool_python/manifest.json @@ -1,7 +1,7 @@ { "type": "extension", "name": "vision_analyze_tool_python", - "version": "0.3.1", + "version": "0.1.0", "dependencies": [ { "type": "system", diff --git a/agents/ten_packages/extension/vision_tool_python/manifest.json b/agents/ten_packages/extension/vision_tool_python/manifest.json index 82c8a516..1bd3aa6b 100644 --- a/agents/ten_packages/extension/vision_tool_python/manifest.json +++ b/agents/ten_packages/extension/vision_tool_python/manifest.json @@ -1,7 +1,7 @@ { "type": "extension", "name": "vision_tool_python", - "version": "0.3.0", + "version": "0.1.0", "dependencies": [ { "type": "system", From f76e0c11e7938fbcd1b2d8203f20fb6f68ee37f5 Mon Sep 17 00:00:00 2001 From: Jay Zhang Date: Sun, 1 Dec 2024 07:46:12 +0000 Subject: [PATCH 5/5] feat: add necessary py extensions in manifest --- agents/.gitignore | 1 + agents/examples/demo/manifest.json | 45 ++++++ agents/examples/experimental/manifest.json | 135 ++++++++++++++++++ .../extension/http_server_python/__init__.py | 4 - .../http_server_python/http_server_addon.py | 14 -- .../http_server_extension.py | 89 ------------ .../extension/http_server_python/log.py | 13 -- .../http_server_python/manifest.json | 63 -------- .../http_server_python/property.json | 4 - 9 files changed, 181 insertions(+), 187 deletions(-) delete mode 100644 agents/ten_packages/extension/http_server_python/__init__.py delete mode 100644 agents/ten_packages/extension/http_server_python/http_server_addon.py delete mode 100644 agents/ten_packages/extension/http_server_python/http_server_extension.py delete mode 100644 agents/ten_packages/extension/http_server_python/log.py delete mode 100644 agents/ten_packages/extension/http_server_python/manifest.json delete mode 100644 agents/ten_packages/extension/http_server_python/property.json diff --git a/agents/.gitignore b/agents/.gitignore index faced1f0..d2e02e77 100644 --- a/agents/.gitignore +++ b/agents/.gitignore @@ -5,6 +5,7 @@ ten_packages/extension/azure_tts ten_packages/extension/agora_sess_ctrl ten_packages/extension/agora_rtm ten_packages/extension/py_init_extension_cpp +ten_packages/extension/http_server_python ten_packages/system/agora_rtc_sdk ten_packages/system/azure_speech_sdk ten_packages/system/nlohmann_json diff --git a/agents/examples/demo/manifest.json b/agents/examples/demo/manifest.json index ab4316ed..a4158c8f 100644 --- a/agents/examples/demo/manifest.json +++ b/agents/examples/demo/manifest.json @@ -37,6 +37,51 @@ "type": "extension", "name": "agora_rtm", "version": "=0.3.0" + }, + { + "type": "extension", + "name": "openai_chatgpt_python", + "version": "=0.1.0" + }, + { + "type": "extension", + "name": "openai_v2v_python", + "version": "=0.1.0" + }, + { + "type": "extension", + "name": "fish_audio_tts", + "version": "=0.1.0" + }, + { + "type": "extension", + "name": "message_collector", + "version": "=0.1.0" + }, + { + "type": "extension", + "name": "message_collector_rtm", + "version": "=0.1.0" + }, + { + "type": "extension", + "name": "vision_tool_python", + "version": "=0.1.0" + }, + { + "type": "extension", + "name": "vision_analyze_tool_python", + "version": "=0.1.0" + }, + { + "type": "extension", + "name": "weatherapi_tool_python", + "version": "=0.1.0" + }, + { + "type": "extension", + "name": "bingsearch_tool_python", + "version": "=0.1.0" } ] } \ No newline at end of file diff --git a/agents/examples/experimental/manifest.json b/agents/examples/experimental/manifest.json index 2a16c223..75532b50 100644 --- a/agents/examples/experimental/manifest.json +++ b/agents/examples/experimental/manifest.json @@ -37,6 +37,141 @@ "type": "extension", "name": "agora_rtm", "version": "=0.3.0" + }, + { + "type": "extension", + "name": "http_server_python", + "version": "0.7.0" + }, + { + "type": "extension", + "name": "aliyun_analyticdb_vector_storage", + "version": "=0.1.0" + }, + { + "type": "extension", + "name": "aliyun_text_embedding", + "version": "=0.1.0" + }, + { + "type": "extension", + "name": "file_chunker", + "version": "=0.1.0" + }, + { + "type": "extension", + "name": "llama_index_chat_engine", + "version": "=0.1.0" + }, + { + "type": "extension", + "name": "bedrock_llm_python", + "version": "=0.1.0" + }, + { + "type": "extension", + "name": "bingsearch_tool_python", + "version": "=0.1.0" + }, + { + "type": "extension", + "name": "cartesia_tts", + "version": "=0.1.0" + }, + { + "type": "extension", + "name": "cosy_tts_python", + "version": "=0.1.0" + }, + { + "type": "extension", + "name": "deepgram_asr_python", + "version": "=0.1.0" + }, + { + "type": "extension", + "name": "elevenlabs_tts_python", + "version": "=0.1.0" + }, + { + "type": "extension", + "name": "fashionai", + "version": "=0.1.0" + }, + { + "type": "extension", + "name": "fish_audio_tts", + "version": "=0.1.0" + }, + { + "type": "extension", + "name": "gemini_llm_python", + "version": "=0.1.0" + }, + { + "type": "extension", + "name": "gemini_llm_python", + "version": "=0.1.0" + }, + { + "type": "extension", + "name": "interrupt_detector_python", + "version": "=0.1.0" + }, + { + "type": "extension", + "name": "message_collector", + "version": "=0.1.0" + }, + { + "type": "extension", + "name": "minimax_tts_python", + "version": "=0.1.0" + }, + { + "type": "extension", + "name": "minimax_v2v_python", + "version": "=0.1.0" + }, + { + "type": "extension", + "name": "openai_chatgpt_python", + "version": "=0.1.0" + }, + { + "type": "extension", + "name": "openai_v2v_python", + "version": "=0.1.0" + }, + { + "type": "extension", + "name": "polly_tts", + "version": "=0.1.0" + }, + { + "type": "extension", + "name": "qwen_llm_python", + "version": "=0.1.0" + }, + { + "type": "extension", + "name": "transcribe_asr_python", + "version": "=0.1.0" + }, + { + "type": "extension", + "name": "tsdb_firestore", + "version": "=0.1.0" + }, + { + "type": "extension", + "name": "vision_tool_python", + "version": "=0.1.0" + }, + { + "type": "extension", + "name": "weatherapi_tool_python", + "version": "=0.1.0" } ] } \ No newline at end of file diff --git a/agents/ten_packages/extension/http_server_python/__init__.py b/agents/ten_packages/extension/http_server_python/__init__.py deleted file mode 100644 index 0bcc331c..00000000 --- a/agents/ten_packages/extension/http_server_python/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -from . import http_server_addon -from .log import logger - -logger.info("http_server_python extension loaded") diff --git a/agents/ten_packages/extension/http_server_python/http_server_addon.py b/agents/ten_packages/extension/http_server_python/http_server_addon.py deleted file mode 100644 index 97f269aa..00000000 --- a/agents/ten_packages/extension/http_server_python/http_server_addon.py +++ /dev/null @@ -1,14 +0,0 @@ -from ten import ( - Addon, - register_addon_as_extension, - TenEnv, -) - - -@register_addon_as_extension("http_server_python") -class HTTPServerExtensionAddon(Addon): - def on_create_instance(self, ten: TenEnv, addon_name: str, context): - from .log import logger - from .http_server_extension import HTTPServerExtension - logger.info("on_create_instance") - ten.on_create_instance_done(HTTPServerExtension(addon_name), context) diff --git a/agents/ten_packages/extension/http_server_python/http_server_extension.py b/agents/ten_packages/extension/http_server_python/http_server_extension.py deleted file mode 100644 index 4148c7c9..00000000 --- a/agents/ten_packages/extension/http_server_python/http_server_extension.py +++ /dev/null @@ -1,89 +0,0 @@ -from ten import ( - Extension, - TenEnv, - Cmd, - StatusCode, - CmdResult, -) -from .log import logger -from http.server import HTTPServer, BaseHTTPRequestHandler -import threading -from functools import partial - - -class HTTPHandler(BaseHTTPRequestHandler): - def __init__(self, ten, *args, directory=None, **kwargs): - logger.info("new handler: %s %s %s", directory, args, kwargs) - self.ten = ten - super().__init__(*args, **kwargs) - - def do_POST(self): - logger.info("post request incoming %s", self.path) - if self.path == "/cmd": - try: - content_length = int(self.headers["Content-Length"]) - input = self.rfile.read(content_length).decode("utf-8") - logger.info("incoming request %s", input) - self.ten.send_cmd( - Cmd.create_from_json(input), - lambda ten, result: logger.info( - "finish send_cmd from http server %s %s", input, result - ), - ) - self.send_response_only(200) - self.end_headers() - except Exception as e: - logger.warning("failed to handle request, err {}".format(e)) - self.send_response_only(500) - self.end_headers() - else: - logger.warning("invalid path: %s", self.path) - self.send_response_only(404) - self.end_headers() - - -class HTTPServerExtension(Extension): - def __init__(self, name: str): - super().__init__(name) - self.listen_addr = "127.0.0.1" - self.listen_port = 8888 - self.cmd_white_list = None - self.server = None - self.thread = None - - def on_start(self, ten: TenEnv): - self.listen_addr = ten.get_property_string("listen_addr") - self.listen_port = ten.get_property_int("listen_port") - """ - white_list = ten.get_property_string("cmd_white_list") - if len(white_list) > 0: - self.cmd_white_list = white_list.split(",") - """ - - logger.info( - "HTTPServerExtension on_start %s:%d, %s", - self.listen_addr, - self.listen_port, - self.cmd_white_list, - ) - - self.server = HTTPServer( - (self.listen_addr, self.listen_port), partial(HTTPHandler, ten) - ) - self.thread = threading.Thread(target=self.server.serve_forever) - self.thread.start() - - ten.on_start_done() - - def on_stop(self, ten: TenEnv): - logger.info("on_stop") - self.server.shutdown() - self.thread.join() - ten.on_stop_done() - - def on_cmd(self, ten: TenEnv, cmd: Cmd): - cmd_json = cmd.to_json() - logger.info("on_cmd json: " + cmd_json) - cmd_result = CmdResult.create(StatusCode.OK) - cmd_result.set_property_string("detail", "ok") - ten.return_result(cmd_result, cmd) diff --git a/agents/ten_packages/extension/http_server_python/log.py b/agents/ten_packages/extension/http_server_python/log.py deleted file mode 100644 index a7b47d79..00000000 --- a/agents/ten_packages/extension/http_server_python/log.py +++ /dev/null @@ -1,13 +0,0 @@ -import logging - -logger = logging.getLogger("http_server_python") -logger.setLevel(logging.INFO) - -formatter = logging.Formatter( - "%(asctime)s - %(name)s - %(levelname)s - %(process)d - [%(filename)s:%(lineno)d] - %(message)s" -) - -console_handler = logging.StreamHandler() -console_handler.setFormatter(formatter) - -logger.addHandler(console_handler) diff --git a/agents/ten_packages/extension/http_server_python/manifest.json b/agents/ten_packages/extension/http_server_python/manifest.json deleted file mode 100644 index 913f3a1a..00000000 --- a/agents/ten_packages/extension/http_server_python/manifest.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "type": "extension", - "name": "http_server_python", - "version": "0.5.0", - "dependencies": [ - { - "type": "system", - "name": "ten_runtime_python", - "version": "0.4" - } - ], - "package": { - "include": [ - "manifest.json", - "property.json", - "**.py" - ] - }, - "api": { - "property": { - "listen_addr": { - "type": "string" - }, - "listen_port": { - "type": "int32" - } - }, - "cmd_out": [ - { - "name": "update_querying_collection", - "property": { - "filename": { - "type": "string" - }, - "collection": { - "type": "string" - } - }, - "required": [ - "filename", - "collection" - ] - }, - { - "name": "file_chunk", - "property": { - "filename": { - "type": "string" - }, - "path": { - "type": "string" - }, - "collection": { - "type": "string" - } - }, - "required": [ - "path" - ] - } - ] - } -} \ No newline at end of file diff --git a/agents/ten_packages/extension/http_server_python/property.json b/agents/ten_packages/extension/http_server_python/property.json deleted file mode 100644 index 27ae7c57..00000000 --- a/agents/ten_packages/extension/http_server_python/property.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "listen_addr": "0.0.0.0", - "listen_port": 8888 -} \ No newline at end of file