Skip to content

Commit a84a980

Browse files
erichareautofix-ci[bot]Copilot
authored andcommitted
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>
1 parent e146f41 commit a84a980

8 files changed

Lines changed: 72 additions & 23 deletions

File tree

src/backend/base/langflow/initial_setup/starter_projects/Blog Writer.json

Lines changed: 5 additions & 3 deletions
Large diffs are not rendered by default.

src/backend/base/langflow/initial_setup/starter_projects/Custom Component Generator.json

Lines changed: 15 additions & 9 deletions
Large diffs are not rendered by default.

src/backend/base/langflow/initial_setup/starter_projects/Simple Agent.json

Lines changed: 5 additions & 3 deletions
Large diffs are not rendered by default.

src/backend/base/langflow/initial_setup/starter_projects/Travel Planning Agents.json

Lines changed: 5 additions & 3 deletions
Large diffs are not rendered by default.

src/lfx/src/lfx/_assets/component_index.json

Lines changed: 6 additions & 4 deletions
Large diffs are not rendered by default.

src/lfx/src/lfx/components/data_source/url.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class URLComponent(Component):
6464
tool_mode=True,
6565
placeholder="Enter a URL...",
6666
list_add_label="Add URL",
67-
input_types=[],
67+
input_types=["Message"],
6868
),
6969
SliderInput(
7070
name="max_depth",

src/lfx/tests/unit/components/data_source/__init__.py

Whitespace-only changes.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
"""Tests for URLComponent input type configuration."""
2+
3+
import sys
4+
from unittest.mock import MagicMock
5+
6+
import pytest
7+
8+
9+
@pytest.fixture
10+
def url_component(monkeypatch):
11+
"""Import URLComponent with heavy third-party modules stubbed for this test."""
12+
for mod in (
13+
"langchain_community",
14+
"langchain_community.document_loaders",
15+
"markitdown",
16+
"bs4",
17+
"lxml",
18+
):
19+
monkeypatch.setitem(sys.modules, mod, MagicMock())
20+
21+
from lfx.components.data_source.url import URLComponent
22+
23+
return URLComponent
24+
25+
26+
class TestURLComponentInputTypes:
27+
"""Verify the urls input accepts Message as an input type."""
28+
29+
def test_urls_input_accepts_message_type(self, url_component):
30+
urls_input = next(inp for inp in url_component.inputs if inp.name == "urls")
31+
assert "Message" in urls_input.input_types
32+
33+
def test_urls_input_is_list(self, url_component):
34+
urls_input = next(inp for inp in url_component.inputs if inp.name == "urls")
35+
assert urls_input.is_list is True

0 commit comments

Comments
 (0)