Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,804 changes: 1,803 additions & 1,001 deletions .secrets.baseline

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ external = ["RUF027"]
"src/lfx/src/lfx/components/knowledge_bases/retrieval.py" = [
"SLF001", # Chroma client private member access
]
"src/lfx/src/lfx/components/mongodb/mongodb_atlas.py" = [
"src/bundles/lfx-bundles/src/lfx_bundles/mongodb/mongodb_atlas.py" = [
"SLF001", # MongoDB collection private member access
]
"src/lfx/src/lfx/components/tools/{python_code_structured_tool.py,searxng.py}" = [
Expand Down
344 changes: 344 additions & 0 deletions scripts/migrate/consolidate_bundles.py

Large diffs are not rendered by default.

102 changes: 96 additions & 6 deletions src/bundles/lfx-bundles/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,102 @@ dependencies = [
]

[project.optional-dependencies]
# Per-provider extras + the ``all`` aggregate are populated by the bulk move
# (scripts/migrate/consolidate_bundles.py) as the long-tail providers land
# here. Extra keys are PEP 685-normalized (lowercase, hyphen-separated).
# ``all`` is GENERATED from the per-provider keys -- never hand-edit it.
# Empty until the first provider tranche moves in.
all = []
# Per-provider extras + the generated ``all`` aggregate. Extra keys are
# PEP 685-normalized (lowercase, hyphen-separated). ``all`` is GENERATED
# from the per-provider keys -- never hand-edit it. Managed by
# scripts/migrate/consolidate_bundles.py.
aiml = ["langchain-openai>=1.1.6", "openai>=1.68.2,<3.0.0"]
apify = ["apify-client>=1.8.1", "langchain-community>=0.4.1,<1.0.0"]
assemblyai = ["assemblyai>=0.33.0,<1.0.0"]
azure = ["langchain-openai>=1.1.6"]
chroma = ["chromadb>=1.0.0,<2.0.0", "langchain-chroma~=0.2.6", "langchain-community>=0.4.1,<1.0.0"]
clickhouse = ["clickhouse-connect==0.7.19", "langchain-community>=0.4.1,<1.0.0"]
cometapi = ["langchain-openai>=1.1.6", "requests>=2.32.0"]
confluence = ["atlassian-python-api==3.41.16", "langchain-community>=0.4.1,<1.0.0"]
couchbase = ["couchbase>=4.2.1", "langchain-community>=0.4.1,<1.0.0"]
deepseek = ["langchain-openai>=1.1.6", "openai>=1.68.2,<3.0.0", "requests>=2.32.0"]
exa = ["metaphor-python==0.1.23"]
firecrawl = ["firecrawl-py>=1.0.16,<2.0.0"]
git = ["GitPython>=3.1.50", "langchain-community>=0.4.1,<1.0.0"]
glean = []
groq = ["langchain-groq~=1.1.1"]
icosacomputing = ["requests>=2.32.0"]
litellm = ["langchain-openai>=1.1.6", "openai>=1.68.2,<3.0.0"]
lmstudio = ["langchain-openai>=1.1.6", "openai>=1.68.2,<3.0.0", "langchain-nvidia-ai-endpoints~=1.0.0"]
mem0 = ["mem0ai>=2.0.2,<3.0.0"]
milvus = ["langchain-milvus~=0.3.2"]
mistral = ["langchain-mistralai~=1.1.1"]
mongodb = ["pymongo>=4.10.1", "langchain-mongodb>=0.11.0"]
needle = ["needle-python>=0.4.0", "langchain-community>=0.4.1,<1.0.0"]
novita = ["langchain-openai>=1.1.6", "requests>=2.32.0"]
ollama = ["langchain-ollama~=0.3.10"]
openrouter = ["langchain-openai>=1.1.6"]
perplexity = ["langchain-perplexity>=1.0.0,<2.0.0"]
pgvector = ["pgvector>=0.4.2", "langchain-community>=0.4.1,<1.0.0"]
pinecone = ["langchain-pinecone~=0.2.13; python_version < '3.14'"]
qdrant = ["qdrant-client>=1.12.0,<2.0.0", "langchain-qdrant>=1.0.0,<2.0.0"]
sambanova = ["langchain-sambanova~=1.0.0"]
scrapegraph = ["scrapegraph-py>=1.12.0"]
serpapi = ["google-search-results>=2.4.1,<3.0.0", "langchain-community>=0.4.1,<1.0.0"]
supabase = ["supabase>=2.6.0,<3.0.0", "langchain-community>=0.4.1,<1.0.0"]
tavily = []
unstructured = ["langchain-unstructured~=1.0.0"]
upstash = ["upstash-vector==0.6.0", "langchain-community>=0.4.1,<1.0.0"]
vllm = ["langchain-openai>=1.1.6", "openai>=1.68.2,<3.0.0"]
weaviate = ["weaviate-client>=4.10.2,<5.0.0", "langchain-weaviate>=0.0.6"]
wikipedia = ["wikipedia==1.4.0", "langchain-community>=0.4.1,<1.0.0"]
wolframalpha = ["wolframalpha==5.1.3", "langchain-community>=0.4.1,<1.0.0"]
xai = ["langchain-openai>=1.1.6", "openai>=1.68.2,<3.0.0", "requests>=2.32.0"]
yahoosearch = ["yfinance==0.2.50"]
youtube = ["pytube==15.0.0", "youtube-transcript-api>=1.0.0,<2.0.0", "google-api-python-client~=2.161"]
zep = ["zep-python==2.0.2"]
all = [
"lfx-bundles[aiml]",
"lfx-bundles[apify]",
"lfx-bundles[assemblyai]",
"lfx-bundles[azure]",
"lfx-bundles[chroma]",
"lfx-bundles[clickhouse]",
"lfx-bundles[cometapi]",
"lfx-bundles[confluence]",
"lfx-bundles[couchbase]",
"lfx-bundles[deepseek]",
"lfx-bundles[exa]",
"lfx-bundles[firecrawl]",
"lfx-bundles[git]",
"lfx-bundles[glean]",
"lfx-bundles[groq]",
"lfx-bundles[icosacomputing]",
"lfx-bundles[litellm]",
"lfx-bundles[lmstudio]",
"lfx-bundles[mem0]",
"lfx-bundles[milvus]",
"lfx-bundles[mistral]",
"lfx-bundles[mongodb]",
"lfx-bundles[needle]",
"lfx-bundles[novita]",
"lfx-bundles[ollama]",
"lfx-bundles[openrouter]",
"lfx-bundles[perplexity]",
"lfx-bundles[pgvector]",
"lfx-bundles[pinecone]",
"lfx-bundles[qdrant]",
"lfx-bundles[sambanova]",
"lfx-bundles[scrapegraph]",
"lfx-bundles[serpapi]",
"lfx-bundles[supabase]",
"lfx-bundles[tavily]",
"lfx-bundles[unstructured]",
"lfx-bundles[upstash]",
"lfx-bundles[vllm]",
"lfx-bundles[weaviate]",
"lfx-bundles[wikipedia]",
"lfx-bundles[wolframalpha]",
"lfx-bundles[xai]",
"lfx-bundles[yahoosearch]",
"lfx-bundles[youtube]",
"lfx-bundles[zep]",
]

[project.urls]
Homepage = "https://github.com/langflow-ai/langflow"
Expand Down
37 changes: 37 additions & 0 deletions src/bundles/lfx-bundles/src/lfx_bundles/aiml/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
from __future__ import annotations

from typing import TYPE_CHECKING, Any

from lfx.components._importing import import_mod

if TYPE_CHECKING:
from lfx_bundles.aiml.aiml import AIMLModelComponent
from lfx_bundles.aiml.aiml_embeddings import AIMLEmbeddingsComponent

_dynamic_imports = {
"AIMLModelComponent": "aiml",
"AIMLEmbeddingsComponent": "aiml_embeddings",
}

__all__ = [
"AIMLEmbeddingsComponent",
"AIMLModelComponent",
]


def __getattr__(attr_name: str) -> Any:
"""Lazily import aiml components on attribute access."""
if attr_name not in _dynamic_imports:
msg = f"module '{__name__}' has no attribute '{attr_name}'"
raise AttributeError(msg)
try:
result = import_mod(attr_name, _dynamic_imports[attr_name], __spec__.parent)
except (ModuleNotFoundError, ImportError, AttributeError) as e:
msg = f"Could not import '{attr_name}' from '{__name__}': {e}"
raise AttributeError(msg) from e
globals()[attr_name] = result
return result


def __dir__() -> list[str]:
return list(__all__)
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
from langchain_openai import ChatOpenAI
from typing_extensions import override

from lfx.base.models.aiml_constants import AimlModels
from lfx.base.models.model import LCModelComponent
from lfx.field_typing import LanguageModel
Expand All @@ -14,6 +12,7 @@
StrInput,
)
from lfx.utils.secrets import secret_value_to_str
from typing_extensions import override


class AIMLModelComponent(LCModelComponent):
Expand Down
5 changes: 5 additions & 0 deletions src/bundles/lfx-bundles/src/lfx_bundles/apify/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from .apify_actor import ApifyActorsComponent

__all__ = [
"ApifyActorsComponent",
]
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
from apify_client import ApifyClient
from langchain_community.document_loaders.apify_dataset import ApifyDatasetLoader
from langchain_core.tools import BaseTool
from pydantic import BaseModel, Field, field_serializer

from lfx.custom.custom_component.component import Component
from lfx.field_typing import Tool
from lfx.inputs.inputs import BoolInput
from lfx.io import MultilineInput, Output, SecretStrInput, StrInput
from lfx.schema.data import Data
from pydantic import BaseModel, Field, field_serializer

MAX_DESCRIPTION_LEN = 250

Expand Down
46 changes: 46 additions & 0 deletions src/bundles/lfx-bundles/src/lfx_bundles/assemblyai/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
from __future__ import annotations

from typing import TYPE_CHECKING, Any

from lfx.components._importing import import_mod

if TYPE_CHECKING:
from .assemblyai_get_subtitles import AssemblyAIGetSubtitles
from .assemblyai_lemur import AssemblyAILeMUR
from .assemblyai_list_transcripts import AssemblyAIListTranscripts
from .assemblyai_poll_transcript import AssemblyAITranscriptionJobPoller
from .assemblyai_start_transcript import AssemblyAITranscriptionJobCreator

_dynamic_imports = {
"AssemblyAIGetSubtitles": "assemblyai_get_subtitles",
"AssemblyAILeMUR": "assemblyai_lemur",
"AssemblyAIListTranscripts": "assemblyai_list_transcripts",
"AssemblyAITranscriptionJobCreator": "assemblyai_start_transcript",
"AssemblyAITranscriptionJobPoller": "assemblyai_poll_transcript",
}

__all__ = [
"AssemblyAIGetSubtitles",
"AssemblyAILeMUR",
"AssemblyAIListTranscripts",
"AssemblyAITranscriptionJobCreator",
"AssemblyAITranscriptionJobPoller",
]


def __getattr__(attr_name: str) -> Any:
"""Lazily import assemblyai components on attribute access."""
if attr_name not in _dynamic_imports:
msg = f"module '{__name__}' has no attribute '{attr_name}'"
raise AttributeError(msg)
try:
result = import_mod(attr_name, _dynamic_imports[attr_name], __spec__.parent)
except (ModuleNotFoundError, ImportError, AttributeError) as e:
msg = f"Could not import '{attr_name}' from '{__name__}': {e}"
raise AttributeError(msg) from e
globals()[attr_name] = result
return result


def __dir__() -> list[str]:
return list(__all__)
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import assemblyai as aai

from lfx.custom.custom_component.component import Component
from lfx.io import DataInput, DropdownInput, IntInput, Output, SecretStrInput
from lfx.log.logger import logger
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import assemblyai as aai

from lfx.custom.custom_component.component import Component
from lfx.io import DataInput, DropdownInput, FloatInput, IntInput, MultilineInput, Output, SecretStrInput
from lfx.log.logger import logger
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import assemblyai as aai

from lfx.custom.custom_component.component import Component
from lfx.io import BoolInput, DropdownInput, IntInput, MessageTextInput, Output, SecretStrInput
from lfx.log.logger import logger
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import assemblyai as aai

from lfx.custom.custom_component.component import Component
from lfx.field_typing.range_spec import RangeSpec
from lfx.io import DataInput, FloatInput, Output, SecretStrInput
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from pathlib import Path

import assemblyai as aai

from lfx.custom.custom_component.component import Component
from lfx.io import BoolInput, DropdownInput, FileInput, MessageTextInput, Output, SecretStrInput
from lfx.log.logger import logger
Expand Down
37 changes: 37 additions & 0 deletions src/bundles/lfx-bundles/src/lfx_bundles/azure/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
from __future__ import annotations

from typing import TYPE_CHECKING, Any

from lfx.components._importing import import_mod

if TYPE_CHECKING:
from .azure_openai import AzureChatOpenAIComponent
from .azure_openai_embeddings import AzureOpenAIEmbeddingsComponent

_dynamic_imports = {
"AzureChatOpenAIComponent": "azure_openai",
"AzureOpenAIEmbeddingsComponent": "azure_openai_embeddings",
}

__all__ = [
"AzureChatOpenAIComponent",
"AzureOpenAIEmbeddingsComponent",
]


def __getattr__(attr_name: str) -> Any:
"""Lazily import azure components on attribute access."""
if attr_name not in _dynamic_imports:
msg = f"module '{__name__}' has no attribute '{attr_name}'"
raise AttributeError(msg)
try:
result = import_mod(attr_name, _dynamic_imports[attr_name], __spec__.parent)
except (ModuleNotFoundError, ImportError, AttributeError) as e:
msg = f"Could not import '{attr_name}' from '{__name__}': {e}"
raise AttributeError(msg) from e
globals()[attr_name] = result
return result


def __dir__() -> list[str]:
return list(__all__)
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from langchain_openai import AzureChatOpenAI

from lfx.base.models.model import LCModelComponent
from lfx.field_typing import LanguageModel
from lfx.field_typing.range_spec import RangeSpec
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from langchain_openai import AzureOpenAIEmbeddings

from lfx.base.models.model import LCModelComponent
from lfx.base.models.openai_constants import OPENAI_EMBEDDING_MODEL_NAMES
from lfx.field_typing import Embeddings
Expand Down
34 changes: 34 additions & 0 deletions src/bundles/lfx-bundles/src/lfx_bundles/chroma/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
from __future__ import annotations

from typing import TYPE_CHECKING, Any

from lfx.components._importing import import_mod

if TYPE_CHECKING:
from .chroma import ChromaVectorStoreComponent

_dynamic_imports = {
"ChromaVectorStoreComponent": "chroma",
}

__all__ = [
"ChromaVectorStoreComponent",
]


def __getattr__(attr_name: str) -> Any:
"""Lazily import Chroma components on attribute access."""
if attr_name not in _dynamic_imports:
msg = f"module '{__name__}' has no attribute '{attr_name}'"
raise AttributeError(msg)
try:
result = import_mod(attr_name, _dynamic_imports[attr_name], __spec__.parent)
except (ModuleNotFoundError, ImportError, AttributeError) as e:
msg = f"Could not import '{attr_name}' from '{__name__}': {e}"
raise AttributeError(msg) from e
globals()[attr_name] = result
return result


def __dir__() -> list[str]:
return list(__all__)
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
from typing import TYPE_CHECKING

from langchain_chroma import Chroma
from typing_extensions import override

from lfx.base.vectorstores.chroma_security import chroma_langchain_collection_kwargs
from lfx.base.vectorstores.model import LCVectorStoreComponent, check_cached_vector_store
from lfx.base.vectorstores.utils import chroma_collection_to_data
from lfx.inputs.inputs import BoolInput, DropdownInput, HandleInput, IntInput, StrInput
from lfx.schema.data import Data
from typing_extensions import override

if TYPE_CHECKING:
from lfx.schema.dataframe import DataFrame
Expand Down
Loading
Loading