From 8d1bff38fe42ddaa7bf08189f93f9f76844a0620 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Fri, 15 Sep 2023 17:42:14 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5=20chore(ChatOutput.py):=20remove?= =?UTF-8?q?=20unused=20ChatOutput=20component?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ChatOutput component was removed as it was no longer being used in the project. This commit removes the file and its associated code. --- .../langflow/components/io/ChatOutput.py | 39 ------------------- 1 file changed, 39 deletions(-) delete mode 100644 src/backend/langflow/components/io/ChatOutput.py diff --git a/src/backend/langflow/components/io/ChatOutput.py b/src/backend/langflow/components/io/ChatOutput.py deleted file mode 100644 index 48fec75bc..000000000 --- a/src/backend/langflow/components/io/ChatOutput.py +++ /dev/null @@ -1,39 +0,0 @@ -from typing import Optional, Text -from langflow.api.v1.schemas import ChatMessage -from langflow.services.utils import get_chat_service -from langflow import CustomComponent -from anyio.from_thread import start_blocking_portal -from loguru import logger - - -class ChatOutput(CustomComponent): - display_name = "Chat Output" - description = "Used to send a message to the chat." - - field_config = { - "code": { - "show": False, - } - } - - def build_config(self): - return {"message": {"input_types": ["Text"]}} - - def build(self, message: Optional[Text], is_ai: bool = False) -> Text: - if not message: - return "" - try: - chat_service = get_chat_service() - chat_message = ChatMessage(message=message, is_bot=is_ai) - # send_message is a coroutine - # run in a thread safe manner - with start_blocking_portal() as portal: - portal.call(chat_service.send_message, chat_message) - chat_service.chat_history.add_message( - chat_service.cache_service.current_client_id, chat_message - ) - except Exception as exc: - logger.exception(exc) - logger.debug(f"Error sending message to chat: {exc}") - self.repr_value = message - return message