diff --git a/404.html b/404.html index 4400f5616f..bbe70a8e64 100644 --- a/404.html +++ b/404.html @@ -23,7 +23,7 @@ - + diff --git a/about-langflow.html b/about-langflow.html index 8f258fd51b..c1c07f4832 100644 --- a/about-langflow.html +++ b/about-langflow.html @@ -23,7 +23,7 @@ - + diff --git a/agent-tutorial.html b/agent-tutorial.html index a79228147d..c87905a6e7 100644 --- a/agent-tutorial.html +++ b/agent-tutorial.html @@ -23,7 +23,7 @@ - + @@ -125,13 +125,13 @@ If not, modify the const email = "isabella.rodriguez@example.com"

_60
import { LangflowClient } from "@datastax/langflow-client";
_60
_60
const LANGFLOW_SERVER_ADDRESS = 'LANGFLOW_SERVER_ADDRESS';
_60
const FLOW_ID = 'FLOW_ID';
_60
const LANGFLOW_API_KEY = 'LANGFLOW_API_KEY';
_60
const email = "isabella.rodriguez@example.com";
_60
_60
async function runAgentFlow(): Promise<void> {
_60
try {
_60
// Initialize the Langflow client
_60
const client = new LangflowClient({
_60
baseUrl: LANGFLOW_SERVER_ADDRESS,
_60
apiKey: LANGFLOW_API_KEY
_60
});
_60
_60
console.log(`Connecting to Langflow server at: ${LANGFLOW_SERVER_ADDRESS} `);
_60
console.log(`Flow ID: ${FLOW_ID}`);
_60
console.log(`Email: ${email}`);
_60
_60
// Get the flow instance
_60
const flow = client.flow(FLOW_ID);
_60
_60
// Run the flow with the email as input
_60
console.log('\nSending request to agent...');
_60
const response = await flow.run(email, {
_60
session_id: email // Use email as session ID for context
_60
});
_60
_60
console.log('\n=== Response from Langflow ===');
_60
console.log('Session ID:', response.sessionId);
_60
_60
// Extract URLs from the chat message
_60
const chatMessage = response.chatOutputText();
_60
console.log('\n=== URLs from Chat Message ===');
_60
const messageUrls = chatMessage.match(/https?:\/\/[^\s"')\]]+/g) || [];
_60
const cleanMessageUrls = [...new Set(messageUrls)].map(url => url.trim());
_60
console.log('URLs from message:');
_60
cleanMessageUrls.slice(0, 3).forEach(url => console.log(url));
_60
_60
} catch (error) {
_60
console.error('Error running flow:', error);
_60
_60
// Provide error messages
_60
if (error instanceof Error) {
_60
if (error.message.includes('fetch')) {
_60
console.error('\nMake sure your Langflow server is running and accessible at:', LANGFLOW_SERVER_ADDRESS);
_60
}
_60
if (error.message.includes('401') || error.message.includes('403')) {
_60
console.error('\nCheck your API key configuration');
_60
}
_60
if (error.message.includes('404')) {
_60
console.error('\nCheck your Flow ID - make sure it exists and is correct');
_60
}
_60
}
_60
}
_60
}
_60
_60
// Run the function
_60
console.log('Starting Langflow Agent...\n');
_60
runAgentFlow().catch(console.error);

  • -

    Save and run the script to send the request and test the flow. -Your application receives three URLs for recommended used items based on a customer's previous orders in your local CSV, all without changing any code.

    -
    Response

    The following is an example of a response returned from this tutorial's flow. Due to the nature of LLMs and variations in your inputs, your response might be different.


    _15
    Starting Langflow Agent...
    _15
    _15
    Connecting to Langflow server at: http://localhost:7860
    _15
    Flow ID: local-db-search
    _15
    Email: isabella.rodriguez@example.com
    _15
    _15
    Sending request to agent...
    _15
    _15
    === Response from Langflow ===
    _15
    Session ID: isabella.rodriguez@example.com
    _15
    _15
    URLs found:
    _15
    https://www.facebook.com/marketplace/258164108225783/electronics/
    _15
    https://www.facebook.com/marketplace/458332108944152/furniture/
    _15
    https://www.facebook.com/marketplace/613732137493719/kitchen-cabinets/

    +

    Save and run the script to send the request and test the flow.

    +

    Your application receives three URLs for recommended used items based on a customer's previous orders in your local CSV, all without changing any code.

    +
    Result

    The following is an example response from this tutorial's flow. Due to the nature of LLMs and variations in your inputs, your response might be different.


    _15
    Starting Langflow Agent...
    _15
    _15
    Connecting to Langflow server at: http://localhost:7860
    _15
    Flow ID: local-db-search
    _15
    Email: isabella.rodriguez@example.com
    _15
    _15
    Sending request to agent...
    _15
    _15
    === Response from Langflow ===
    _15
    Session ID: isabella.rodriguez@example.com
    _15
    _15
    URLs found:
    _15
    https://www.facebook.com/marketplace/258164108225783/electronics/
    _15
    https://www.facebook.com/marketplace/458332108944152/furniture/
    _15
    https://www.facebook.com/marketplace/613732137493719/kitchen-cabinets/

  • To quickly check traffic to your flow, open the Playground. -New sessions appear named after the user's email address. +New sessions are named after the user's email address. Keeping sessions distinct helps the agent maintain context. For more on session IDs, see Session ID.

  • diff --git a/agents-tools.html b/agents-tools.html index a738ad62b5..33ef16755e 100644 --- a/agents-tools.html +++ b/agents-tools.html @@ -23,7 +23,7 @@ - + @@ -77,24 +77,29 @@ Click Add custom components as tools -

    An agent can use custom components as tools.

    +

    An agent can use custom components as tools.

    1. To add a custom component to the agent flow, click New Custom Component.

    2. -

      Add custom Python code to the custom component. -For example, to create a text analyzer component, paste the below code into the custom component's Code pane.

      +

      Enter Python code into the Code pane to create the custom component.

      +

      If you don't already have code for a custom component, you can use the following code snippet as an example before creating your own.

      +
      Text Analyzer custom component

      This code creates a text analyzer component.


      _50
      from langflow.custom import Component
      _50
      from langflow.io import MessageTextInput, Output
      _50
      from langflow.schema import Data
      _50
      import re
      _50
      _50
      class TextAnalyzerComponent(Component):
      _50
      display_name = "Text Analyzer"
      _50
      description = "Analyzes and transforms input text."
      _50
      documentation: str = "http://docs.langflow.org/components/custom"
      _50
      icon = "chart-bar"
      _50
      name = "TextAnalyzerComponent"
      _50
      _50
      inputs = [
      _50
      MessageTextInput(
      _50
      name="input_text",
      _50
      display_name="Input Text",
      _50
      info="Enter text to analyze",
      _50
      value="Hello, World!",
      _50
      tool_mode=True,
      _50
      ),
      _50
      ]
      _50
      _50
      outputs = [
      _50
      Output(display_name="Analysis Result", name="output", method="analyze_text"),
      _50
      ]
      _50
      _50
      def analyze_text(self) -> Data:
      _50
      text = self.input_text
      _50
      _50
      # Perform text analysis
      _50
      word_count = len(text.split())
      _50
      char_count = len(text)
      _50
      sentence_count = len(re.findall(r'\w+[.!?]', text))
      _50
      _50
      # Transform text
      _50
      reversed_text = text[::-1]
      _50
      uppercase_text = text.upper()
      _50
      _50
      analysis_result = {
      _50
      "original_text": text,
      _50
      "word_count": word_count,
      _50
      "character_count": char_count,
      _50
      "sentence_count": sentence_count,
      _50
      "reversed_text": reversed_text,
      _50
      "uppercase_text": uppercase_text
      _50
      }
      _50
      _50
      data = Data(value=analysis_result)
      _50
      self.status = data
      _50
      return data

      +
    3. +
    4. +

      To use the custom component as a tool, click Tool Mode.

      +
    5. +
    6. +

      Connect the custom component's tool output to the agent's tools input.

      +
    7. +
    8. +

      Open the Playground and instruct the agent, Use the text analyzer on this text: "Agents really are thinking machines!"

      +

      Based on your instruction, the agent should call the analyze_text action and return the result. +For example:

      +

      _10
      gpt-4o
      _10
      Finished
      _10
      0.6s
      _10
      Here is the analysis of the text "Agents really are thinking machines!":
      _10
      Original Text: Agents really are thinking machines!
      _10
      Word Count: 5
      _10
      Character Count: 36
      _10
      Sentence Count: 1
      _10
      Reversed Text: !senihcam gnikniht era yllaer stnegA
      _10
      Uppercase Text: AGENTS REALLY ARE THINKING MACHINES!

    -
    Python

    _50
    from langflow.custom import Component
    _50
    from langflow.io import MessageTextInput, Output
    _50
    from langflow.schema import Data
    _50
    import re
    _50
    _50
    class TextAnalyzerComponent(Component):
    _50
    display_name = "Text Analyzer"
    _50
    description = "Analyzes and transforms input text."
    _50
    documentation: str = "http://docs.langflow.org/components/custom"
    _50
    icon = "chart-bar"
    _50
    name = "TextAnalyzerComponent"
    _50
    _50
    inputs = [
    _50
    MessageTextInput(
    _50
    name="input_text",
    _50
    display_name="Input Text",
    _50
    info="Enter text to analyze",
    _50
    value="Hello, World!",
    _50
    tool_mode=True,
    _50
    ),
    _50
    ]
    _50
    _50
    outputs = [
    _50
    Output(display_name="Analysis Result", name="output", method="analyze_text"),
    _50
    ]
    _50
    _50
    def analyze_text(self) -> Data:
    _50
    text = self.input_text
    _50
    _50
    # Perform text analysis
    _50
    word_count = len(text.split())
    _50
    char_count = len(text)
    _50
    sentence_count = len(re.findall(r'\w+[.!?]', text))
    _50
    _50
    # Transform text
    _50
    reversed_text = text[::-1]
    _50
    uppercase_text = text.upper()
    _50
    _50
    analysis_result = {
    _50
    "original_text": text,
    _50
    "word_count": word_count,
    _50
    "character_count": char_count,
    _50
    "sentence_count": sentence_count,
    _50
    "reversed_text": reversed_text,
    _50
    "uppercase_text": uppercase_text
    _50
    }
    _50
    _50
    data = Data(value=analysis_result)
    _50
    self.status = data
    _50
    return data

    -
      -
    1. To use the custom component as a tool, click Tool Mode.
    2. -
    3. Connect the custom component's tool output to the agent's tools input.
    4. -
    5. Open the Playground and instruct the agent, Use the text analyzer on this text: "Agents really are thinking machines!"
    6. -
    -
    Response

    _11
    AI
    _11
    gpt-4o
    _11
    Finished
    _11
    0.6s
    _11
    Here is the analysis of the text "Agents really are thinking machines!":
    _11
    Original Text: Agents really are thinking machines!
    _11
    Word Count: 5
    _11
    Character Count: 36
    _11
    Sentence Count: 1
    _11
    Reversed Text: !senihcam gnikniht era yllaer stnegA
    _11
    Uppercase Text: AGENTS REALLY ARE THINKING MACHINES!

    -

    The agent correctly calls the analyze_text action and returns the result to the Playground.

    Make any component a tool

    If the component you want to use as a tool doesn't have a Tool Mode button, add tool_mode=True to one of the component's inputs, and connect the new Toolset output to the agent's Tools input.

    Langflow supports Tool Mode for the following data types:

    diff --git a/agents.html b/agents.html index dc90be9e02..143df1d091 100644 --- a/agents.html +++ b/agents.html @@ -23,7 +23,7 @@ - + diff --git a/api-build.html b/api-build.html index 7df7026595..a69ae5179b 100644 --- a/api-build.html +++ b/api-build.html @@ -23,7 +23,7 @@ - + @@ -58,13 +58,17 @@ You might need to use or understand these endpoints when contributing to the Lan

    Build flow and stream events

    This endpoint builds and executes a flow, returning a job ID that can be used to stream execution events.

      -
    1. Send a POST request to the /build/$FLOW_ID/flow endpoint.
    2. +
    3. +

      Send a POST request to the /build/$FLOW_ID/flow endpoint:

      +

      _10
      curl -X POST \
      _10
      "$LANGFLOW_URL/api/v1/build/$FLOW_ID/flow" \
      _10
      -H "accept: application/json" \
      _10
      -H "Content-Type: application/json" \
      _10
      -H "x-api-key: $LANGFLOW_API_KEY" \
      _10
      -d '{
      _10
      "inputs": {
      _10
      "input_value": "Tell me a story"
      _10
      }
      _10
      }'

      +
      Result

      _10
      {
      _10
      "job_id": "123e4567-e89b-12d3-a456-426614174000"
      _10
      }

      +
    4. +
    5. +

      After receiving a job ID from the build endpoint, use the /build/$JOB_ID/events endpoint to stream the execution results:

      +

      _10
      curl -X GET \
      _10
      "$LANGFLOW_URL/api/v1/build/123e4567-e89b-12d3-a456-426614174000/events" \
      _10
      -H "accept: application/json" \
      _10
      -H "x-api-key: $LANGFLOW_API_KEY"

      +
      Result

      _10
      {"event": "vertices_sorted", "data": {"ids": ["ChatInput-XtBLx"], "to_run": ["Prompt-x74Ze", "ChatOutput-ylMzN", "ChatInput-XtBLx", "OpenAIModel-d1wOZ"]}}
      _10
      _10
      {"event": "add_message", "data": {"timestamp": "2025-03-03T17:42:23", "sender": "User", "sender_name": "User", "session_id": "d2bbd92b-187e-4c84-b2d4-5df365704201", "text": "Tell me a story", "files": [], "error": false, "edit": false, "properties": {"text_color": "", "background_color": "", "edited": false, "source": {"id": null, "display_name": null, "source": null}, "icon": "", "allow_markdown": false, "positive_feedback": null, "state": "complete", "targets": []}, "category": "message", "content_blocks": [], "id": "28879bd8-6a68-4dd5-b658-74d643a4dd92", "flow_id": "d2bbd92b-187e-4c84-b2d4-5df365704201"}}
      _10
      _10
      // ... Additional events as the flow executes ...
      _10
      _10
      {"event": "end", "data": {}}

      +
    -

    _10
    curl -X POST \
    _10
    "$LANGFLOW_URL/api/v1/build/$FLOW_ID/flow" \
    _10
    -H "accept: application/json" \
    _10
    -H "Content-Type: application/json" \
    _10
    -H "x-api-key: $LANGFLOW_API_KEY" \
    _10
    -d '{
    _10
    "inputs": {
    _10
    "input_value": "Tell me a story"
    _10
    }
    _10
    }'

    -
      -
    1. After receiving a job ID from the build endpoint, use the /build/$JOB_ID/events endpoint to stream the execution results:
    2. -
    -

    _10
    curl -X GET \
    _10
    "$LANGFLOW_URL/api/v1/build/123e4567-e89b-12d3-a456-426614174000/events" \
    _10
    -H "accept: application/json" \
    _10
    -H "x-api-key: $LANGFLOW_API_KEY"

    The /build/$FLOW_ID/events endpoint accepts an optional stream query parameter that defaults to true. To disable streaming and get all events at once, set stream to false.


    _10
    curl -X GET \
    _10
    "$LANGFLOW_URL/api/v1/build/123e4567-e89b-12d3-a456-426614174000/events?stream=false" \
    _10
    -H "accept: application/json" \
    _10
    -H "x-api-key: $LANGFLOW_API_KEY"

    @@ -80,7 +84,8 @@ For example, to stop flow execution at the OpenAI model component, run the follo

    Override flow parameters

    The /build endpoint also accepts inputs for data directly, instead of using the values stored in the Langflow database. This is useful for running flows without having to pass custom values through the UI.

    -

    _15
    curl -X POST \
    _15
    "$LANGFLOW_URL/api/v1/build/$FLOW_ID/flow" \
    _15
    -H "accept: application/json" \
    _15
    -H "Content-Type: application/json" \
    _15
    -H "x-api-key: $LANGFLOW_API_KEY" \
    _15
    -d '{
    _15
    "data": {
    _15
    "nodes": [],
    _15
    "edges": []
    _15
    },
    _15
    "inputs": {
    _15
    "input_value": "Your custom input here",
    _15
    "session": "session_id"
    _15
    }
    _15
    }'

    +

    _15
    curl -X POST \
    _15
    "$LANGFLOW_URL/api/v1/build/$FLOW_ID/flow" \
    _15
    -H "accept: application/json" \
    _15
    -H "Content-Type: application/json" \
    _15
    -H "x-api-key: $LANGFLOW_API_KEY" \
    _15
    -d '{
    _15
    "data": {
    _15
    "nodes": [],
    _15
    "edges": []
    _15
    },
    _15
    "inputs": {
    _15
    "input_value": "Your custom input here",
    _15
    "session": "session_id"
    _15
    }
    _15
    }'

    +
    Result

    _10
    { "job_id": "0bcc7f23-40b4-4bfa-9b8a-a44181fd1175" }

    See also

  • Create a virtual environment with uv.

    -
  • -
    Need help with virtual environments?

    Virtual environments ensure Langflow is installed in an isolated, fresh environment. -To create a new virtual environment, do the following.

      -
    1. Navigate to where you want your virtual environment to be created, and create it with uv. -Replace VENV_NAME with your preferred name for your virtual environment.
    2. -

    _10
    uv venv VENV_NAME

      -
    1. Start the virtual environment.
    2. -

    _10
    source VENV_NAME/bin/activate

    Your shell's prompt changes to display that you're currently working in a virtual environment.


    _10
    (VENV_NAME) ➜ langflow git:(main) ✗

      -
    1. To deactivate the virtual environment and return to your regular shell, type deactivate. -When activated, the virtual environment temporarily modifies your PATH variable to prioritize packages installed within the virtual environment, so always deactivate it when you're done to avoid conflicts with other projects. -To delete the virtual environment, type rm -rf VENV_NAME.
    2. +To create a new virtual environment, do the following.

        +
      1. +

        Navigate to where you want your virtual environment to be created, and then create it with uv:

        +

        _10
        uv venv VENV_NAME

        +

        Replace VENV_NAME with a name for your virtual environment.

        +
      2. +
      3. +

        Start the virtual environment:

        +

        _10
        source VENV_NAME/bin/activate

        +

        Your shell's prompt changes to display that you're currently working in a virtual environment:

        +

        _10
        (VENV_NAME) ➜ langflow git:(main) ✗

        +
      4. +
      5. +

        To deactivate the virtual environment and return to your regular shell, type deactivate.

        +

        When activated, the virtual environment temporarily modifies your PATH variable to prioritize packages installed within the virtual environment. +To avoid conflicts with other projects, it's a good idea to deactivate your virtual environment when you're done working in it.

        +

        To delete the virtual environment, type rm -rf VENV_NAME. +This completely removes the virtual environment directory and its contents.

        +
    -
      +
    1. In your virtual environment, install Langflow:


      _10
      uv pip install langflow

      diff --git a/get-started-quickstart.html b/get-started-quickstart.html index 4903954ecf..fd24c445a8 100644 --- a/get-started-quickstart.html +++ b/get-started-quickstart.html @@ -23,7 +23,7 @@ - + @@ -52,10 +52,14 @@

      Get started with Langflow by loading a template flow, running it, and then serving it at the /run API endpoint.

      Prerequisites

      +
    2. +

      Install and start Langflow

      +
    3. +
    4. +

      Create an OpenAI API key

      +
    5. +
    6. +

      Create a Langflow API key

      Create a Langflow API key

      A Langflow API key is a user-specific token you can use with Langflow.

      To create a Langflow API key, do the following:

      1. In Langflow, click your user icon, and then select Settings.

        @@ -72,9 +76,11 @@
      2. To use your Langflow API key in a request, set a LANGFLOW_API_KEY environment variable in your terminal, and then include an x-api-key header or query parameter with your request. For example:

        -

        _13
        # Set variable
        _13
        export LANGFLOW_API_KEY="sk..."
        _13
        _13
        # Send request
        _13
        curl --request POST \
        _13
        --url 'http://LANGFLOW_SERVER_ADDRESS/api/v1/run/FLOW_ID' \
        _13
        --header 'Content-Type: application/json' \
        _13
        --header 'x-api-key: LANGFLOW_API_KEY' \
        _13
        --data '{
        _13
        "output_type": "chat",
        _13
        "input_type": "chat",
        _13
        "input_value": "Hello"
        _13
        }'

        +

        _13
        # Set variable
        _13
        export LANGFLOW_API_KEY="sk..."
        _13
        _13
        # Send request
        _13
        curl --request POST \
        _13
        --url 'http://LANGFLOW_SERVER_ADDRESS/api/v1/run/FLOW_ID' \
        _13
        --header 'Content-Type: application/json' \
        _13
        --header 'x-api-key: LANGFLOW_API_KEY' \
        _13
        --data '{
        _13
        "output_type": "chat",
        _13
        "input_type": "chat",
        _13
        "input_value": "Hello"
        _13
        }'

      +
    7. +

      Run the Simple Agent template flow

      1. In Langflow, click New Flow, and then select the Simple Agent template.
      2. @@ -133,7 +139,7 @@ If you are using the curl snippet, you can run the command directly in your term

      If the request is successful, the response includes many details about the flow run, including the session ID, inputs, outputs, components, durations, and more. The following is an example of a response from running the Simple Agent template flow:

      -
      Response

      _162
      {
      _162
      "session_id": "29deb764-af3f-4d7d-94a0-47491ed241d6",
      _162
      "outputs": [
      _162
      {
      _162
      "inputs": {
      _162
      "input_value": "hello world!"
      _162
      },
      _162
      "outputs": [
      _162
      {
      _162
      "results": {
      _162
      "message": {
      _162
      "text_key": "text",
      _162
      "data": {
      _162
      "timestamp": "2025-06-16 19:58:23 UTC",
      _162
      "sender": "Machine",
      _162
      "sender_name": "AI",
      _162
      "session_id": "29deb764-af3f-4d7d-94a0-47491ed241d6",
      _162
      "text": "Hello world! 🌍 How can I assist you today?",
      _162
      "files": [],
      _162
      "error": false,
      _162
      "edit": false,
      _162
      "properties": {
      _162
      "text_color": "",
      _162
      "background_color": "",
      _162
      "edited": false,
      _162
      "source": {
      _162
      "id": "Agent-ZOknz",
      _162
      "display_name": "Agent",
      _162
      "source": "gpt-4o-mini"
      _162
      },
      _162
      "icon": "bot",
      _162
      "allow_markdown": false,
      _162
      "positive_feedback": null,
      _162
      "state": "complete",
      _162
      "targets": []
      _162
      },
      _162
      "category": "message",
      _162
      "content_blocks": [
      _162
      {
      _162
      "title": "Agent Steps",
      _162
      "contents": [
      _162
      {
      _162
      "type": "text",
      _162
      "duration": 2,
      _162
      "header": {
      _162
      "title": "Input",
      _162
      "icon": "MessageSquare"
      _162
      },
      _162
      "text": "**Input**: hello world!"
      _162
      },
      _162
      {
      _162
      "type": "text",
      _162
      "duration": 226,
      _162
      "header": {
      _162
      "title": "Output",
      _162
      "icon": "MessageSquare"
      _162
      },
      _162
      "text": "Hello world! 🌍 How can I assist you today?"
      _162
      }
      _162
      ],
      _162
      "allow_markdown": true,
      _162
      "media_url": null
      _162
      }
      _162
      ],
      _162
      "id": "f3d85d9a-261c-4325-b004-95a1bf5de7ca",
      _162
      "flow_id": "29deb764-af3f-4d7d-94a0-47491ed241d6",
      _162
      "duration": null
      _162
      },
      _162
      "default_value": "",
      _162
      "text": "Hello world! 🌍 How can I assist you today?",
      _162
      "sender": "Machine",
      _162
      "sender_name": "AI",
      _162
      "files": [],
      _162
      "session_id": "29deb764-af3f-4d7d-94a0-47491ed241d6",
      _162
      "timestamp": "2025-06-16T19:58:23+00:00",
      _162
      "flow_id": "29deb764-af3f-4d7d-94a0-47491ed241d6",
      _162
      "error": false,
      _162
      "edit": false,
      _162
      "properties": {
      _162
      "text_color": "",
      _162
      "background_color": "",
      _162
      "edited": false,
      _162
      "source": {
      _162
      "id": "Agent-ZOknz",
      _162
      "display_name": "Agent",
      _162
      "source": "gpt-4o-mini"
      _162
      },
      _162
      "icon": "bot",
      _162
      "allow_markdown": false,
      _162
      "positive_feedback": null,
      _162
      "state": "complete",
      _162
      "targets": []
      _162
      },
      _162
      "category": "message",
      _162
      "content_blocks": [
      _162
      {
      _162
      "title": "Agent Steps",
      _162
      "contents": [
      _162
      {
      _162
      "type": "text",
      _162
      "duration": 2,
      _162
      "header": {
      _162
      "title": "Input",
      _162
      "icon": "MessageSquare"
      _162
      },
      _162
      "text": "**Input**: hello world!"
      _162
      },
      _162
      {
      _162
      "type": "text",
      _162
      "duration": 226,
      _162
      "header": {
      _162
      "title": "Output",
      _162
      "icon": "MessageSquare"
      _162
      },
      _162
      "text": "Hello world! 🌍 How can I assist you today?"
      _162
      }
      _162
      ],
      _162
      "allow_markdown": true,
      _162
      "media_url": null
      _162
      }
      _162
      ],
      _162
      "duration": null
      _162
      }
      _162
      },
      _162
      "artifacts": {
      _162
      "message": "Hello world! 🌍 How can I assist you today?",
      _162
      "sender": "Machine",
      _162
      "sender_name": "AI",
      _162
      "files": [],
      _162
      "type": "object"
      _162
      },
      _162
      "outputs": {
      _162
      "message": {
      _162
      "message": "Hello world! 🌍 How can I assist you today?",
      _162
      "type": "text"
      _162
      }
      _162
      },
      _162
      "logs": {
      _162
      "message": []
      _162
      },
      _162
      "messages": [
      _162
      {
      _162
      "message": "Hello world! 🌍 How can I assist you today?",
      _162
      "sender": "Machine",
      _162
      "sender_name": "AI",
      _162
      "session_id": "29deb764-af3f-4d7d-94a0-47491ed241d6",
      _162
      "stream_url": null,
      _162
      "component_id": "ChatOutput-aF5lw",
      _162
      "files": [],
      _162
      "type": "text"
      _162
      }
      _162
      ],
      _162
      "timedelta": null,
      _162
      "duration": null,
      _162
      "component_display_name": "Chat Output",
      _162
      "component_id": "ChatOutput-aF5lw",
      _162
      "used_frozen_result": false
      _162
      }
      _162
      ]
      _162
      }
      _162
      ]
      _162
      }

      +
      Result

      _162
      {
      _162
      "session_id": "29deb764-af3f-4d7d-94a0-47491ed241d6",
      _162
      "outputs": [
      _162
      {
      _162
      "inputs": {
      _162
      "input_value": "hello world!"
      _162
      },
      _162
      "outputs": [
      _162
      {
      _162
      "results": {
      _162
      "message": {
      _162
      "text_key": "text",
      _162
      "data": {
      _162
      "timestamp": "2025-06-16 19:58:23 UTC",
      _162
      "sender": "Machine",
      _162
      "sender_name": "AI",
      _162
      "session_id": "29deb764-af3f-4d7d-94a0-47491ed241d6",
      _162
      "text": "Hello world! 🌍 How can I assist you today?",
      _162
      "files": [],
      _162
      "error": false,
      _162
      "edit": false,
      _162
      "properties": {
      _162
      "text_color": "",
      _162
      "background_color": "",
      _162
      "edited": false,
      _162
      "source": {
      _162
      "id": "Agent-ZOknz",
      _162
      "display_name": "Agent",
      _162
      "source": "gpt-4o-mini"
      _162
      },
      _162
      "icon": "bot",
      _162
      "allow_markdown": false,
      _162
      "positive_feedback": null,
      _162
      "state": "complete",
      _162
      "targets": []
      _162
      },
      _162
      "category": "message",
      _162
      "content_blocks": [
      _162
      {
      _162
      "title": "Agent Steps",
      _162
      "contents": [
      _162
      {
      _162
      "type": "text",
      _162
      "duration": 2,
      _162
      "header": {
      _162
      "title": "Input",
      _162
      "icon": "MessageSquare"
      _162
      },
      _162
      "text": "**Input**: hello world!"
      _162
      },
      _162
      {
      _162
      "type": "text",
      _162
      "duration": 226,
      _162
      "header": {
      _162
      "title": "Output",
      _162
      "icon": "MessageSquare"
      _162
      },
      _162
      "text": "Hello world! 🌍 How can I assist you today?"
      _162
      }
      _162
      ],
      _162
      "allow_markdown": true,
      _162
      "media_url": null
      _162
      }
      _162
      ],
      _162
      "id": "f3d85d9a-261c-4325-b004-95a1bf5de7ca",
      _162
      "flow_id": "29deb764-af3f-4d7d-94a0-47491ed241d6",
      _162
      "duration": null
      _162
      },
      _162
      "default_value": "",
      _162
      "text": "Hello world! 🌍 How can I assist you today?",
      _162
      "sender": "Machine",
      _162
      "sender_name": "AI",
      _162
      "files": [],
      _162
      "session_id": "29deb764-af3f-4d7d-94a0-47491ed241d6",
      _162
      "timestamp": "2025-06-16T19:58:23+00:00",
      _162
      "flow_id": "29deb764-af3f-4d7d-94a0-47491ed241d6",
      _162
      "error": false,
      _162
      "edit": false,
      _162
      "properties": {
      _162
      "text_color": "",
      _162
      "background_color": "",
      _162
      "edited": false,
      _162
      "source": {
      _162
      "id": "Agent-ZOknz",
      _162
      "display_name": "Agent",
      _162
      "source": "gpt-4o-mini"
      _162
      },
      _162
      "icon": "bot",
      _162
      "allow_markdown": false,
      _162
      "positive_feedback": null,
      _162
      "state": "complete",
      _162
      "targets": []
      _162
      },
      _162
      "category": "message",
      _162
      "content_blocks": [
      _162
      {
      _162
      "title": "Agent Steps",
      _162
      "contents": [
      _162
      {
      _162
      "type": "text",
      _162
      "duration": 2,
      _162
      "header": {
      _162
      "title": "Input",
      _162
      "icon": "MessageSquare"
      _162
      },
      _162
      "text": "**Input**: hello world!"
      _162
      },
      _162
      {
      _162
      "type": "text",
      _162
      "duration": 226,
      _162
      "header": {
      _162
      "title": "Output",
      _162
      "icon": "MessageSquare"
      _162
      },
      _162
      "text": "Hello world! 🌍 How can I assist you today?"
      _162
      }
      _162
      ],
      _162
      "allow_markdown": true,
      _162
      "media_url": null
      _162
      }
      _162
      ],
      _162
      "duration": null
      _162
      }
      _162
      },
      _162
      "artifacts": {
      _162
      "message": "Hello world! 🌍 How can I assist you today?",
      _162
      "sender": "Machine",
      _162
      "sender_name": "AI",
      _162
      "files": [],
      _162
      "type": "object"
      _162
      },
      _162
      "outputs": {
      _162
      "message": {
      _162
      "message": "Hello world! 🌍 How can I assist you today?",
      _162
      "type": "text"
      _162
      }
      _162
      },
      _162
      "logs": {
      _162
      "message": []
      _162
      },
      _162
      "messages": [
      _162
      {
      _162
      "message": "Hello world! 🌍 How can I assist you today?",
      _162
      "sender": "Machine",
      _162
      "sender_name": "AI",
      _162
      "session_id": "29deb764-af3f-4d7d-94a0-47491ed241d6",
      _162
      "stream_url": null,
      _162
      "component_id": "ChatOutput-aF5lw",
      _162
      "files": [],
      _162
      "type": "text"
      _162
      }
      _162
      ],
      _162
      "timedelta": null,
      _162
      "duration": null,
      _162
      "component_display_name": "Chat Output",
      _162
      "component_id": "ChatOutput-aF5lw",
      _162
      "used_frozen_result": false
      _162
      }
      _162
      ]
      _162
      }
      _162
      ]
      _162
      }

      In a production application, you probably want to select parts of this response to return to the user, store in logs, and so on. The next steps demonstrate how you can extract data from a Langflow API response to use in your application.

      Extract data from the response

      The following example builds on the API pane's example code to create a question-and-answer chat in your terminal that stores the Agent's previous answer.

      diff --git a/index.html b/index.html index 0aa8a1a980..72e588fb0f 100644 --- a/index.html +++ b/index.html @@ -23,7 +23,7 @@ - + diff --git a/install-custom-dependencies.html b/install-custom-dependencies.html index 5b328095b1..ec9225d677 100644 --- a/install-custom-dependencies.html +++ b/install-custom-dependencies.html @@ -23,7 +23,7 @@ - + diff --git a/integrations-apify.html b/integrations-apify.html index 0f042782d2..6212a21026 100644 --- a/integrations-apify.html +++ b/integrations-apify.html @@ -23,7 +23,7 @@ - + diff --git a/integrations-arize.html b/integrations-arize.html index d5843b4672..32ba059fe9 100644 --- a/integrations-arize.html +++ b/integrations-arize.html @@ -23,7 +23,7 @@ - + diff --git a/integrations-assemblyai.html b/integrations-assemblyai.html index e8d836b8ca..8a1a7ba583 100644 --- a/integrations-assemblyai.html +++ b/integrations-assemblyai.html @@ -23,7 +23,7 @@ - + diff --git a/integrations-cleanlab.html b/integrations-cleanlab.html index ce40a64237..549265a705 100644 --- a/integrations-cleanlab.html +++ b/integrations-cleanlab.html @@ -23,7 +23,7 @@ - + diff --git a/integrations-composio.html b/integrations-composio.html index 2358cb5caf..32077e0366 100644 --- a/integrations-composio.html +++ b/integrations-composio.html @@ -23,7 +23,7 @@ - + diff --git a/integrations-docling.html b/integrations-docling.html index f72883fb02..ff3d1ebd66 100644 --- a/integrations-docling.html +++ b/integrations-docling.html @@ -23,7 +23,7 @@ - + @@ -74,17 +74,25 @@ The chunked document is loaded as vectors into your vector database.

      Docling components

      The following sections describe the purpose and configuration options for each component in the Docling bundle.

      Docling

      -

      This component uses Docling to process input documents running the Docling models locally.

      -
      Parameters

      Inputs

      NameTypeDescription
      filesFileThe files to process.
      pipelineStringDocling pipeline to use (standard, vlm).
      ocr_engineStringOCR engine to use (easyocr, tesserocr, rapidocr, ocrmac).

      Outputs

      NameTypeDescription
      filesFileThe processed files with DoclingDocument data.
      +

      The Docling component ingest documents, and then uses Docling to process them by running the Docling models locally.

      +

      It outputs files, which is the processed files with DoclingDocument data.

      +

      Docling parameters

      +
      NameTypeDescription
      filesFileThe files to process.
      pipelineStringDocling pipeline to use (standard, vlm).
      ocr_engineStringOCR engine to use (easyocr, tesserocr, rapidocr, ocrmac).

      Docling Serve

      -

      This component uses Docling to process input documents connecting to your instance of Docling Serve.

      -
      Parameters

      Inputs

      NameTypeDescription
      filesFileThe files to process.
      api_urlStringURL of the Docling Serve instance.
      max_concurrencyIntegerMaximum number of concurrent requests for the server.
      max_poll_timeoutFloatMaximum waiting time for the document conversion to complete.
      api_headersDictOptional dictionary of additional headers required for connecting to Docling Serve.
      docling_serve_optsDictOptional dictionary of additional options for Docling Serve.

      Outputs

      NameTypeDescription
      filesFileThe processed files with DoclingDocument data.
      +

      The Docling Serve component ingests documents, and then uses Docling to process them by connecting to your instance of Docling Serve.

      +

      It outputs files, which is the processed files with DoclingDocument data.

      +

      Docling Serve parameters

      +
      NameTypeDescription
      filesFileThe files to process.
      api_urlStringURL of the Docling Serve instance.
      max_concurrencyIntegerMaximum number of concurrent requests for the server.
      max_poll_timeoutFloatMaximum waiting time for the document conversion to complete.
      api_headersDictOptional dictionary of additional headers required for connecting to Docling Serve.
      docling_serve_optsDictOptional dictionary of additional options for Docling Serve.

      Chunk DoclingDocument

      -

      This component uses the DoclingDocument chunkers to split a document into chunks.

      -
      Parameters

      Inputs

      NameTypeDescription
      data_inputsData/DataFrameThe data with documents to split in chunks.
      chunkerStringWhich chunker to use (HybridChunker, HierarchicalChunker).
      providerStringWhich tokenizer provider (Hugging Face, OpenAI).
      hf_model_nameStringModel name of the tokenizer to use with the HybridChunker when Hugging Face is chosen.
      openai_model_nameStringModel name of the tokenizer to use with the HybridChunker when OpenAI is chosen.
      max_tokensIntegerMaximum number of tokens for the HybridChunker.
      doc_keyStringThe key to use for the DoclingDocument column.

      Outputs

      NameTypeDescription
      dataframeDataFrameThe chunked documents as a DataFrame.
      +

      The Chunk DoclingDocument component uses the DoclingDocument chunkers to split a document into chunks.

      +

      It outputs the chunked documents as a DataFrame.

      +

      Chunk DoclingDocument parameters

      +
      NameTypeDescription
      data_inputsData/DataFrameThe data with documents to split in chunks.
      chunkerStringWhich chunker to use (HybridChunker, HierarchicalChunker).
      providerStringWhich tokenizer provider (Hugging Face, OpenAI).
      hf_model_nameStringModel name of the tokenizer to use with the HybridChunker when Hugging Face is chosen.
      openai_model_nameStringModel name of the tokenizer to use with the HybridChunker when OpenAI is chosen.
      max_tokensIntegerMaximum number of tokens for the HybridChunker.
      doc_keyStringThe key to use for the DoclingDocument column.

      Export DoclingDocument

      -

      This component exports DoclingDocument to Markdown, HTML, and other formats.

      -
      Parameters

      Inputs

      NameTypeDescription
      data_inputsData/DataFrameThe data with documents to export.
      export_formatStringSelect the export format to convert the input (Markdown, HTML, Plaintext, DocTags).
      image_modeStringSpecify how images are exported in the output (placeholder, embedded).
      md_image_placeholderStringSpecify the image placeholder for markdown exports.
      md_page_break_placeholderStringAdd this placeholder between pages in the markdown output.
      doc_keyStringThe key to use for the DoclingDocument column.

      Outputs

      NameTypeDescription
      dataDataThe exported data.
      dataframeDataFrameThe exported data as a DataFrame.