Step-by-Step Guides

Python Function

Python Function

Langflow allows you to create a customized tool using the PythonFunction connected to a Tool component. In this example, Regex is used in Python to validate a pattern.

import re

def is_brazilian_zipcode(zipcode: str) -> bool:
    pattern = r"\d{5}-?\d{3}"

    # Check if the zip code matches the pattern
    if re.match(pattern, zipcode):
        return True

    return False

TIP

When a tool is called, it is often desirable to have its output returned directly to the user. You can do this by setting the return_direct flag for a tool to be True.

The AgentInitializer component is a quick way to construct an agent from the model and tools.

INFO

The PythonFunction is a custom component that uses the LangChain 🦜🔗 tool decorator. Learn more about it here.

⛓️ Langflow Example

LANGCHAIN COMPONENTS 🦜🔗

LANGCHAIN COMPONENTS 🦜🔗

Getting Started

👋 Welcome to Langflow
📦 How to install?
🤗 HuggingFace Spaces
🎨 Creating Flows

Guidelines

Sign up and Sign in
API Keys
Assynchronous Processing
Component
Features
Collection
Prompt Customization
Chat Interface
Chat Widget
Custom Components

Step-by-Step Guides

Async API
Integrating documents with prompt variables
Building chatbots with System Message
Integrating Langfuse with Langflow

Examples

FlowRunner Component
Conversation Chain
Buffer Memory
MidJourney Prompt Chain
CSV Loader
Serp API Tool
Multiple Vector Stores
Python Function
📚 How to Upload Examples?

Deployment

Deploy on Google Cloud Platform

Contributing

How to contribute?
GitHub Issues
Community

Search Docs…

Search Docs…