diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index fde81192..2cece602 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,7 +2,7 @@ // README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile { "name": "astra", - "image": "ghcr.io/rte-design/astra_agents_build", + "image": "ghcr.io/rte-design/astra_agents_build:0.3.5", "customizations": { "vscode": { "extensions": [ diff --git a/agents/addon/extension/elevenlabs_tts_python/elevenlabs_tts_extension.py b/agents/addon/extension/elevenlabs_tts_python/elevenlabs_tts_extension.py index ede19d97..1feadb44 100644 --- a/agents/addon/extension/elevenlabs_tts_python/elevenlabs_tts_extension.py +++ b/agents/addon/extension/elevenlabs_tts_python/elevenlabs_tts_extension.py @@ -272,16 +272,6 @@ def process_text_queue(self, rte: RteEnv): @register_addon_as_extension("elevenlabs_tts_python") class ElevenlabsTTSExtensionAddon(Addon): - def on_init(self, rte: RteEnv, manifest, property) -> None: - logger.info("on_init") - rte.on_init_done(manifest, property) - return - def on_create_instance(self, rte: RteEnv, addon_name: str, context) -> None: logger.info("on_create_instance") rte.on_create_instance_done(ElevenlabsTTSExtension(addon_name), context) - - def on_deinit(self, rte: RteEnv) -> None: - logger.info("on_deinit") - rte.on_deinit_done() - return diff --git a/agents/addon/extension/openai_chatgpt_python/openai_chatgpt_extension.py b/agents/addon/extension/openai_chatgpt_python/openai_chatgpt_extension.py index 60ddf256..7dec2073 100644 --- a/agents/addon/extension/openai_chatgpt_python/openai_chatgpt_extension.py +++ b/agents/addon/extension/openai_chatgpt_python/openai_chatgpt_extension.py @@ -369,28 +369,9 @@ def chat_completions_stream_worker(start_time, input_text, memory): ) thread.start() logger.info(f"OpenAIChatGPTExtension on_data end") - # try: - # rte_data = Data.create("text_data") - # rte_data.set_property_string("text", "hello, world, who are you!") - # except Exception as e: - # logger.info(f"on_data new_data error, ", e) - # return - - # rte.send_data(rte_data) - @register_addon_as_extension("openai_chatgpt_python") class OpenAIChatGPTExtensionAddon(Addon): - def on_init(self, rte: RteEnv, manifest, property) -> None: - logger.info("OpenAIChatGPTExtensionAddon on_init") - rte.on_init_done(manifest, property) - return - def on_create_instance(self, rte: RteEnv, addon_name: str, context) -> None: logger.info("on_create_instance") rte.on_create_instance_done(OpenAIChatGPTExtension(addon_name), context) - - def on_deinit(self, rte: RteEnv) -> None: - logger.info("OpenAIChatGPTExtensionAddon on_deinit") - rte.on_deinit_done() - return diff --git a/agents/addon/extension/polly_tts/main.py b/agents/addon/extension/polly_tts/main.py index 585a18a0..2fea0cee 100644 --- a/agents/addon/extension/polly_tts/main.py +++ b/agents/addon/extension/polly_tts/main.py @@ -54,8 +54,8 @@ def on_start(self, rte: Rte) -> None: polly_config = PollyConfig.default_config() - for optional_param in [PROPERTY_REGION, PROPERTY_ENGINE, PROPERTY_VOICE, - PROPERTY_SAMPLE_RATE, PROPERTY_LANG_CODE, + for optional_param in [PROPERTY_REGION, PROPERTY_ENGINE, PROPERTY_VOICE, + PROPERTY_SAMPLE_RATE, PROPERTY_LANG_CODE, PROPERTY_ACCESS_KEY, PROPERTY_SECRET_KEY ]: try: value = rte.get_property_string(optional_param).strip() @@ -80,14 +80,10 @@ def on_stop(self, rte: Rte) -> None: self.thread.join() rte.on_stop_done() - def on_deinit(self, rte: Rte) -> None: - logger.info("PollyTTSExtension on_deinit") - rte.on_deinit_done() - def need_interrupt(self, ts: datetime.time) -> bool: return (self.outdateTs - ts).total_seconds() > 1 - + def __get_frame(self, data: bytes) -> PcmFrame: sample_rate = int(self.polly.config.sample_rate) @@ -95,7 +91,7 @@ def __get_frame(self, data: bytes) -> PcmFrame: f.set_sample_rate(sample_rate) f.set_bytes_per_sample(2) f.set_number_of_channels(1) - + f.set_data_fmt(RTE_PCM_FRAME_DATA_FMT.RTE_PCM_FRAME_DATA_FMT_INTERLEAVE) f.set_samples_per_channel(sample_rate // 100) f.alloc_buf(self.frame_size) @@ -142,7 +138,7 @@ def on_data(self, rte: Rte, data: Data) -> None: if len(inputText) == 0: logger.info("ignore empty text") return - + is_end = data.get_property_bool("end_of_segment") logger.info("on data %s %d", inputText, is_end) @@ -168,16 +164,6 @@ def on_cmd(self, rte: Rte, cmd: Cmd) -> None: @register_addon_as_extension("polly_tts") class PollyTTSExtensionAddon(Addon): - def on_init(self, rte: Rte, manifest, property) -> None: - logger.info("PollyTTSExtensionAddon on_init") - rte.on_init_done(manifest, property) - return - def on_create_instance(self, rte: Rte, addon_name: str, context) -> None: logger.info("on_create_instance") rte.on_create_instance_done(PollyTTSExtension(addon_name), context) - - def on_deinit(self, rte: Rte) -> None: - logger.info("PollyTTSExtensionAddon on_deinit") - rte.on_deinit_done() - return diff --git a/docker-compose.yml b/docker-compose.yml index 6772611f..409b5ca6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -33,13 +33,13 @@ services: OPENAI_PROXY_URL: ${OPENAI_PROXY_URL} QWEN_API_KEY: ${QWEN_API_KEY} astra_playground: - image: agoraio/astra_playground:latest + image: ghcr.io/rte-design/astra_playground:v0.2.0-15-g38e1738 container_name: astra_playground restart: always ports: - "3000:3000" astra_graph_designer: - image: agoraio/astra_graph_designer:latest + image: agoraio/astra_graph_designer:0.1.0 container_name: astra_graph_designer restart: always ports: