From 0217f90a92e412d4f2835550d60ced717cc36987 Mon Sep 17 00:00:00 2001 From: Jay Zhang Date: Thu, 24 Oct 2024 16:28:48 +0000 Subject: [PATCH] feat: able to support greeting --- agents/property.json | 11 +++++++++++ .../extension/minimax_v2v_python/extension.py | 7 +++++++ 2 files changed, 18 insertions(+) diff --git a/agents/property.json b/agents/property.json index efda5280..6f80af51 100644 --- a/agents/property.json +++ b/agents/property.json @@ -3216,6 +3216,17 @@ } ] } + ], + "cmd": [ + { + "name": "on_user_joined", + "dest": [ + { + "extension_group": "llm", + "extension": "minimax_v2v_python" + } + ] + } ] }, { diff --git a/agents/ten_packages/extension/minimax_v2v_python/extension.py b/agents/ten_packages/extension/minimax_v2v_python/extension.py index f8e14bc1..e09c276e 100644 --- a/agents/ten_packages/extension/minimax_v2v_python/extension.py +++ b/agents/ten_packages/extension/minimax_v2v_python/extension.py @@ -11,6 +11,8 @@ import requests import json import httpx +import pathlib +import os from queue import Queue from typing import Iterator, Any, List @@ -171,6 +173,11 @@ def on_cmd(self, ten_env: TenEnv, cmd: Cmd) -> None: ten_env.send_cmd( out_cmd, lambda ten, result: logger.info("send_cmd flush done"), ) + # elif cmd_name == "on_user_joined": + # hello_cn_file = pathlib.Path(__file__).parent.absolute().joinpath("hello_cn.pcm") + # with open(hello_cn_file, "rb") as f: + # content = f.read() + # self.queue.put((datetime.now(), content)) cmd_result = CmdResult.create(StatusCode.OK) ten_env.return_result(cmd_result, cmd)