fix: Accept inputs for the URL component (#12474)

* fix: Accept inputs for the URL component

* [autofix.ci] apply automated fixes

* Update src/lfx/tests/unit/components/data_source/test_url_component.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* rebuild comp index

* Update component_index.json

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Eric Hare
2026-04-06 09:28:43 -07:00
committed by GitHub
parent 66c206740e
commit acf2ae0605
8 changed files with 72 additions and 23 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -64,7 +64,7 @@ class URLComponent(Component):
tool_mode=True,
placeholder="Enter a URL...",
list_add_label="Add URL",
input_types=[],
input_types=["Message"],
),
SliderInput(
name="max_depth",

View File

@ -0,0 +1,35 @@
"""Tests for URLComponent input type configuration."""
import sys
from unittest.mock import MagicMock
import pytest
@pytest.fixture
def url_component(monkeypatch):
"""Import URLComponent with heavy third-party modules stubbed for this test."""
for mod in (
"langchain_community",
"langchain_community.document_loaders",
"markitdown",
"bs4",
"lxml",
):
monkeypatch.setitem(sys.modules, mod, MagicMock())
from lfx.components.data_source.url import URLComponent
return URLComponent
class TestURLComponentInputTypes:
"""Verify the urls input accepts Message as an input type."""
def test_urls_input_accepts_message_type(self, url_component):
urls_input = next(inp for inp in url_component.inputs if inp.name == "urls")
assert "Message" in urls_input.input_types
def test_urls_input_is_list(self, url_component):
urls_input = next(inp for inp in url_component.inputs if inp.name == "urls")
assert urls_input.is_list is True