* refactor: Add utility functions for getting handle IDs in CustomNodes - Added `getRightHandleId` function to generate the right handle ID for source handles. - Added `getLeftHandleId` function to generate the left handle ID for target handles. - These functions improve code readability and maintainability by encapsulating the logic for generating handle IDs. * refactor: Add type for escaped handle IDs in edges to improve type safety in reactflowUtils * feat: Add function to escape handle IDs in edges, enhancing edge management in reactflowUtils * feat: Add function to check edges without escaped handle IDs, improving edge validation in reactflowUtils * feat: Enhance edge processing in reactflowUtils to handle edges without escaped handle IDs more effectively * feat: Add layoutUtils module for handling node layout using elkjs * feat: update processDataFromFlow to add layout to nodes if needed * Refactor import paths to use 'initialize' module in 'base.py' * feat: Add method to set class source code and integrate it with frontend node input field * refactor: Update sourceHandle dataType to use custom component class name * fix: Raise error for unknown vertex types instead of returning default Vertex class * refactor: Remove redundant call to _import_vertex_types() in VertexTypesDict initialization * refactor: Simplify add_code_field by removing unnecessary field_config parameter from function signature * feat: Add elkjs dependency to package.json and package-lock.json for enhanced functionality in the frontend * refactor: Update fields type in Template class to use InputTypes for improved type safety * refactor: Reorganize imports in __init__.py for better structure and consistency across the inputs module * refactor: Clean up imports in types.py for better organization and consistency in the graph vertex module * refactor: Change vertex type annotations to strings for better compatibility and consistency in the graph module methods * refactor: Update component instantiation to include _code parameter and fix input type annotations for improved type handling * refactor: Remove unused CustomComponent import from __init__.py for cleaner module structure and improved organization * refactor: Modify custom_component instantiation to include _code argument for enhanced functionality and clarity in CodeParser class * refactor: Update CustomComponent import in __init__.py for improved module structure and organization * refactor: Update launch.json to include correct path for backend source files * refactor: Update dependencies in poetry.lock to latest versions and resolve merge conflicts in backend files * refactor: Update dataType assignment in Component class to use component name if available, or fallback to class name * refactor: Correct flow_id reference in MemoryComponent to improve clarity and consistency in memory handling * refactor: Update import path for DefaultPromptField to improve code organization and maintainability in api_utils.py * refactor: Add loading module to __init__.py for improved organization of interface package * refactor: Clean up imports in base.py and enforce edge validation in Graph class for improved maintainability and error handling * refactor: Remove edge component additions in test_base.py to streamline graph tests and emphasize error handling for unprepared graphs * refactor: Mark @clack/prompts is-unicode-supported as extraneous in package-lock.json for better dependency management * refactor: Update dataType assignment in Component class to use component name if available, or fallback to class name * refactor: Fix edge existence check in Graph class to use correct variable, ensuring accurate validation of graph structure * refactor: Add test for graph with edge and improve graph preparation logic * refactor: Set default node type to "genericNode" in getLayoutedNodes for consistent layout structure * create consts for node widht and height * refactor: Catch and log errors when processing flow data in flowsManagerStore and reactflowUtils * [autofix.ci] apply automated fixes * fix: Validate custom components for source and target vertices in Graph edges * test: Add fixture for client and raise TypeError for invalid class parsing in CodeParser tests * test: Add unit test for listing flows as Flow objects in custom component with client * test: Update assertions for memory chatbot component types in unit tests * test: Refactor assertions to use updated component names in vector store RAG unit tests * fix: Change error handling to return default Vertex for unknown node types in graph class * [autofix.ci] apply automated fixes * test: Add pytest fixture for CustomComponent in unit tests to enhance test structure and readability * chore: Update component names in vector store RAG unit tests * test: Refactor imports and make flow name generation unique in database unit tests * chore: Remove unused upload and flow management functions from flowsManagerStore for cleaner codebase * chore: Await processDataFromFlow in useAddFlow hook * chore: Correct NODE_HEIGHT calculation to use NODE_WIDTH constant for consistency in constants file * chore: Remove extraneous flag for is-unicode-supported in package-lock.json for cleaner dependency management --------- Co-authored-by: anovazzi1 <otavio2204@gmail.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> |
||
|---|---|---|
| .devcontainer | ||
| .github | ||
| .vscode | ||
| deploy | ||
| docker | ||
| docker_example | ||
| docs | ||
| scripts | ||
| src | ||
| .env.example | ||
| .eslintrc.json | ||
| .gitattributes | ||
| .gitignore | ||
| .pre-commit-config.yaml | ||
| CODE_OF_CONDUCT.md | ||
| CONTRIBUTING.md | ||
| eslint.config.js | ||
| LICENSE | ||
| Makefile | ||
| poetry.lock | ||
| pyproject.toml | ||
| README.ja.md | ||
| README.KR.md | ||
| README.md | ||
| README.PT.md | ||
| README.zh_CN.md | ||
| render.yaml | ||
Langflow 1.0 is OUT! 🎉
Read all about it here!
A visual framework for building multi-agent and RAG applications
Open-source, Python-powered, fully customizable, LLM and vector store agnostic
Docs - Join our Discord - Follow us on X - Live demo
📝 Content
- 📝 Content
- 📦 Get Started
- Running Langflow from a Cloned Repository
- 🎨 Create Flows
- Deploy
- 🖥️ Command Line Interface (CLI)
- 👋 Contribute
- 🌟 Contributors
- 📄 License
📦 Get Started
You can install Langflow with pip:
# Make sure you have >=Python 3.10 installed on your system.
python -m pip install langflow -U
Then, run Langflow with:
python -m langflow run
Running Langflow from a Cloned Repository
If you prefer to run Langflow from a cloned repository rather than installing it via pip, follow these steps:
- Clone the Repository
First, clone the Langflow repository from GitHub:
git clone https://github.com/langflow-ai/langflow.git
Navigate into the cloned directory:
cd langflow
- Build and Install Dependencies
To build and install Langflow’s frontend and backend, use the following commands:
make install_frontend && make build_frontend && make install_backend
- Run Langflow
Once the installation is complete, you can run Langflow with:
poetry run python -m langflow run
🎨 Create Flows
Creating flows with Langflow is easy. Simply drag components from the sidebar onto the workspace and connect them to start building your application.
Explore by editing prompt parameters, grouping components into a single high-level component, and building your own Custom Components.
Once you’re done, you can export your flow as a JSON file.
Load the flow with:
from langflow.load import run_flow_from_json
results = run_flow_from_json("path/to/flow.json", input_value="Hello, World!")
Deploy
DataStax Langflow
DataStax Langflow is a hosted version of Langflow integrated with AstraDB. Be up and running in minutes with no installation or setup required. Sign up for free.
Deploy Langflow on Hugging Face Spaces
You can also preview Langflow in HuggingFace Spaces. Clone the space using this link to create your own Langflow workspace in minutes.
Deploy Langflow on Google Cloud Platform
Follow our step-by-step guide to deploy Langflow on Google Cloud Platform (GCP) using Google Cloud Shell. The guide is available in the Langflow in Google Cloud Platform document.
Alternatively, click the "Open in Cloud Shell" button below to launch Google Cloud Shell, clone the Langflow repository, and start an interactive tutorial that will guide you through the process of setting up the necessary resources and deploying Langflow on your GCP project.
Deploy on Railway
Use this template to deploy Langflow 1.0 on Railway:
Deploy on Render
Deploy on Kubernetes
Follow our step-by-step guide to deploy Langflow on Kubernetes.
🖥️ Command Line Interface (CLI)
Langflow provides a command-line interface (CLI) for easy management and configuration.
Usage
You can run the Langflow using the following command:
langflow run [OPTIONS]
Each option is detailed below:
--help: Displays all available options.--host: Defines the host to bind the server to. Can be set using theLANGFLOW_HOSTenvironment variable. The default is127.0.0.1.--workers: Sets the number of worker processes. Can be set using theLANGFLOW_WORKERSenvironment variable. The default is1.--timeout: Sets the worker timeout in seconds. The default is60.--port: Sets the port to listen on. Can be set using theLANGFLOW_PORTenvironment variable. The default is7860.--env-file: Specifies the path to the .env file containing environment variables. The default is.env.--log-level: Defines the logging level. Can be set using theLANGFLOW_LOG_LEVELenvironment variable. The default iscritical.--components-path: Specifies the path to the directory containing custom components. Can be set using theLANGFLOW_COMPONENTS_PATHenvironment variable. The default islangflow/components.--log-file: Specifies the path to the log file. Can be set using theLANGFLOW_LOG_FILEenvironment variable. The default islogs/langflow.log.--cache: Selects the type of cache to use. Options areInMemoryCacheandSQLiteCache. Can be set using theLANGFLOW_LANGCHAIN_CACHEenvironment variable. The default isSQLiteCache.--dev/--no-dev: Toggles the development mode. The default isno-dev.--path: Specifies the path to the frontend directory containing build files. This option is for development purposes only. Can be set using theLANGFLOW_FRONTEND_PATHenvironment variable.--open-browser/--no-open-browser: Toggles the option to open the browser after starting the server. Can be set using theLANGFLOW_OPEN_BROWSERenvironment variable. The default isopen-browser.--remove-api-keys/--no-remove-api-keys: Toggles the option to remove API keys from the projects saved in the database. Can be set using theLANGFLOW_REMOVE_API_KEYSenvironment variable. The default isno-remove-api-keys.--install-completion [bash|zsh|fish|powershell|pwsh]: Installs completion for the specified shell.--show-completion [bash|zsh|fish|powershell|pwsh]: Shows completion for the specified shell, allowing you to copy it or customize the installation.--backend-only: This parameter, with a default value ofFalse, allows running only the backend server without the frontend. It can also be set using theLANGFLOW_BACKEND_ONLYenvironment variable.--store: This parameter, with a default value ofTrue, enables the store features, use--no-storeto deactivate it. It can be configured using theLANGFLOW_STOREenvironment variable.
These parameters are important for users who need to customize the behavior of Langflow, especially in development or specialized deployment scenarios.
Environment Variables
You can configure many of the CLI options using environment variables. These can be exported in your operating system or added to a .env file and loaded using the --env-file option.
A sample .env file named .env.example is included with the project. Copy this file to a new file named .env and replace the example values with your actual settings. If you're setting values in both your OS and the .env file, the .env settings will take precedence.
👋 Contribute
We welcome contributions from developers of all levels to our open-source project on GitHub. If you'd like to contribute, please check our contributing guidelines and help make Langflow more accessible.
🌟 Contributors
📄 License
Langflow is released under the MIT License. See the LICENSE file for details.
