* feat(agent.py): add support for handling message responses in LCAgentComponent to improve agent functionality and interaction with messages * feat: add ToolEnabledLanguageModel type alias to constants.py This commit adds a new type alias `ToolEnabledLanguageModel` to the `constants.py` file in the `field_typing` module. This type alias is used to define the type of language models that have tooling enabled. It includes the `BaseLanguageModel`, `BaseLLM`, and `BaseChatModel` types. This change enhances the typing capabilities of the codebase and improves the clarity of the code. * feat: update agent.py to include support for ToolEnabledLanguageModel This commit modifies the `agent.py` file to include support for the `ToolEnabledLanguageModel` in the `LCToolsAgentComponent` class. The `ToolEnabledLanguageModel` is now added as an input type in the `HandleInput` section. This change enhances the functionality of the agent by allowing it to work with language models that have tooling enabled. The addition of this input type improves the flexibility and versatility of the codebase. * feat: add support for ToolEnabledLanguageModel in LCAgentComponent This commit modifies the `agent.py` file to include support for the `ToolEnabledLanguageModel` in the `LCAgentComponent` class. The `ToolEnabledLanguageModel` is now added as an input type in the `HandleInput` section. This change enhances the functionality of the agent by allowing it to work with language models that have tooling enabled. The addition of this input type improves the flexibility and versatility of the codebase. * feat: add AgentAsyncHandler for handling callbacks from Agents This commit adds the `AgentAsyncHandler` class to handle callbacks from langchain in the `callback.py` file. The `AgentAsyncHandler` is an async callback handler that can be used to handle various events such as tool start, tool end, agent action, and agent finish. This change enhances the functionality of the codebase by providing a convenient way to handle callbacks from langchain and log the events if a log function is provided. * chore: add field_serializer decorator to Log class for message serialization This commit adds the `field_serializer` decorator to the `Log` class in the `schema.py` file. The decorator is used to serialize the `message` attribute of the `Log` class, ensuring that all nested objects are properly serialized. This change improves the serialization process and enhances the functionality of the codebase. * feat: Fix issue with logs in LangSmithTracer This commit fixes an issue in the `LangSmithTracer` class where logs were not being properly serialized. The `add_metadata` method now converts logs to dictionaries using the `model_dump` method if they are not already dictionaries. This ensures that all logs are correctly serialized and improves the functionality of the codebase. * feat: Add support for Pydantic V1 models in Log serialization * fix: Update LCAgentComponent to handle list results in result variable This commit modifies the `LCAgentComponent` class in the `agent.py` file to handle list results in the `result` variable. If the `result` is a list, it is joined into a single string using the `text` attribute of each result dictionary. This change improves the functionality of the codebase by ensuring that the `result` variable is always a string, which is expected by the `Message` class. * feat: Add "name" parameter to AgentAsyncHandler methods This commit adds a "name" parameter to the `on_tool_start`, `on_tool_end`, `on_agent_action`, and `on_agent_finish` methods of the `AgentAsyncHandler` class in the `callback.py` file. The "name" parameter allows for specifying a name for the event, which can be useful for logging and tracking purposes. This change enhances the functionality of the codebase by providing more flexibility in handling callbacks and improves the clarity of the code. * feat: Update AgentAsyncHandler constructor to support logging multiple loggable types This commit updates the `AgentAsyncHandler` constructor in the `callback.py` file to support logging multiple loggable types. The `log_function` parameter now accepts a callable that can handle either a single `LoggableType` or a list of `LoggableType` objects along with a string representing the event name. This change enhances the flexibility of the codebase by allowing for more versatile logging options and improves the clarity of the code. * refactor(callback.py): update type hints in AgentAsyncHandler constructor and methods for better readability and accuracy refactor(callback.py): simplify on_tool_end method by using **kwargs for flexibility and consistency with other methods |
||
|---|---|---|
| .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 | ||
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
- 🎨 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
Or
If you would like to install from your cloned repo, you can build and install Langflow's frontend and backend with:
make install_frontend && make build_frontend && make install_backend
Then, run Langflow with:
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.
