ref: Use better task cancellation logic #13624
Annotations
1 error and 2 warnings
Run unit tests:
src/backend/tests/src/backend/tests/base.py#L128
TestChatInput.test_component_versions[1.0.19]
AssertionError: Failed to execute component TestChatInput for version 1.0.19:
Module: inputs
File: ChatInput
Error: All of session_id, sender, and sender_name must be provided.
Component Code: from langflow.base.data.utils import IMG_FILE_TYPES, TEXT_FILE_TYPES
from langflow.base.io.chat import ChatComponent
from langflow.inputs import BoolInput
from langflow.io import DropdownInput, FileInput, MessageTextInput, MultilineInput, Output
from langflow.memory import store_message
from langflow.schema.message import Message
from langflow.utils.constants import MESSAGE_SENDER_AI, MESSAGE_SENDER_NAME_USER, MESSAGE_SENDER_USER
class ChatInput(ChatComponent):
display_name = "Chat Input"
description = "Get chat inputs from the Playground."
icon = "ChatInput"
name = "ChatInput"
inputs = [
MultilineInput(
name="input_value",
display_name="Text",
value="",
info="Message to be passed as input.",
),
BoolInput(
name="should_store_message",
display_name="Store Messages",
info="Store the message in the history.",
value=True,
advanced=True,
),
DropdownInput(
name="sender",
display_name="Sender Type",
options=[MESSAGE_SENDER_AI, MESSAGE_SENDER_USER],
value=MESSAGE_SENDER_USER,
info="Type of sender.",
advanced=True,
),
MessageTextInput(
name="sender_name",
display_name="Sender Name",
info="Name of the sender.",
value=MESSAGE_SENDER_NAME_USER,
advanced=True,
),
MessageTextInput(
name="session_id",
display_name="Session ID",
info="The session ID of the chat. If empty, the current session ID parameter will be used.",
advanced=True,
),
FileInput(
name="files",
display_name="Files",
file_types=TEXT_FILE_TYPES + IMG_FILE_TYPES,
info="Files to be sent with the message.",
advanced=True,
is_list=True,
),
]
outputs = [
Output(display_name="Message", name="message", method="message_response"),
]
def message_response(self) -> Message:
message = Message(
text=self.input_value,
sender=self.sender,
sender_name=self.sender_name,
session_id=self.session_id,
files=self.files,
)
if (
self.session_id
and isinstance(message, Message)
and isinstance(message.text, str)
and self.should_store_message
):
store_message(
message,
flow_id=self.graph.flow_id,
)
self.message.value = message
self.status = message
return message
|
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
|
Run unit tests
Attempt 1 failed. Reason: Child_process exited with error code 2
|
Loading