sample_id stringlengths 21 196 | text stringlengths 105 936k | metadata dict | category stringclasses 6
values |
|---|---|---|---|
langflow-ai/langflow:src/lfx/src/lfx/base/models/unified_models.py | from __future__ import annotations
import importlib
import os
from functools import lru_cache
from typing import TYPE_CHECKING, Any
from uuid import UUID
if TYPE_CHECKING:
from collections.abc import Callable
import contextlib
import json
from lfx.base.models.anthropic_constants import ANTHROPIC_MODELS_DETAILED... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/lfx/src/lfx/base/models/unified_models.py",
"license": "MIT License",
"lines": 1351,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
langflow-ai/langflow:src/backend/tests/integration/test_projects_integration.py | """Integration tests for project creation logic.
These tests verify the project creation endpoint with minimal mocking,
focusing on real database interactions and business logic.
"""
from unittest.mock import MagicMock, patch
import pytest
from fastapi import status
from httpx import AsyncClient
@pytest.mark.async... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/tests/integration/test_projects_integration.py",
"license": "MIT License",
"lines": 45,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
langflow-ai/langflow:src/backend/tests/unit/api/v1/test_mcp_utils.py | from types import SimpleNamespace
import pytest
from langflow.api.v1 import mcp_utils
class FakeResult:
def __init__(self, rows):
self._rows = rows
def all(self):
return list(self._rows)
class FakeSession:
def __init__(self, flows, user_files):
self._flows = flows
self.... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/tests/unit/api/v1/test_mcp_utils.py",
"license": "MIT License",
"lines": 61,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
langflow-ai/langflow:src/backend/tests/unit/utils/mcp.py | from __future__ import annotations
from contextlib import asynccontextmanager
from langflow.api.v1.mcp_projects import (
project_mcp_servers,
start_project_task_group,
stop_project_task_group,
)
@asynccontextmanager
async def project_session_manager_lifespan():
"""Test helper to ensure project sessi... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/tests/unit/utils/mcp.py",
"license": "MIT License",
"lines": 16,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
langflow-ai/langflow:src/backend/tests/unit/services/test_storage_parse_file_path.py | """Tests for storage service parse_file_path method."""
from unittest.mock import Mock
import pytest
from langflow.services.storage.local import LocalStorageService
from langflow.services.storage.s3 import S3StorageService
class TestLocalStorageParseFilePath:
"""Test LocalStorageService.parse_file_path method."... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/tests/unit/services/test_storage_parse_file_path.py",
"license": "MIT License",
"lines": 334,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
langflow-ai/langflow:src/lfx/tests/unit/base/data/test_docling_utils.py | """Tests for docling_utils module."""
import time
from unittest.mock import MagicMock, patch
import pytest
try:
from docling_core.types.doc import DoclingDocument
DOCLING_AVAILABLE = True
except ImportError:
DOCLING_AVAILABLE = False
# Skip entire module if docling not available
pytest.skip("doc... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/lfx/tests/unit/base/data/test_docling_utils.py",
"license": "MIT License",
"lines": 296,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
langflow-ai/langflow:src/backend/tests/unit/test_api_key_source.py | """Tests for API key validation with different sources (db and env).
This module tests the check_key function behavior when:
- API_KEY_SOURCE='db' (default): Validates against database-stored API keys
- API_KEY_SOURCE='env': Validates against LANGFLOW_API_KEY environment variable
"""
from unittest.mock import AsyncMo... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/tests/unit/test_api_key_source.py",
"license": "MIT License",
"lines": 456,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
langflow-ai/langflow:src/lfx/src/lfx/components/vllm/vllm.py | from typing import Any
from langchain_openai import ChatOpenAI
from pydantic.v1 import SecretStr
from lfx.base.models.model import LCModelComponent
from lfx.field_typing import LanguageModel
from lfx.field_typing.range_spec import RangeSpec
from lfx.inputs.inputs import BoolInput, DictInput, IntInput, SecretStrInput,... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/lfx/src/lfx/components/vllm/vllm.py",
"license": "MIT License",
"lines": 128,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
langflow-ai/langflow:src/lfx/src/lfx/components/vllm/vllm_embeddings.py | from langchain_openai import OpenAIEmbeddings
from lfx.base.embeddings.model import LCEmbeddingsModel
from lfx.field_typing import Embeddings
from lfx.io import BoolInput, DictInput, FloatInput, IntInput, MessageTextInput, SecretStrInput
class VllmEmbeddingsComponent(LCEmbeddingsModel):
display_name = "vLLM Embe... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/lfx/src/lfx/components/vllm/vllm_embeddings.py",
"license": "MIT License",
"lines": 105,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
langflow-ai/langflow:src/backend/tests/unit/components/files_and_knowledge/test_file_component_image_processing.py | """Tests for FileComponent image processing with Docling.
These tests cover scenarios where:
- Images are processed but contain no extractable text (e.g., profile pictures)
- Docling returns empty doc_rows
- Storage path resolution for uploaded files
- Edge cases in error handling
"""
import json
from pathlib import ... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/tests/unit/components/files_and_knowledge/test_file_component_image_processing.py",
"license": "MIT License",
"lines": 545,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"te... | test |
langflow-ai/langflow:src/backend/tests/unit/components/flow_controls/test_loop_freeze.py | """Tests for Loop component behavior when frozen.
This module tests the fix for the issue where frozen Loop components
would run infinitely instead of iterating correctly through their data.
The fix ensures that Loop components always execute their build() method
even when frozen, because they need to iterate through... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/tests/unit/components/flow_controls/test_loop_freeze.py",
"license": "MIT License",
"lines": 374,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
langflow-ai/langflow:src/backend/tests/unit/components/embeddings/test_embeddings_with_models.py | """Tests for EmbeddingsWithModels class."""
from typing import Any
import pytest
from langchain_core.embeddings import Embeddings
from lfx.base.embeddings.embeddings_class import EmbeddingsWithModels
# Test fixture: Create a simple mock embeddings class for testing
class SimpleEmbeddings(Embeddings):
"""Simple ... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/tests/unit/components/embeddings/test_embeddings_with_models.py",
"license": "MIT License",
"lines": 268,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
langflow-ai/langflow:src/backend/tests/unit/components/vectorstores/test_opensearch_multimodal.py | """Tests for OpenSearch Multi-Model Multi-Embedding Vector Store Component."""
from typing import Any
from unittest.mock import MagicMock, patch
import pytest
from langchain_core.embeddings import Embeddings
from lfx.base.embeddings.embeddings_class import EmbeddingsWithModels
from lfx.components.elastic.opensearch_m... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/tests/unit/components/vectorstores/test_opensearch_multimodal.py",
"license": "MIT License",
"lines": 493,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
langflow-ai/langflow:src/lfx/src/lfx/base/embeddings/embeddings_class.py | """Extended embeddings class with available models metadata."""
from langchain_core.embeddings import Embeddings
class EmbeddingsWithModels(Embeddings):
"""Extended Embeddings class that includes available models with dedicated instances.
This class inherits from LangChain Embeddings and provides a mapping ... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/lfx/src/lfx/base/embeddings/embeddings_class.py",
"license": "MIT License",
"lines": 85,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | documentation |
langflow-ai/langflow:src/lfx/src/lfx/components/elastic/opensearch_multimodal.py | from __future__ import annotations
import copy
import json
import time
import uuid
from concurrent.futures import ThreadPoolExecutor, as_completed
from typing import Any
from opensearchpy import OpenSearch, helpers
from opensearchpy.exceptions import OpenSearchException, RequestError
from lfx.base.vectorstores.model... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/lfx/src/lfx/components/elastic/opensearch_multimodal.py",
"license": "MIT License",
"lines": 1744,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
langflow-ai/langflow:src/backend/tests/integration/base/tools/run_flow/test_run_flow_integration.py | from unittest.mock import MagicMock
from uuid import uuid4
import pytest
from langflow.services.database.models.flow.model import FlowCreate
from lfx.components.flow_controls.run_flow import RunFlowComponent
from lfx.components.input_output import ChatInput, ChatOutput, TextInputComponent, TextOutputComponent
from lfx... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/tests/integration/base/tools/run_flow/test_run_flow_integration.py",
"license": "MIT License",
"lines": 418,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
langflow-ai/langflow:src/backend/tests/unit/base/tools/test_run_flow.py | from unittest.mock import AsyncMock, MagicMock, Mock, PropertyMock, patch
from uuid import uuid4
import pytest
from lfx.base.tools.run_flow import RunFlowBaseComponent
from lfx.graph.graph.base import Graph
from lfx.graph.vertex.base import Vertex
from lfx.schema.data import Data
from lfx.schema.dotdict import dotdict... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/tests/unit/base/tools/test_run_flow.py",
"license": "MIT License",
"lines": 587,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
langflow-ai/langflow:src/backend/tests/unit/components/logic/test_run_flow_component.py | from types import SimpleNamespace
from unittest.mock import AsyncMock, MagicMock, patch
from uuid import uuid4
import pytest
from lfx.components.flow_controls.run_flow import RunFlowComponent
from lfx.graph.graph.base import Graph
from lfx.schema.data import Data
from lfx.schema.dotdict import dotdict
from lfx.schema.... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/tests/unit/components/logic/test_run_flow_component.py",
"license": "MIT License",
"lines": 551,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
langflow-ai/langflow:src/backend/tests/unit/helpers/test_flow_helpers.py | from unittest.mock import AsyncMock, MagicMock, patch
from uuid import uuid4
import pytest
from langflow.helpers.flow import (
get_flow_by_id_or_name,
list_flows,
list_flows_by_flow_folder,
list_flows_by_folder_id,
)
from langflow.schema.data import Data
from langflow.services.database.models.flow.mode... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/tests/unit/helpers/test_flow_helpers.py",
"license": "MIT License",
"lines": 180,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
langflow-ai/langflow:src/lfx/tests/unit/helpers/test_flow_helpers.py | from unittest.mock import AsyncMock, MagicMock
from uuid import UUID, uuid4
import pytest
from lfx.graph.graph.base import Graph
from lfx.helpers.flow import (
build_schema_from_inputs,
get_arg_names,
get_flow_by_id_or_name,
get_flow_inputs,
list_flows,
list_flows_by_flow_folder,
list_flows... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/lfx/tests/unit/helpers/test_flow_helpers.py",
"license": "MIT License",
"lines": 192,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
langflow-ai/langflow:src/backend/tests/integration/storage/test_s3_storage_service.py | """Integration tests for S3StorageService using real AWS S3.
These tests use actual AWS credentials and interact with a real S3 bucket.
They are designed to be safe and clean up after themselves.
AWS credentials must be set as environment variables:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_DEFAULT_REGION (op... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/tests/integration/storage/test_s3_storage_service.py",
"license": "MIT License",
"lines": 455,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
langflow-ai/langflow:src/backend/tests/unit/api/test_s3_endpoints.py | """API endpoint tests for S3 storage.
This module tests the file API endpoints (download, upload, delete) work correctly
with S3 storage. These are unit tests that mock the storage layer to focus on
testing API logic:
- Path parsing from database file records
- HTTP response construction (StreamingResponse vs content)... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/tests/unit/api/test_s3_endpoints.py",
"license": "MIT License",
"lines": 200,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
langflow-ai/langflow:src/backend/tests/unit/components/data_source/test_s3_components.py | """S3-specific test class for components that work with S3 storage.
This test class focuses on components that are compatible with S3 storage.
"""
from contextlib import contextmanager
from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from lfx.components.files_and_knowledge.file import FileComponen... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/tests/unit/components/data_source/test_s3_components.py",
"license": "MIT License",
"lines": 367,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
langflow-ai/langflow:src/backend/tests/unit/services/storage/test_local_storage_service.py | """Tests for LocalStorageService."""
from unittest.mock import Mock
import anyio
import pytest
from langflow.services.storage.local import LocalStorageService
@pytest.fixture
def mock_settings_service():
"""Create a mock settings service."""
settings_service = Mock()
settings_service.settings.config_dir... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/tests/unit/services/storage/test_local_storage_service.py",
"license": "MIT License",
"lines": 261,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
langflow-ai/langflow:src/lfx/src/lfx/base/data/storage_utils.py | """Storage-aware file utilities for components.
This module provides utilities that work with both local files and remote files
stored in the storage service.
TODO: Can abstract these into the storage service interface and update
implementations.
"""
from __future__ import annotations
from pathlib import Path
from ... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/lfx/src/lfx/base/data/storage_utils.py",
"license": "MIT License",
"lines": 230,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
langflow-ai/langflow:src/lfx/src/lfx/services/database/service.py | """Database service implementations for lfx package."""
from __future__ import annotations
from contextlib import asynccontextmanager
class NoopDatabaseService:
"""No-operation database service for standalone lfx usage.
This provides a database service interface that always returns NoopSession,
allowin... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/lfx/src/lfx/services/database/service.py",
"license": "MIT License",
"lines": 17,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | documentation |
langflow-ai/langflow:src/lfx/tests/unit/base/data/test_storage_utils.py | """Tests for base/data/storage_utils.py - storage-aware file utilities."""
from unittest.mock import AsyncMock, Mock, patch
import pytest
from lfx.base.data.storage_utils import (
file_exists,
get_file_size,
parse_storage_path,
read_file_bytes,
read_file_text,
)
class TestParseStoragePath:
"... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/lfx/tests/unit/base/data/test_storage_utils.py",
"license": "MIT License",
"lines": 291,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
langflow-ai/langflow:src/lfx/tests/unit/components/langchain_utilities/test_csv_agent.py | import sys
import tempfile
from pathlib import Path
from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from lfx.components.langchain_utilities.csv_agent import CSVAgentComponent
from lfx.schema import Message
class TestCSVAgentComponent:
@pytest.fixture
def component_class(self):
"""... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/lfx/tests/unit/components/langchain_utilities/test_csv_agent.py",
"license": "MIT License",
"lines": 481,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
langflow-ai/langflow:src/lfx/tests/unit/components/langchain_utilities/test_json_agent.py | import sys
import tempfile
from pathlib import Path
from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from lfx.components.langchain_utilities.json_agent import JsonAgentComponent
class TestJsonAgentComponent:
@pytest.fixture
def component_class(self):
"""Return the component class t... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/lfx/tests/unit/components/langchain_utilities/test_json_agent.py",
"license": "MIT License",
"lines": 271,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
langflow-ai/langflow:scripts/generate_migration.py | """Generate Expand-Contract pattern compliant Alembic migrations."""
import hashlib # noqa: F401
import random # noqa: F401
import re # noqa: F401
import subprocess # noqa: F401
from datetime import datetime # noqa: F401
from pathlib import Path # noqa: F401
from typing import Optional # noqa: F401
import clic... | {
"repo_id": "langflow-ai/langflow",
"file_path": "scripts/generate_migration.py",
"license": "MIT License",
"lines": 224,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | documentation |
langflow-ai/langflow:scripts/test_validator.py | """Test script for migration validator."""
import os
import sys
import tempfile
from pathlib import Path
# Add parent directory to path
sys.path.append(str(Path(__file__).parent.parent))
from src.backend.base.langflow.alembic.migration_validator import MigrationValidator
def create_test_migration(content: str, fil... | {
"repo_id": "langflow-ai/langflow",
"file_path": "scripts/test_validator.py",
"license": "MIT License",
"lines": 173,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
langflow-ai/langflow:scripts/test_with_database.py | """Test migrations with actual database."""
import sqlite3
import tempfile
from alembic import command
from alembic.config import Config
def test_real_migration():
"""Test migration with actual SQLite database."""
# Create temporary database
with tempfile.NamedTemporaryFile(suffix=".db") as tmp:
... | {
"repo_id": "langflow-ai/langflow",
"file_path": "scripts/test_with_database.py",
"license": "MIT License",
"lines": 37,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
langflow-ai/langflow:src/backend/base/langflow/alembic/migration_validator.py | """Migration Validator - Enforces Expand-Contract Pattern for Alembic migrations."""
import ast
import json
import re
import sys
from dataclasses import dataclass
from enum import Enum
from pathlib import Path
from typing import Any
class MigrationPhase(Enum):
EXPAND = "EXPAND"
MIGRATE = "MIGRATE"
CONTRA... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/base/langflow/alembic/migration_validator.py",
"license": "MIT License",
"lines": 305,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
langflow-ai/langflow:src/backend/tests/unit/alembic/test_existing_migrations.py | from pathlib import Path
import pytest
from langflow.alembic.migration_validator import MigrationValidator
class TestExistingMigrations:
"""Validate all existing migration files against the guidelines."""
def test_validation_of_test_migrations(self):
"""Verify specific test migrations (001, 002, 003... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/tests/unit/alembic/test_existing_migrations.py",
"license": "MIT License",
"lines": 53,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
langflow-ai/langflow:src/backend/tests/unit/alembic/test_migration_execution.py | import os
import sqlite3
import tempfile
from pathlib import Path
import pytest
from alembic import command
from alembic.config import Config
def test_real_migration_execution():
"""Test migration with actual SQLite database."""
# Create temporary database
with tempfile.NamedTemporaryFile(suffix=".db") a... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/tests/unit/alembic/test_migration_execution.py",
"license": "MIT License",
"lines": 44,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
langflow-ai/langflow:src/backend/tests/unit/alembic/test_migration_guidelines.py | import pytest
import sqlalchemy as sa
from langflow.alembic.migration_validator import MigrationValidator
from sqlalchemy import Column, Integer, MetaData, String, Table, create_engine, text
# Fixture to create temporary migration files
@pytest.fixture
def create_migration_file(tmp_path):
def _create(content):
... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/tests/unit/alembic/test_migration_guidelines.py",
"license": "MIT License",
"lines": 193,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
langflow-ai/langflow:src/backend/tests/unit/alembic/test_migration_validator.py | from pathlib import Path
import pytest
from langflow.alembic.migration_validator import MigrationValidator
@pytest.fixture
def create_test_migration(tmp_path):
def _create(content: str, filename: str) -> Path:
p = tmp_path / filename
p.write_text(content)
return p
return _create
cl... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/tests/unit/alembic/test_migration_validator.py",
"license": "MIT License",
"lines": 135,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
langflow-ai/langflow:scripts/check_deprecated_imports.py | #!/usr/bin/env python3
"""Check for deprecated langchain import patterns in component files.
This script scans all Python files in the lfx/components directory for
deprecated import patterns and reports them. It's designed to be used
as a pre-commit hook to catch import issues early.
Exit codes:
0: No deprecated ... | {
"repo_id": "langflow-ai/langflow",
"file_path": "scripts/check_deprecated_imports.py",
"license": "MIT License",
"lines": 93,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
langflow-ai/langflow:src/lfx/tests/unit/services/settings/test_mcp_composer.py | """Unit tests for MCP Composer Service port management and process killing."""
import asyncio
import contextlib
import socket
from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from lfx.services.mcp_composer.service import MCPComposerPortError, MCPComposerService
@pytest.fixture
def mcp_service():
... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/lfx/tests/unit/services/settings/test_mcp_composer.py",
"license": "MIT License",
"lines": 342,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
langflow-ai/langflow:src/lfx/tests/unit/services/settings/test_mcp_composer_windows.py | """Unit tests for MCP Composer Service Windows-specific functionality."""
# ruff: noqa: SIM115, SIM117
import asyncio
import contextlib
import json
import subprocess
import tempfile
from pathlib import Path
from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from lfx.services.mcp_composer.service imp... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/lfx/tests/unit/services/settings/test_mcp_composer_windows.py",
"license": "MIT License",
"lines": 491,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
langflow-ai/langflow:src/backend/base/langflow/agentic/mcp/__main__.py | """Entry point for running the Langflow Agentic MCP server.
This allows running the server with:
python -m langflow.agentic.mcp
"""
from langflow.agentic.mcp.server import mcp
if __name__ == "__main__":
mcp.run()
| {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/base/langflow/agentic/mcp/__main__.py",
"license": "MIT License",
"lines": 7,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | documentation |
langflow-ai/langflow:src/backend/base/langflow/agentic/mcp/server.py | """FastMCP server for Langflow Agentic tools.
This module exposes template search and creation functions as MCP tools using FastMCP decorators.
"""
from typing import Any
from uuid import UUID
from mcp.server.fastmcp import FastMCP
from langflow.agentic.mcp.support import replace_none_and_null_with_empty_str
from l... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/base/langflow/agentic/mcp/server.py",
"license": "MIT License",
"lines": 494,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | documentation |
langflow-ai/langflow:src/backend/base/langflow/agentic/mcp/support.py | import math
from lfx.log.logger import logger
def replace_none_and_null_with_empty_str(data: list[dict], required_fields: list[str] | None = None) -> list[dict]:
"""Replaces all None, 'null' (case-insensitive), and NaN/NaT float values with empty strings in a list of dicts.
Args:
data: List of dicti... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/base/langflow/agentic/mcp/support.py",
"license": "MIT License",
"lines": 42,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
langflow-ai/langflow:src/backend/base/langflow/agentic/utils/component_search.py | """Component search and metadata utilities for Langflow."""
from typing import Any
from lfx.interface.components import get_and_cache_all_types_dict
from lfx.log.logger import logger
from lfx.services.settings.service import SettingsService
async def list_all_components(
query: str | None = None,
component_... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/base/langflow/agentic/utils/component_search.py",
"license": "MIT License",
"lines": 219,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
langflow-ai/langflow:src/backend/base/langflow/agentic/utils/flow_component.py | """Flow component operations utilities for Langflow."""
from typing import Any
from uuid import UUID
from lfx.graph.graph.base import Graph
from lfx.log.logger import logger
from langflow.helpers.flow import get_flow_by_id_or_endpoint_name
from langflow.services.database.models.flow.model import Flow
from langflow.s... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/base/langflow/agentic/utils/flow_component.py",
"license": "MIT License",
"lines": 311,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
langflow-ai/langflow:src/backend/base/langflow/agentic/utils/flow_graph.py | """Flow graph visualization utilities for Langflow."""
from typing import TYPE_CHECKING, Any
from uuid import UUID
from lfx.graph.graph.ascii import draw_graph
from lfx.graph.graph.base import Graph
from lfx.log.logger import logger
from langflow.helpers.flow import get_flow_by_id_or_endpoint_name
if TYPE_CHECKING:... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/base/langflow/agentic/utils/flow_graph.py",
"license": "MIT License",
"lines": 164,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
langflow-ai/langflow:src/backend/base/langflow/agentic/utils/template_create.py | """Utilities to create flows from starter templates.
This module provides a helper to create a new Flow from a starter template
JSON (looked up by template id) and returns a link to open it in the UI.
"""
from __future__ import annotations
from typing import TYPE_CHECKING, Any
from fastapi import HTTPException
fro... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/base/langflow/agentic/utils/template_create.py",
"license": "MIT License",
"lines": 70,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
langflow-ai/langflow:src/backend/base/langflow/agentic/utils/template_search.py | """Template search and loading utilities for Langflow."""
import json
from pathlib import Path
from typing import Any
import orjson
from lfx.log.logger import logger
def list_templates(
query: str | None = None,
fields: list[str] | None = None,
tags: list[str] | None = None,
starter_projects_path: s... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/base/langflow/agentic/utils/template_search.py",
"license": "MIT License",
"lines": 151,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
langflow-ai/langflow:src/backend/base/langflow/api/utils/mcp/agentic_mcp.py | """Utilities for auto-configuring the Langflow Agentic MCP server."""
import sys
from uuid import UUID
from fastapi import HTTPException
from lfx.log.logger import logger
from lfx.services.deps import get_settings_service
from sqlalchemy import exc as sqlalchemy_exc
from sqlmodel import select
from sqlmodel.ext.async... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/base/langflow/api/utils/mcp/agentic_mcp.py",
"license": "MIT License",
"lines": 301,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
langflow-ai/langflow:src/backend/tests/unit/agentic/utils/test_template_search.py | """Unit tests for template_search module using real templates."""
import tempfile
import pytest
from langflow.agentic.utils import (
get_all_tags,
get_template_by_id,
get_templates_count,
list_templates,
)
class TestListTemplates:
"""Test cases for list_templates function using real templates.""... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/tests/unit/agentic/utils/test_template_search.py",
"license": "MIT License",
"lines": 419,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
langflow-ai/langflow:src/backend/tests/unit/components/bundles/composio/test_composio_components.py | """Unit tests for Composio components cloud validation."""
import os
from unittest.mock import patch
import pytest
from lfx.base.composio.composio_base import ComposioBaseComponent
from lfx.components.composio.composio_api import ComposioAPIComponent
@pytest.mark.unit
class TestComposioCloudValidation:
"""Test ... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/tests/unit/components/bundles/composio/test_composio_components.py",
"license": "MIT License",
"lines": 26,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
langflow-ai/langflow:src/backend/tests/unit/components/bundles/mem0/test_mem0_component.py | """Unit tests for Mem0MemoryComponent cloud validation."""
import os
from unittest.mock import patch
import pytest
from lfx.components.mem0.mem0_chat_memory import Mem0MemoryComponent
@pytest.mark.unit
class TestMem0CloudValidation:
"""Test Mem0 component cloud validation."""
def test_build_mem0_disabled_i... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/tests/unit/components/bundles/mem0/test_mem0_component.py",
"license": "MIT License",
"lines": 23,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
langflow-ai/langflow:src/backend/tests/unit/components/bundles/twelvelabs/test_twelvelabs_components.py | """Unit tests for TwelveLabs components cloud validation."""
import os
from unittest.mock import patch
import pytest
from lfx.components.twelvelabs.split_video import SplitVideoComponent
from lfx.components.twelvelabs.video_file import VideoFileComponent
@pytest.mark.unit
class TestTwelveLabsCloudValidation:
""... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/tests/unit/components/bundles/twelvelabs/test_twelvelabs_components.py",
"license": "MIT License",
"lines": 25,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
... | test |
langflow-ai/langflow:src/lfx/src/lfx/utils/validate_cloud.py | """Cloud environment validation utilities.
This module contains validation functions for cloud-specific constraints,
such as disabling certain features when running in Astra cloud environment.
"""
import os
from typing import Any
def is_astra_cloud_environment() -> bool:
"""Check if we're running in an Astra cl... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/lfx/src/lfx/utils/validate_cloud.py",
"license": "MIT License",
"lines": 79,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | documentation |
langflow-ai/langflow:src/lfx/tests/unit/utils/test_validate_cloud.py | """Unit tests for the validate_cloud module."""
import os
from unittest.mock import patch
import pytest
from lfx.utils.validate_cloud import raise_error_if_astra_cloud_disable_component
class TestRaiseErrorIfAstraCloudDisableComponent:
"""Test suite for the raise_error_if_astra_cloud_disable_component function.... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/lfx/tests/unit/utils/test_validate_cloud.py",
"license": "MIT License",
"lines": 97,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
langflow-ai/langflow:src/backend/tests/unit/services/database/test_poolclass.py | """Tests that demonstrate the exact bug fix for PR #10232.
These tests show:
1. What FAILS with the OLD (buggy) code
2. What PASSES with the NEW (fixed) code
Issue: https://github.com/langflow-ai/langflow/issues/10231
PR: https://github.com/langflow-ai/langflow/pull/10232
Run these tests to verify:
- The bug exists ... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/tests/unit/services/database/test_poolclass.py",
"license": "MIT License",
"lines": 121,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
langflow-ai/langflow:src/backend/tests/integration/test_telemetry_splitting_integration.py | """Integration tests for telemetry service splitting."""
from unittest.mock import MagicMock
import pytest
from langflow.services.telemetry.schema import ComponentInputsPayload
from langflow.services.telemetry.service import TelemetryService
@pytest.mark.asyncio
async def test_service_splits_large_payload(mock_sett... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/tests/integration/test_telemetry_splitting_integration.py",
"license": "MIT License",
"lines": 60,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
langflow-ai/langflow:src/backend/tests/unit/services/telemetry/test_component_inputs_splitting.py | """Tests for ComponentInputsPayload splitting logic."""
from hypothesis import given
from hypothesis import strategies as st
from langflow.services.telemetry.schema import MAX_TELEMETRY_URL_SIZE, ComponentInputsPayload
def test_chunk_fields_exist():
"""Test that chunk_index and total_chunks fields exist on paylo... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/tests/unit/services/telemetry/test_component_inputs_splitting.py",
"license": "MIT License",
"lines": 367,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
langflow-ai/langflow:src/backend/base/langflow/tests/services/database/models/transactions/test_model.py | import uuid
from datetime import datetime, timezone
import pytest
from langflow.services.database.models.transactions.model import TransactionBase
def test_serialize_inputs_excludes_code_key():
"""Test that the code key is excluded from inputs when serializing."""
# Create a TransactionBase object with input... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/base/langflow/tests/services/database/models/transactions/test_model.py",
"license": "MIT License",
"lines": 97,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""... | test |
langflow-ai/langflow:src/backend/tests/unit/groq/test_groq_constants.py | """Tests for Groq constants and fallback models.
Tests cover:
- Fallback model structure and integrity
- Model categorization (production, preview, deprecated, unsupported)
- Backward compatibility constants
- Model metadata completeness
"""
class TestGroqConstantsStructure:
"""Test the structure and integrity o... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/tests/unit/groq/test_groq_constants.py",
"license": "MIT License",
"lines": 299,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
langflow-ai/langflow:src/backend/tests/unit/groq/test_groq_integration.py | """Integration tests for Groq component with dynamic model discovery.
Tests cover:
- Success paths: get_models with/without API key, tool_model_enabled filtering
- Error paths: invalid API key, discovery failures, missing dependencies
- Edge cases: empty results, build config updates
"""
from unittest.mock import pat... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/tests/unit/groq/test_groq_integration.py",
"license": "MIT License",
"lines": 329,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
langflow-ai/langflow:src/backend/tests/unit/groq/test_groq_model_discovery.py | """Comprehensive tests for Groq model discovery system.
Tests cover:
- Success paths: API fetching, caching, tool calling detection
- Error paths: API failures, network errors, invalid responses
- Edge cases: expired cache, corrupted cache, missing API key
"""
import json
from unittest.mock import MagicMock, Mock, pa... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/tests/unit/groq/test_groq_model_discovery.py",
"license": "MIT License",
"lines": 416,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
langflow-ai/langflow:src/lfx/src/lfx/base/models/groq_model_discovery.py | """Dynamic Groq model discovery and tool calling detection.
This module fetches available models directly from the Groq API
and tests their tool calling capabilities programmatically,
eliminating the need for manual metadata updates.
"""
import json
from datetime import datetime, timedelta, timezone
from pathlib impo... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/lfx/src/lfx/base/models/groq_model_discovery.py",
"license": "MIT License",
"lines": 215,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
langflow-ai/langflow:src/backend/tests/unit/components/models_and_agents/test_altk_agent_logic.py | """Comprehensive unit tests for ALTK Agent logic without requiring API keys.
This test suite focuses on testing the actual orchestration logic, tool wrapping,
and pipeline execution order without requiring external API dependencies.
"""
from unittest.mock import MagicMock
from uuid import uuid4
import pytest
from la... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/tests/unit/components/models_and_agents/test_altk_agent_logic.py",
"license": "MIT License",
"lines": 1283,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
langflow-ai/langflow:src/backend/tests/unit/components/models_and_agents/test_altk_agent_tool_conversion.py | from langchain_core.tools import BaseTool
from lfx.base.agents.altk_tool_wrappers import PreToolValidationWrapper
from lfx.log.logger import logger
from pydantic import BaseModel, Field
class CustomSchemaExceptionError(Exception):
"""Custom exception for schema errors."""
class MockBasicTool(BaseTool):
name... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/tests/unit/components/models_and_agents/test_altk_agent_tool_conversion.py",
"license": "MIT License",
"lines": 186,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template"... | test |
langflow-ai/langflow:src/backend/tests/unit/components/models_and_agents/test_conversation_context_ordering.py | """Unit tests for conversation context ordering in agent components.
This test ensures that conversation context maintains proper chronological order
(oldest → newest → current input) rather than reverse ordering which breaks
SPARC tool validation and conversation flow understanding.
"""
from langchain_core.messages ... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/tests/unit/components/models_and_agents/test_conversation_context_ordering.py",
"license": "MIT License",
"lines": 106,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"templa... | test |
langflow-ai/langflow:src/lfx/src/lfx/base/agents/altk_base_agent.py | """Reusable base classes for ALTK agent components and tool wrappers.
This module abstracts common orchestration so concrete components can focus
on user-facing configuration and small customizations.
"""
from __future__ import annotations
import uuid
from abc import ABC, abstractmethod
from typing import TYPE_CHECK... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/lfx/src/lfx/base/agents/altk_base_agent.py",
"license": "MIT License",
"lines": 327,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
langflow-ai/langflow:src/lfx/src/lfx/base/agents/altk_tool_wrappers.py | import ast
import json
import uuid
from typing import Any
from altk.core.toolkit import AgentPhase, ComponentConfig
from altk.post_tool.code_generation.code_generation import (
CodeGenerationComponent,
CodeGenerationComponentConfig,
)
from altk.post_tool.core.toolkit import CodeGenerationRunInput
from altk.pre... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/lfx/src/lfx/base/agents/altk_tool_wrappers.py",
"license": "MIT License",
"lines": 474,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
langflow-ai/langflow:src/lfx/src/lfx/components/composio/apollo_composio.py | from lfx.base.composio.composio_base import ComposioBaseComponent
class ComposioApolloAPIComponent(ComposioBaseComponent):
display_name: str = "Apollo"
icon = "Apollo"
documentation: str = "https://docs.composio.dev"
app_name = "apollo"
def set_default_tools(self):
"""Set the default tool... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/lfx/src/lfx/components/composio/apollo_composio.py",
"license": "MIT License",
"lines": 8,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
langflow-ai/langflow:src/lfx/src/lfx/components/composio/bitbucket_composio.py | from lfx.base.composio.composio_base import ComposioBaseComponent
class ComposioBitbucketAPIComponent(ComposioBaseComponent):
display_name: str = "Bitbucket"
icon = "Bitbucket"
documentation: str = "https://docs.composio.dev"
app_name = "bitbucket"
def set_default_tools(self):
"""Set the ... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/lfx/src/lfx/components/composio/bitbucket_composio.py",
"license": "MIT License",
"lines": 8,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
langflow-ai/langflow:src/lfx/src/lfx/components/composio/canva_composio.py | from lfx.base.composio.composio_base import ComposioBaseComponent
class ComposioCanvaAPIComponent(ComposioBaseComponent):
display_name: str = "Canva"
icon = "Canva"
documentation: str = "https://docs.composio.dev"
app_name = "canva"
def set_default_tools(self):
"""Set the default tools fo... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/lfx/src/lfx/components/composio/canva_composio.py",
"license": "MIT License",
"lines": 8,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
langflow-ai/langflow:src/lfx/src/lfx/components/composio/coda_composio.py | from lfx.base.composio.composio_base import ComposioBaseComponent
class ComposioCodaAPIComponent(ComposioBaseComponent):
display_name: str = "Coda"
icon = "Coda"
documentation: str = "https://docs.composio.dev"
app_name = "coda"
def set_default_tools(self):
"""Set the default tools for Co... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/lfx/src/lfx/components/composio/coda_composio.py",
"license": "MIT License",
"lines": 8,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
langflow-ai/langflow:src/lfx/src/lfx/components/composio/elevenlabs_composio.py | from lfx.base.composio.composio_base import ComposioBaseComponent
class ComposioElevenLabsAPIComponent(ComposioBaseComponent):
display_name: str = "ElevenLabs"
icon = "Elevenlabs"
documentation: str = "https://docs.composio.dev"
app_name = "elevenlabs"
def set_default_tools(self):
"""Set ... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/lfx/src/lfx/components/composio/elevenlabs_composio.py",
"license": "MIT License",
"lines": 8,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
langflow-ai/langflow:src/lfx/src/lfx/components/composio/exa_composio.py | from lfx.base.composio.composio_base import ComposioBaseComponent
class ComposioExaAPIComponent(ComposioBaseComponent):
display_name: str = "Exa"
icon = "ExaComposio"
documentation: str = "https://docs.composio.dev"
app_name = "exa"
def set_default_tools(self):
"""Set the default tools fo... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/lfx/src/lfx/components/composio/exa_composio.py",
"license": "MIT License",
"lines": 8,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
langflow-ai/langflow:src/lfx/src/lfx/components/composio/firecrawl_composio.py | from lfx.base.composio.composio_base import ComposioBaseComponent
class ComposioFirecrawlAPIComponent(ComposioBaseComponent):
display_name: str = "Firecrawl"
icon = "Firecrawl"
documentation: str = "https://docs.composio.dev"
app_name = "firecrawl"
def set_default_tools(self):
"""Set the ... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/lfx/src/lfx/components/composio/firecrawl_composio.py",
"license": "MIT License",
"lines": 8,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
langflow-ai/langflow:src/lfx/src/lfx/components/composio/fireflies_composio.py | from lfx.base.composio.composio_base import ComposioBaseComponent
class ComposioFirefliesAPIComponent(ComposioBaseComponent):
display_name: str = "Fireflies"
icon = "Fireflies"
documentation: str = "https://docs.composio.dev"
app_name = "fireflies"
def set_default_tools(self):
"""Set the ... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/lfx/src/lfx/components/composio/fireflies_composio.py",
"license": "MIT License",
"lines": 8,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
langflow-ai/langflow:src/lfx/src/lfx/components/composio/googlebigquery_composio.py | from lfx.base.composio.composio_base import ComposioBaseComponent
class ComposioGoogleBigQueryAPIComponent(ComposioBaseComponent):
display_name: str = "GoogleBigQuery"
icon = "Googlebigquery"
documentation: str = "https://docs.composio.dev"
app_name = "googlebigquery"
def set_default_tools(self):... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/lfx/src/lfx/components/composio/googlebigquery_composio.py",
"license": "MIT License",
"lines": 8,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
langflow-ai/langflow:src/lfx/src/lfx/components/composio/heygen_composio.py | from lfx.base.composio.composio_base import ComposioBaseComponent
class ComposioHeygenAPIComponent(ComposioBaseComponent):
display_name: str = "Heygen"
icon = "Heygen"
documentation: str = "https://docs.composio.dev"
app_name = "heygen"
def set_default_tools(self):
"""Set the default tool... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/lfx/src/lfx/components/composio/heygen_composio.py",
"license": "MIT License",
"lines": 8,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
langflow-ai/langflow:src/lfx/src/lfx/components/composio/mem0_composio.py | from lfx.base.composio.composio_base import ComposioBaseComponent
class ComposioMem0APIComponent(ComposioBaseComponent):
display_name: str = "Mem0"
icon = "Mem0Composio"
documentation: str = "https://docs.composio.dev"
app_name = "mem0"
def set_default_tools(self):
"""Set the default tool... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/lfx/src/lfx/components/composio/mem0_composio.py",
"license": "MIT License",
"lines": 8,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
langflow-ai/langflow:src/lfx/src/lfx/components/composio/peopledatalabs_composio.py | from lfx.base.composio.composio_base import ComposioBaseComponent
class ComposioPeopleDataLabsAPIComponent(ComposioBaseComponent):
display_name: str = "PeopleDataLabs"
icon = "Peopledatalabs"
documentation: str = "https://docs.composio.dev"
app_name = "peopledatalabs"
def set_default_tools(self):... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/lfx/src/lfx/components/composio/peopledatalabs_composio.py",
"license": "MIT License",
"lines": 8,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
langflow-ai/langflow:src/lfx/src/lfx/components/composio/perplexityai_composio.py | from lfx.base.composio.composio_base import ComposioBaseComponent
class ComposioPerplexityAIAPIComponent(ComposioBaseComponent):
display_name: str = "PerplexityAI"
icon = "PerplexityComposio"
documentation: str = "https://docs.composio.dev"
app_name = "perplexityai"
def set_default_tools(self):
... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/lfx/src/lfx/components/composio/perplexityai_composio.py",
"license": "MIT License",
"lines": 8,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
langflow-ai/langflow:src/lfx/src/lfx/components/composio/serpapi_composio.py | from lfx.base.composio.composio_base import ComposioBaseComponent
class ComposioSerpAPIComponent(ComposioBaseComponent):
display_name: str = "SerpAPI"
icon = "SerpSearchComposio"
documentation: str = "https://docs.composio.dev"
app_name = "serpapi"
def set_default_tools(self):
"""Set the ... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/lfx/src/lfx/components/composio/serpapi_composio.py",
"license": "MIT License",
"lines": 8,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
langflow-ai/langflow:src/lfx/src/lfx/components/composio/snowflake_composio.py | from lfx.base.composio.composio_base import ComposioBaseComponent
class ComposioSnowflakeAPIComponent(ComposioBaseComponent):
display_name: str = "Snowflake"
icon = "Snowflake"
documentation: str = "https://docs.composio.dev"
app_name = "snowflake"
def set_default_tools(self):
"""Set the ... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/lfx/src/lfx/components/composio/snowflake_composio.py",
"license": "MIT License",
"lines": 8,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
langflow-ai/langflow:src/lfx/src/lfx/components/composio/tavily_composio.py | from lfx.base.composio.composio_base import ComposioBaseComponent
class ComposioTavilyAPIComponent(ComposioBaseComponent):
display_name: str = "Tavily"
icon = "Tavily"
documentation: str = "https://docs.composio.dev"
app_name = "tavily"
def set_default_tools(self):
"""Set the default tool... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/lfx/src/lfx/components/composio/tavily_composio.py",
"license": "MIT License",
"lines": 8,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
langflow-ai/langflow:src/backend/tests/unit/api/v1/test_monitor_auth.py | """Security tests for monitor endpoints requiring authentication."""
import pytest
from fastapi import status
from httpx import AsyncClient
async def test_get_messages_requires_auth(client: AsyncClient):
"""Test that GET /monitor/messages requires authentication."""
response = await client.get("api/v1/monito... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/tests/unit/api/v1/test_monitor_auth.py",
"license": "MIT License",
"lines": 64,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
langflow-ai/langflow:src/backend/base/langflow/utils/registered_email_util.py | from lfx.log.logger import logger
from langflow.api.v2.registration import load_registration
from langflow.services.telemetry.schema import EmailPayload
class _RegisteredEmailCache:
"""An in-memory cache for the registered email address."""
# Static variable
_email_model: EmailPayload | None = None
... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/base/langflow/utils/registered_email_util.py",
"license": "MIT License",
"lines": 75,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
langflow-ai/langflow:src/backend/tests/unit/utils/test_registered_email_util.py | from unittest.mock import patch
import pytest
from langflow.services.telemetry.schema import EmailPayload
from langflow.utils.registered_email_util import _RegisteredEmailCache, get_email_model
@pytest.fixture(autouse=True)
def reset_cache():
"""Fixture to reset the registered email cache before each test."""
... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/tests/unit/utils/test_registered_email_util.py",
"license": "MIT License",
"lines": 78,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
langflow-ai/langflow:src/lfx/src/lfx/utils/ssrf_protection.py | """SSRF (Server-Side Request Forgery) protection utilities.
This module provides validation to prevent SSRF attacks by blocking requests to:
- Private IP ranges (RFC 1918)
- Loopback addresses
- Cloud metadata endpoints (169.254.169.254)
- Other internal/special-use addresses
IMPORTANT: HTTP Redirects
According t... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/lfx/src/lfx/utils/ssrf_protection.py",
"license": "MIT License",
"lines": 307,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
langflow-ai/langflow:src/lfx/tests/unit/utils/test_ssrf_protection.py | """Unit tests for SSRF protection utilities."""
from contextlib import contextmanager
from unittest.mock import MagicMock, patch
import pytest
from lfx.utils.ssrf_protection import (
SSRFProtectionError,
get_allowed_hosts,
is_host_allowed,
is_ip_blocked,
is_ssrf_protection_enabled,
resolve_hos... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/lfx/tests/unit/utils/test_ssrf_protection.py",
"license": "MIT License",
"lines": 372,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
langflow-ai/langflow:src/backend/base/langflow/api/v2/registration.py | import json
from asyncio import to_thread
from datetime import datetime, timezone
from pathlib import Path
from fastapi import APIRouter, Depends, HTTPException
from pydantic import BaseModel, EmailStr
from langflow.logging import logger
from langflow.services.auth.utils import get_current_active_user
from langflow.s... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/base/langflow/api/v2/registration.py",
"license": "MIT License",
"lines": 110,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
langflow-ai/langflow:src/backend/tests/unit/api/v2/test_registration.py | import json
from unittest.mock import MagicMock, mock_open, patch
import pytest
from fastapi.testclient import TestClient
from httpx import AsyncClient
from langflow.api.v2.registration import (
RegisterRequest,
RegisterResponse,
_ensure_registration_file,
load_registration,
router,
save_regist... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/tests/unit/api/v2/test_registration.py",
"license": "MIT License",
"lines": 273,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
langflow-ai/langflow:src/backend/tests/integration/components/languagemodels/test_chatollama_integration.py | from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from lfx.components.ollama.ollama import ChatOllamaComponent
from lfx.schema.data import Data
from lfx.schema.dataframe import DataFrame
from lfx.schema.message import Message
@pytest.mark.integration
class TestChatOllamaIntegration:
"""Integrat... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/tests/integration/components/languagemodels/test_chatollama_integration.py",
"license": "MIT License",
"lines": 145,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template"... | test |
langflow-ai/langflow:src/lfx/src/lfx/base/models/watsonx_constants.py | from .model_metadata import create_model_metadata
WATSONX_DEFAULT_LLM_MODELS = [
create_model_metadata(
provider="IBM WatsonX",
name="ibm/granite-3-2b-instruct",
icon="IBM",
model_type="llm",
tool_calling=True,
default=True,
),
create_model_metadata(
... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/lfx/src/lfx/base/models/watsonx_constants.py",
"license": "MIT License",
"lines": 73,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
langflow-ai/langflow:src/backend/tests/unit/base/mcp/test_mcp_ssl.py | """Unit tests for MCP SSL/TLS functionality.
This test suite validates SSL certificate verification functionality for MCP clients including:
- SSL verification enabled (default secure behavior)
- SSL verification disabled (for self-signed certificates)
- SSL connection error handling
- Integration with both Streamable... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/tests/unit/base/mcp/test_mcp_ssl.py",
"license": "MIT License",
"lines": 311,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
langflow-ai/langflow:src/backend/tests/unit/base/datastax/test_astradb_base_component.py | from collections import defaultdict
from unittest.mock import AsyncMock, Mock, patch
import pytest
# Assuming the component is imported from the module
# Adjust the import path as needed
from lfx.base.datastax import AstraDBBaseComponent
@pytest.fixture
def mock_component():
"""Create a mock AstraDBBaseComponen... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/tests/unit/base/datastax/test_astradb_base_component.py",
"license": "MIT License",
"lines": 410,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
langflow-ai/langflow:src/lfx/src/lfx/components/datastax/astradb_chatmemory.py | from lfx.base.datastax.astradb_base import AstraDBBaseComponent
from lfx.base.memory.model import LCChatMemoryComponent
from lfx.field_typing.constants import Memory
from lfx.inputs.inputs import MessageTextInput
class AstraDBChatMemory(AstraDBBaseComponent, LCChatMemoryComponent):
display_name = "Astra DB Chat M... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/lfx/src/lfx/components/datastax/astradb_chatmemory.py",
"license": "MIT License",
"lines": 35,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
langflow-ai/langflow:src/backend/tests/unit/test_settings_initialization_order.py | """Unit tests for settings initialization order.
These tests specifically verify that:
1. The check for pre-initialized settings works correctly
2. .env files can be loaded before settings initialization
3. The error message is helpful when settings are already initialized
4. CLI --env-file flag works with real subpro... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/tests/unit/test_settings_initialization_order.py",
"license": "MIT License",
"lines": 260,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
langflow-ai/langflow:src/backend/tests/unit/graph/test_execution_path_equivalence.py | """Test suite for validating execution path equivalence between async_start and arun.
This module tests that both execution paths (async_start/astep and arun/process) produce
identical results, run the same components in compatible orders, and handle loops correctly.
"""
from __future__ import annotations
from datac... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/tests/unit/graph/test_execution_path_equivalence.py",
"license": "MIT License",
"lines": 534,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
langflow-ai/langflow:src/backend/tests/unit/graph/test_execution_path_validation.py | """Execution path validation using test data flows.
This test validates that both execution paths produce identical results
using the test flows in src/backend/tests/data/ which don't require API keys.
"""
from __future__ import annotations
import json
import shutil
from copy import deepcopy
from pathlib import Path... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/tests/unit/graph/test_execution_path_validation.py",
"license": "MIT License",
"lines": 151,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
langflow-ai/langflow:src/backend/base/langflow/alembic/versions/182e5471b900_add_context_message.py | """add context_id to message table
Revision ID: 182e5471b900
Revises: d37bc4322900
Create Date: 2025-10-08 11:30:12.912190
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = '182e5471b900'
down_revision: Union[str, None] = ... | {
"repo_id": "langflow-ai/langflow",
"file_path": "src/backend/base/langflow/alembic/versions/182e5471b900_add_context_message.py",
"license": "MIT License",
"lines": 29,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.