From 0805d96e675844675e453025c457bb66df2e12bc Mon Sep 17 00:00:00 2001 From: Jay Zhang Date: Fri, 15 Nov 2024 15:00:39 +0000 Subject: [PATCH 1/2] chore: ignore temp dat --- agents/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/agents/.gitignore b/agents/.gitignore index 0e730d35..2ed20cf0 100644 --- a/agents/.gitignore +++ b/agents/.gitignore @@ -12,6 +12,7 @@ ten_packages/system/ten_runtime* .ten agoradns.dat agorareport.dat +agorartmreport.dat bin/ /BUILD.gn .cache/ From 33547b54cc9b2892153aabd8ac89ce2f113883ad Mon Sep 17 00:00:00 2001 From: Jay Zhang Date: Fri, 15 Nov 2024 15:01:22 +0000 Subject: [PATCH 2/2] feat: remove template extensions --- .../README.md | 29 ----- .../__init__.py | 6 - .../addon.py | 19 ---- .../extension.py | 49 -------- .../manifest.json | 107 ------------------ .../property.json | 1 - .../requirements.txt | 0 .../README.md | 29 ----- .../__init__.py | 6 - .../addon.py | 20 ---- .../extension.py | 44 ------- .../manifest.json | 65 ----------- .../property.json | 1 - .../requirements.txt | 0 14 files changed, 376 deletions(-) delete mode 100644 agents/ten_packages/extension/default_async_llm_extension_python/README.md delete mode 100644 agents/ten_packages/extension/default_async_llm_extension_python/__init__.py delete mode 100644 agents/ten_packages/extension/default_async_llm_extension_python/addon.py delete mode 100644 agents/ten_packages/extension/default_async_llm_extension_python/extension.py delete mode 100644 agents/ten_packages/extension/default_async_llm_extension_python/manifest.json delete mode 100644 agents/ten_packages/extension/default_async_llm_extension_python/property.json delete mode 100644 agents/ten_packages/extension/default_async_llm_extension_python/requirements.txt delete mode 100644 agents/ten_packages/extension/default_async_llm_tool_extension_python/README.md delete mode 100644 agents/ten_packages/extension/default_async_llm_tool_extension_python/__init__.py delete mode 100644 agents/ten_packages/extension/default_async_llm_tool_extension_python/addon.py delete mode 100644 agents/ten_packages/extension/default_async_llm_tool_extension_python/extension.py delete mode 100644 agents/ten_packages/extension/default_async_llm_tool_extension_python/manifest.json delete mode 100644 agents/ten_packages/extension/default_async_llm_tool_extension_python/property.json delete mode 100644 agents/ten_packages/extension/default_async_llm_tool_extension_python/requirements.txt diff --git a/agents/ten_packages/extension/default_async_llm_extension_python/README.md b/agents/ten_packages/extension/default_async_llm_extension_python/README.md deleted file mode 100644 index 31ee575e..00000000 --- a/agents/ten_packages/extension/default_async_llm_extension_python/README.md +++ /dev/null @@ -1,29 +0,0 @@ -# default_async_llm_extension_python - - - -## Features - - - -- xxx feature - -## API - -Refer to `api` definition in [manifest.json] and default values in [property.json](property.json). - - - -## Development - -### Build - - - -### Unit test - - - -## Misc - - diff --git a/agents/ten_packages/extension/default_async_llm_extension_python/__init__.py b/agents/ten_packages/extension/default_async_llm_extension_python/__init__.py deleted file mode 100644 index 72593ab2..00000000 --- a/agents/ten_packages/extension/default_async_llm_extension_python/__init__.py +++ /dev/null @@ -1,6 +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. -# -from . import addon diff --git a/agents/ten_packages/extension/default_async_llm_extension_python/addon.py b/agents/ten_packages/extension/default_async_llm_extension_python/addon.py deleted file mode 100644 index 5d095832..00000000 --- a/agents/ten_packages/extension/default_async_llm_extension_python/addon.py +++ /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. -# -from ten import ( - Addon, - register_addon_as_extension, - TenEnv, -) -from .extension import DefaultAsyncLLMExtension - - -@register_addon_as_extension("default_async_llm_extension_python") -class DefaultAsyncLLMExtensionAddon(Addon): - def on_create_instance(self, ten_env: TenEnv, name: str, context) -> None: - ten_env.log_info("on_create_instance") - ten_env.on_create_instance_done( - DefaultAsyncLLMExtension(name), context) diff --git a/agents/ten_packages/extension/default_async_llm_extension_python/extension.py b/agents/ten_packages/extension/default_async_llm_extension_python/extension.py deleted file mode 100644 index 53107fa5..00000000 --- a/agents/ten_packages/extension/default_async_llm_extension_python/extension.py +++ /dev/null @@ -1,49 +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. -# -from ten import AsyncTenEnv -from ten_ai_base import ( - AsyncLLMBaseExtension, LLMCallCompletionArgs, LLMDataCompletionArgs, LLMToolMetadata, BaseConfig -) -from dataclasses import dataclass - - -@dataclass -class DefaultAsyncLLMConfig(BaseConfig): - model: str = "" - # TODO: add extra config fields here - - -class DefaultAsyncLLMExtension(AsyncLLMBaseExtension): - async def on_start(self, ten_env: AsyncTenEnv) -> None: - await super().on_start(ten_env) - - # initialize configuration - self.config = DefaultAsyncLLMConfig.create(ten_env=ten_env) - ten_env.log_info(f"config: {self.config}") - - """Implement this method to construct and start your resources.""" - ten_env.log_debug("TODO: on_start") - - async def on_stop(self, ten_env: AsyncTenEnv) -> None: - await super().on_stop(ten_env) - - """Implement this method to stop and destruct your resources.""" - ten_env.log_debug("TODO: on_stop") - - async def on_call_chat_completion(self, ten_env: AsyncTenEnv, **kargs: LLMCallCompletionArgs) -> any: - """Called when a chat completion is requested by cmd call. Implement this method to process the chat completion.""" - ten_env.log_debug("TODO: on_call_chat_completion") - - async def on_data_chat_completion(self, ten_env: AsyncTenEnv, **kargs: LLMDataCompletionArgs) -> None: - """ - Called when a chat completion is requested by data input. Implement this method to process the chat completion. - Note that this method is stream-based, and it should consider supporting local context caching. - """ - ten_env.log_debug("TODO: on_data_chat_completion") - - async def on_tools_update(self, ten_env: AsyncTenEnv, tool: LLMToolMetadata) -> None: - """Called when a new tool is registered. Implement this method to process the new tool.""" - ten_env.log_debug("TODO: on_tools_update") diff --git a/agents/ten_packages/extension/default_async_llm_extension_python/manifest.json b/agents/ten_packages/extension/default_async_llm_extension_python/manifest.json deleted file mode 100644 index 7c91ef7b..00000000 --- a/agents/ten_packages/extension/default_async_llm_extension_python/manifest.json +++ /dev/null @@ -1,107 +0,0 @@ -{ - "type": "extension", - "name": "default_async_llm_extension_python", - "version": "0.1.0", - "dependencies": [ - { - "type": "system", - "name": "ten_ai_base", - "version": "0.1.0" - } - ], - "package": { - "include": [ - "manifest.json", - "property.json", - "requirements.txt", - "**.tent", - "**.py", - "README.md" - ] - }, - "api": { - "property": { - "model": { - "type": "string" - } - }, - "cmd_in": [ - { - "name": "tool_register", - "property": { - "tool": { - "type": "string" - } - }, - "required": [ - "tool" - ] - }, - { - "name": "call_chat_completion", - "property": { - "messages": { - "type": "string" - }, - "stream": { - "type": "bool" - } - }, - "required": [ - "messages" - ], - "result": { - "property": { - "text": { - "type": "string" - } - }, - "required": [ - "text" - ] - } - }, - { - "name": "flush" - } - ], - "cmd_out": [ - { - "name": "flush" - } - ], - "data_in": [ - { - "name": "text_data", - "property": { - "text": { - "type": "string" - }, - "is_final": { - "type": "bool" - } - }, - "required": [ - "text" - ] - } - ], - "data_out": [ - { - "name": "text_data", - "property": { - "text": { - "type": "string" - }, - "end_of_segment": { - "type": "bool" - } - }, - "required": [ - "text", - "end_of_segment" - ] - } - ] - } -} \ No newline at end of file diff --git a/agents/ten_packages/extension/default_async_llm_extension_python/property.json b/agents/ten_packages/extension/default_async_llm_extension_python/property.json deleted file mode 100644 index 9e26dfee..00000000 --- a/agents/ten_packages/extension/default_async_llm_extension_python/property.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/agents/ten_packages/extension/default_async_llm_extension_python/requirements.txt b/agents/ten_packages/extension/default_async_llm_extension_python/requirements.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/agents/ten_packages/extension/default_async_llm_tool_extension_python/README.md b/agents/ten_packages/extension/default_async_llm_tool_extension_python/README.md deleted file mode 100644 index 8b26a3ab..00000000 --- a/agents/ten_packages/extension/default_async_llm_tool_extension_python/README.md +++ /dev/null @@ -1,29 +0,0 @@ -# default_async_llm_tool_extension_python - - - -## Features - - - -- xxx feature - -## API - -Refer to `api` definition in [manifest.json] and default values in [property.json](property.json). - - - -## Development - -### Build - - - -### Unit test - - - -## Misc - - diff --git a/agents/ten_packages/extension/default_async_llm_tool_extension_python/__init__.py b/agents/ten_packages/extension/default_async_llm_tool_extension_python/__init__.py deleted file mode 100644 index 72593ab2..00000000 --- a/agents/ten_packages/extension/default_async_llm_tool_extension_python/__init__.py +++ /dev/null @@ -1,6 +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. -# -from . import addon diff --git a/agents/ten_packages/extension/default_async_llm_tool_extension_python/addon.py b/agents/ten_packages/extension/default_async_llm_tool_extension_python/addon.py deleted file mode 100644 index 8cab0dd2..00000000 --- a/agents/ten_packages/extension/default_async_llm_tool_extension_python/addon.py +++ /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. -# -from ten import ( - Addon, - register_addon_as_extension, - TenEnv, -) -from .extension import DefaultAsyncLLMToolExtension - - -@register_addon_as_extension("default_async_llm_tool_extension_python") -class DefaultAsyncLLMToolExtensionAddon(Addon): - - def on_create_instance(self, ten_env: TenEnv, name: str, context) -> None: - ten_env.log_info("on_create_instance") - ten_env.on_create_instance_done( - DefaultAsyncLLMToolExtension(name), context) diff --git a/agents/ten_packages/extension/default_async_llm_tool_extension_python/extension.py b/agents/ten_packages/extension/default_async_llm_tool_extension_python/extension.py deleted file mode 100644 index 16d64f59..00000000 --- a/agents/ten_packages/extension/default_async_llm_tool_extension_python/extension.py +++ /dev/null @@ -1,44 +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. -# -from ten import ( - TenEnv, - AsyncTenEnv, -) -from ten_ai_base import ( - AsyncLLMToolBaseExtension, LLMToolMetadata, LLMToolResult, BaseConfig -) -from dataclasses import dataclass - - -@dataclass -class DefaultAsyncLLMToolConfig(BaseConfig): - # TODO: add extra config fields here - pass - - -class DefaultAsyncLLMToolExtension(AsyncLLMToolBaseExtension): - async def on_start(self, ten_env: AsyncTenEnv) -> None: - await super().on_start(ten_env) - - # initialize configuration - self.config = DefaultAsyncLLMToolConfig.create(ten_env=ten_env) - ten_env.log_info(f"config: {self.config}") - - """Implement this method to construct and start your resources.""" - ten_env.log_debug("TODO: on_start") - - async def on_stop(self, ten_env: AsyncTenEnv) -> None: - await super().on_stop(ten_env) - - """Implement this method to stop and destruct your resources.""" - ten_env.log_debug("TODO: on_stop") - - def get_tool_metadata(self, ten_env: TenEnv) -> list[LLMToolMetadata]: - ten_env.log_debug("TODO: get_tool_metadata") - return [] - - async def run_tool(self, ten_env: AsyncTenEnv, name: str, args: dict) -> LLMToolResult: - ten_env.log_debug(f"TODO: run_tool {name} {args}") diff --git a/agents/ten_packages/extension/default_async_llm_tool_extension_python/manifest.json b/agents/ten_packages/extension/default_async_llm_tool_extension_python/manifest.json deleted file mode 100644 index b6b44832..00000000 --- a/agents/ten_packages/extension/default_async_llm_tool_extension_python/manifest.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "type": "extension", - "name": "default_async_llm_tool_extension_python", - "version": "0.1.0", - "dependencies": [ - { - "type": "system", - "name": "ten_ai_base", - "version": "0.1.0" - } - ], - "package": { - "include": [ - "manifest.json", - "property.json", - "requirements.txt", - "**.tent", - "**.py", - "README.md" - ] - }, - "api": { - "property": {}, - "cmd_in": [ - { - "name": "tool_call", - "property": { - "name": { - "type": "string" - }, - "arguments": { - "type": "string" - } - }, - "required": [ - "name", - "arguments" - ], - "result": { - "property": { - "tool_result": { - "type": "string" - } - }, - "required": [ - "tool_result" - ] - } - } - ], - "cmd_out": [ - { - "name": "tool_register", - "property": { - "tool": { - "type": "string" - } - }, - "required": [ - "tool" - ] - } - ] - } -} \ No newline at end of file diff --git a/agents/ten_packages/extension/default_async_llm_tool_extension_python/property.json b/agents/ten_packages/extension/default_async_llm_tool_extension_python/property.json deleted file mode 100644 index 9e26dfee..00000000 --- a/agents/ten_packages/extension/default_async_llm_tool_extension_python/property.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/agents/ten_packages/extension/default_async_llm_tool_extension_python/requirements.txt b/agents/ten_packages/extension/default_async_llm_tool_extension_python/requirements.txt deleted file mode 100644 index e69de29b..00000000