* chore: Update launch.json to use debugpy instead of python for debugging * refactor: Update import statements for Record in langflow components * feat: Add image handling functionality to langflow schema * update projects * 📝 (constants.py): Add 'output_types' to NODE_FORMAT_ATTRIBUTES for consistency and completeness ♻️ (setup.py): Refactor imports to improve readability and maintainability ♻️ (setup.py): Update code to remove fields that are not in the latest template for consistency * refactor: Update schema from Record to Message * refactor: Remove print statement in MonitorService * refactor: Remove fields not in the latest template for consistency * refactor: Update code to handle Record objects in utils.py * update projects * 📝 (monitor.py): Add type hint for message_id parameter in update_message function 📝 (parse.py): Rename ParsedContext to ParsedArgs for clarity 📝 (chat.py): Remove unused imports and methods in ChatComponent class 📝 (StoreMessage.py): Change return type of store_message method from list[Record] to list[Message] 📝 (base.py): Change type hint from Dict[str, str | list[str]] to Mapping[str, str | list[str]] in update_raw_params method 📝 (loading.py): Add condition to check if raw is not None before accessing its attributes in instantiate_custom_component function 📝 (memory.py): Change return type of get_messages function from list[Record] to list[Message] 📝 (memory.py): Change parameter type of add_messages function from Message to Message | list[Message] 📝 (image.py): Add type hint for image_prompt_value variable in Message class 🐛 (record.py): fix type hint for image_prompt_value variable to ImagePromptValue to improve code clarity and maintainability * chore: Add orjson options for serialization * chore: Update orjson options for serialization in setup.py * chore: Update input_value options for models This commit updates the input_value options for the models in the `OpenAIModel.py`, `MistralModel.py`, `CohereModel.py`, `VertexAiModel.py`, `ChatLiteLLMModel.py`, `OllamaModel.py`, `HuggingFaceModel.py`, `AnthropicModel.py`, and `AmazonBedrockModel.py` files. The `input_value` now supports the additional input type "Prompt". This change allows for more flexibility in the input data that can be provided to the models. Fixes #<issue_number> * chore: Update edges with latest component versions This commit updates the edges in the project data with the latest component versions. It ensures that the source and target nodes are correctly updated based on their corresponding nodes in the project. The commit also includes escaping of JSON dumps for the source and target handles in the edges. * 📝 (utils.py): Remove unnecessary async keyword from dict_values_to_string function to improve code readability and consistency 🔧 (utils.py): Simplify handling of Message objects by directly accessing the text property instead of calling to_lc_message() method * chore: Refactor PromptComponent to use updated Prompt class and remove unused imports * feat: Add support for image files in Message model This commit modifies the Message model to support image files as attachments. It introduces the `is_image_file` function to check if a file is an image, and the `to_content_dict` method in the Image class to convert the image object to a content dictionary. Additionally, the `get_file_content_dicts` method is added to generate content dictionaries for all files in the message, including images. This enhancement improves the handling of image attachments in the messaging system. Fixes #<issue_number> * update projects and lock * chore: Update LCModelComponent to use Prompt instead of Record * refactor: Update artifact type to include message in utils.py * fix: Add check for input_value to only pass if string * ✨ (switchOutputView/index.tsx): introduce constant RECORD_TYPES to store valid record types for better readability and maintainability 🔧 (switchOutputView/index.tsx): refactor switch cases to use RECORD_TYPES constant for checking valid record types and simplify the logic for handling different types of result messages * feat: Enable loading from database for openai_api_key field in Langflow starter projects This commit updates the Langflow starter projects by enabling the loading of the `openai_api_key` field from the database. Previously, the field was not being loaded from the database, but now it will be loaded and used in the projects. This change improves the functionality and flexibility of the projects. Fixes #<issue_number> * ♻️ (constants.py): remove unnecessary import statement and clean up code formatting in ORJSON_OPTIONS constant definition * refactor: Update MemoryComponent to use messages instead of records This commit updates the MemoryComponent class in the langflow/components/helpers/MemoryComponent.py file to use the term "messages" instead of "records" for better clarity and consistency. It also updates the get_messages method to return a list of Message objects instead of Record objects. This change improves the naming and readability of the code. * refactor: Update Message model to include timestamp conversion function This commit updates the Message model in the langflow/schema/message.py file to include a new function `_timestamp_to_str` that converts the timestamp to a string format. This function is used as a BeforeValidator for the `timestamp` field, ensuring that it is always formatted correctly. This change improves the consistency and reliability of the timestamp handling in the messaging system. * refactor: Update test_data_components.py to improve directory component loading This commit updates the test_data_components.py file to improve the loading of the directory component. It ensures that the directory component can load mdx files from the ../docs/docs/components directory. This change enhances the functionality and reliability of the directory component. Fixes #<issue_number> * refactor: Update .gitattributes to specify working-tree-encoding for .mdx and .json files This commit updates the .gitattributes file to specify the working-tree-encoding for .mdx and .json files. It sets the encoding to UTF-8 for both file types, ensuring consistent handling of character encoding. This change improves the reliability and compatibility of the repository. Fixes #<issue_number> * fix: 🐛 corrects encoding error * refactor: Update toolkits.mdx to improve documentation and fix formatting * refactor: Add dictdiffer library as a dependency This commit adds the dictdiffer library as a dependency in the poetry.lock file. The dictdiffer library is a useful tool for diffing and patching dictionaries. It will enhance the functionality and flexibility of the project. |
||
|---|---|---|
| .devcontainer | ||
| .github | ||
| .vscode | ||
| deploy | ||
| docker | ||
| docker_example | ||
| docs | ||
| scripts | ||
| src | ||
| tests | ||
| .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.md | ||
| README.PT.md | ||
| README.zh_CN.md | ||
| render.yaml | ||
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
- 🎨 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.
# Install the pre-release version (recommended for the latest updates)
python -m pip install langflow --pre --force-reinstall
# or stable version
python -m pip install langflow -U
Then, run Langflow with:
python -m langflow run
You can also preview Langflow in HuggingFace Spaces. Clone the space using this link to create your own Langflow workspace in minutes.
🎨 Create Flows
Creating flows with Langflow is easy. Simply drag components from the sidebar onto the canvas 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
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 Preview on Railway:
Or this one to deploy Langflow 0.6.x:
Deploy on Render
🖥️ 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.
