diff --git a/404.html b/404.html index bd36f076b9..27cd2e2f55 100644 --- a/404.html +++ b/404.html @@ -23,8 +23,8 @@ - - + + diff --git a/agent-tutorial.html b/agent-tutorial.html index fa2be3f140..75d57c3916 100644 --- a/agent-tutorial.html +++ b/agent-tutorial.html @@ -23,8 +23,8 @@ - - + + diff --git a/agents-tools.html b/agents-tools.html index 212a7f737e..fc66705ac3 100644 --- a/agents-tools.html +++ b/agents-tools.html @@ -23,8 +23,8 @@ - - + + diff --git a/agents.html b/agents.html index 807cfd7e23..a70447aebf 100644 --- a/agents.html +++ b/agents.html @@ -23,8 +23,8 @@ - - + + @@ -70,12 +70,18 @@ For a prebuilt example, use the Simple Agent template or the Add an Agent component to your flow.

  • -

    Enter a valid OpenAI API key.

    -

    The default model for the Agent component is an OpenAI model. -If you want to use a different provider, edit the Model Provider, Model Name, and API Key fields accordingly. +

    Select the provider and model that you want to use. +The default model for the Agent component is an OpenAI model. +If you want to use a different provider, edit the Model Provider and Model Name fields accordingly. +If your preferred model isn't listed, type the complete model name into the Model Name field, and then select it from the Model Name menu. +Make sure that the model is enabled/verified in your model provider account. For more information, see Agent component parameters.

  • +

    Enter a valid credential for your selected model provider. +Make sure that the credential has permission to call the selected model.

    +
  • +
  • Add Chat Input and Chat Output components to your flow, and then connect them to the Agent component.

    At this point, you have created a basic LLM-based chat flow that you can test in the Playground. However, this flow only chats with the LLM. @@ -120,7 +126,12 @@ You can modify all parameters through the Provider and model

    Use the Model Provider (agent_llm) and Model Name (llm_model) settings to select the model provider and LLM that you want the agent to use.

    The Agent component includes many models from several popular model providers. -To access other providers and models, set Model Provider to Connect other models, and then connect any language model component.

    +To access other providers or models, you can do either of the following:

    +

    If you need to generate embeddings in your flow, use an embedding model component.

    Model provider API key

    In the API Key field, enter a valid authentication key for your selected model provider, if you are using a built-in provider. @@ -151,9 +162,9 @@ Additionally, the Message History component provides more optio

    With the Agent component, the available parameters can change depending on the selected provider and model, including support for additional modes, arguments, or features like chat memory and temperature. For example:

    Some parameters are hidden by default in the visual editor. You can modify all parameters through the Controls in the component's header menu.

    diff --git a/api-build.html b/api-build.html index 2bae931a9b..4c8123bddf 100644 --- a/api-build.html +++ b/api-build.html @@ -23,8 +23,8 @@ - - + + @@ -48,7 +48,7 @@
  • Build endpoints

    -
    important

    The /build endpoints are used by Langflow's frontend visual editor code. +

    info

    The /build endpoints are used by Langflow's frontend visual editor code. These endpoints are part of the internal Langflow codebase.

    Don't use these endpoints to run flows in applications that use your Langflow flows. To run flows in your apps, see Flow trigger endpoints.

    The /build endpoints support Langflow's frontend code for building flows in the Langflow visual editor. @@ -68,13 +68,13 @@ You might need to use or understand these endpoints when contributing to the Lan

    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": {}}

    -

    The /build/$FLOW_ID/events endpoint has a stream query parameter that defaults to true. +

    The /build/$FLOW_ID/events endpoint has a stream query parameter that defaults to true. To disable streaming and get all events at once, set ?stream=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"

    Build headers

    HeaderInfoExample
    Content-TypeRequired. Specifies the JSON format."application/json"
    acceptOptional. Specifies the response format."application/json"
    x-api-keyOptional. Required only if authentication is enabled."sk-..."

    Build parameters

    -
    ParameterTypeDescription
    inputsobjectOptional. Input values for flow components.
    dataobjectOptional. Flow data to override stored configuration.
    filesarray[string]Optional. List of file paths to use.
    start_component_idstringOptional. ID of the component where the execution should start. Component id values can be found in Langflow JSON files
    stop_component_idstringOptional. ID of the component where the execution should stop. Component id values can be found in Langflow JSON files.
    log_buildsBooleanWhether to record build logs. Default: Enabled (true).
    +
    ParameterTypeDescription
    inputsobjectOptional. Input values for flow components.
    dataobjectOptional. Flow data to override stored configuration.
    filesarray[string]Optional. List of file paths to use.
    start_component_idstringOptional. ID of the component where the execution should start. Component id values can be found in Langflow JSON files
    stop_component_idstringOptional. ID of the component where the execution should stop. Component id values can be found in Langflow JSON files.
    log_buildsBooleanWhether to record build logs. Default: Enabled (true).

    Set start and stop points

    The /build endpoint accepts optional values for start_component_id and stop_component_id to control where the flow run starts and stops. Setting stop_component_id for a component triggers the same behavior as clicking Run component on that component in the visual editor: The specified component and all dependent components leading up to that component will run.

    diff --git a/api-files.html b/api-files.html index 7c7defb08d..18c091992b 100644 --- a/api-files.html +++ b/api-files.html @@ -23,8 +23,8 @@ - - + + @@ -126,7 +126,7 @@ You must include the ampersand (@) in the request to instruct curl

    Send files to your flows (v2)

    -
    important

    The /v2/files endpoint can't send image files to flows. +

    info

    The /v2/files endpoint can't send image files to flows. To send image files to your flows through the API, see Upload image files (v1).

    This endpoint uploads files to your Langflow server's file management system. To use an uploaded file in a flow, send the file path to a flow with a File component.

    diff --git a/api-flows-run.html b/api-flows-run.html index d6db96da51..da64e4779f 100644 --- a/api-flows-run.html +++ b/api-flows-run.html @@ -23,8 +23,8 @@ - - + + diff --git a/api-flows.html b/api-flows.html index ffdffeec67..e096d83492 100644 --- a/api-flows.html +++ b/api-flows.html @@ -23,8 +23,8 @@ - - + + diff --git a/api-keys-and-authentication.html b/api-keys-and-authentication.html index c863fbee3e..c8fcaf4718 100644 --- a/api-keys-and-authentication.html +++ b/api-keys-and-authentication.html @@ -23,8 +23,8 @@ - - + + @@ -127,7 +127,7 @@ Additionally, when exporting flows, you can
    • If LANGFLOW_AUTO_LOGIN=False, automatic login is disabled. Users must sign in to the visual editor, authenticate as a superuser to run certain Langflow CLI commands, and use a Langflow API key for Langflow API requests. -If false, the Langflow team recommends that you also explicitly set LANGFLOW_SUPERUSER and LANGFLOW_SUPERUSER_PASSWORD to avoid using the insecure default values.

      +If false, the Langflow team recommends that you also explicitly set LANGFLOW_SUPERUSER and LANGFLOW_SUPERUSER_PASSWORD to avoid using the insecure default values.

    • If LANGFLOW_AUTO_LOGIN=True (default), all API requests require authentication with a Langflow API key, but the visual editor automatically signs in all users as superusers, and Langflow uses only the default superuser credentials. @@ -140,16 +140,16 @@ If two users edit the same flow, Langflow saves only the work of the most recent

      Default authentication enforcement and LANGFLOW_SKIP_AUTH_AUTO_LOGIN

      In Langflow version 1.6, the default settings are LANGFLOW_AUTO_LOGIN=True and LANGFLOW_SKIP_AUTH_AUTO_LOGIN=False. This enforces authentication for API requests only, as explained in the preceding section.

      -

      For temporary backwards compatibility, you can revert to the fully unauthenticated behavior from earlier versions by setting both variables to true. +

      For temporary backwards compatibility, you can revert to the fully unauthenticated behavior from earlier versions by setting both variables to true. However, a future release will set LANGFLOW_AUTO_LOGIN=False and remove LANGFLOW_SKIP_AUTH_AUTO_LOGIN. At that point, Langflow will strictly enforce API key authentication for API requests, and you can manually disable authentication for some features, like the visual editor, by setting LANGFLOW_AUTO_LOGIN=True.

      Authentication enforcement in earlier versions

      Langflow version 1.5 was the first version that could enforce authentication for Langflow API requests, regardless of the value of LANGFLOW_AUTO_LOGIN. -As a temporary bypass for backwards compatibility, this version added the LANGFLOW_SKIP_AUTH_AUTO_LOGIN environment variable and set both variables to true by default to preserve the fully unauthenticated behavior from earlier versions. +As a temporary bypass for backwards compatibility, this version added the LANGFLOW_SKIP_AUTH_AUTO_LOGIN environment variable and set both variables to true by default to preserve the fully unauthenticated behavior from earlier versions. This allowed users to upgrade to version 1.5 with no change in the authentication behavior.

      In Langflow versions earlier than 1.5, Langflow API requests didn't require authentication. Additionally, the default setting of LANGFLOW_AUTO_LOGIN=True automatically granted all users superuser privileges in the visual editor, and it allowed all users to run all Langflow CLI commands as superusers.

      LANGFLOW_ENABLE_SUPERUSER_CLI

      Controls the availability of the langflow superuser command in the Langflow CLI. -The default is true, but false is recommended to prevent unrestricted superuser creation. +The default is true, but false is recommended to prevent unrestricted superuser creation. For more information, see langflow superuser.

      LANGFLOW_SUPERUSER and LANGFLOW_SUPERUSER_PASSWORD

      These variables specify the username and password for the Langflow server's superuser.

      @@ -209,7 +209,7 @@ For more information, see LANGFLOW_CORS_*

      Cross-Origin Resource Sharing (CORS) configuration controls how authentication credentials are handled when your Langflow frontend and backend are served from different origins. The following LANGFLOW_CORS_* environment variables are available:

      -
      VariableFormatDefaultDescription
      LANGFLOW_CORS_ALLOW_CREDENTIALSBooleanTrueWhether to allow credentials, such as cookies and authorization headers, in CORS requests.
      LANGFLOW_CORS_ALLOW_HEADERSList[String] or String*The allowed headers for CORS requests. Provide a comma-separated list of headers or use * to allow all headers.
      LANGFLOW_CORS_ALLOW_METHODSList[String] or String*The allowed HTTP methods for CORS requests. Provide a comma-separated list of methods or use * to allow all methods.
      LANGFLOW_CORS_ORIGINSString*The allowed CORS origins. Provide a comma-separated list of origins or use * for all origins.
      +
      VariableFormatDefaultDescription
      LANGFLOW_CORS_ALLOW_CREDENTIALSBooleanTrueWhether to allow credentials, such as cookies and authorization headers, in CORS requests.
      LANGFLOW_CORS_ALLOW_HEADERSList[String] or String*The allowed headers for CORS requests. Provide a comma-separated list of headers or use * to allow all headers.
      LANGFLOW_CORS_ALLOW_METHODSList[String] or String*The allowed HTTP methods for CORS requests. Provide a comma-separated list of methods or use * to allow all methods.
      LANGFLOW_CORS_ORIGINSString*The allowed CORS origins. Provide a comma-separated list of origins or use * for all origins.

      The default configuration enables CORS credentials and uses wildcards (*) to allow all origins, headers, and methods:


      _10
      LANGFLOW_CORS_ORIGINS=*
      _10
      LANGFLOW_CORS_ALLOW_CREDENTIALS=True
      _10
      LANGFLOW_CORS_ALLOW_HEADERS=*
      _10
      LANGFLOW_CORS_ALLOW_METHODS=*

      danger

      Langflow's default CORS settings can be a security risk in production environments because any website can make requests to your Langflow API, and any website can include credentials in cross-origin requests, including authentication cookies and authorization headers.

      In production deployments, specify exact origins in LANGFLOW_CORS_ORIGINS. diff --git a/api-logs.html b/api-logs.html index 475c8104d0..111cb3f8ed 100644 --- a/api-logs.html +++ b/api-logs.html @@ -23,8 +23,8 @@ - - + + diff --git a/api-monitor.html b/api-monitor.html index 76a1245d72..21c564523b 100644 --- a/api-monitor.html +++ b/api-monitor.html @@ -23,8 +23,8 @@ - - + + diff --git a/api-openai-responses.html b/api-openai-responses.html index 24fab3b729..4347c18c1c 100644 --- a/api-openai-responses.html +++ b/api-openai-responses.html @@ -23,8 +23,8 @@ - - + + diff --git a/api-projects.html b/api-projects.html index 9d5af17a65..d1633113c6 100644 --- a/api-projects.html +++ b/api-projects.html @@ -23,8 +23,8 @@ - - + + diff --git a/api-reference-api-examples.html b/api-reference-api-examples.html index 88287776a6..9dc477fbad 100644 --- a/api-reference-api-examples.html +++ b/api-reference-api-examples.html @@ -23,8 +23,8 @@ - - + + diff --git a/api-users.html b/api-users.html index 1ade9a2c22..b07c0b3b77 100644 --- a/api-users.html +++ b/api-users.html @@ -23,8 +23,8 @@ - - + + diff --git a/api.html b/api.html index 1bc5b4a64f..39ae2c0822 100644 --- a/api.html +++ b/api.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/add-server.html b/api/add-server.html index 470771302e..5621ac7f07 100644 --- a/api/add-server.html +++ b/api/add-server.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/add-user.html b/api/add-user.html index 794628c93a..20207d06c8 100644 --- a/api/add-user.html +++ b/api/add-user.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/auto-login.html b/api/auto-login.html index 73271e6efb..c0581532a8 100644 --- a/api/auto-login.html +++ b/api/auto-login.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/build-flow.html b/api/build-flow.html index 33f104bf6e..beda471af7 100644 --- a/api/build-flow.html +++ b/api/build-flow.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/build-public-tmp.html b/api/build-public-tmp.html index 29aa9c64e9..e8ef7ec91b 100644 --- a/api/build-public-tmp.html +++ b/api/build-public-tmp.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/build-vertex-stream.html b/api/build-vertex-stream.html index aa5993a940..108d9ae36c 100644 --- a/api/build-vertex-stream.html +++ b/api/build-vertex-stream.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/build-vertex.html b/api/build-vertex.html index 4ab443b999..a6ff0da64b 100644 --- a/api/build-vertex.html +++ b/api/build-vertex.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/cancel-build.html b/api/cancel-build.html index e5a9b72890..4ff29edd84 100644 --- a/api/cancel-build.html +++ b/api/cancel-build.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/check-if-store-has-api-key.html b/api/check-if-store-has-api-key.html index 14df616539..87ce29b7a7 100644 --- a/api/check-if-store-has-api-key.html +++ b/api/check-if-store-has-api-key.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/check-if-store-is-enabled.html b/api/check-if-store-is-enabled.html index f0b8e55233..cf69151b6a 100644 --- a/api/check-if-store-is-enabled.html +++ b/api/check-if-store-is-enabled.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/check-installed-mcp-servers.html b/api/check-installed-mcp-servers.html index 5d8d9e2225..07a5b06f95 100644 --- a/api/check-installed-mcp-servers.html +++ b/api/check-installed-mcp-servers.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/create-api-key-route.html b/api/create-api-key-route.html index e423467e80..13fdb9689c 100644 --- a/api/create-api-key-route.html +++ b/api/create-api-key-route.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/create-flow.html b/api/create-flow.html index c26f396838..6ef59c56ba 100644 --- a/api/create-flow.html +++ b/api/create-flow.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/create-flows.html b/api/create-flows.html index c21100c9f5..9c2b7ca1b3 100644 --- a/api/create-flows.html +++ b/api/create-flows.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/create-folder-redirect.html b/api/create-folder-redirect.html index 87a3265df5..f498da90bc 100644 --- a/api/create-folder-redirect.html +++ b/api/create-folder-redirect.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/create-project.html b/api/create-project.html index 6498682463..e3b85f5cdb 100644 --- a/api/create-project.html +++ b/api/create-project.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/create-upload-file.html b/api/create-upload-file.html index a7e8e1a098..83f3d72e41 100644 --- a/api/create-upload-file.html +++ b/api/create-upload-file.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/create-variable.html b/api/create-variable.html index 1a79077994..4cd43b99ef 100644 --- a/api/create-variable.html +++ b/api/create-variable.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/custom-component-update.html b/api/custom-component-update.html index 984aa48217..2bebed6492 100644 --- a/api/custom-component-update.html +++ b/api/custom-component-update.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/custom-component.html b/api/custom-component.html index 305aac5f1f..1cd69482bb 100644 --- a/api/custom-component.html +++ b/api/custom-component.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/delete-all-files-1.html b/api/delete-all-files-1.html index c0c40f60bf..9f67bcab4d 100644 --- a/api/delete-all-files-1.html +++ b/api/delete-all-files-1.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/delete-all-files.html b/api/delete-all-files.html index 81716d328d..44594108d3 100644 --- a/api/delete-all-files.html +++ b/api/delete-all-files.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/delete-api-key-route.html b/api/delete-api-key-route.html index ee2dbf0da3..ca6e14fe4e 100644 --- a/api/delete-api-key-route.html +++ b/api/delete-api-key-route.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/delete-file-1.html b/api/delete-file-1.html index 3e81068d97..0a2aa8ba5e 100644 --- a/api/delete-file-1.html +++ b/api/delete-file-1.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/delete-file.html b/api/delete-file.html index 8d09df4b8c..5f4d16d186 100644 --- a/api/delete-file.html +++ b/api/delete-file.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/delete-files-batch.html b/api/delete-files-batch.html index 3502e41f6f..deedf2d0f6 100644 --- a/api/delete-files-batch.html +++ b/api/delete-files-batch.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/delete-flow.html b/api/delete-flow.html index f71402a4c7..99feca6f53 100644 --- a/api/delete-flow.html +++ b/api/delete-flow.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/delete-folder-redirect.html b/api/delete-folder-redirect.html index 90570df390..a52f879bf4 100644 --- a/api/delete-folder-redirect.html +++ b/api/delete-folder-redirect.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/delete-messages-session.html b/api/delete-messages-session.html index a07268ab01..f488dd2da1 100644 --- a/api/delete-messages-session.html +++ b/api/delete-messages-session.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/delete-messages.html b/api/delete-messages.html index 610b86e745..fb326ec979 100644 --- a/api/delete-messages.html +++ b/api/delete-messages.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/delete-multiple-flows.html b/api/delete-multiple-flows.html index 244f27bc32..548e89e0d2 100644 --- a/api/delete-multiple-flows.html +++ b/api/delete-multiple-flows.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/delete-project.html b/api/delete-project.html index 8ad6056ce9..71eca25013 100644 --- a/api/delete-project.html +++ b/api/delete-project.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/delete-server.html b/api/delete-server.html index 5bf159a148..5595f3f8f9 100644 --- a/api/delete-server.html +++ b/api/delete-server.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/delete-user.html b/api/delete-user.html index a4797a610f..3309f72825 100644 --- a/api/delete-user.html +++ b/api/delete-user.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/delete-variable.html b/api/delete-variable.html index 58d2b6074a..8e6263078b 100644 --- a/api/delete-variable.html +++ b/api/delete-variable.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/delete-vertex-builds.html b/api/delete-vertex-builds.html index 2cf845856c..aa3bafbf5c 100644 --- a/api/delete-vertex-builds.html +++ b/api/delete-vertex-builds.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/download-component.html b/api/download-component.html index 852b8718df..30a3aa45e9 100644 --- a/api/download-component.html +++ b/api/download-component.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/download-file-1.html b/api/download-file-1.html index 2263e530c4..c1527b572f 100644 --- a/api/download-file-1.html +++ b/api/download-file-1.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/download-file-2.html b/api/download-file-2.html index 1f88836f23..7f46c476c2 100644 --- a/api/download-file-2.html +++ b/api/download-file-2.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/download-file-redirect.html b/api/download-file-redirect.html index 05b5c2df2b..1cd520b1a4 100644 --- a/api/download-file-redirect.html +++ b/api/download-file-redirect.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/download-file.html b/api/download-file.html index e8afda1cec..d1f3a2f4ca 100644 --- a/api/download-file.html +++ b/api/download-file.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/download-files-batch.html b/api/download-files-batch.html index f72af7a19b..1ff50945cd 100644 --- a/api/download-files-batch.html +++ b/api/download-files-batch.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/download-image.html b/api/download-image.html index 079e4cb669..a91dff7d30 100644 --- a/api/download-image.html +++ b/api/download-image.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/download-multiple-file.html b/api/download-multiple-file.html index e69574d3c1..00f32f76ef 100644 --- a/api/download-multiple-file.html +++ b/api/download-multiple-file.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/download-profile-picture.html b/api/download-profile-picture.html index 5d852cc24d..fa12ee1393 100644 --- a/api/download-profile-picture.html +++ b/api/download-profile-picture.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/edit-file-name.html b/api/edit-file-name.html index b0d061e5fa..efc29931ff 100644 --- a/api/edit-file-name.html +++ b/api/edit-file-name.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/experimental-run-flow.html b/api/experimental-run-flow.html index b2cf54c108..1751f6cf5e 100644 --- a/api/experimental-run-flow.html +++ b/api/experimental-run-flow.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/get-all.html b/api/get-all.html index 1ba0d1c463..61e8868b58 100644 --- a/api/get-all.html +++ b/api/get-all.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/get-api-keys-route.html b/api/get-api-keys-route.html index ac7b59eaf6..bbc8f90c4f 100644 --- a/api/get-api-keys-route.html +++ b/api/get-api-keys-route.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/get-build-events.html b/api/get-build-events.html index b919023e7e..949e0340bc 100644 --- a/api/get-build-events.html +++ b/api/get-build-events.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/get-components.html b/api/get-components.html index 7fd4487bf6..11b09d310e 100644 --- a/api/get-components.html +++ b/api/get-components.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/get-config.html b/api/get-config.html index d1b9e96d12..0f1aa2a9e9 100644 --- a/api/get-config.html +++ b/api/get-config.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/get-elevenlabs-voice-ids.html b/api/get-elevenlabs-voice-ids.html index 19b1418179..6d2d4776a4 100644 --- a/api/get-elevenlabs-voice-ids.html +++ b/api/get-elevenlabs-voice-ids.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/get-list-of-components-liked-by-user.html b/api/get-list-of-components-liked-by-user.html index c0e91937ba..2796394b58 100644 --- a/api/get-list-of-components-liked-by-user.html +++ b/api/get-list-of-components-liked-by-user.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/get-message-sessions.html b/api/get-message-sessions.html index fefc519eb9..cde5e130c4 100644 --- a/api/get-message-sessions.html +++ b/api/get-message-sessions.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/get-messages.html b/api/get-messages.html index 8f405ea443..9dac00c75a 100644 --- a/api/get-messages.html +++ b/api/get-messages.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/get-server-endpoint.html b/api/get-server-endpoint.html index 49962c4c6f..2cc7679b89 100644 --- a/api/get-server-endpoint.html +++ b/api/get-server-endpoint.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/get-servers.html b/api/get-servers.html index c9bc8100e1..e880e56cd5 100644 --- a/api/get-servers.html +++ b/api/get-servers.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/get-starter-projects.html b/api/get-starter-projects.html index 8d7005eed0..6d0c9c529e 100644 --- a/api/get-starter-projects.html +++ b/api/get-starter-projects.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/get-tags.html b/api/get-tags.html index 7779c640ef..ecc4aa95a2 100644 --- a/api/get-tags.html +++ b/api/get-tags.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/get-task-status.html b/api/get-task-status.html index ed2c2ae973..77cfaf8e91 100644 --- a/api/get-task-status.html +++ b/api/get-task-status.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/get-transactions.html b/api/get-transactions.html index 316d6dad7d..49cb3bee34 100644 --- a/api/get-transactions.html +++ b/api/get-transactions.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/get-version.html b/api/get-version.html index 4d094ed196..fb4dfe899f 100644 --- a/api/get-version.html +++ b/api/get-version.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/get-vertex-builds.html b/api/get-vertex-builds.html index 7eae9c3dc0..3a5b9f59d8 100644 --- a/api/get-vertex-builds.html +++ b/api/get-vertex-builds.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/handle-messages-1.html b/api/handle-messages-1.html index cdda6a0b6f..c3513d46ec 100644 --- a/api/handle-messages-1.html +++ b/api/handle-messages-1.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/handle-messages.html b/api/handle-messages.html index d0c9ec4e2e..8123a9fb66 100644 --- a/api/handle-messages.html +++ b/api/handle-messages.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/handle-project-messages-with-slash.html b/api/handle-project-messages-with-slash.html index f3a868e73f..a876ec3022 100644 --- a/api/handle-project-messages-with-slash.html +++ b/api/handle-project-messages-with-slash.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/handle-project-messages.html b/api/handle-project-messages.html index 31d829b0ec..88ae1dc924 100644 --- a/api/handle-project-messages.html +++ b/api/handle-project-messages.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/handle-project-sse.html b/api/handle-project-sse.html index 053cef84de..49ba1de41f 100644 --- a/api/handle-project-sse.html +++ b/api/handle-project-sse.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/handle-sse-1.html b/api/handle-sse-1.html index edd55a073b..7e5cff726b 100644 --- a/api/handle-sse-1.html +++ b/api/handle-sse-1.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/handle-sse.html b/api/handle-sse.html index d61f5ab776..769635134d 100644 --- a/api/handle-sse.html +++ b/api/handle-sse.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/health-check.html b/api/health-check.html index 4cc66d8e85..84afcb507e 100644 --- a/api/health-check.html +++ b/api/health-check.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/health.html b/api/health.html index e138e81c4b..356c4748b4 100644 --- a/api/health.html +++ b/api/health.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/install-mcp-config.html b/api/install-mcp-config.html index 66164279f0..e971962a89 100644 --- a/api/install-mcp-config.html +++ b/api/install-mcp-config.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/like-component.html b/api/like-component.html index 61b3f20902..85b39d51cf 100644 --- a/api/like-component.html +++ b/api/like-component.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/list-files-1.html b/api/list-files-1.html index 3a8230f259..af4827d7c6 100644 --- a/api/list-files-1.html +++ b/api/list-files-1.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/list-files-2.html b/api/list-files-2.html index 2049e3b437..51cedf5b7e 100644 --- a/api/list-files-2.html +++ b/api/list-files-2.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/list-files.html b/api/list-files.html index 9ab8358aa6..c8cce7c9e2 100644 --- a/api/list-files.html +++ b/api/list-files.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/list-profile-pictures.html b/api/list-profile-pictures.html index a7f32f9754..392dbc8844 100644 --- a/api/list-profile-pictures.html +++ b/api/list-profile-pictures.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/list-project-tools.html b/api/list-project-tools.html index 2e52c6e6f1..85300b4d95 100644 --- a/api/list-project-tools.html +++ b/api/list-project-tools.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/login-to-get-access-token.html b/api/login-to-get-access-token.html index 4c8d270db5..57601125a0 100644 --- a/api/login-to-get-access-token.html +++ b/api/login-to-get-access-token.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/logout.html b/api/logout.html index 300d8a6bcb..0bf60882ae 100644 --- a/api/logout.html +++ b/api/logout.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/logs.html b/api/logs.html index 4fc89ade67..5f2015b483 100644 --- a/api/logs.html +++ b/api/logs.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/patch-user.html b/api/patch-user.html index 7cab681312..daada0b293 100644 --- a/api/patch-user.html +++ b/api/patch-user.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/post-validate-code.html b/api/post-validate-code.html index 3300b3aa99..3a7680710e 100644 --- a/api/post-validate-code.html +++ b/api/post-validate-code.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/post-validate-prompt.html b/api/post-validate-prompt.html index 60a168dd30..cb747c034d 100644 --- a/api/post-validate-prompt.html +++ b/api/post-validate-prompt.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/process-1.html b/api/process-1.html index 4b466562b7..feb8527f89 100644 --- a/api/process-1.html +++ b/api/process-1.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/process.html b/api/process.html index 5adf8dbd02..33f68196b1 100644 --- a/api/process.html +++ b/api/process.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/read-all-users.html b/api/read-all-users.html index ee74e46bf2..94401671a3 100644 --- a/api/read-all-users.html +++ b/api/read-all-users.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/read-basic-examples.html b/api/read-basic-examples.html index 14edc8988f..55745202f5 100644 --- a/api/read-basic-examples.html +++ b/api/read-basic-examples.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/read-current-user.html b/api/read-current-user.html index 1153cf74ea..a397e53e7c 100644 --- a/api/read-current-user.html +++ b/api/read-current-user.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/read-flow.html b/api/read-flow.html index 0a53dc9cad..89e4d3f5e9 100644 --- a/api/read-flow.html +++ b/api/read-flow.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/read-flows.html b/api/read-flows.html index 69223bef42..8baff67fd6 100644 --- a/api/read-flows.html +++ b/api/read-flows.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/read-folder-redirect.html b/api/read-folder-redirect.html index 3baf992aac..638838b590 100644 --- a/api/read-folder-redirect.html +++ b/api/read-folder-redirect.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/read-folders-redirect.html b/api/read-folders-redirect.html index d78a40922b..c7f66db9cf 100644 --- a/api/read-folders-redirect.html +++ b/api/read-folders-redirect.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/read-project.html b/api/read-project.html index a1727403f7..0eff307c20 100644 --- a/api/read-project.html +++ b/api/read-project.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/read-projects.html b/api/read-projects.html index cd85a53a3e..ff2a896257 100644 --- a/api/read-projects.html +++ b/api/read-projects.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/read-public-flow.html b/api/read-public-flow.html index d7c6268d33..dd9740ba06 100644 --- a/api/read-public-flow.html +++ b/api/read-public-flow.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/read-variables.html b/api/read-variables.html index 288fa99ce2..fce803ebb3 100644 --- a/api/read-variables.html +++ b/api/read-variables.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/refresh-token.html b/api/refresh-token.html index a6276c7781..635860ba9a 100644 --- a/api/refresh-token.html +++ b/api/refresh-token.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/reset-password.html b/api/reset-password.html index 148a185c2e..5ef6e49be6 100644 --- a/api/reset-password.html +++ b/api/reset-password.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/retrieve-vertices-order.html b/api/retrieve-vertices-order.html index 5274db403e..34d3c0c35d 100644 --- a/api/retrieve-vertices-order.html +++ b/api/retrieve-vertices-order.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/save-store-api-key.html b/api/save-store-api-key.html index 0c93f318f1..369f4c87c6 100644 --- a/api/save-store-api-key.html +++ b/api/save-store-api-key.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/share-component.html b/api/share-component.html index 5c49bbd0d7..a96d5b4de8 100644 --- a/api/share-component.html +++ b/api/share-component.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/simplified-run-flow.html b/api/simplified-run-flow.html index a073a8647b..8ff38b9f05 100644 --- a/api/simplified-run-flow.html +++ b/api/simplified-run-flow.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/stream-logs.html b/api/stream-logs.html index a4a18ac8c6..377e04132c 100644 --- a/api/stream-logs.html +++ b/api/stream-logs.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/update-flow.html b/api/update-flow.html index 3e60c2f1c9..8115d86609 100644 --- a/api/update-flow.html +++ b/api/update-flow.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/update-folder-redirect.html b/api/update-folder-redirect.html index 5f32aab2ba..e7f56a01be 100644 --- a/api/update-folder-redirect.html +++ b/api/update-folder-redirect.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/update-message.html b/api/update-message.html index 47834d8212..f10f2c1dc2 100644 --- a/api/update-message.html +++ b/api/update-message.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/update-project-mcp-settings.html b/api/update-project-mcp-settings.html index b91e2cf73d..861d2a99bc 100644 --- a/api/update-project-mcp-settings.html +++ b/api/update-project-mcp-settings.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/update-project.html b/api/update-project.html index 1c532e6163..c5a2a85dc5 100644 --- a/api/update-project.html +++ b/api/update-project.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/update-server-endpoint.html b/api/update-server-endpoint.html index e143c944e0..bebc07b400 100644 --- a/api/update-server-endpoint.html +++ b/api/update-server-endpoint.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/update-session-id.html b/api/update-session-id.html index 91346c69a8..7f86ece26a 100644 --- a/api/update-session-id.html +++ b/api/update-session-id.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/update-shared-component.html b/api/update-shared-component.html index f017b1b9f5..e630e351b5 100644 --- a/api/update-shared-component.html +++ b/api/update-shared-component.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/update-variable.html b/api/update-variable.html index 1b3834eb7c..8717c1d056 100644 --- a/api/update-variable.html +++ b/api/update-variable.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/upload-file-1.html b/api/upload-file-1.html index c13042d054..85158ad221 100644 --- a/api/upload-file-1.html +++ b/api/upload-file-1.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/upload-file-2.html b/api/upload-file-2.html index b769fd04ab..0321c5fe5e 100644 --- a/api/upload-file-2.html +++ b/api/upload-file-2.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/upload-file-redirect.html b/api/upload-file-redirect.html index ab754b2c95..bb6dc9f881 100644 --- a/api/upload-file-redirect.html +++ b/api/upload-file-redirect.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/upload-file.html b/api/upload-file.html index 45553ce3d3..b434137483 100644 --- a/api/upload-file.html +++ b/api/upload-file.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/upload-user-file-1.html b/api/upload-user-file-1.html index f12d3f42a1..4afd76c5e8 100644 --- a/api/upload-user-file-1.html +++ b/api/upload-user-file-1.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/upload-user-file.html b/api/upload-user-file.html index 2351133f8a..89a4c89e26 100644 --- a/api/upload-user-file.html +++ b/api/upload-user-file.html @@ -23,8 +23,8 @@ - - + + diff --git a/api/webhook-run-flow.html b/api/webhook-run-flow.html index 87d46cd1ea..cc83fd6d4b 100644 --- a/api/webhook-run-flow.html +++ b/api/webhook-run-flow.html @@ -23,8 +23,8 @@ - - + + diff --git a/assets/js/0132780e.209c19de.js b/assets/js/0132780e.209c19de.js deleted file mode 100644 index 2f387ef4f3..0000000000 --- a/assets/js/0132780e.209c19de.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[7841],{12260:(e,n,t)=>{t.d(n,{A:()=>o});const o=t.p+"assets/images/conditional-looping-756b330b8dc690b3dab1c44cc2fb05db.png"},17886:(e,n,t)=>{t.d(n,{A:()=>r});t(96540);var o=t(64058),s=t(74848);function r({name:e,...n}){const t=o[e];return t?(0,s.jsx)(t,{...n}):null}},31929:(e,n,t)=>{t.d(n,{Ay:()=>l,RM:()=>i});var o=t(74848),s=t(28453),r=t(17886);const i=[];function c(e){const n={a:"a",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,o.jsxs)(n.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,o.jsx)(r.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Controls"})," in the ",(0,o.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function l(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(c,{...e})}):c(e)}},36813:(e,n,t)=>{t.d(n,{Ay:()=>l,RM:()=>i});var o=t(74848),s=t(28453),r=t(17886);const i=[];function c(e){const n={a:"a",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(n.p,{children:["Legacy components are longer supported and can be removed in a future release.\nYou can continue to use them in existing flows, but it is recommended that you replace them with supported components as soon as possible.\nSuggested replacements are included in the ",(0,o.jsx)(n.strong,{children:"Legacy"})," banner on components in your flows.\nThey are also given in release notes and Langflow documentation whenever possible."]}),"\n",(0,o.jsxs)(n.p,{children:["If you aren't sure how to replace a legacy component, ",(0,o.jsx)(r.A,{name:"Search","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Search"})," for components by provider, service, or component name.\nThe component may have been deprecated in favor of a completely new component, a similar component, or a new version of the same component in a different category."]}),"\n",(0,o.jsxs)(n.p,{children:["If there is no obvious replacement, consider whether another component can be adapted to your use case.\nFor example, many ",(0,o.jsx)(r.A,{name:"Component","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Core components"})," provide generic functionality that can support multiple providers and use cases, such as the ",(0,o.jsxs)(n.a,{href:"/components-data#api-request",children:[(0,o.jsx)(n.strong,{children:"API Request"})," component"]}),"."]}),"\n",(0,o.jsxs)(n.p,{children:["If neither of these options are viable, you could use the legacy component's code to create your own custom component, or ",(0,o.jsx)(n.a,{href:"/contributing-github-issues",children:"start a discussion"})," about the legacy component."]}),"\n",(0,o.jsxs)(n.p,{children:["To discourage use of legacy components in new flows, these components are hidden by default.\nIn the visual editor, you can click ",(0,o.jsx)(r.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Component settings"})," to toggle the ",(0,o.jsx)(n.strong,{children:"Legacy"})," filter."]})]})}function l(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(c,{...e})}):c(e)}},57373:(e,n,t)=>{t.r(n),t.d(n,{CH:()=>x,assets:()=>p,chCodeConfig:()=>u,contentTitle:()=>h,default:()=>g,frontMatter:()=>a,metadata:()=>o,toc:()=>j});const o=JSON.parse('{"id":"Components/components-logic","title":"Logic","description":"Logic components provide functionalities for routing, conditional processing, and flow management.","source":"@site/docs/Components/components-logic.mdx","sourceDirName":"Components","slug":"/components-logic","permalink":"/components-logic","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Logic","slug":"/components-logic"},"sidebar":"docs","previous":{"title":"Prompt Template","permalink":"/components-prompts"},"next":{"title":"Helpers","permalink":"/components-helpers"}}');var s=t(74848),r=t(28453),i=t(24754),c=t(17886),l=t(31929),d=t(36813);const a={title:"Logic",slug:"/components-logic"},h=void 0,p={},x={annotations:i.hk,Code:i.Cy},u={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},j=[{value:"If-Else (conditional router)",id:"if-else",level:2},{value:"Use the If-Else component in a flow",id:"use-the-if-else-component-in-a-flow",level:3},{value:"If-Else parameters",id:"if-else-parameters",level:3},...l.RM,{value:"Loop",id:"loop",level:2},{value:"The looping process",id:"the-looping-process",level:3},{value:"Loop example",id:"loop-example",level:3},{value:"Conditional looping",id:"conditional-looping",level:3},{value:"Notify and Listen",id:"notify-and-listen",level:2},{value:"Run flow",id:"run-flow",level:2},{value:"Run Flow parameters",id:"run-flow-parameters",level:3},...l.RM,{value:"Legacy Logic components",id:"legacy-logic-components",level:2},...d.RM];function m(e){const n={a:"a",admonition:"admonition",code:"code",em:"em",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,r.R)(),...e.components},{Details:o}=n;return x||f("CH",!1),x.Code||f("CH.Code",!0),o||f("Details",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n","\n",(0,s.jsx)(n.p,{children:"Logic components provide functionalities for routing, conditional processing, and flow management."}),"\n",(0,s.jsx)(n.h2,{id:"if-else",children:"If-Else (conditional router)"}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"If-Else"})," component is a conditional router that routes messages by comparing two strings.\nIt evaluates a condition by comparing two text inputs using the specified operator, and then routes the message to ",(0,s.jsx)(n.code,{children:"true_result"})," or ",(0,s.jsx)(n.code,{children:"false_result"})," depending on the evaluation."]}),"\n",(0,s.jsxs)(n.p,{children:["The operator looks for single strings in the input (",(0,s.jsx)(n.code,{children:"input_text"}),") based on an operator and match text (",(0,s.jsx)(n.code,{children:"match_text"}),"), but it can also search for multiple words by matching a regex.\nAvailable operators include:"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"equals"}),": Exact match comparison"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"not equals"}),": Inverse of exact match"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"contains"}),": Checks if the ",(0,s.jsx)(n.code,{children:"match_text"})," is found within ",(0,s.jsx)(n.code,{children:"input_text"})]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"starts with"}),": Checks if ",(0,s.jsx)(n.code,{children:"input_text"})," begins with ",(0,s.jsx)(n.code,{children:"match_text"})]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"ends with"}),": Checks if ",(0,s.jsx)(n.code,{children:"input_text"})," ends with ",(0,s.jsx)(n.code,{children:"match_text"})]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"regex"}),": Matches on a case-sensitive pattern"]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["By default, all operators are case insensitive except ",(0,s.jsx)(n.strong,{children:"regex"}),".\n",(0,s.jsx)(n.strong,{children:"regex"})," is always case sensitive, and you can enable case sensitivity for all other operators in the ",(0,s.jsx)(n.a,{href:"#if-else-parameters",children:"If-Else parameters"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"use-the-if-else-component-in-a-flow",children:"Use the If-Else component in a flow"}),"\n",(0,s.jsxs)(n.p,{children:["The following example uses the ",(0,s.jsx)(n.strong,{children:"If-Else"})," component to check incoming chat messages with regex matching, and then output a different response depending on whether the match evaluated to true or false."]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"A conditional router connected to two OpenAI components",src:t(89329).A+"",width:"3532",height:"3044"})}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Add an ",(0,s.jsx)(n.strong,{children:"If-Else"})," component to your flow, and then configure it as follows:"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Text Input"}),": Connect the ",(0,s.jsx)(n.strong,{children:"Text Input"})," port to a ",(0,s.jsx)(n.strong,{children:"Chat Input"})," component or another ",(0,s.jsx)(n.code,{children:"Message"})," input."]}),"\n",(0,s.jsxs)(n.p,{children:["If your input isn't in ",(0,s.jsx)(n.code,{children:"Message"})," format, you can use another component to transform it, such as the ",(0,s.jsxs)(n.a,{href:"/components-processing#type-convert",children:[(0,s.jsx)(n.strong,{children:"Type Convert"})," component"]})," or ",(0,s.jsxs)(n.a,{href:"/components-processing#parser",children:[(0,s.jsx)(n.strong,{children:"Parser"})," component"]}),".\nIf your input isn't appropriate for ",(0,s.jsx)(n.code,{children:"Message"})," format, consider using another component for conditional routing, such as the ",(0,s.jsxs)(n.a,{href:"/components-processing#data-operations",children:[(0,s.jsx)(n.strong,{children:"Data Operations"})," component"]}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Match Text"}),": Enter ",(0,s.jsx)(n.code,{children:".*(urgent|warning|caution).*"})," so the component looks for these values in incoming input. The regex match is case sensitive, so if you need to look for all permutations of ",(0,s.jsx)(n.code,{children:"warning"}),", enter ",(0,s.jsx)(n.code,{children:"warning|Warning|WARNING"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Operator"}),": Select ",(0,s.jsx)(n.strong,{children:"regex"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Case True"}),": In the ",(0,s.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),", click ",(0,s.jsx)(c.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Controls"}),", enable the ",(0,s.jsx)(n.strong,{children:"Case True"})," parameter, click ",(0,s.jsx)(n.strong,{children:"Close"}),", and then enter ",(0,s.jsx)(n.code,{children:"New Message Detected"})," in the field."]}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"Case True"})," message is sent from the ",(0,s.jsx)(n.strong,{children:"True"})," output port when the match condition evaluates to true."]}),"\n",(0,s.jsxs)(n.p,{children:["No message is set for ",(0,s.jsx)(n.strong,{children:"Case False"})," so the component doesn't emit a message when the condition evaluates to false."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Depending on what you want to happen when the outcome is ",(0,s.jsx)(n.strong,{children:"True"}),", add components to your flow to execute that logic:"]}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Add a ",(0,s.jsx)(n.strong,{children:"Language Model"}),", ",(0,s.jsx)(n.strong,{children:"Prompt Template"}),", and ",(0,s.jsx)(n.strong,{children:"Chat Output"})," component to your flow."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["In the ",(0,s.jsx)(n.strong,{children:"Language Model"})," component, enter your OpenAI API key or select a different provider and model."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Connect the ",(0,s.jsx)(n.strong,{children:"If-Else"})," component's ",(0,s.jsx)(n.strong,{children:"True"})," output port to the ",(0,s.jsx)(n.strong,{children:"Language Model"})," component's ",(0,s.jsx)(n.strong,{children:"Input"})," port."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["In the ",(0,s.jsx)(n.strong,{children:"Prompt Template"})," component, enter instructions for the model when the evaluation is true, such as ",(0,s.jsx)(n.code,{children:"Send a message that a new warning, caution, or urgent message was received"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Connect the ",(0,s.jsx)(n.strong,{children:"Prompt Template"})," component to the ",(0,s.jsx)(n.strong,{children:"Language Model"})," component's ",(0,s.jsx)(n.strong,{children:"System Message"})," port."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Connect the ",(0,s.jsx)(n.strong,{children:"Language Model"})," component's output to the ",(0,s.jsx)(n.strong,{children:"Chat Output"})," component."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Repeat the same process with another set of ",(0,s.jsx)(n.strong,{children:"Language Model"}),", ",(0,s.jsx)(n.strong,{children:"Prompt Template"}),", and ",(0,s.jsx)(n.strong,{children:"Chat Output"})," components for the ",(0,s.jsx)(n.strong,{children:"False"})," outcome."]}),"\n",(0,s.jsxs)(n.p,{children:["Connect the ",(0,s.jsx)(n.strong,{children:"If-Else"})," component's ",(0,s.jsx)(n.strong,{children:"False"})," output port to the second ",(0,s.jsx)(n.strong,{children:"Language Model"})," component's ",(0,s.jsx)(n.strong,{children:"Input"})," port.\nIn the second ",(0,s.jsx)(n.strong,{children:"Prompt Template"}),", enter instructions for the model when the evaluation is false, such as ",(0,s.jsx)(n.code,{children:"Send a message that a new low-priority message was received"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["To test the flow, open the ",(0,s.jsx)(n.strong,{children:"Playground"}),", and then send the flow some messages with and without your regex strings.\nThe chat output should reflect the instructions in your prompts based on the regex evaluation."]}),"\n",(0,s.jsx)(x.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"User: A new user was created.",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"AI: A new low-priority message was received.",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"User: Sign-in warning: new user locked out.",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"AI: A new warning, caution, or urgent message was received. Please review it at your earliest convenience.",props:{}}]}],lang:"text"},annotations:[]}]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"if-else-parameters",children:"If-Else parameters"}),"\n",(0,s.jsx)(l.Ay,{}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"input_text"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. The primary text input for the operation."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"match_text"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. The text to compare against."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"operator"}),(0,s.jsx)(n.td,{children:"Dropdown"}),(0,s.jsxs)(n.td,{children:["Input parameter. The operator used to compare texts. Options include ",(0,s.jsx)(n.code,{children:"equals"}),", ",(0,s.jsx)(n.code,{children:"not equals"}),", ",(0,s.jsx)(n.code,{children:"contains"}),", ",(0,s.jsx)(n.code,{children:"starts with"}),", ",(0,s.jsx)(n.code,{children:"ends with"}),", and ",(0,s.jsx)(n.code,{children:"regex"}),". The default is ",(0,s.jsx)(n.code,{children:"equals"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"case_sensitive"}),(0,s.jsx)(n.td,{children:"Boolean"}),(0,s.jsx)(n.td,{children:"Input parameter. When true, the comparison is case sensitive. The default is false. This setting doesn't apply to regex comparisons."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"max_iterations"}),(0,s.jsx)(n.td,{children:"Integer"}),(0,s.jsx)(n.td,{children:"Input parameter. The maximum number of iterations allowed for the conditional router. The default is 10."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"default_route"}),(0,s.jsx)(n.td,{children:"Dropdown"}),(0,s.jsxs)(n.td,{children:["Input parameter. The route to take when max iterations are reached. Options include ",(0,s.jsx)(n.code,{children:"true_result"})," or ",(0,s.jsx)(n.code,{children:"false_result"}),". The default is ",(0,s.jsx)(n.code,{children:"false_result"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"true_result"}),(0,s.jsx)(n.td,{children:"Message"}),(0,s.jsx)(n.td,{children:"Output parameter. The output produced when the condition is true."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"false_result"}),(0,s.jsx)(n.td,{children:"Message"}),(0,s.jsx)(n.td,{children:"Output parameter. The output produced when the condition is false."})]})]})]}),"\n",(0,s.jsx)(n.h2,{id:"loop",children:"Loop"}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"Loop"})," component iterates over a list of input by passing individual items to other components attached at the ",(0,s.jsx)(n.strong,{children:"Item"})," output port until there are no items left to process.\nThen, the ",(0,s.jsx)(n.strong,{children:"Loop"})," component passes the aggregated result of all looping to the component connected to the ",(0,s.jsx)(n.strong,{children:"Done"})," port."]}),"\n",(0,s.jsx)(n.h3,{id:"the-looping-process",children:"The looping process"}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"Loop"})," component is like a miniature flow within your flow.\nHere's a breakdown of the looping process:"]}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Accepts a list of ",(0,s.jsx)(n.a,{href:"/data-types#data",children:(0,s.jsx)(n.code,{children:"Data"})})," or ",(0,s.jsx)(n.a,{href:"/data-types#dataframe",children:(0,s.jsx)(n.code,{children:"DataFrame"})})," objects, such as a CSV file, through the ",(0,s.jsx)(n.strong,{children:"Loop"})," component's ",(0,s.jsx)(n.strong,{children:"Inputs"})," port."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Splits the input into individual items. For example, a CSV file is broken down by rows."}),"\n",(0,s.jsxs)(n.p,{children:["Specifically, the ",(0,s.jsx)(n.strong,{children:"Loop"})," component repeatedly extracts items by ",(0,s.jsx)(n.code,{children:"text"})," key in the ",(0,s.jsx)(n.code,{children:"Data"})," or ",(0,s.jsx)(n.code,{children:"DataFrame"})," objects until there are no more items to extract.\nEach ",(0,s.jsx)(n.code,{children:"item"})," output is a ",(0,s.jsx)(n.code,{children:"Data"})," objects."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Iterates over each ",(0,s.jsx)(n.code,{children:"item"})," by passing them to the ",(0,s.jsx)(n.strong,{children:"Item"})," output port."]}),"\n",(0,s.jsxs)(n.p,{children:["This port connects to one or more components that perform actions on each item.\nThe final component in the ",(0,s.jsx)(n.strong,{children:"Item"})," loop connects back to the ",(0,s.jsx)(n.strong,{children:"Loop"})," component's ",(0,s.jsx)(n.strong,{children:"Looping"})," port to process the next item."]}),"\n",(0,s.jsxs)(n.p,{children:["Only one component connects to the ",(0,s.jsx)(n.strong,{children:"Item"})," port, but you can pass the data through as many components as you need, as long as the last component in the chain connects back to the ",(0,s.jsx)(n.strong,{children:"Looping"})," port."]}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"If-Else"})," component isn't compatible with the ",(0,s.jsx)(n.strong,{children:"Loop"})," component.\nFor more information, see ",(0,s.jsx)(n.a,{href:"#conditional-looping",children:"Conditional looping"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["After processing all items, the results are aggregated into a single ",(0,s.jsx)(n.code,{children:"Data"})," object that is passed from the ",(0,s.jsx)(n.strong,{children:"Loop"})," component's ",(0,s.jsx)(n.strong,{children:"Done"})," port to the next component in the flow."]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["The following simplified Python code summarizes how the ",(0,s.jsx)(n.strong,{children:"Loop"})," component works.\nThis ",(0,s.jsx)(n.em,{children:"isn't"})," the actual component code; it is only meant to help you understand the general process."]}),"\n",(0,s.jsx)(x.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"for",props:{style:{color:"#FF7B72"}}},{content:" i ",props:{style:{color:"#C9D1D9"}}},{content:"in ",props:{style:{color:"#FF7B72"}}},{content:"input",props:{style:{color:"#79C0FF"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"# Receive input data as a list",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:" process_item(i) ",props:{style:{color:"#C9D1D9"}}},{content:"# Process each item through components connected at the Item port",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:" if",props:{style:{color:"#FF7B72"}}},{content:" has_more_items():",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" continue ",props:{style:{color:"#FF7B72"}}},{content:"# Loop back to Looping port to process the next item",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:" else",props:{style:{color:"#FF7B72"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" break ",props:{style:{color:"#FF7B72"}}},{content:"# Exit the loop when no more items are left",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"done ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" aggregate_results() ",props:{style:{color:"#C9D1D9"}}},{content:"# Compile all returned items",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"print",props:{style:{color:"#79C0FF"}}},{content:"(done) ",props:{style:{color:"#C9D1D9"}}},{content:"# Send the aggregated results from the Done port to another component",props:{style:{color:"#8B949E"}}}]}],lang:"python"},annotations:[]}]}),"\n",(0,s.jsx)(n.h3,{id:"loop-example",children:"Loop example"}),"\n",(0,s.jsxs)(n.p,{children:["In the follow example, the ",(0,s.jsx)(n.strong,{children:"Loop"})," component iterates over a CSV file until there are no rows left to process.\nIn this case, the ",(0,s.jsx)(n.strong,{children:"Item"})," port passes each row to a ",(0,s.jsx)(n.strong,{children:"Type Convert"})," component to convert the row into a ",(0,s.jsx)(n.code,{children:"Message"})," object, passes the ",(0,s.jsx)(n.code,{children:"Message"})," to a ",(0,s.jsx)(n.strong,{children:"Structured Output"})," component to be processed into structured data that is then passed back to the ",(0,s.jsx)(n.strong,{children:"Loop"})," component's ",(0,s.jsx)(n.strong,{children:"Looping"})," port.\nAfter processing all rows, the ",(0,s.jsx)(n.strong,{children:"Loop"})," component loads the aggregated list of structured data into a Chroma DB database through the ",(0,s.jsx)(n.strong,{children:"Chroma DB"})," component connected to the ",(0,s.jsx)(n.strong,{children:"Done"})," port."]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"Loop CSV parser",src:t(91110).A+"",width:"3876",height:"3300"})}),"\n",(0,s.jsx)(n.admonition,{type:"tip",children:(0,s.jsxs)(n.p,{children:["For more examples of the ",(0,s.jsx)(n.strong,{children:"Loop"})," component, try the ",(0,s.jsx)(n.strong,{children:"Research Translation Loop"})," template in Langflow, or see the video tutorial ",(0,s.jsx)(n.a,{href:"https://www.youtube.com/watch?v=9Wx7WODSKTo",children:"Mastering the Loop Component & Agentic RAG in Langflow"}),"."]})}),"\n",(0,s.jsx)(n.h3,{id:"conditional-looping",children:"Conditional looping"}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"If-Else"})," component isn't compatible with the ",(0,s.jsx)(n.strong,{children:"Loop"})," component.\nIf you need conditional loop events, redesign your flow to process conditions before the loop.\nFor example, if you are looping over a ",(0,s.jsx)(n.code,{children:"DataFrame"}),", you could use multiple ",(0,s.jsxs)(n.a,{href:"/components-processing#dataframe-operations",children:[(0,s.jsx)(n.strong,{children:"DataFrame Operations"})," components"]})," to conditionally filter data, and then run separate loops on each set of filtered data."]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"A flow with conditional looping.",src:t(12260).A+"",width:"1482",height:"673"})}),"\n",(0,s.jsx)(n.h2,{id:"notify-and-listen",children:"Notify and Listen"}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"Notify"})," and ",(0,s.jsx)(n.strong,{children:"Listen"})," components are used together."]}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"Notify"})," component builds a notification from the current flow's context, including specific data content and a status identifier."]}),"\n",(0,s.jsxs)(n.p,{children:["The resulting notification is sent to the ",(0,s.jsx)(n.strong,{children:"Listen"})," component.\nThe notification data can then be passed to other components in the flow, such as the ",(0,s.jsx)(n.strong,{children:"If-Else"})," component."]}),"\n",(0,s.jsx)(n.h2,{id:"run-flow",children:"Run flow"}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"Run Flow"})," component runs another Langflow flow as a subprocess of the current flow."]}),"\n",(0,s.jsxs)(n.p,{children:["You can use this component to chain flows together, run flows conditionally, and attach flows to ",(0,s.jsxs)(n.a,{href:"/components-agents",children:[(0,s.jsx)(n.strong,{children:"Agent"})," components"]})," as ",(0,s.jsx)(n.a,{href:"/agents-tools",children:"tools for agents"})," to run as needed."]}),"\n",(0,s.jsxs)(n.p,{children:["When used with an agent, the ",(0,s.jsx)(n.code,{children:"name"})," and ",(0,s.jsx)(n.code,{children:"description"})," metadata that the agent uses to register the tool are created automatically."]}),"\n",(0,s.jsxs)(n.p,{children:["When you select a flow for the ",(0,s.jsx)(n.strong,{children:"Run Flow"})," component, it uses the target flow's graph structure to dynamically generate input and output fields on the ",(0,s.jsx)(n.strong,{children:"Run Flow"})," component."]}),"\n",(0,s.jsx)(n.h3,{id:"run-flow-parameters",children:"Run Flow parameters"}),"\n",(0,s.jsx)(l.Ay,{}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"flow_name_selected"}),(0,s.jsx)(n.td,{children:"Dropdown"}),(0,s.jsx)(n.td,{children:"Input parameter. The name of the flow to run."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"session_id"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. The session ID for the flow run, if you want to pass a custom session ID for the subflow."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"flow_tweak_data"}),(0,s.jsx)(n.td,{children:"Dict"}),(0,s.jsx)(n.td,{children:"Input parameter. Dictionary of tweaks to customize the flow's behavior. Available tweaks depend on the selected flow."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"dynamic inputs"}),(0,s.jsx)(n.td,{children:"Various"}),(0,s.jsx)(n.td,{children:"Input parameter. Additional inputs are generated based on the selected flow."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"run_outputs"}),(0,s.jsxs)(n.td,{children:["A ",(0,s.jsx)(n.code,{children:"List"})," of types (",(0,s.jsx)(n.code,{children:"Data"}),", ",(0,s.jsx)(n.code,{children:"Message"}),", or ",(0,s.jsx)(n.code,{children:"DataFrame"}),")"]}),(0,s.jsx)(n.td,{children:"Output parameter. All outputs are generated from running the flow."})]})]})]}),"\n",(0,s.jsx)(n.h2,{id:"legacy-logic-components",children:"Legacy Logic components"}),"\n","\n",(0,s.jsx)(d.Ay,{}),"\n",(0,s.jsx)(n.p,{children:"The following Logic components are in legacy status:"}),"\n",(0,s.jsxs)(o,{children:[(0,s.jsx)("summary",{children:"Condition"}),(0,s.jsxs)(n.p,{children:["As an alternative to this legacy component, see the ",(0,s.jsxs)(n.a,{href:"#if-else",children:[(0,s.jsx)(n.strong,{children:"If-Else"})," component"]}),"."]}),(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"Condition"})," component routes ",(0,s.jsx)(n.code,{children:"Data"})," objects based on a condition applied to a specified key, including Boolean validation.\nIt supports ",(0,s.jsx)(n.code,{children:"true_output"})," and ",(0,s.jsx)(n.code,{children:"false_output"})," for routing the results based on the condition evaluation."]}),(0,s.jsx)(n.p,{children:"This component is useful in workflows that require conditional routing of complex data structures, enabling dynamic decision-making based on data content."}),(0,s.jsxs)(n.p,{children:["It can process either a single ",(0,s.jsx)(n.code,{children:"Data"})," object or a list of ",(0,s.jsx)(n.code,{children:"Data"})," objects.\nThe following actions occur when processing a list of ",(0,s.jsx)(n.code,{children:"Data"})," objects:"]}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Each object in the list is evaluated individually."}),"\n",(0,s.jsxs)(n.li,{children:["Objects meeting the condition go to ",(0,s.jsx)(n.code,{children:"true_output"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:["Objects not meeting the condition go to ",(0,s.jsx)(n.code,{children:"false_output"}),"."]}),"\n",(0,s.jsx)(n.li,{children:"If all objects go to one output, the other output is empty."}),"\n"]}),(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"Condition"})," component accepts the following parameters:"]}),(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"data_input"}),(0,s.jsx)(n.td,{children:"Data"}),(0,s.jsx)(n.td,{children:"Input parameter. The Data object or list of Data objects to process. This input can handle both single items and lists."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"key_name"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. The name of the key in the Data object to check."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"operator"}),(0,s.jsx)(n.td,{children:"Dropdown"}),(0,s.jsxs)(n.td,{children:["Input parameter. The operator to apply. Options: ",(0,s.jsx)(n.code,{children:"equals"}),", ",(0,s.jsx)(n.code,{children:"not equals"}),", ",(0,s.jsx)(n.code,{children:"contains"}),", ",(0,s.jsx)(n.code,{children:"starts with"}),", ",(0,s.jsx)(n.code,{children:"ends with"}),", ",(0,s.jsx)(n.code,{children:"boolean validator"}),". Default: ",(0,s.jsx)(n.code,{children:"equals"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"compare_value"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsxs)(n.td,{children:["Input parameter. The value to compare against. Not shown/used when operator is ",(0,s.jsx)(n.code,{children:"boolean validator"}),"."]})]})]})]}),(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.code,{children:"operator"})," options have the following behaviors:"]}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"equals"}),": Exact match comparison between the key's value and compare_value."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"not equals"}),": Inverse of exact match."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"contains"}),": Checks if compare_value is found within the key's value."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"starts with"}),": Checks if the key's value begins with compare_value."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"ends with"}),": Checks if the key's value ends with compare_value."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"boolean validator"}),": Treats the key's value as a Boolean. The following values are considered true:","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["Boolean ",(0,s.jsx)(n.code,{children:"true"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:["Strings: ",(0,s.jsx)(n.code,{children:"true"}),", ",(0,s.jsx)(n.code,{children:"1"}),", ",(0,s.jsx)(n.code,{children:"yes"}),", ",(0,s.jsx)(n.code,{children:"y"}),", ",(0,s.jsx)(n.code,{children:"on"})," (case-insensitive)"]}),"\n",(0,s.jsxs)(n.li,{children:["Any other value is converted using Python's ",(0,s.jsx)(n.code,{children:"bool()"})," function"]}),"\n"]}),"\n"]}),"\n"]})]}),"\n",(0,s.jsxs)(o,{children:[(0,s.jsx)("summary",{children:"Pass"}),(0,s.jsxs)(n.p,{children:["As an alternative to this legacy component, use the ",(0,s.jsxs)(n.a,{href:"#if-else",children:[(0,s.jsx)(n.strong,{children:"If-Else"})," component"]})," to pass a message without modification."]}),(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"Pass"})," component forwards the input message without modification."]}),(0,s.jsx)(n.p,{children:"It accepts the following parameters:"}),(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Display Name"}),(0,s.jsx)(n.th,{children:"Info"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"input_message"}),(0,s.jsx)(n.td,{children:"Input Message"}),(0,s.jsx)(n.td,{children:"Input parameter. The message to forward."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"ignored_message"}),(0,s.jsx)(n.td,{children:"Ignored Message"}),(0,s.jsx)(n.td,{children:"Input parameter. A second message that is ignored. Used as a workaround for continuity."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"output_message"}),(0,s.jsx)(n.td,{children:"Output Message"}),(0,s.jsx)(n.td,{children:"Output parameter. The forwarded message from the input."})]})]})]})]}),"\n",(0,s.jsxs)(o,{children:[(0,s.jsx)("summary",{children:"Flow As Tool"}),(0,s.jsx)(n.p,{children:"This component constructed a tool from a function that ran a loaded flow."}),(0,s.jsxs)(n.p,{children:["It was deprecated in Langflow version 1.1.2 and replaced by the ",(0,s.jsxs)(n.a,{href:"#run-flow",children:[(0,s.jsx)(n.strong,{children:"Run Flow"})," component"]}),"."]})]}),"\n",(0,s.jsxs)(o,{children:[(0,s.jsx)("summary",{children:"Sub Flow"}),(0,s.jsx)(n.p,{children:"This component integrated entire flows as components within a larger workflow.\nIt dynamically generated inputs based on the selected flow and executed the flow with provided parameters."}),(0,s.jsxs)(n.p,{children:["It was deprecated in Langflow version 1.1.2 and replaced by the ",(0,s.jsxs)(n.a,{href:"#run-flow",children:[(0,s.jsx)(n.strong,{children:"Run Flow"})," component"]}),"."]})]})]})}function g(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(m,{...e})}):m(e)}function f(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}},89329:(e,n,t)=>{t.d(n,{A:()=>o});const o=t.p+"assets/images/component-conditional-router-1fb27526613395545592fc9166c75c27.png"},91110:(e,n,t)=>{t.d(n,{A:()=>o});const o=t.p+"assets/images/component-loop-csv-66c1b53f0722b36a900632806cb32d78.png"}}]); \ No newline at end of file diff --git a/assets/js/0132780e.e353fb9b.js b/assets/js/0132780e.e353fb9b.js new file mode 100644 index 0000000000..d2d42538a7 --- /dev/null +++ b/assets/js/0132780e.e353fb9b.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[7841],{12260:(e,n,t)=>{t.d(n,{A:()=>o});const o=t.p+"assets/images/conditional-looping-756b330b8dc690b3dab1c44cc2fb05db.png"},17886:(e,n,t)=>{t.d(n,{A:()=>r});t(96540);var o=t(64058),s=t(74848);function r({name:e,...n}){const t=o[e];return t?(0,s.jsx)(t,{...n}):null}},31929:(e,n,t)=>{t.d(n,{Ay:()=>l,RM:()=>i});var o=t(74848),s=t(28453),r=t(17886);const i=[];function c(e){const n={a:"a",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,o.jsxs)(n.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,o.jsx)(r.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Controls"})," in the ",(0,o.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function l(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(c,{...e})}):c(e)}},36813:(e,n,t)=>{t.d(n,{Ay:()=>l,RM:()=>i});var o=t(74848),s=t(28453),r=t(17886);const i=[];function c(e){const n={a:"a",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(n.p,{children:["Legacy components are longer supported and can be removed in a future release.\nYou can continue to use them in existing flows, but it is recommended that you replace them with supported components as soon as possible.\nSuggested replacements are included in the ",(0,o.jsx)(n.strong,{children:"Legacy"})," banner on components in your flows.\nThey are also given in release notes and Langflow documentation whenever possible."]}),"\n",(0,o.jsxs)(n.p,{children:["If you aren't sure how to replace a legacy component, ",(0,o.jsx)(r.A,{name:"Search","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Search"})," for components by provider, service, or component name.\nThe component may have been deprecated in favor of a completely new component, a similar component, or a new version of the same component in a different category."]}),"\n",(0,o.jsxs)(n.p,{children:["If there is no obvious replacement, consider whether another component can be adapted to your use case.\nFor example, many ",(0,o.jsx)(r.A,{name:"Component","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Core components"})," provide generic functionality that can support multiple providers and use cases, such as the ",(0,o.jsxs)(n.a,{href:"/components-data#api-request",children:[(0,o.jsx)(n.strong,{children:"API Request"})," component"]}),"."]}),"\n",(0,o.jsxs)(n.p,{children:["If neither of these options are viable, you could use the legacy component's code to create your own custom component, or ",(0,o.jsx)(n.a,{href:"/contributing-github-issues",children:"start a discussion"})," about the legacy component."]}),"\n",(0,o.jsxs)(n.p,{children:["To discourage use of legacy components in new flows, these components are hidden by default.\nIn the visual editor, you can click ",(0,o.jsx)(r.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Component settings"})," to toggle the ",(0,o.jsx)(n.strong,{children:"Legacy"})," filter."]})]})}function l(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(c,{...e})}):c(e)}},57373:(e,n,t)=>{t.r(n),t.d(n,{CH:()=>x,assets:()=>p,chCodeConfig:()=>u,contentTitle:()=>h,default:()=>g,frontMatter:()=>a,metadata:()=>o,toc:()=>j});const o=JSON.parse('{"id":"Components/components-logic","title":"Logic","description":"Logic components provide functionalities for routing, conditional processing, and flow management.","source":"@site/docs/Components/components-logic.mdx","sourceDirName":"Components","slug":"/components-logic","permalink":"/components-logic","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Logic","slug":"/components-logic"},"sidebar":"docs","previous":{"title":"Prompt Template","permalink":"/components-prompts"},"next":{"title":"Helpers","permalink":"/components-helpers"}}');var s=t(74848),r=t(28453),i=t(24754),c=t(17886),l=t(31929),d=t(36813);const a={title:"Logic",slug:"/components-logic"},h=void 0,p={},x={annotations:i.hk,Code:i.Cy},u={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},j=[{value:"If-Else (conditional router)",id:"if-else",level:2},{value:"Use the If-Else component in a flow",id:"use-the-if-else-component-in-a-flow",level:3},{value:"If-Else parameters",id:"if-else-parameters",level:3},...l.RM,{value:"Loop",id:"loop",level:2},{value:"The looping process",id:"the-looping-process",level:3},{value:"Loop example",id:"loop-example",level:3},{value:"Conditional looping",id:"conditional-looping",level:3},{value:"Notify and Listen",id:"notify-and-listen",level:2},{value:"Run flow",id:"run-flow",level:2},{value:"Run Flow parameters",id:"run-flow-parameters",level:3},...l.RM,{value:"Legacy Logic components",id:"legacy-logic-components",level:2},...d.RM];function m(e){const n={a:"a",admonition:"admonition",code:"code",em:"em",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,r.R)(),...e.components},{Details:o}=n;return x||f("CH",!1),x.Code||f("CH.Code",!0),o||f("Details",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n","\n",(0,s.jsx)(n.p,{children:"Logic components provide functionalities for routing, conditional processing, and flow management."}),"\n",(0,s.jsx)(n.h2,{id:"if-else",children:"If-Else (conditional router)"}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"If-Else"})," component is a conditional router that routes messages by comparing two strings.\nIt evaluates a condition by comparing two text inputs using the specified operator, and then routes the message to ",(0,s.jsx)(n.code,{children:"true_result"})," or ",(0,s.jsx)(n.code,{children:"false_result"})," depending on the evaluation."]}),"\n",(0,s.jsxs)(n.p,{children:["The operator looks for single strings in the input (",(0,s.jsx)(n.code,{children:"input_text"}),") based on an operator and match text (",(0,s.jsx)(n.code,{children:"match_text"}),"), but it can also search for multiple words by matching a regex.\nAvailable operators include:"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"equals"}),": Exact match comparison"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"not equals"}),": Inverse of exact match"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"contains"}),": Checks if the ",(0,s.jsx)(n.code,{children:"match_text"})," is found within ",(0,s.jsx)(n.code,{children:"input_text"})]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"starts with"}),": Checks if ",(0,s.jsx)(n.code,{children:"input_text"})," begins with ",(0,s.jsx)(n.code,{children:"match_text"})]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"ends with"}),": Checks if ",(0,s.jsx)(n.code,{children:"input_text"})," ends with ",(0,s.jsx)(n.code,{children:"match_text"})]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"regex"}),": Matches on a case-sensitive pattern"]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["By default, all operators are case insensitive except ",(0,s.jsx)(n.strong,{children:"regex"}),".\n",(0,s.jsx)(n.strong,{children:"regex"})," is always case sensitive, and you can enable case sensitivity for all other operators in the ",(0,s.jsx)(n.a,{href:"#if-else-parameters",children:"If-Else parameters"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"use-the-if-else-component-in-a-flow",children:"Use the If-Else component in a flow"}),"\n",(0,s.jsxs)(n.p,{children:["The following example uses the ",(0,s.jsx)(n.strong,{children:"If-Else"})," component to check incoming chat messages with regex matching, and then output a different response depending on whether the match evaluated to true or false."]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"A conditional router connected to two OpenAI components",src:t(89329).A+"",width:"3532",height:"3044"})}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Add an ",(0,s.jsx)(n.strong,{children:"If-Else"})," component to your flow, and then configure it as follows:"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Text Input"}),": Connect the ",(0,s.jsx)(n.strong,{children:"Text Input"})," port to a ",(0,s.jsx)(n.strong,{children:"Chat Input"})," component or another ",(0,s.jsx)(n.code,{children:"Message"})," input."]}),"\n",(0,s.jsxs)(n.p,{children:["If your input isn't in ",(0,s.jsx)(n.code,{children:"Message"})," format, you can use another component to transform it, such as the ",(0,s.jsxs)(n.a,{href:"/components-processing#type-convert",children:[(0,s.jsx)(n.strong,{children:"Type Convert"})," component"]})," or ",(0,s.jsxs)(n.a,{href:"/components-processing#parser",children:[(0,s.jsx)(n.strong,{children:"Parser"})," component"]}),".\nIf your input isn't appropriate for ",(0,s.jsx)(n.code,{children:"Message"})," format, consider using another component for conditional routing, such as the ",(0,s.jsxs)(n.a,{href:"/components-processing#data-operations",children:[(0,s.jsx)(n.strong,{children:"Data Operations"})," component"]}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Match Text"}),": Enter ",(0,s.jsx)(n.code,{children:".*(urgent|warning|caution).*"})," so the component looks for these values in incoming input. The regex match is case sensitive, so if you need to look for all permutations of ",(0,s.jsx)(n.code,{children:"warning"}),", enter ",(0,s.jsx)(n.code,{children:"warning|Warning|WARNING"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Operator"}),": Select ",(0,s.jsx)(n.strong,{children:"regex"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Case True"}),": In the ",(0,s.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),", click ",(0,s.jsx)(c.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Controls"}),", enable the ",(0,s.jsx)(n.strong,{children:"Case True"})," parameter, click ",(0,s.jsx)(n.strong,{children:"Close"}),", and then enter ",(0,s.jsx)(n.code,{children:"New Message Detected"})," in the field."]}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"Case True"})," message is sent from the ",(0,s.jsx)(n.strong,{children:"True"})," output port when the match condition evaluates to true."]}),"\n",(0,s.jsxs)(n.p,{children:["No message is set for ",(0,s.jsx)(n.strong,{children:"Case False"})," so the component doesn't emit a message when the condition evaluates to false."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Depending on what you want to happen when the outcome is ",(0,s.jsx)(n.strong,{children:"True"}),", add components to your flow to execute that logic:"]}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Add a ",(0,s.jsx)(n.strong,{children:"Language Model"}),", ",(0,s.jsx)(n.strong,{children:"Prompt Template"}),", and ",(0,s.jsx)(n.strong,{children:"Chat Output"})," component to your flow."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["In the ",(0,s.jsx)(n.strong,{children:"Language Model"})," component, enter your OpenAI API key or select a different provider and model."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Connect the ",(0,s.jsx)(n.strong,{children:"If-Else"})," component's ",(0,s.jsx)(n.strong,{children:"True"})," output port to the ",(0,s.jsx)(n.strong,{children:"Language Model"})," component's ",(0,s.jsx)(n.strong,{children:"Input"})," port."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["In the ",(0,s.jsx)(n.strong,{children:"Prompt Template"})," component, enter instructions for the model when the evaluation is true, such as ",(0,s.jsx)(n.code,{children:"Send a message that a new warning, caution, or urgent message was received"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Connect the ",(0,s.jsx)(n.strong,{children:"Prompt Template"})," component to the ",(0,s.jsx)(n.strong,{children:"Language Model"})," component's ",(0,s.jsx)(n.strong,{children:"System Message"})," port."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Connect the ",(0,s.jsx)(n.strong,{children:"Language Model"})," component's output to the ",(0,s.jsx)(n.strong,{children:"Chat Output"})," component."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Repeat the same process with another set of ",(0,s.jsx)(n.strong,{children:"Language Model"}),", ",(0,s.jsx)(n.strong,{children:"Prompt Template"}),", and ",(0,s.jsx)(n.strong,{children:"Chat Output"})," components for the ",(0,s.jsx)(n.strong,{children:"False"})," outcome."]}),"\n",(0,s.jsxs)(n.p,{children:["Connect the ",(0,s.jsx)(n.strong,{children:"If-Else"})," component's ",(0,s.jsx)(n.strong,{children:"False"})," output port to the second ",(0,s.jsx)(n.strong,{children:"Language Model"})," component's ",(0,s.jsx)(n.strong,{children:"Input"})," port.\nIn the second ",(0,s.jsx)(n.strong,{children:"Prompt Template"}),", enter instructions for the model when the evaluation is false, such as ",(0,s.jsx)(n.code,{children:"Send a message that a new low-priority message was received"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["To test the flow, open the ",(0,s.jsx)(n.strong,{children:"Playground"}),", and then send the flow some messages with and without your regex strings.\nThe chat output should reflect the instructions in your prompts based on the regex evaluation."]}),"\n",(0,s.jsx)(x.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"User: A new user was created.",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"AI: A new low-priority message was received.",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"User: Sign-in warning: new user locked out.",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"AI: A new warning, caution, or urgent message was received. Please review it at your earliest convenience.",props:{}}]}],lang:"text"},annotations:[]}]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"if-else-parameters",children:"If-Else parameters"}),"\n",(0,s.jsx)(l.Ay,{}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"input_text"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. The primary text input for the operation."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"match_text"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. The text to compare against."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"operator"}),(0,s.jsx)(n.td,{children:"Dropdown"}),(0,s.jsxs)(n.td,{children:["Input parameter. The operator used to compare texts. Options include ",(0,s.jsx)(n.code,{children:"equals"}),", ",(0,s.jsx)(n.code,{children:"not equals"}),", ",(0,s.jsx)(n.code,{children:"contains"}),", ",(0,s.jsx)(n.code,{children:"starts with"}),", ",(0,s.jsx)(n.code,{children:"ends with"}),", and ",(0,s.jsx)(n.code,{children:"regex"}),". The default is ",(0,s.jsx)(n.code,{children:"equals"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"case_sensitive"}),(0,s.jsx)(n.td,{children:"Boolean"}),(0,s.jsxs)(n.td,{children:["Input parameter. When ",(0,s.jsx)(n.code,{children:"true"}),", the comparison is case sensitive. The default is ",(0,s.jsx)(n.code,{children:"false"}),". This setting doesn't apply to regex comparisons."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"max_iterations"}),(0,s.jsx)(n.td,{children:"Integer"}),(0,s.jsx)(n.td,{children:"Input parameter. The maximum number of iterations allowed for the conditional router. The default is 10."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"default_route"}),(0,s.jsx)(n.td,{children:"Dropdown"}),(0,s.jsxs)(n.td,{children:["Input parameter. The route to take when max iterations are reached. Options include ",(0,s.jsx)(n.code,{children:"true_result"})," or ",(0,s.jsx)(n.code,{children:"false_result"}),". The default is ",(0,s.jsx)(n.code,{children:"false_result"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"true_result"}),(0,s.jsx)(n.td,{children:"Message"}),(0,s.jsx)(n.td,{children:"Output parameter. The output produced when the condition is true."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"false_result"}),(0,s.jsx)(n.td,{children:"Message"}),(0,s.jsx)(n.td,{children:"Output parameter. The output produced when the condition is false."})]})]})]}),"\n",(0,s.jsx)(n.h2,{id:"loop",children:"Loop"}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"Loop"})," component iterates over a list of input by passing individual items to other components attached at the ",(0,s.jsx)(n.strong,{children:"Item"})," output port until there are no items left to process.\nThen, the ",(0,s.jsx)(n.strong,{children:"Loop"})," component passes the aggregated result of all looping to the component connected to the ",(0,s.jsx)(n.strong,{children:"Done"})," port."]}),"\n",(0,s.jsx)(n.h3,{id:"the-looping-process",children:"The looping process"}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"Loop"})," component is like a miniature flow within your flow.\nHere's a breakdown of the looping process:"]}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Accepts a list of ",(0,s.jsx)(n.a,{href:"/data-types#data",children:(0,s.jsx)(n.code,{children:"Data"})})," or ",(0,s.jsx)(n.a,{href:"/data-types#dataframe",children:(0,s.jsx)(n.code,{children:"DataFrame"})})," objects, such as a CSV file, through the ",(0,s.jsx)(n.strong,{children:"Loop"})," component's ",(0,s.jsx)(n.strong,{children:"Inputs"})," port."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Splits the input into individual items. For example, a CSV file is broken down by rows."}),"\n",(0,s.jsxs)(n.p,{children:["Specifically, the ",(0,s.jsx)(n.strong,{children:"Loop"})," component repeatedly extracts items by ",(0,s.jsx)(n.code,{children:"text"})," key in the ",(0,s.jsx)(n.code,{children:"Data"})," or ",(0,s.jsx)(n.code,{children:"DataFrame"})," objects until there are no more items to extract.\nEach ",(0,s.jsx)(n.code,{children:"item"})," output is a ",(0,s.jsx)(n.code,{children:"Data"})," objects."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Iterates over each ",(0,s.jsx)(n.code,{children:"item"})," by passing them to the ",(0,s.jsx)(n.strong,{children:"Item"})," output port."]}),"\n",(0,s.jsxs)(n.p,{children:["This port connects to one or more components that perform actions on each item.\nThe final component in the ",(0,s.jsx)(n.strong,{children:"Item"})," loop connects back to the ",(0,s.jsx)(n.strong,{children:"Loop"})," component's ",(0,s.jsx)(n.strong,{children:"Looping"})," port to process the next item."]}),"\n",(0,s.jsxs)(n.p,{children:["Only one component connects to the ",(0,s.jsx)(n.strong,{children:"Item"})," port, but you can pass the data through as many components as you need, as long as the last component in the chain connects back to the ",(0,s.jsx)(n.strong,{children:"Looping"})," port."]}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"If-Else"})," component isn't compatible with the ",(0,s.jsx)(n.strong,{children:"Loop"})," component.\nFor more information, see ",(0,s.jsx)(n.a,{href:"#conditional-looping",children:"Conditional looping"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["After processing all items, the results are aggregated into a single ",(0,s.jsx)(n.code,{children:"Data"})," object that is passed from the ",(0,s.jsx)(n.strong,{children:"Loop"})," component's ",(0,s.jsx)(n.strong,{children:"Done"})," port to the next component in the flow."]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["The following simplified Python code summarizes how the ",(0,s.jsx)(n.strong,{children:"Loop"})," component works.\nThis ",(0,s.jsx)(n.em,{children:"isn't"})," the actual component code; it is only meant to help you understand the general process."]}),"\n",(0,s.jsx)(x.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"for",props:{style:{color:"#FF7B72"}}},{content:" i ",props:{style:{color:"#C9D1D9"}}},{content:"in ",props:{style:{color:"#FF7B72"}}},{content:"input",props:{style:{color:"#79C0FF"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"# Receive input data as a list",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:" process_item(i) ",props:{style:{color:"#C9D1D9"}}},{content:"# Process each item through components connected at the Item port",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:" if",props:{style:{color:"#FF7B72"}}},{content:" has_more_items():",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" continue ",props:{style:{color:"#FF7B72"}}},{content:"# Loop back to Looping port to process the next item",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:" else",props:{style:{color:"#FF7B72"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" break ",props:{style:{color:"#FF7B72"}}},{content:"# Exit the loop when no more items are left",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"done ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" aggregate_results() ",props:{style:{color:"#C9D1D9"}}},{content:"# Compile all returned items",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"print",props:{style:{color:"#79C0FF"}}},{content:"(done) ",props:{style:{color:"#C9D1D9"}}},{content:"# Send the aggregated results from the Done port to another component",props:{style:{color:"#8B949E"}}}]}],lang:"python"},annotations:[]}]}),"\n",(0,s.jsx)(n.h3,{id:"loop-example",children:"Loop example"}),"\n",(0,s.jsxs)(n.p,{children:["In the follow example, the ",(0,s.jsx)(n.strong,{children:"Loop"})," component iterates over a CSV file until there are no rows left to process.\nIn this case, the ",(0,s.jsx)(n.strong,{children:"Item"})," port passes each row to a ",(0,s.jsx)(n.strong,{children:"Type Convert"})," component to convert the row into a ",(0,s.jsx)(n.code,{children:"Message"})," object, passes the ",(0,s.jsx)(n.code,{children:"Message"})," to a ",(0,s.jsx)(n.strong,{children:"Structured Output"})," component to be processed into structured data that is then passed back to the ",(0,s.jsx)(n.strong,{children:"Loop"})," component's ",(0,s.jsx)(n.strong,{children:"Looping"})," port.\nAfter processing all rows, the ",(0,s.jsx)(n.strong,{children:"Loop"})," component loads the aggregated list of structured data into a Chroma DB database through the ",(0,s.jsx)(n.strong,{children:"Chroma DB"})," component connected to the ",(0,s.jsx)(n.strong,{children:"Done"})," port."]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"Loop CSV parser",src:t(91110).A+"",width:"3876",height:"3300"})}),"\n",(0,s.jsx)(n.admonition,{type:"tip",children:(0,s.jsxs)(n.p,{children:["For more examples of the ",(0,s.jsx)(n.strong,{children:"Loop"})," component, try the ",(0,s.jsx)(n.strong,{children:"Research Translation Loop"})," template in Langflow, or see the video tutorial ",(0,s.jsx)(n.a,{href:"https://www.youtube.com/watch?v=9Wx7WODSKTo",children:"Mastering the Loop Component & Agentic RAG in Langflow"}),"."]})}),"\n",(0,s.jsx)(n.h3,{id:"conditional-looping",children:"Conditional looping"}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"If-Else"})," component isn't compatible with the ",(0,s.jsx)(n.strong,{children:"Loop"})," component.\nIf you need conditional loop events, redesign your flow to process conditions before the loop.\nFor example, if you are looping over a ",(0,s.jsx)(n.code,{children:"DataFrame"}),", you could use multiple ",(0,s.jsxs)(n.a,{href:"/components-processing#dataframe-operations",children:[(0,s.jsx)(n.strong,{children:"DataFrame Operations"})," components"]})," to conditionally filter data, and then run separate loops on each set of filtered data."]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"A flow with conditional looping.",src:t(12260).A+"",width:"1482",height:"673"})}),"\n",(0,s.jsx)(n.h2,{id:"notify-and-listen",children:"Notify and Listen"}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"Notify"})," and ",(0,s.jsx)(n.strong,{children:"Listen"})," components are used together."]}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"Notify"})," component builds a notification from the current flow's context, including specific data content and a status identifier."]}),"\n",(0,s.jsxs)(n.p,{children:["The resulting notification is sent to the ",(0,s.jsx)(n.strong,{children:"Listen"})," component.\nThe notification data can then be passed to other components in the flow, such as the ",(0,s.jsx)(n.strong,{children:"If-Else"})," component."]}),"\n",(0,s.jsx)(n.h2,{id:"run-flow",children:"Run flow"}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"Run Flow"})," component runs another Langflow flow as a subprocess of the current flow."]}),"\n",(0,s.jsxs)(n.p,{children:["You can use this component to chain flows together, run flows conditionally, and attach flows to ",(0,s.jsxs)(n.a,{href:"/components-agents",children:[(0,s.jsx)(n.strong,{children:"Agent"})," components"]})," as ",(0,s.jsx)(n.a,{href:"/agents-tools",children:"tools for agents"})," to run as needed."]}),"\n",(0,s.jsxs)(n.p,{children:["When used with an agent, the ",(0,s.jsx)(n.code,{children:"name"})," and ",(0,s.jsx)(n.code,{children:"description"})," metadata that the agent uses to register the tool are created automatically."]}),"\n",(0,s.jsxs)(n.p,{children:["When you select a flow for the ",(0,s.jsx)(n.strong,{children:"Run Flow"})," component, it uses the target flow's graph structure to dynamically generate input and output fields on the ",(0,s.jsx)(n.strong,{children:"Run Flow"})," component."]}),"\n",(0,s.jsx)(n.h3,{id:"run-flow-parameters",children:"Run Flow parameters"}),"\n",(0,s.jsx)(l.Ay,{}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"flow_name_selected"}),(0,s.jsx)(n.td,{children:"Dropdown"}),(0,s.jsx)(n.td,{children:"Input parameter. The name of the flow to run."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"session_id"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. The session ID for the flow run, if you want to pass a custom session ID for the subflow."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"flow_tweak_data"}),(0,s.jsx)(n.td,{children:"Dict"}),(0,s.jsx)(n.td,{children:"Input parameter. Dictionary of tweaks to customize the flow's behavior. Available tweaks depend on the selected flow."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"dynamic inputs"}),(0,s.jsx)(n.td,{children:"Various"}),(0,s.jsx)(n.td,{children:"Input parameter. Additional inputs are generated based on the selected flow."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"run_outputs"}),(0,s.jsxs)(n.td,{children:["A ",(0,s.jsx)(n.code,{children:"List"})," of types (",(0,s.jsx)(n.code,{children:"Data"}),", ",(0,s.jsx)(n.code,{children:"Message"}),", or ",(0,s.jsx)(n.code,{children:"DataFrame"}),")"]}),(0,s.jsx)(n.td,{children:"Output parameter. All outputs are generated from running the flow."})]})]})]}),"\n",(0,s.jsx)(n.h2,{id:"legacy-logic-components",children:"Legacy Logic components"}),"\n","\n",(0,s.jsx)(d.Ay,{}),"\n",(0,s.jsx)(n.p,{children:"The following Logic components are in legacy status:"}),"\n",(0,s.jsxs)(o,{children:[(0,s.jsx)("summary",{children:"Condition"}),(0,s.jsxs)(n.p,{children:["As an alternative to this legacy component, see the ",(0,s.jsxs)(n.a,{href:"#if-else",children:[(0,s.jsx)(n.strong,{children:"If-Else"})," component"]}),"."]}),(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"Condition"})," component routes ",(0,s.jsx)(n.code,{children:"Data"})," objects based on a condition applied to a specified key, including Boolean validation.\nIt supports ",(0,s.jsx)(n.code,{children:"true_output"})," and ",(0,s.jsx)(n.code,{children:"false_output"})," for routing the results based on the condition evaluation."]}),(0,s.jsx)(n.p,{children:"This component is useful in workflows that require conditional routing of complex data structures, enabling dynamic decision-making based on data content."}),(0,s.jsxs)(n.p,{children:["It can process either a single ",(0,s.jsx)(n.code,{children:"Data"})," object or a list of ",(0,s.jsx)(n.code,{children:"Data"})," objects.\nThe following actions occur when processing a list of ",(0,s.jsx)(n.code,{children:"Data"})," objects:"]}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Each object in the list is evaluated individually."}),"\n",(0,s.jsxs)(n.li,{children:["Objects meeting the condition go to ",(0,s.jsx)(n.code,{children:"true_output"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:["Objects not meeting the condition go to ",(0,s.jsx)(n.code,{children:"false_output"}),"."]}),"\n",(0,s.jsx)(n.li,{children:"If all objects go to one output, the other output is empty."}),"\n"]}),(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"Condition"})," component accepts the following parameters:"]}),(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"data_input"}),(0,s.jsx)(n.td,{children:"Data"}),(0,s.jsx)(n.td,{children:"Input parameter. The Data object or list of Data objects to process. This input can handle both single items and lists."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"key_name"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. The name of the key in the Data object to check."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"operator"}),(0,s.jsx)(n.td,{children:"Dropdown"}),(0,s.jsxs)(n.td,{children:["Input parameter. The operator to apply. Options: ",(0,s.jsx)(n.code,{children:"equals"}),", ",(0,s.jsx)(n.code,{children:"not equals"}),", ",(0,s.jsx)(n.code,{children:"contains"}),", ",(0,s.jsx)(n.code,{children:"starts with"}),", ",(0,s.jsx)(n.code,{children:"ends with"}),", ",(0,s.jsx)(n.code,{children:"boolean validator"}),". Default: ",(0,s.jsx)(n.code,{children:"equals"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"compare_value"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsxs)(n.td,{children:["Input parameter. The value to compare against. Not shown/used when operator is ",(0,s.jsx)(n.code,{children:"boolean validator"}),"."]})]})]})]}),(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.code,{children:"operator"})," options have the following behaviors:"]}),(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"equals"}),": Exact match comparison between the key's value and compare_value."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"not equals"}),": Inverse of exact match."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"contains"}),": Checks if compare_value is found within the key's value."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"starts with"}),": Checks if the key's value begins with compare_value."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"ends with"}),": Checks if the key's value ends with compare_value."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"boolean validator"}),": Treats the key's value as a Boolean. The following values are considered true:","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["Boolean ",(0,s.jsx)(n.code,{children:"true"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:["Strings: ",(0,s.jsx)(n.code,{children:"true"}),", ",(0,s.jsx)(n.code,{children:"1"}),", ",(0,s.jsx)(n.code,{children:"yes"}),", ",(0,s.jsx)(n.code,{children:"y"}),", ",(0,s.jsx)(n.code,{children:"on"})," (case-insensitive)"]}),"\n",(0,s.jsxs)(n.li,{children:["Any other value is converted using Python's ",(0,s.jsx)(n.code,{children:"bool()"})," function"]}),"\n"]}),"\n"]}),"\n"]})]}),"\n",(0,s.jsxs)(o,{children:[(0,s.jsx)("summary",{children:"Pass"}),(0,s.jsxs)(n.p,{children:["As an alternative to this legacy component, use the ",(0,s.jsxs)(n.a,{href:"#if-else",children:[(0,s.jsx)(n.strong,{children:"If-Else"})," component"]})," to pass a message without modification."]}),(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"Pass"})," component forwards the input message without modification."]}),(0,s.jsx)(n.p,{children:"It accepts the following parameters:"}),(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Display Name"}),(0,s.jsx)(n.th,{children:"Info"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"input_message"}),(0,s.jsx)(n.td,{children:"Input Message"}),(0,s.jsx)(n.td,{children:"Input parameter. The message to forward."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"ignored_message"}),(0,s.jsx)(n.td,{children:"Ignored Message"}),(0,s.jsx)(n.td,{children:"Input parameter. A second message that is ignored. Used as a workaround for continuity."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"output_message"}),(0,s.jsx)(n.td,{children:"Output Message"}),(0,s.jsx)(n.td,{children:"Output parameter. The forwarded message from the input."})]})]})]})]}),"\n",(0,s.jsxs)(o,{children:[(0,s.jsx)("summary",{children:"Flow As Tool"}),(0,s.jsx)(n.p,{children:"This component constructed a tool from a function that ran a loaded flow."}),(0,s.jsxs)(n.p,{children:["It was deprecated in Langflow version 1.1.2 and replaced by the ",(0,s.jsxs)(n.a,{href:"#run-flow",children:[(0,s.jsx)(n.strong,{children:"Run Flow"})," component"]}),"."]})]}),"\n",(0,s.jsxs)(o,{children:[(0,s.jsx)("summary",{children:"Sub Flow"}),(0,s.jsx)(n.p,{children:"This component integrated entire flows as components within a larger workflow.\nIt dynamically generated inputs based on the selected flow and executed the flow with provided parameters."}),(0,s.jsxs)(n.p,{children:["It was deprecated in Langflow version 1.1.2 and replaced by the ",(0,s.jsxs)(n.a,{href:"#run-flow",children:[(0,s.jsx)(n.strong,{children:"Run Flow"})," component"]}),"."]})]})]})}function g(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(m,{...e})}):m(e)}function f(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}},89329:(e,n,t)=>{t.d(n,{A:()=>o});const o=t.p+"assets/images/component-conditional-router-1fb27526613395545592fc9166c75c27.png"},91110:(e,n,t)=>{t.d(n,{A:()=>o});const o=t.p+"assets/images/component-loop-csv-66c1b53f0722b36a900632806cb32d78.png"}}]); \ No newline at end of file diff --git a/assets/js/017d425f.0e428502.js b/assets/js/017d425f.0e428502.js deleted file mode 100644 index aa42ad33ef..0000000000 --- a/assets/js/017d425f.0e428502.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[2360],{28453:(e,t,n)=>{n.d(t,{R:()=>i,x:()=>a});var o=n(96540);const r={},s=o.createContext(r);function i(e){const t=o.useContext(s);return o.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:i(e.components),o.createElement(s.Provider,{value:t},e.children)}},45033:(e,t,n)=>{n.r(t),n.d(t,{CH:()=>d,assets:()=>l,chCodeConfig:()=>h,contentTitle:()=>c,default:()=>u,frontMatter:()=>a,metadata:()=>o,toc:()=>p});const o=JSON.parse('{"id":"Components/components-prompts","title":"Prompt Template","description":"Use the Prompt Template core component to create a prompt that supplies instructions and context to an LLM or agent, separate from other input like chat messages and file uploads.","source":"@site/docs/Components/components-prompts.mdx","sourceDirName":"Components","slug":"/components-prompts","permalink":"/components-prompts","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Prompt Template","slug":"/components-prompts"},"sidebar":"docs","previous":{"title":"Processing components","permalink":"/components-processing"},"next":{"title":"Logic","permalink":"/components-logic"}}');var r=n(74848),s=n(28453),i=n(24754);const a={title:"Prompt Template",slug:"/components-prompts"},c=void 0,l={},d={annotations:i.hk,Code:i.Cy},h={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},p=[{value:"Prompt Template parameters",id:"prompt-template-parameters",level:2},{value:"Define variables in prompts",id:"define-variables-in-prompts",level:2},{value:"See also",id:"see-also",level:2}];function m(e){const t={a:"a",code:"code",em:"em",h2:"h2",li:"li",ol:"ol",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,s.R)(),...e.components};return d||x("CH",!1),d.Code||x("CH.Code",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n",(0,r.jsxs)(t.p,{children:["Use the ",(0,r.jsx)(t.strong,{children:"Prompt Template"})," core component to create a ",(0,r.jsx)(t.em,{children:"prompt"})," that supplies instructions and context to an LLM or agent, separate from other input like chat messages and file uploads."]}),"\n",(0,r.jsx)(t.p,{children:"Prompts are structured input that use natural language, fixed values, and dynamic variables to provide baseline context for the LLM.\nFor example:"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsx)(t.li,{children:"Define a consistent structure for user queries, making it easier for the LLM to understand and respond appropriately."}),"\n",(0,r.jsx)(t.li,{children:"Define a specific output format for the LLM, such as JSON or structured text."}),"\n",(0,r.jsxs)(t.li,{children:["Define a role for the LLM, such as ",(0,r.jsx)(t.code,{children:"You are a helpful assistant"})," or ",(0,r.jsx)(t.code,{children:"You are an expert in microbiology"}),"."]}),"\n",(0,r.jsx)(t.li,{children:"Allow the LLM to reference chat memory."}),"\n"]}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Prompt Template"})," component can also output variable instructions to other components later in the flow."]}),"\n",(0,r.jsx)(t.h2,{id:"prompt-template-parameters",children:"Prompt Template parameters"}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Name"}),(0,r.jsx)(t.th,{children:"Display Name"}),(0,r.jsx)(t.th,{children:"Description"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"template"}),(0,r.jsx)(t.td,{children:"Template"}),(0,r.jsxs)(t.td,{children:["Input parameter. Create a prompt template with dynamic variables (",(0,r.jsx)(t.code,{children:"{VARIABLE_NAME}"}),")."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"prompt"}),(0,r.jsx)(t.td,{children:"Prompt Message"}),(0,r.jsxs)(t.td,{children:["Output parameter. The built prompt message returned by the ",(0,r.jsx)(t.code,{children:"build_prompt"})," method."]})]})]})]}),"\n",(0,r.jsx)(t.h2,{id:"define-variables-in-prompts",children:"Define variables in prompts"}),"\n",(0,r.jsxs)(t.p,{children:["Variables in a ",(0,r.jsx)(t.strong,{children:"Prompt Template"})," component dynamically add fields to the ",(0,r.jsx)(t.strong,{children:"Prompt Template"})," component so that your flow can receive definitions for those values from other components, Langflow global variables, or fixed input."]}),"\n",(0,r.jsxs)(t.p,{children:["For example, with the ",(0,r.jsxs)(t.a,{href:"/components-helpers#message-history",children:[(0,r.jsx)(t.strong,{children:"Message History"})," component"]}),", you can use a ",(0,r.jsx)(t.code,{children:"{memory}"})," variable to pass chat history to the prompt.\nHowever, the ",(0,r.jsx)(t.strong,{children:"Agent"})," component includes built-in chat memory that is enabled by default.\nFor more information, see ",(0,r.jsx)(t.a,{href:"/memory",children:"Memory management options"}),"."]}),"\n",(0,r.jsxs)(t.p,{children:["The following steps demonstrate how to add variables to a ",(0,r.jsx)(t.strong,{children:"Prompt Template"})," component:"]}),"\n",(0,r.jsxs)(t.ol,{children:["\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Create a flow based on the ",(0,r.jsx)(t.strong,{children:"Basic prompting"})," template."]}),"\n",(0,r.jsxs)(t.p,{children:["This template already has a ",(0,r.jsx)(t.strong,{children:"Prompt Template"})," component, but the template only contains natural language instructions: ",(0,r.jsx)(t.code,{children:"Answer the user as if you were a GenAI expert, enthusiastic about helping them get started building something fresh."})]}),"\n",(0,r.jsx)(t.p,{children:"This prompt defines a role for the LLM's chat interactions, but it doesn't include variables that help you create prompts that adapt dynamically to changing contexts, such as different users and environments."}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Click the ",(0,r.jsx)(t.strong,{children:"Prompt Template"})," component, and then add some variables to the ",(0,r.jsx)(t.strong,{children:"Template"})," field."]}),"\n",(0,r.jsxs)(t.p,{children:["Variables are declared by wrapping the variable name in curly braces, like ",(0,r.jsx)(t.code,{children:"{variable_name}"}),".\nFor example, the following template creates ",(0,r.jsx)(t.code,{children:"context"})," and ",(0,r.jsx)(t.code,{children:"user_question"})," variables:"]}),"\n",(0,r.jsx)(d.Code,{codeConfig:h,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"Given the context:",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"{context}",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"Answer the question:",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"{user_question}",props:{}}]}],lang:"text"},annotations:[]}]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Click ",(0,r.jsx)(t.strong,{children:"Check & Save"})," to save the template."]}),"\n",(0,r.jsxs)(t.p,{children:["After adding the variables to the template, new fields are added to the ",(0,r.jsx)(t.strong,{children:"Prompt Template"})," component for each variable."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsx)(t.p,{children:"Provide input for the variable fields:"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsx)(t.li,{children:"Connect the fields to other components to pass the output from those components to the variables."}),"\n",(0,r.jsx)(t.li,{children:"Use Langflow global variables."}),"\n",(0,r.jsx)(t.li,{children:"Enter fixed values directly into the fields."}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(t.p,{children:["You can add as many variables as you like in your template.\nFor example, you could add variables for ",(0,r.jsx)(t.code,{children:"{references}"})," and ",(0,r.jsx)(t.code,{children:"{instructions}"}),", and then feed that information in from other components, such as ",(0,r.jsx)(t.strong,{children:"Text Input"}),", ",(0,r.jsx)(t.strong,{children:"URL"}),", or ",(0,r.jsx)(t.strong,{children:"File"})," components."]}),"\n",(0,r.jsx)(t.h2,{id:"see-also",children:"See also"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsx)(t.li,{children:(0,r.jsxs)(t.a,{href:"/bundles-langchain#prompt-hub",children:[(0,r.jsx)(t.strong,{children:"LangChain Prompt Hub"})," component"]})}),"\n",(0,r.jsx)(t.li,{children:(0,r.jsx)(t.a,{href:"/components-processing",children:"Processing components"})}),"\n"]})]})}function u(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(m,{...e})}):m(e)}function x(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}}}]); \ No newline at end of file diff --git a/assets/js/017d425f.d868b3f5.js b/assets/js/017d425f.d868b3f5.js new file mode 100644 index 0000000000..29baad2dd8 --- /dev/null +++ b/assets/js/017d425f.d868b3f5.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[2360],{28453:(e,t,n)=>{n.d(t,{R:()=>a,x:()=>i});var o=n(96540);const r={},s=o.createContext(r);function a(e){const t=o.useContext(s);return o.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function i(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:a(e.components),o.createElement(s.Provider,{value:t},e.children)}},45033:(e,t,n)=>{n.r(t),n.d(t,{CH:()=>h,assets:()=>d,chCodeConfig:()=>p,contentTitle:()=>l,default:()=>x,frontMatter:()=>c,metadata:()=>o,toc:()=>m});const o=JSON.parse('{"id":"Components/components-prompts","title":"Prompt Template","description":"Use the Prompt Template core component to create a prompt that supplies instructions and context to an LLM or agent, separate from other input like chat messages and file uploads.","source":"@site/docs/Components/components-prompts.mdx","sourceDirName":"Components","slug":"/components-prompts","permalink":"/components-prompts","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Prompt Template","slug":"/components-prompts"},"sidebar":"docs","previous":{"title":"Processing components","permalink":"/components-processing"},"next":{"title":"Logic","permalink":"/components-logic"}}');var r=n(74848),s=n(28453),a=n(24754),i=n(72736);const c={title:"Prompt Template",slug:"/components-prompts"},l=void 0,d={},h={annotations:a.hk,Code:a.Cy},p={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},m=[{value:"Prompt Template parameters",id:"prompt-template-parameters",level:2},{value:"Define variables in prompts",id:"define-variables-in-prompts",level:2},...i.RM,{value:"See also",id:"see-also",level:2}];function u(e){const t={a:"a",code:"code",em:"em",h2:"h2",li:"li",ol:"ol",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,s.R)(),...e.components};return h||f("CH",!1),h.Code||f("CH.Code",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n","\n",(0,r.jsxs)(t.p,{children:["Use the ",(0,r.jsx)(t.strong,{children:"Prompt Template"})," core component to create a ",(0,r.jsx)(t.em,{children:"prompt"})," that supplies instructions and context to an LLM or agent, separate from other input like chat messages and file uploads."]}),"\n",(0,r.jsx)(t.p,{children:"Prompts are structured input that use natural language, fixed values, and dynamic variables to provide baseline context for the LLM.\nFor example:"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsx)(t.li,{children:"Define a consistent structure for user queries, making it easier for the LLM to understand and respond appropriately."}),"\n",(0,r.jsx)(t.li,{children:"Define a specific output format for the LLM, such as JSON or structured text."}),"\n",(0,r.jsxs)(t.li,{children:["Define a role for the LLM, such as ",(0,r.jsx)(t.code,{children:"You are a helpful assistant"})," or ",(0,r.jsx)(t.code,{children:"You are an expert in microbiology"}),"."]}),"\n",(0,r.jsx)(t.li,{children:"Allow the LLM to reference chat memory."}),"\n"]}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Prompt Template"})," component can also output variable instructions to other components later in the flow."]}),"\n",(0,r.jsx)(t.h2,{id:"prompt-template-parameters",children:"Prompt Template parameters"}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Name"}),(0,r.jsx)(t.th,{children:"Display Name"}),(0,r.jsx)(t.th,{children:"Description"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"template"}),(0,r.jsx)(t.td,{children:"Template"}),(0,r.jsxs)(t.td,{children:["Input parameter. Create a prompt template with dynamic variables in curly braces, such as ",(0,r.jsx)(t.code,{children:"{VARIABLE_NAME}"}),". ",(0,r.jsx)(i.Ay,{})]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"prompt"}),(0,r.jsx)(t.td,{children:"Prompt Message"}),(0,r.jsxs)(t.td,{children:["Output parameter. The built prompt message returned by the ",(0,r.jsx)(t.code,{children:"build_prompt"})," method."]})]})]})]}),"\n",(0,r.jsx)(t.h2,{id:"define-variables-in-prompts",children:"Define variables in prompts"}),"\n",(0,r.jsxs)(t.p,{children:["Variables in a ",(0,r.jsx)(t.strong,{children:"Prompt Template"})," component dynamically add fields to the ",(0,r.jsx)(t.strong,{children:"Prompt Template"})," component so that your flow can receive definitions for those values from other components, Langflow global variables, or fixed input."]}),"\n",(0,r.jsxs)(t.p,{children:["For example, with the ",(0,r.jsxs)(t.a,{href:"/components-helpers#message-history",children:[(0,r.jsx)(t.strong,{children:"Message History"})," component"]}),", you can use a ",(0,r.jsx)(t.code,{children:"{memory}"})," variable to pass chat history to the prompt.\nHowever, the ",(0,r.jsx)(t.strong,{children:"Agent"})," component includes built-in chat memory that is enabled by default.\nFor more information, see ",(0,r.jsx)(t.a,{href:"/memory",children:"Memory management options"}),"."]}),"\n",(0,r.jsxs)(t.p,{children:["The following steps demonstrate how to add variables to a ",(0,r.jsx)(t.strong,{children:"Prompt Template"})," component:"]}),"\n",(0,r.jsxs)(t.ol,{children:["\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Create a flow based on the ",(0,r.jsx)(t.strong,{children:"Basic prompting"})," template."]}),"\n",(0,r.jsxs)(t.p,{children:["This template already has a ",(0,r.jsx)(t.strong,{children:"Prompt Template"})," component, but the template only contains natural language instructions: ",(0,r.jsx)(t.code,{children:"Answer the user as if you were a GenAI expert, enthusiastic about helping them get started building something fresh."})]}),"\n",(0,r.jsx)(t.p,{children:"This prompt defines a role for the LLM's chat interactions, but it doesn't include variables that help you create prompts that adapt dynamically to changing contexts, such as different users and environments."}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Click the ",(0,r.jsx)(t.strong,{children:"Prompt Template"})," component, and then add some variables to the ",(0,r.jsx)(t.strong,{children:"Template"})," field."]}),"\n",(0,r.jsxs)(t.p,{children:["Variables are declared by wrapping the variable name in curly braces, like ",(0,r.jsx)(t.code,{children:"{variable_name}"}),".\nFor example, the following template creates ",(0,r.jsx)(t.code,{children:"context"})," and ",(0,r.jsx)(t.code,{children:"user_question"})," variables:"]}),"\n",(0,r.jsx)(h.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"Given the context:",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"{context}",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"Answer the question:",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"{user_question}",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,r.jsx)(i.Ay,{}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Click ",(0,r.jsx)(t.strong,{children:"Check & Save"})," to save the template."]}),"\n",(0,r.jsxs)(t.p,{children:["After adding the variables to the template, new fields are added to the ",(0,r.jsx)(t.strong,{children:"Prompt Template"})," component for each variable."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsx)(t.p,{children:"Provide input for the variable fields:"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsx)(t.li,{children:"Connect the fields to other components to pass the output from those components to the variables."}),"\n",(0,r.jsx)(t.li,{children:"Use Langflow global variables."}),"\n",(0,r.jsx)(t.li,{children:"Enter fixed values directly into the fields."}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(t.p,{children:["You can add as many variables as you like in your template.\nFor example, you could add variables for ",(0,r.jsx)(t.code,{children:"{references}"})," and ",(0,r.jsx)(t.code,{children:"{instructions}"}),", and then feed that information in from other components, such as ",(0,r.jsx)(t.strong,{children:"Text Input"}),", ",(0,r.jsx)(t.strong,{children:"URL"}),", or ",(0,r.jsx)(t.strong,{children:"File"})," components."]}),"\n",(0,r.jsx)(t.h2,{id:"see-also",children:"See also"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsx)(t.li,{children:(0,r.jsxs)(t.a,{href:"/bundles-langchain#prompt-hub",children:[(0,r.jsx)(t.strong,{children:"LangChain Prompt Hub"})," component"]})}),"\n",(0,r.jsx)(t.li,{children:(0,r.jsx)(t.a,{href:"/components-processing",children:"Processing components"})}),"\n"]})]})}function x(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(u,{...e})}):u(e)}function f(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}},72736:(e,t,n)=>{n.d(t,{Ay:()=>i,RM:()=>s});var o=n(74848),r=n(28453);const s=[];function a(e){const t={code:"code",p:"p",...(0,r.R)(),...e.components};return(0,o.jsxs)(t.p,{children:["If your template includes literal text and variables, you can use double curly braces to escape literal curly braces in the template and prevent interpretation of that text as a variable.\nFor example: ",(0,o.jsx)(t.code,{children:"This is a template with {{literal text in curly braces}} and a {variable}"}),"."]})}function i(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,o.jsx)(t,{...e,children:(0,o.jsx)(a,{...e})}):a(e)}}}]); \ No newline at end of file diff --git a/assets/js/02f8077b.4dd9ccc3.js b/assets/js/02f8077b.4dd9ccc3.js deleted file mode 100644 index 61aa9c365c..0000000000 --- a/assets/js/02f8077b.4dd9ccc3.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[8267],{17886:(e,t,r)=>{r.d(t,{A:()=>o});r(96540);var n=r(64058),s=r(74848);function o({name:e,...t}){const r=n[e];return r?(0,s.jsx)(r,{...t}):null}},29744:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>p,contentTitle:()=>u,default:()=>j,frontMatter:()=>h,metadata:()=>n,toc:()=>x});const n=JSON.parse('{"id":"Components/bundles-clickhouse","title":"ClickHouse","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/bundles-clickhouse.mdx","sourceDirName":"Components","slug":"/bundles-clickhouse","permalink":"/bundles-clickhouse","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"ClickHouse","slug":"/bundles-clickhouse"},"sidebar":"docs","previous":{"title":"Cleanlab","permalink":"/integrations-cleanlab"},"next":{"title":"Cloudflare","permalink":"/bundles-cloudflare"}}');var s=r(74848),o=r(28453),c=r(17886),a=r(31929),i=r(80223),d=r(90465),l=r(50005);const h={title:"ClickHouse",slug:"/bundles-clickhouse"},u=void 0,p={},x=[{value:"ClickHouse vector store",id:"clickhouse-vector-store",level:2},...l.RM,...d.RM,{value:"ClickHouse parameters",id:"clickhouse-parameters",level:3},...a.RM,...i.RM];function m(e){const t={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,o.R)(),...e.components},{Details:r}=t;return r||function(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(t.p,{children:[(0,s.jsx)(c.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(t.a,{href:"/components-bundle-components",children:(0,s.jsx)(t.strong,{children:"Bundles"})})," contain custom components that support specific third-party integrations with Langflow."]}),"\n",(0,s.jsxs)(t.p,{children:["This page describes the components that are available in the ",(0,s.jsx)(t.strong,{children:"ClickHouse"})," bundle."]}),"\n",(0,s.jsx)(t.h2,{id:"clickhouse-vector-store",children:"ClickHouse vector store"}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.strong,{children:"ClickHouse"})," component reads and writes to a ClickHouse vector store using an instance of ",(0,s.jsx)(t.code,{children:"ClickHouse"})," vector store."]}),"\n",(0,s.jsxs)(r,{children:[(0,s.jsx)("summary",{children:"About vector store instances"}),(0,s.jsx)(l.Ay,{})]}),"\n",(0,s.jsx)(d.Ay,{}),"\n",(0,s.jsx)(t.admonition,{type:"tip",children:(0,s.jsxs)(t.p,{children:["For a tutorial using a vector database in a flow, see ",(0,s.jsx)(t.a,{href:"/chat-with-rag",children:"Create a vector RAG chatbot"}),"."]})}),"\n",(0,s.jsx)(t.h3,{id:"clickhouse-parameters",children:"ClickHouse parameters"}),"\n",(0,s.jsx)(t.p,{children:"You can inspect a vector store component's parameters to learn more about the inputs it accepts, the features it supports, and how to configure it."}),"\n",(0,s.jsx)(a.Ay,{}),"\n",(0,s.jsx)(i.Ay,{}),"\n",(0,s.jsxs)(t.p,{children:["For information about accepted values and functionality, see the ",(0,s.jsx)(t.a,{href:"https://clickhouse.com/docs/en/intro",children:"ClickHouse Documentation"})," or inspect ",(0,s.jsx)(t.a,{href:"/concepts-components#component-code",children:"component code"}),"."]}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Name"}),(0,s.jsx)(t.th,{children:"Display Name"}),(0,s.jsx)(t.th,{children:"Info"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"host"}),(0,s.jsx)(t.td,{children:"hostname"}),(0,s.jsxs)(t.td,{children:["Input parameter. The ClickHouse server hostname. Required. Default: ",(0,s.jsx)(t.code,{children:"localhost"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"port"}),(0,s.jsx)(t.td,{children:"port"}),(0,s.jsxs)(t.td,{children:["Input parameter. The ClickHouse server port. Required. Default: ",(0,s.jsx)(t.code,{children:"8123"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"database"}),(0,s.jsx)(t.td,{children:"database"}),(0,s.jsx)(t.td,{children:"Input parameter. The ClickHouse database name. Required."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"table"}),(0,s.jsx)(t.td,{children:"Table name"}),(0,s.jsx)(t.td,{children:"Input parameter. The ClickHouse table name. Required."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"username"}),(0,s.jsx)(t.td,{children:"Username"}),(0,s.jsx)(t.td,{children:"Input parameter. ClickHouse username for authentication. Required."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"password"}),(0,s.jsx)(t.td,{children:"Password"}),(0,s.jsx)(t.td,{children:"Input parameter. ClickHouse password for authentication. Required."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"index_type"}),(0,s.jsx)(t.td,{children:"index_type"}),(0,s.jsxs)(t.td,{children:["Input parameter. Type of the index, either ",(0,s.jsx)(t.code,{children:"annoy"})," (default) or ",(0,s.jsx)(t.code,{children:"vector_similarity"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"metric"}),(0,s.jsx)(t.td,{children:"metric"}),(0,s.jsxs)(t.td,{children:["Input parameter. Metric to compute distance for similarity search. The options are ",(0,s.jsx)(t.code,{children:"angular"})," (default), ",(0,s.jsx)(t.code,{children:"euclidean"}),", ",(0,s.jsx)(t.code,{children:"manhattan"}),", ",(0,s.jsx)(t.code,{children:"hamming"}),", ",(0,s.jsx)(t.code,{children:"dot"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"secure"}),(0,s.jsx)(t.td,{children:"Use HTTPS/TLS"}),(0,s.jsx)(t.td,{children:"Input parameter. If true, enables HTTPS/TLS for the ClickHouse server and overrides inferred values for interface or port arguments. Default: false."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"index_param"}),(0,s.jsx)(t.td,{children:"Param of the index"}),(0,s.jsxs)(t.td,{children:["Input parameter. Index parameters. Default: ",(0,s.jsx)(t.code,{children:"100,'L2Distance'"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"index_query_params"}),(0,s.jsx)(t.td,{children:"index query params"}),(0,s.jsx)(t.td,{children:"Input parameter. Additional index query parameters."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"search_query"}),(0,s.jsx)(t.td,{children:"Search Query"}),(0,s.jsx)(t.td,{children:"Input parameter. The query string for similarity search. Only relevant for reads."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"ingest_data"}),(0,s.jsx)(t.td,{children:"Ingest Data"}),(0,s.jsx)(t.td,{children:"Input parameter. The records to load into the vector store."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"cache_vector_store"}),(0,s.jsx)(t.td,{children:"Cache Vector Store"}),(0,s.jsx)(t.td,{children:"Input parameter. If true, the component caches the vector store in memory for faster reads. Default: Enabled (true)."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"embedding"}),(0,s.jsx)(t.td,{children:"Embedding"}),(0,s.jsx)(t.td,{children:"Input parameter. The embedding model to use."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"number_of_results"}),(0,s.jsx)(t.td,{children:"Number of Results"}),(0,s.jsxs)(t.td,{children:["Input parameter. The number of search results to return. Default: ",(0,s.jsx)(t.code,{children:"4"}),". Only relevant for reads."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"score_threshold"}),(0,s.jsx)(t.td,{children:"Score threshold"}),(0,s.jsx)(t.td,{children:"Input parameter. The threshold for similarity score comparison. Default: Unset (no threshold). Only relevant for reads."})]})]})]})]})}function j(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(m,{...e})}):m(e)}},31929:(e,t,r)=>{r.d(t,{Ay:()=>i,RM:()=>c});var n=r(74848),s=r(28453),o=r(17886);const c=[];function a(e){const t={a:"a",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,n.jsxs)(t.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,n.jsx)(o.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,n.jsx)(t.strong,{children:"Controls"})," in the ",(0,n.jsx)(t.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function i(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(a,{...e})}):a(e)}},50005:(e,t,r)=>{r.d(t,{Ay:()=>a,RM:()=>o});var n=r(74848),s=r(28453);const o=[];function c(e){const t={a:"a",code:"code",p:"p",...(0,s.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(t.p,{children:["Because Langflow is based on LangChain, vector store components use an instance of ",(0,n.jsx)(t.a,{href:"https://python.langchain.com/docs/integrations/vectorstores/",children:"LangChain vector store"})," to drive the underlying read and write functions.\nThese instances are provider-specific and configured according to the component's parameters, such as the connection string, index name, and schema."]}),"\n",(0,n.jsxs)(t.p,{children:["In component code, this is often instantiated as ",(0,n.jsx)(t.code,{children:"vector_store"}),", but some vector store components use a different name, such as the provider name."]}),"\n",(0,n.jsx)(t.p,{children:"Some LangChain classes don't expose all possible options as component parameters.\nDepending on the provider, these options might use default values or allow modification through environment variables, if they are supported in Langflow.\nFor information about specific options, see the LangChain API reference and vector store provider's documentation."})]})}function a(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(c,{...e})}):c(e)}},80223:(e,t,r)=>{r.d(t,{Ay:()=>a,RM:()=>o});var n=r(74848),s=r(28453);const o=[];function c(e){const t={p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,n.jsxs)(t.p,{children:["Some parameters are conditional, and they are only available after you set other parameters or select specific options for other parameters.\nConditional parameters may not be visible on the ",(0,n.jsx)(t.strong,{children:"Controls"})," pane until you set the required dependencies."]})}function a(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(c,{...e})}):c(e)}},90465:(e,t,r)=>{r.d(t,{Ay:()=>a,RM:()=>o});var n=r(74848),s=r(28453);const o=[];function c(e){const t={a:"a",code:"code",p:"p",...(0,s.R)(),...e.components};return(0,n.jsxs)(t.p,{children:["If you use a vector store component to query your vector database, it produces search results that you can pass to downstream components in your flow as a list of ",(0,n.jsx)(t.a,{href:"/data-types#data",children:(0,n.jsx)(t.code,{children:"Data"})})," objects or a tabular ",(0,n.jsx)(t.a,{href:"/data-types#dataframe",children:(0,n.jsx)(t.code,{children:"DataFrame"})}),".\nIf both types are supported, you can set the format near the vector store component's output port in the visual editor."]})}function a(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(c,{...e})}):c(e)}}}]); \ No newline at end of file diff --git a/assets/js/02f8077b.888569a0.js b/assets/js/02f8077b.888569a0.js new file mode 100644 index 0000000000..4dd3b5a250 --- /dev/null +++ b/assets/js/02f8077b.888569a0.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[8267],{17886:(e,t,r)=>{r.d(t,{A:()=>o});r(96540);var n=r(64058),s=r(74848);function o({name:e,...t}){const r=n[e];return r?(0,s.jsx)(r,{...t}):null}},29744:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>p,contentTitle:()=>u,default:()=>j,frontMatter:()=>h,metadata:()=>n,toc:()=>x});const n=JSON.parse('{"id":"Components/bundles-clickhouse","title":"ClickHouse","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/bundles-clickhouse.mdx","sourceDirName":"Components","slug":"/bundles-clickhouse","permalink":"/bundles-clickhouse","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"ClickHouse","slug":"/bundles-clickhouse"},"sidebar":"docs","previous":{"title":"Cleanlab","permalink":"/integrations-cleanlab"},"next":{"title":"Cloudflare","permalink":"/bundles-cloudflare"}}');var s=r(74848),o=r(28453),c=r(17886),i=r(31929),a=r(80223),d=r(90465),l=r(50005);const h={title:"ClickHouse",slug:"/bundles-clickhouse"},u=void 0,p={},x=[{value:"ClickHouse vector store",id:"clickhouse-vector-store",level:2},...l.RM,...d.RM,{value:"ClickHouse parameters",id:"clickhouse-parameters",level:3},...i.RM,...a.RM];function m(e){const t={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,o.R)(),...e.components},{Details:r}=t;return r||function(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(t.p,{children:[(0,s.jsx)(c.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(t.a,{href:"/components-bundle-components",children:(0,s.jsx)(t.strong,{children:"Bundles"})})," contain custom components that support specific third-party integrations with Langflow."]}),"\n",(0,s.jsxs)(t.p,{children:["This page describes the components that are available in the ",(0,s.jsx)(t.strong,{children:"ClickHouse"})," bundle."]}),"\n",(0,s.jsx)(t.h2,{id:"clickhouse-vector-store",children:"ClickHouse vector store"}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.strong,{children:"ClickHouse"})," component reads and writes to a ClickHouse vector store using an instance of ",(0,s.jsx)(t.code,{children:"ClickHouse"})," vector store."]}),"\n",(0,s.jsxs)(r,{children:[(0,s.jsx)("summary",{children:"About vector store instances"}),(0,s.jsx)(l.Ay,{})]}),"\n",(0,s.jsx)(d.Ay,{}),"\n",(0,s.jsx)(t.admonition,{type:"tip",children:(0,s.jsxs)(t.p,{children:["For a tutorial using a vector database in a flow, see ",(0,s.jsx)(t.a,{href:"/chat-with-rag",children:"Create a vector RAG chatbot"}),"."]})}),"\n",(0,s.jsx)(t.h3,{id:"clickhouse-parameters",children:"ClickHouse parameters"}),"\n",(0,s.jsx)(t.p,{children:"You can inspect a vector store component's parameters to learn more about the inputs it accepts, the features it supports, and how to configure it."}),"\n",(0,s.jsx)(i.Ay,{}),"\n",(0,s.jsx)(a.Ay,{}),"\n",(0,s.jsxs)(t.p,{children:["For information about accepted values and functionality, see the ",(0,s.jsx)(t.a,{href:"https://clickhouse.com/docs/en/intro",children:"ClickHouse Documentation"})," or inspect ",(0,s.jsx)(t.a,{href:"/concepts-components#component-code",children:"component code"}),"."]}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Name"}),(0,s.jsx)(t.th,{children:"Display Name"}),(0,s.jsx)(t.th,{children:"Info"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"host"}),(0,s.jsx)(t.td,{children:"hostname"}),(0,s.jsxs)(t.td,{children:["Input parameter. The ClickHouse server hostname. Required. Default: ",(0,s.jsx)(t.code,{children:"localhost"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"port"}),(0,s.jsx)(t.td,{children:"port"}),(0,s.jsxs)(t.td,{children:["Input parameter. The ClickHouse server port. Required. Default: ",(0,s.jsx)(t.code,{children:"8123"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"database"}),(0,s.jsx)(t.td,{children:"database"}),(0,s.jsx)(t.td,{children:"Input parameter. The ClickHouse database name. Required."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"table"}),(0,s.jsx)(t.td,{children:"Table name"}),(0,s.jsx)(t.td,{children:"Input parameter. The ClickHouse table name. Required."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"username"}),(0,s.jsx)(t.td,{children:"Username"}),(0,s.jsx)(t.td,{children:"Input parameter. ClickHouse username for authentication. Required."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"password"}),(0,s.jsx)(t.td,{children:"Password"}),(0,s.jsx)(t.td,{children:"Input parameter. ClickHouse password for authentication. Required."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"index_type"}),(0,s.jsx)(t.td,{children:"index_type"}),(0,s.jsxs)(t.td,{children:["Input parameter. Type of the index, either ",(0,s.jsx)(t.code,{children:"annoy"})," (default) or ",(0,s.jsx)(t.code,{children:"vector_similarity"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"metric"}),(0,s.jsx)(t.td,{children:"metric"}),(0,s.jsxs)(t.td,{children:["Input parameter. Metric to compute distance for similarity search. The options are ",(0,s.jsx)(t.code,{children:"angular"})," (default), ",(0,s.jsx)(t.code,{children:"euclidean"}),", ",(0,s.jsx)(t.code,{children:"manhattan"}),", ",(0,s.jsx)(t.code,{children:"hamming"}),", ",(0,s.jsx)(t.code,{children:"dot"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"secure"}),(0,s.jsx)(t.td,{children:"Use HTTPS/TLS"}),(0,s.jsxs)(t.td,{children:["Input parameter. If ",(0,s.jsx)(t.code,{children:"true"}),", enables HTTPS/TLS for the ClickHouse server and overrides inferred values for interface or port arguments. Default: ",(0,s.jsx)(t.code,{children:"false"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"index_param"}),(0,s.jsx)(t.td,{children:"Param of the index"}),(0,s.jsxs)(t.td,{children:["Input parameter. Index parameters. Default: ",(0,s.jsx)(t.code,{children:"100,'L2Distance'"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"index_query_params"}),(0,s.jsx)(t.td,{children:"index query params"}),(0,s.jsx)(t.td,{children:"Input parameter. Additional index query parameters."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"search_query"}),(0,s.jsx)(t.td,{children:"Search Query"}),(0,s.jsx)(t.td,{children:"Input parameter. The query string for similarity search. Only relevant for reads."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"ingest_data"}),(0,s.jsx)(t.td,{children:"Ingest Data"}),(0,s.jsx)(t.td,{children:"Input parameter. The records to load into the vector store."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"cache_vector_store"}),(0,s.jsx)(t.td,{children:"Cache Vector Store"}),(0,s.jsxs)(t.td,{children:["Input parameter. If ",(0,s.jsx)(t.code,{children:"true"}),", the component caches the vector store in memory for faster reads. Default: Enabled (",(0,s.jsx)(t.code,{children:"true"}),")."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"embedding"}),(0,s.jsx)(t.td,{children:"Embedding"}),(0,s.jsx)(t.td,{children:"Input parameter. The embedding model to use."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"number_of_results"}),(0,s.jsx)(t.td,{children:"Number of Results"}),(0,s.jsxs)(t.td,{children:["Input parameter. The number of search results to return. Default: ",(0,s.jsx)(t.code,{children:"4"}),". Only relevant for reads."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"score_threshold"}),(0,s.jsx)(t.td,{children:"Score threshold"}),(0,s.jsx)(t.td,{children:"Input parameter. The threshold for similarity score comparison. Default: Unset (no threshold). Only relevant for reads."})]})]})]})]})}function j(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(m,{...e})}):m(e)}},31929:(e,t,r)=>{r.d(t,{Ay:()=>a,RM:()=>c});var n=r(74848),s=r(28453),o=r(17886);const c=[];function i(e){const t={a:"a",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,n.jsxs)(t.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,n.jsx)(o.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,n.jsx)(t.strong,{children:"Controls"})," in the ",(0,n.jsx)(t.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function a(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(i,{...e})}):i(e)}},50005:(e,t,r)=>{r.d(t,{Ay:()=>i,RM:()=>o});var n=r(74848),s=r(28453);const o=[];function c(e){const t={a:"a",code:"code",p:"p",...(0,s.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(t.p,{children:["Because Langflow is based on LangChain, vector store components use an instance of ",(0,n.jsx)(t.a,{href:"https://python.langchain.com/docs/integrations/vectorstores/",children:"LangChain vector store"})," to drive the underlying read and write functions.\nThese instances are provider-specific and configured according to the component's parameters, such as the connection string, index name, and schema."]}),"\n",(0,n.jsxs)(t.p,{children:["In component code, this is often instantiated as ",(0,n.jsx)(t.code,{children:"vector_store"}),", but some vector store components use a different name, such as the provider name."]}),"\n",(0,n.jsx)(t.p,{children:"Some LangChain classes don't expose all possible options as component parameters.\nDepending on the provider, these options might use default values or allow modification through environment variables, if they are supported in Langflow.\nFor information about specific options, see the LangChain API reference and vector store provider's documentation."})]})}function i(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(c,{...e})}):c(e)}},80223:(e,t,r)=>{r.d(t,{Ay:()=>i,RM:()=>o});var n=r(74848),s=r(28453);const o=[];function c(e){const t={p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,n.jsxs)(t.p,{children:["Some parameters are conditional, and they are only available after you set other parameters or select specific options for other parameters.\nConditional parameters may not be visible on the ",(0,n.jsx)(t.strong,{children:"Controls"})," pane until you set the required dependencies."]})}function i(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(c,{...e})}):c(e)}},90465:(e,t,r)=>{r.d(t,{Ay:()=>i,RM:()=>o});var n=r(74848),s=r(28453);const o=[];function c(e){const t={a:"a",code:"code",p:"p",...(0,s.R)(),...e.components};return(0,n.jsxs)(t.p,{children:["If you use a vector store component to query your vector database, it produces search results that you can pass to downstream components in your flow as a list of ",(0,n.jsx)(t.a,{href:"/data-types#data",children:(0,n.jsx)(t.code,{children:"Data"})})," objects or a tabular ",(0,n.jsx)(t.a,{href:"/data-types#dataframe",children:(0,n.jsx)(t.code,{children:"DataFrame"})}),".\nIf both types are supported, you can set the format near the vector store component's output port in the visual editor."]})}function i(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(c,{...e})}):c(e)}}}]); \ No newline at end of file diff --git a/assets/js/03735ec1.03d84efe.js b/assets/js/03735ec1.cfd17913.js similarity index 63% rename from assets/js/03735ec1.03d84efe.js rename to assets/js/03735ec1.cfd17913.js index 05f577c5ff..c6d66a4b1a 100644 --- a/assets/js/03735ec1.03d84efe.js +++ b/assets/js/03735ec1.cfd17913.js @@ -1 +1 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[956],{17886:(e,t,n)=>{n.d(t,{A:()=>o});n(96540);var r=n(64058),s=n(74848);function o({name:e,...t}){const n=r[e];return n?(0,s.jsx)(n,{...t}):null}},31929:(e,t,n)=>{n.d(t,{Ay:()=>d,RM:()=>i});var r=n(74848),s=n(28453),o=n(17886);const i=[];function a(e){const t={a:"a",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,r.jsxs)(t.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,r.jsx)(o.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Controls"})," in the ",(0,r.jsx)(t.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function d(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}},50005:(e,t,n)=>{n.d(t,{Ay:()=>a,RM:()=>o});var r=n(74848),s=n(28453);const o=[];function i(e){const t={a:"a",code:"code",p:"p",...(0,s.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(t.p,{children:["Because Langflow is based on LangChain, vector store components use an instance of ",(0,r.jsx)(t.a,{href:"https://python.langchain.com/docs/integrations/vectorstores/",children:"LangChain vector store"})," to drive the underlying read and write functions.\nThese instances are provider-specific and configured according to the component's parameters, such as the connection string, index name, and schema."]}),"\n",(0,r.jsxs)(t.p,{children:["In component code, this is often instantiated as ",(0,r.jsx)(t.code,{children:"vector_store"}),", but some vector store components use a different name, such as the provider name."]}),"\n",(0,r.jsx)(t.p,{children:"Some LangChain classes don't expose all possible options as component parameters.\nDepending on the provider, these options might use default values or allow modification through environment variables, if they are supported in Langflow.\nFor information about specific options, see the LangChain API reference and vector store provider's documentation."})]})}function a(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(i,{...e})}):i(e)}},80223:(e,t,n)=>{n.d(t,{Ay:()=>a,RM:()=>o});var r=n(74848),s=n(28453);const o=[];function i(e){const t={p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,r.jsxs)(t.p,{children:["Some parameters are conditional, and they are only available after you set other parameters or select specific options for other parameters.\nConditional parameters may not be visible on the ",(0,r.jsx)(t.strong,{children:"Controls"})," pane until you set the required dependencies."]})}function a(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(i,{...e})}):i(e)}},80345:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>u,contentTitle:()=>p,default:()=>j,frontMatter:()=>h,metadata:()=>r,toc:()=>m});const r=JSON.parse('{"id":"Components/bundles-mongodb","title":"MongoDB","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/bundles-mongodb.mdx","sourceDirName":"Components","slug":"/bundles-mongodb","permalink":"/bundles-mongodb","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"MongoDB","slug":"/bundles-mongodb"},"sidebar":"docs","previous":{"title":"MistralAI","permalink":"/bundles-mistralai"},"next":{"title":"Set up a Notion App","permalink":"/integrations/notion/setup"}}');var s=n(74848),o=n(28453),i=n(17886),a=n(31929),d=n(80223),c=n(90465),l=n(50005);const h={title:"MongoDB",slug:"/bundles-mongodb"},p=void 0,u={},m=[{value:"MongoDB Atlas",id:"mongodb-atlas",level:2},...l.RM,...c.RM,{value:"MongoDB Atlas parameters",id:"mongodb-atlas-parameters",level:3},...a.RM,...d.RM];function x(e){const t={a:"a",code:"code",h2:"h2",h3:"h3",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,o.R)(),...e.components},{Details:n}=t;return n||function(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(t.p,{children:[(0,s.jsx)(i.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(t.a,{href:"/components-bundle-components",children:(0,s.jsx)(t.strong,{children:"Bundles"})})," contain custom components that support specific third-party integrations with Langflow."]}),"\n",(0,s.jsxs)(t.p,{children:["This page describes the components that are available in the ",(0,s.jsx)(t.strong,{children:"MongoDB"})," bundle."]}),"\n",(0,s.jsx)(t.h2,{id:"mongodb-atlas",children:"MongoDB Atlas"}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.strong,{children:"MongoDB Atlas"})," component reads and writes to MongoDB Atlas vector stores using an instance of ",(0,s.jsx)(t.a,{href:"https://python.langchain.com/docs/integrations/vectorstores/mongodb_atlas/",children:(0,s.jsx)(t.code,{children:"MongoDBAtlasVectorSearch"})}),"."]}),"\n",(0,s.jsxs)(n,{children:[(0,s.jsx)("summary",{children:"About vector store instances"}),(0,s.jsx)(l.Ay,{})]}),"\n",(0,s.jsx)(c.Ay,{}),"\n",(0,s.jsx)(t.h3,{id:"mongodb-atlas-parameters",children:"MongoDB Atlas parameters"}),"\n",(0,s.jsx)(t.p,{children:"You can inspect a vector store component's parameters to learn more about the inputs it accepts, the features it supports, and how to configure it."}),"\n",(0,s.jsx)(a.Ay,{}),"\n",(0,s.jsx)(d.Ay,{}),"\n",(0,s.jsxs)(t.p,{children:["For information about accepted values and functionality, see the ",(0,s.jsx)(t.a,{href:"https://www.mongodb.com/docs/atlas/atlas-vector-search/tutorials/vector-search-quick-start/",children:"MongoDB Atlas documentation"})," or inspect ",(0,s.jsx)(t.a,{href:"/concepts-components#component-code",children:"component code"}),"."]}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Name"}),(0,s.jsx)(t.th,{children:"Type"}),(0,s.jsx)(t.th,{children:"Description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"mongodb_atlas_cluster_uri"}),(0,s.jsx)(t.td,{children:"SecretString"}),(0,s.jsx)(t.td,{children:"Input parameter. The connection URI for your MongoDB Atlas cluster. Required."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"enable_mtls"}),(0,s.jsx)(t.td,{children:"Boolean"}),(0,s.jsx)(t.td,{children:"Input parameter. Enable mutual TLS authentication. Default: false."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"mongodb_atlas_client_cert"}),(0,s.jsx)(t.td,{children:"SecretString"}),(0,s.jsx)(t.td,{children:"Input parameter. Client certificate combined with private key for mTLS authentication. Required if mTLS is enabled."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"db_name"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. The name of the database to use. Required."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"collection_name"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. The name of the collection to use. Required."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"index_name"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. The name of the Atlas Search index, it should be a Vector Search. Required."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"insert_mode"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:'Input parameter. How to insert new documents into the collection. The options are "append" or "overwrite". Default: "append".'})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"embedding"}),(0,s.jsx)(t.td,{children:"Embeddings"}),(0,s.jsx)(t.td,{children:"Input parameter. The embedding model to use."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"number_of_results"}),(0,s.jsx)(t.td,{children:"Integer"}),(0,s.jsx)(t.td,{children:"Input parameter. Number of results to return in similarity search. Default: 4."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"index_field"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:'Input parameter. The field to index. Default: "embedding".'})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"filter_field"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. The field to filter the index."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"number_dimensions"}),(0,s.jsx)(t.td,{children:"Integer"}),(0,s.jsx)(t.td,{children:"Input parameter. Embedding vector dimension count. Default: 1536."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"similarity"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:'Input parameter. The method used to measure similarity between vectors. The options are "cosine", "euclidean", or "dotProduct". Default: "cosine".'})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"quantization"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:'Input parameter. Quantization reduces memory costs by converting 32-bit floats to smaller data types. The options are "scalar" or "binary".'})]})]})]})]})}function j(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(x,{...e})}):x(e)}},90465:(e,t,n)=>{n.d(t,{Ay:()=>a,RM:()=>o});var r=n(74848),s=n(28453);const o=[];function i(e){const t={a:"a",code:"code",p:"p",...(0,s.R)(),...e.components};return(0,r.jsxs)(t.p,{children:["If you use a vector store component to query your vector database, it produces search results that you can pass to downstream components in your flow as a list of ",(0,r.jsx)(t.a,{href:"/data-types#data",children:(0,r.jsx)(t.code,{children:"Data"})})," objects or a tabular ",(0,r.jsx)(t.a,{href:"/data-types#dataframe",children:(0,r.jsx)(t.code,{children:"DataFrame"})}),".\nIf both types are supported, you can set the format near the vector store component's output port in the visual editor."]})}function a(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(i,{...e})}):i(e)}}}]); \ No newline at end of file +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[956],{17886:(e,t,n)=>{n.d(t,{A:()=>o});n(96540);var r=n(64058),s=n(74848);function o({name:e,...t}){const n=r[e];return n?(0,s.jsx)(n,{...t}):null}},31929:(e,t,n)=>{n.d(t,{Ay:()=>d,RM:()=>i});var r=n(74848),s=n(28453),o=n(17886);const i=[];function a(e){const t={a:"a",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,r.jsxs)(t.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,r.jsx)(o.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Controls"})," in the ",(0,r.jsx)(t.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function d(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}},50005:(e,t,n)=>{n.d(t,{Ay:()=>a,RM:()=>o});var r=n(74848),s=n(28453);const o=[];function i(e){const t={a:"a",code:"code",p:"p",...(0,s.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(t.p,{children:["Because Langflow is based on LangChain, vector store components use an instance of ",(0,r.jsx)(t.a,{href:"https://python.langchain.com/docs/integrations/vectorstores/",children:"LangChain vector store"})," to drive the underlying read and write functions.\nThese instances are provider-specific and configured according to the component's parameters, such as the connection string, index name, and schema."]}),"\n",(0,r.jsxs)(t.p,{children:["In component code, this is often instantiated as ",(0,r.jsx)(t.code,{children:"vector_store"}),", but some vector store components use a different name, such as the provider name."]}),"\n",(0,r.jsx)(t.p,{children:"Some LangChain classes don't expose all possible options as component parameters.\nDepending on the provider, these options might use default values or allow modification through environment variables, if they are supported in Langflow.\nFor information about specific options, see the LangChain API reference and vector store provider's documentation."})]})}function a(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(i,{...e})}):i(e)}},80223:(e,t,n)=>{n.d(t,{Ay:()=>a,RM:()=>o});var r=n(74848),s=n(28453);const o=[];function i(e){const t={p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,r.jsxs)(t.p,{children:["Some parameters are conditional, and they are only available after you set other parameters or select specific options for other parameters.\nConditional parameters may not be visible on the ",(0,r.jsx)(t.strong,{children:"Controls"})," pane until you set the required dependencies."]})}function a(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(i,{...e})}):i(e)}},80345:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>u,contentTitle:()=>p,default:()=>j,frontMatter:()=>h,metadata:()=>r,toc:()=>m});const r=JSON.parse('{"id":"Components/bundles-mongodb","title":"MongoDB","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/bundles-mongodb.mdx","sourceDirName":"Components","slug":"/bundles-mongodb","permalink":"/bundles-mongodb","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"MongoDB","slug":"/bundles-mongodb"},"sidebar":"docs","previous":{"title":"MistralAI","permalink":"/bundles-mistralai"},"next":{"title":"Set up a Notion App","permalink":"/integrations/notion/setup"}}');var s=n(74848),o=n(28453),i=n(17886),a=n(31929),d=n(80223),c=n(90465),l=n(50005);const h={title:"MongoDB",slug:"/bundles-mongodb"},p=void 0,u={},m=[{value:"MongoDB Atlas",id:"mongodb-atlas",level:2},...l.RM,...c.RM,{value:"MongoDB Atlas parameters",id:"mongodb-atlas-parameters",level:3},...a.RM,...d.RM];function x(e){const t={a:"a",code:"code",h2:"h2",h3:"h3",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,o.R)(),...e.components},{Details:n}=t;return n||function(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(t.p,{children:[(0,s.jsx)(i.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(t.a,{href:"/components-bundle-components",children:(0,s.jsx)(t.strong,{children:"Bundles"})})," contain custom components that support specific third-party integrations with Langflow."]}),"\n",(0,s.jsxs)(t.p,{children:["This page describes the components that are available in the ",(0,s.jsx)(t.strong,{children:"MongoDB"})," bundle."]}),"\n",(0,s.jsx)(t.h2,{id:"mongodb-atlas",children:"MongoDB Atlas"}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.strong,{children:"MongoDB Atlas"})," component reads and writes to MongoDB Atlas vector stores using an instance of ",(0,s.jsx)(t.a,{href:"https://python.langchain.com/docs/integrations/vectorstores/mongodb_atlas/",children:(0,s.jsx)(t.code,{children:"MongoDBAtlasVectorSearch"})}),"."]}),"\n",(0,s.jsxs)(n,{children:[(0,s.jsx)("summary",{children:"About vector store instances"}),(0,s.jsx)(l.Ay,{})]}),"\n",(0,s.jsx)(c.Ay,{}),"\n",(0,s.jsx)(t.h3,{id:"mongodb-atlas-parameters",children:"MongoDB Atlas parameters"}),"\n",(0,s.jsx)(t.p,{children:"You can inspect a vector store component's parameters to learn more about the inputs it accepts, the features it supports, and how to configure it."}),"\n",(0,s.jsx)(a.Ay,{}),"\n",(0,s.jsx)(d.Ay,{}),"\n",(0,s.jsxs)(t.p,{children:["For information about accepted values and functionality, see the ",(0,s.jsx)(t.a,{href:"https://www.mongodb.com/docs/atlas/atlas-vector-search/tutorials/vector-search-quick-start/",children:"MongoDB Atlas documentation"})," or inspect ",(0,s.jsx)(t.a,{href:"/concepts-components#component-code",children:"component code"}),"."]}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Name"}),(0,s.jsx)(t.th,{children:"Type"}),(0,s.jsx)(t.th,{children:"Description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"mongodb_atlas_cluster_uri"}),(0,s.jsx)(t.td,{children:"SecretString"}),(0,s.jsx)(t.td,{children:"Input parameter. The connection URI for your MongoDB Atlas cluster. Required."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"enable_mtls"}),(0,s.jsx)(t.td,{children:"Boolean"}),(0,s.jsxs)(t.td,{children:["Input parameter. Enable mutual TLS authentication. Default: ",(0,s.jsx)(t.code,{children:"false"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"mongodb_atlas_client_cert"}),(0,s.jsx)(t.td,{children:"SecretString"}),(0,s.jsx)(t.td,{children:"Input parameter. Client certificate combined with private key for mTLS authentication. Required if mTLS is enabled."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"db_name"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. The name of the database to use. Required."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"collection_name"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. The name of the collection to use. Required."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"index_name"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. The name of the Atlas Search index, it should be a Vector Search. Required."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"insert_mode"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:'Input parameter. How to insert new documents into the collection. The options are "append" or "overwrite". Default: "append".'})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"embedding"}),(0,s.jsx)(t.td,{children:"Embeddings"}),(0,s.jsx)(t.td,{children:"Input parameter. The embedding model to use."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"number_of_results"}),(0,s.jsx)(t.td,{children:"Integer"}),(0,s.jsx)(t.td,{children:"Input parameter. Number of results to return in similarity search. Default: 4."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"index_field"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:'Input parameter. The field to index. Default: "embedding".'})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"filter_field"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. The field to filter the index."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"number_dimensions"}),(0,s.jsx)(t.td,{children:"Integer"}),(0,s.jsx)(t.td,{children:"Input parameter. Embedding vector dimension count. Default: 1536."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"similarity"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:'Input parameter. The method used to measure similarity between vectors. The options are "cosine", "euclidean", or "dotProduct". Default: "cosine".'})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"quantization"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:'Input parameter. Quantization reduces memory costs by converting 32-bit floats to smaller data types. The options are "scalar" or "binary".'})]})]})]})]})}function j(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(x,{...e})}):x(e)}},90465:(e,t,n)=>{n.d(t,{Ay:()=>a,RM:()=>o});var r=n(74848),s=n(28453);const o=[];function i(e){const t={a:"a",code:"code",p:"p",...(0,s.R)(),...e.components};return(0,r.jsxs)(t.p,{children:["If you use a vector store component to query your vector database, it produces search results that you can pass to downstream components in your flow as a list of ",(0,r.jsx)(t.a,{href:"/data-types#data",children:(0,r.jsx)(t.code,{children:"Data"})})," objects or a tabular ",(0,r.jsx)(t.a,{href:"/data-types#dataframe",children:(0,r.jsx)(t.code,{children:"DataFrame"})}),".\nIf both types are supported, you can set the format near the vector store component's output port in the visual editor."]})}function a(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(i,{...e})}):i(e)}}}]); \ No newline at end of file diff --git a/assets/js/07e388ca.674e270a.js b/assets/js/07e388ca.674e270a.js new file mode 100644 index 0000000000..e158c6e75b --- /dev/null +++ b/assets/js/07e388ca.674e270a.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[1628],{4558:(o,e,t)=>{t.d(e,{A:()=>n});const n=t.p+"assets/images/api-pane-9cb07c8f812374268f94e3f8e65c6be3.png"},11470:(o,e,t)=>{t.d(e,{A:()=>x});var n=t(96540),s=t(18215),l=t(23104),r=t(56347),c=t(205),p=t(57485),a=t(31682),i=t(70679);function d(o){return n.Children.toArray(o).filter(o=>"\n"!==o).map(o=>{if(!o||(0,n.isValidElement)(o)&&function(o){const{props:e}=o;return!!e&&"object"==typeof e&&"value"in e}(o))return o;throw new Error(`Docusaurus error: Bad child <${"string"==typeof o.type?o.type:o.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function h(o){const{values:e,children:t}=o;return(0,n.useMemo)(()=>{const o=e??function(o){return d(o).map(({props:{value:o,label:e,attributes:t,default:n}})=>({value:o,label:e,attributes:t,default:n}))}(t);return function(o){const e=(0,a.XI)(o,(o,e)=>o.value===e.value);if(e.length>0)throw new Error(`Docusaurus error: Duplicate values "${e.map(o=>o.value).join(", ")}" found in . Every value needs to be unique.`)}(o),o},[e,t])}function y({value:o,tabValues:e}){return e.some(e=>e.value===o)}function u({queryString:o=!1,groupId:e}){const t=(0,r.W6)(),s=function({queryString:o=!1,groupId:e}){if("string"==typeof o)return o;if(!1===o)return null;if(!0===o&&!e)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return e??null}({queryString:o,groupId:e});return[(0,p.aZ)(s),(0,n.useCallback)(o=>{if(!s)return;const e=new URLSearchParams(t.location.search);e.set(s,o),t.replace({...t.location,search:e.toString()})},[s,t])]}function f(o){const{defaultValue:e,queryString:t=!1,groupId:s}=o,l=h(o),[r,p]=(0,n.useState)(()=>function({defaultValue:o,tabValues:e}){if(0===e.length)throw new Error("Docusaurus error: the component requires at least one children component");if(o){if(!y({value:o,tabValues:e}))throw new Error(`Docusaurus error: The has a defaultValue "${o}" but none of its children has the corresponding value. Available values are: ${e.map(o=>o.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return o}const t=e.find(o=>o.default)??e[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:e,tabValues:l})),[a,d]=u({queryString:t,groupId:s}),[f,D]=function({groupId:o}){const e=function(o){return o?`docusaurus.tab.${o}`:null}(o),[t,s]=(0,i.Dv)(e);return[t,(0,n.useCallback)(o=>{e&&s.set(o)},[e,s])]}({groupId:s}),F=(()=>{const o=a??f;return y({value:o,tabValues:l})?o:null})();(0,c.A)(()=>{F&&p(F)},[F]);return{selectedValue:r,selectValue:(0,n.useCallback)(o=>{if(!y({value:o,tabValues:l}))throw new Error(`Can't select invalid tab value=${o}`);p(o),d(o),D(o)},[d,D,l]),tabValues:l}}var D=t(92303);const F={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var g=t(74848);function m({className:o,block:e,selectedValue:t,selectValue:n,tabValues:r}){const c=[],{blockElementScrollPositionUntilNextRender:p}=(0,l.a_)(),a=o=>{const e=o.currentTarget,s=c.indexOf(e),l=r[s].value;l!==t&&(p(e),n(l))},i=o=>{let e=null;switch(o.key){case"Enter":a(o);break;case"ArrowRight":{const t=c.indexOf(o.currentTarget)+1;e=c[t]??c[0];break}case"ArrowLeft":{const t=c.indexOf(o.currentTarget)-1;e=c[t]??c[c.length-1];break}}e?.focus()};return(0,g.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.A)("tabs",{"tabs--block":e},o),children:r.map(({value:o,label:e,attributes:n})=>(0,g.jsx)("li",{role:"tab",tabIndex:t===o?0:-1,"aria-selected":t===o,ref:o=>{c.push(o)},onKeyDown:i,onClick:a,...n,className:(0,s.A)("tabs__item",F.tabItem,n?.className,{"tabs__item--active":t===o}),children:e??o},o))})}function w({lazy:o,children:e,selectedValue:t}){const l=(Array.isArray(e)?e:[e]).filter(Boolean);if(o){const o=l.find(o=>o.props.value===t);return o?(0,n.cloneElement)(o,{className:(0,s.A)("margin-top--md",o.props.className)}):null}return(0,g.jsx)("div",{className:"margin-top--md",children:l.map((o,e)=>(0,n.cloneElement)(o,{key:e,hidden:o.props.value!==t}))})}function C(o){const e=f(o);return(0,g.jsxs)("div",{className:(0,s.A)("tabs-container",F.tabList),children:[(0,g.jsx)(m,{...e,...o}),(0,g.jsx)(w,{...e,...o})]})}function x(o){const e=(0,D.A)();return(0,g.jsx)(C,{...o,children:d(o.children)},String(e))}},19365:(o,e,t)=>{t.d(e,{A:()=>r});t(96540);var n=t(18215);const s={tabItem:"tabItem_Ymn6"};var l=t(74848);function r({children:o,hidden:e,className:t}){return(0,l.jsx)("div",{role:"tabpanel",className:(0,n.A)(s.tabItem,t),hidden:e,children:o})}},28453:(o,e,t)=>{t.d(e,{R:()=>r,x:()=>c});var n=t(96540);const s={},l=n.createContext(s);function r(o){const e=n.useContext(l);return n.useMemo(function(){return"function"==typeof o?o(e):{...e,...o}},[e,o])}function c(o){let e;return e=o.disableParentContext?"function"==typeof o.components?o.components(s):o.components||s:r(o.components),n.createElement(l.Provider,{value:e},o.children)}},42373:(o,e,t)=>{t.r(e),t.d(e,{CH:()=>h,assets:()=>d,chCodeConfig:()=>y,contentTitle:()=>i,default:()=>D,frontMatter:()=>a,metadata:()=>n,toc:()=>u});const n=JSON.parse('{"id":"Concepts/concepts-publish","title":"Trigger flows with the Langflow API","description":"After you build a flow, you probably want to run it within an application, such as a chatbot within a mobile app or website.","source":"@site/docs/Concepts/concepts-publish.mdx","sourceDirName":"Concepts","slug":"/concepts-publish","permalink":"/concepts-publish","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Trigger flows with the Langflow API","slug":"/concepts-publish"},"sidebar":"docs","previous":{"title":"Build flows","permalink":"/concepts-flows"},"next":{"title":"Trigger flows with webhooks","permalink":"/webhook"}}');var s=t(74848),l=t(28453),r=t(24754),c=t(11470),p=t(19365);const a={title:"Trigger flows with the Langflow API",slug:"/concepts-publish"},i=void 0,d={},h={annotations:r.hk,Code:r.Cy},y={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},u=[{value:"Use the Langflow API to run flows",id:"api-access",level:2},{value:"Generate API code snippets",id:"generate-api-code-snippets",level:3},{value:"Langflow API authentication",id:"langflow-api-authentication",level:3},{value:"Input Schema (tweaks)",id:"input-schema",level:3},{value:"Use a flow ID alias",id:"use-a-flow-id-alias",level:3},{value:"Embed a flow into a website",id:"embedded-chat-widget",level:2},{value:"Get a langflow-chat snippet",id:"get-a-langflow-chat-snippet",level:3},{value:"Embed the chat widget with React, Angular, or HTML",id:"embed-the-chat-widget",level:3},{value:"Configure the langflow-chat web component",id:"configure-the-langflow-chat-web-component",level:3},{value:"Serve flows through a Langflow MCP server",id:"serve-flows-through-a-langflow-mcp-server",level:2},{value:"Run flows with the OpenAI Responses compatible endpoint",id:"openai-responses-api",level:2},{value:"See also",id:"see-also",level:2}];function f(o){const e={a:"a",admonition:"admonition",code:"code",em:"em",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,l.R)(),...o.components},{Details:n}=e;return h||F("CH",!1),h.Code||F("CH.Code",!0),n||F("Details",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n","\n",(0,s.jsx)(e.p,{children:"After you build a flow, you probably want to run it within an application, such as a chatbot within a mobile app or website."}),"\n",(0,s.jsx)(e.p,{children:"Langflow provides several ways to run flows from external applications:"}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsx)(e.li,{children:(0,s.jsx)(e.a,{href:"#api-access",children:"Trigger flows with the Langflow API"})}),"\n",(0,s.jsx)(e.li,{children:(0,s.jsx)(e.a,{href:"#embedded-chat-widget",children:"Add an embedded chat widget to a website"})}),"\n",(0,s.jsx)(e.li,{children:(0,s.jsx)(e.a,{href:"#serve-flows-through-a-langflow-mcp-server",children:"Serve flows through a Langflow MCP server"})}),"\n",(0,s.jsx)(e.li,{children:(0,s.jsx)(e.a,{href:"#openai-responses-api",children:"Run flows with the OpenAI Responses compatible endpoint"})}),"\n"]}),"\n",(0,s.jsxs)(e.p,{children:["Although you can use these options with an isolated, local Langflow instance, they are typically more valuable when you have ",(0,s.jsx)(e.a,{href:"/deployment-overview",children:"deployed a Langflow server"})," or ",(0,s.jsx)(e.a,{href:"/develop-application",children:"packaged Langflow as a dependency of an application"}),"."]}),"\n",(0,s.jsx)(e.h2,{id:"api-access",children:"Use the Langflow API to run flows"}),"\n",(0,s.jsx)(e.p,{children:"The Langflow API is the primary way to access your flows and Langflow servers programmatically."}),"\n",(0,s.jsx)(e.admonition,{title:"Try it",type:"tip",children:(0,s.jsxs)(e.p,{children:["For an example of a script that calls the Langflow API, see the ",(0,s.jsx)(e.a,{href:"/get-started-quickstart",children:"Quickstart"}),"."]})}),"\n",(0,s.jsx)(e.h3,{id:"generate-api-code-snippets",children:"Generate API code snippets"}),"\n",(0,s.jsx)(e.p,{children:"To help you embed Langflow API requests in your scripts, Langflow automatically generates Python, JavaScript, and curl code snippets for your flows.\nTo get these code snippets, do the following:"}),"\n",(0,s.jsxs)(e.ol,{children:["\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsx)(e.p,{children:"In Langflow, open the flow that you want to embed in your application."}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:["Click ",(0,s.jsx)(e.strong,{children:"Share"}),", and then select ",(0,s.jsx)(e.strong,{children:"API access"}),"."]}),"\n",(0,s.jsxs)(e.p,{children:["These code snippets call the ",(0,s.jsx)(e.code,{children:"/v1/run/$FLOW_ID"})," endpoint, and they automatically populate minimum values, like the Langflow server URL, flow ID, headers, and request parameters."]}),"\n",(0,s.jsx)(e.admonition,{title:"Windows",type:"tip",children:(0,s.jsx)(e.p,{children:"The paths generated by the API access pane assume a *nix environment.\nIf you use Microsoft Windows or WSL, you might need to adjust the filepaths given in the code snippets."})}),"\n",(0,s.jsx)(e.p,{children:(0,s.jsx)(e.img,{alt:"API access pane",src:t(4558).A+"",width:"4000",height:"2212"})}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:["Optional: Click ",(0,s.jsx)(e.a,{href:"#input-schema",children:(0,s.jsx)(e.strong,{children:"Input Schema"})})," to modify component parameters in the code snippets without changing the flow itself."]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsx)(e.p,{children:"Copy the snippet for the language that you want to use."}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsx)(e.p,{children:"Run the snippet as is, or use the snippet in the context of a larger script."}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(e.p,{children:["For more information and examples of other Langflow API endpoints, see ",(0,s.jsx)(e.a,{href:"/api-reference-api-examples",children:"Get started with the Langflow API"}),"."]}),"\n",(0,s.jsx)(e.h3,{id:"langflow-api-authentication",children:"Langflow API authentication"}),"\n",(0,s.jsx)(e.p,{children:"In Langflow versions 1.5 and later, most API endpoints require authentication with a Langflow API key."}),"\n",(0,s.jsxs)(e.p,{children:["Code snippets generated in the ",(0,s.jsx)(e.strong,{children:"API access"})," pane include a script that checks for a ",(0,s.jsx)(e.code,{children:"LANGFLOW_API_KEY"})," environment variable set in the local terminal session.\nThis script doesn't check for Langflow API keys set anywhere besides the local terminal session."]}),"\n",(0,s.jsxs)(e.p,{children:["For this script to work, you must set a ",(0,s.jsx)(e.code,{children:"LANGFLOW_API_KEY"})," variable in the terminal session where you intend to run the code snippet, such as ",(0,s.jsx)(e.code,{children:'export LANGFLOW_API_KEY="sk..."'}),"."]}),"\n",(0,s.jsxs)(e.p,{children:["Alternatively, you can edit the code snippet to include an ",(0,s.jsx)(e.code,{children:"x-api-key"})," header and ensure that the request can authenticate to the Langflow API."]}),"\n",(0,s.jsxs)(e.p,{children:["For more information, see ",(0,s.jsx)(e.a,{href:"/api-keys-and-authentication",children:"API keys and authentication"})," and ",(0,s.jsx)(e.a,{href:"/api-reference-api-examples",children:"Get started with the Langflow API"}),"."]}),"\n",(0,s.jsx)(e.h3,{id:"input-schema",children:"Input Schema (tweaks)"}),"\n",(0,s.jsxs)(e.p,{children:["Tweaks are one-time overrides that modify component parameters at runtime, rather than permanently modifying the flow itself.\nFor an example of tweaks in a script, see the ",(0,s.jsx)(e.a,{href:"/get-started-quickstart",children:"Quickstart"}),"."]}),"\n",(0,s.jsxs)(e.admonition,{type:"tip",children:[(0,s.jsx)(e.p,{children:"Tweaks make your flows more dynamic and reusable."}),(0,s.jsx)(e.p,{children:"You can create one flow and use it for multiple applications by passing application-specific tweaks in each application's Langflow API requests."})]}),"\n",(0,s.jsxs)(e.p,{children:["In the ",(0,s.jsx)(e.strong,{children:"API access"})," pane, click ",(0,s.jsx)(e.strong,{children:"Input Schema"})," to add ",(0,s.jsx)(e.code,{children:"tweaks"})," to the request payload in a flow's code snippets."]}),"\n",(0,s.jsxs)(e.p,{children:["Changes to a flow's ",(0,s.jsx)(e.strong,{children:"Input Schema"})," are saved exclusively as tweaks for that flow's ",(0,s.jsx)(e.strong,{children:"API access"})," code snippets.\nThese tweaks don't change the flow parameters set in the ",(0,s.jsx)(e.a,{href:"/concepts-overview#workspace",children:"workspace"}),", and they don't apply to other flows."]}),"\n",(0,s.jsxs)(e.p,{children:["Adding tweaks through the ",(0,s.jsx)(e.strong,{children:"Input Schema"})," can help you troubleshoot formatting issues with tweaks that you manually added to Langflow API requests."]}),"\n",(0,s.jsxs)(e.p,{children:["For example, the following curl command includes a tweak that disables the ",(0,s.jsx)(e.strong,{children:"Store Messages"})," setting in a flow's ",(0,s.jsx)(e.strong,{children:"Chat Input"})," component:"]}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"--request ",props:{style:{color:"#79C0FF"}}},{content:"POST ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" --url ",props:{style:{color:"#79C0FF"}}},{content:'"http://LANGFLOW_SERVER_ADDRESS/api/v1/run/FLOW_ID" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" --header ",props:{style:{color:"#79C0FF"}}},{content:'"Content-Type: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" --header ",props:{style:{color:"#79C0FF"}}},{content:'"x-api-key: LANGFLOW_API_KEY" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" --data ",props:{style:{color:"#79C0FF"}}},{content:"'{",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "input_value": "Text to input to the flow",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "output_type": "chat",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "input_type": "chat",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "tweaks": {',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "ChatInput-4WKag": {',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "should_store_message": false',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" }",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" }",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"}'",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,s.jsx)(e.h3,{id:"use-a-flow-id-alias",children:"Use a flow ID alias"}),"\n",(0,s.jsxs)(e.p,{children:["If you want your requests to use an alias instead of the actual flow ID, you can rename the flow's ",(0,s.jsx)(e.code,{children:"/v1/run/$FLOW_ID"})," endpoint:"]}),"\n",(0,s.jsxs)(e.ol,{children:["\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:["In Langflow, open the flow, click ",(0,s.jsx)(e.strong,{children:"Share"}),", and then select ",(0,s.jsx)(e.strong,{children:"API access"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:["Click ",(0,s.jsx)(e.strong,{children:"Input Schema"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:["In the ",(0,s.jsx)(e.strong,{children:"Endpoint Name"})," field, enter an alias for your flow's ID, such as a memorable, human-readable name."]}),"\n",(0,s.jsxs)(e.p,{children:["The name can contain only letters, numbers, hyphens, and underscores, such as ",(0,s.jsx)(e.code,{children:"flow-customer-database-agent"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:["To save the change, close the ",(0,s.jsx)(e.strong,{children:"Input Schema"})," pane."]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(e.p,{children:["The automatically generated code snippets now use your new endpoint name instead of the original flow ID, such as ",(0,s.jsx)(e.code,{children:'url = "http://localhost:7868/api/v1/run/flow-customer-database-agent"'}),"."]}),"\n",(0,s.jsx)(e.h2,{id:"embedded-chat-widget",children:"Embed a flow into a website"}),"\n",(0,s.jsxs)(e.p,{children:["For each flow, Langflow provides a code snippet that you can insert into the ",(0,s.jsx)(e.code,{children:""})," of your website's HTML to interact with your flow through an embedded chat widget."]}),"\n",(0,s.jsxs)(e.admonition,{title:"Required components",type:"warning",children:[(0,s.jsxs)(e.p,{children:["The chat widget only supports flows that have ",(0,s.jsx)(e.strong,{children:"Chat Input"})," and ",(0,s.jsx)(e.strong,{children:"Chat Output"})," components, which are required for the chat experience.\n",(0,s.jsx)(e.strong,{children:"Text Input"})," and ",(0,s.jsx)(e.strong,{children:"Text Output"})," components can send and receive messages, but they don't include ongoing LLM chat context."]}),(0,s.jsxs)(e.p,{children:["Attempting to chat with a flow that doesn't have ",(0,s.jsxs)(e.a,{href:"/components-io",children:[(0,s.jsx)(e.strong,{children:"Chat Input"})," component"]})," will trigger the flow, but the response only indicates that the input was empty."]})]}),"\n",(0,s.jsx)(e.h3,{id:"get-a-langflow-chat-snippet",children:"Get a langflow-chat snippet"}),"\n",(0,s.jsx)(e.p,{children:"To get a flow's embedded chat widget code snippet, do the following:"}),"\n",(0,s.jsxs)(e.ol,{children:["\n",(0,s.jsx)(e.li,{children:"In Langflow, open the flow you want to embed."}),"\n",(0,s.jsxs)(e.li,{children:["Click ",(0,s.jsx)(e.strong,{children:"Share"}),", and then select ",(0,s.jsx)(e.strong,{children:"Embed into site"}),"."]}),"\n",(0,s.jsxs)(e.li,{children:["Copy the code snippet and use it in the ",(0,s.jsx)(e.code,{children:""})," of your website's HTML.\nFor more information, see ",(0,s.jsx)(e.a,{href:"#embed-the-chat-widget",children:"Embed the chat widget with React, Angular, or HTML"}),"."]}),"\n",(0,s.jsxs)(e.li,{children:["Add the ",(0,s.jsx)(e.code,{children:"api_key"})," prop to ensure the widget has permission to run the flow, as explained in ",(0,s.jsx)(e.a,{href:"#configure-the-langflow-chat-web-component",children:"Configure the langflow-chat web component"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(e.p,{children:["The chat widget is implemented as a web component called ",(0,s.jsx)(e.code,{children:"langflow-chat"})," that is loaded from a CDN. For more information, see the ",(0,s.jsx)(e.a,{href:"https://github.com/langflow-ai/langflow-embedded-chat",children:"langflow-embedded-chat repository"}),"."]}),"\n",(0,s.jsxs)(e.p,{children:["For example, the following HTML embeds a chat widget for a ",(0,s.jsx)(e.strong,{children:"Basic Prompting"})," template flow hosted on a Langflow server deployed on ngrok:"]}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"<",props:{style:{color:"#C9D1D9"}}},{content:"html",props:{style:{color:"#7EE787"}}},{content:">",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" <",props:{style:{color:"#C9D1D9"}}},{content:"head",props:{style:{color:"#7EE787"}}},{content:">",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" <",props:{style:{color:"#C9D1D9"}}},{content:"script ",props:{style:{color:"#7EE787"}}},{content:"src",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"https://cdn.jsdelivr.net/gh/langflow-ai/langflow-embedded-chat@main/dist/build/static/js/bundle.min.js"',props:{style:{color:"#A5D6FF"}}},{content:">",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" <",props:{style:{color:"#C9D1D9"}}},{content:"body",props:{style:{color:"#7EE787"}}},{content:">",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" <",props:{style:{color:"#C9D1D9"}}},{content:"langflow-chat",props:{style:{color:"#7EE787"}}}]},{tokens:[{content:" host_url",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"https://c822-73-64-93-151.ngrok-free.app"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" flow_id",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"dcbed533-859f-4b99-b1f5-16fce884f28f"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" api_key",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"$LANGFLOW_API_KEY"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" >",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]}],lang:"html"},annotations:[]}]}),"\n",(0,s.jsx)(e.p,{children:"When this code is deployed to a live site, it renders as a responsive chatbot.\nIf a user interacts with the chatbot, the input triggers the specified flow, and then the chatbot returns the output from the flow run."}),"\n",(0,s.jsx)(e.p,{children:(0,s.jsx)(e.img,{alt:"Default chat widget",src:t(43806).A+"",width:"1852",height:"2668"})}),"\n",(0,s.jsx)(e.admonition,{title:"Try it",type:"tip",children:(0,s.jsxs)(e.p,{children:["Use the ",(0,s.jsx)(e.a,{href:"https://codesandbox.io/p/sandbox/langflow-embedded-chat-example-dv9zpx",children:"Langflow embedded chat CodeSandbox"})," for an interactive live demo of the embedded chat widget that uses your own flow.\nFor more information, see the ",(0,s.jsx)(e.a,{href:"https://github.com/langflow-ai/langflow-embedded-chat?tab=readme-ov-file#live-example",children:"langflow-embedded-chat README"}),"."]})}),"\n",(0,s.jsx)(e.h3,{id:"embed-the-chat-widget",children:"Embed the chat widget with React, Angular, or HTML"}),"\n",(0,s.jsx)(e.p,{children:"The following examples show how to use embedded chat widget in React, Angular, and plain HTML."}),"\n",(0,s.jsxs)(c.A,{children:[(0,s.jsxs)(p.A,{value:"react",label:"React",default:!0,children:[(0,s.jsx)(e.p,{children:"To use the chat widget in your React application, create a component that loads the widget script and renders the chat interface:"}),(0,s.jsxs)(e.ol,{children:["\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsx)(e.p,{children:"Declare your web component, and then encapsulate it in a React component:"}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"//Declaration of langflow-chat web component",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:"declare",props:{style:{color:"#FF7B72"}}},{content:" global {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"namespace ",props:{style:{color:"#FF7B72"}}},{content:"JSX",props:{style:{color:"#FFA657"}}},{content:" {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" interface ",props:{style:{color:"#FF7B72"}}},{content:"IntrinsicElements",props:{style:{color:"#FFA657"}}},{content:" {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "langflow-chat"',props:{style:{color:"#A5D6FF"}}},{content:": ",props:{style:{color:"#FF7B72"}}},{content:"any",props:{style:{color:"#79C0FF"}}},{content:";",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" }",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"//Definition for langflow-chat React component",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:"export default function ",props:{style:{color:"#FF7B72"}}},{content:"ChatWidget",props:{style:{color:"#D2A8FF"}}},{content:"({ className }) ",props:{style:{color:"#FFA657"}}},{content:"{",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"return",props:{style:{color:"#FF7B72"}}},{content:" (",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" <",props:{style:{color:"#C9D1D9"}}},{content:"div ",props:{style:{color:"#7EE787"}}},{content:"className",props:{style:{color:"#79C0FF"}}},{content:"={",props:{style:{color:"#FF7B72"}}},{content:"className",props:{style:{color:"#C9D1D9"}}},{content:"}",props:{style:{color:"#FF7B72"}}},{content:">",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" <",props:{style:{color:"#C9D1D9"}}},{content:"langflow-chat",props:{style:{color:"#7EE787"}}}]},{tokens:[{content:" host_url",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"https://c822-73-64-93-151.ngrok-free.app"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" flow_id",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"dcbed533-859f-4b99-b1f5-16fce884f28f"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" api_key",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"$LANGFLOW_API_KEY"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" >",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:");",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]}],lang:"javascript"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsx)(e.p,{children:"Place the component anywhere in your code to render the chat widget."}),"\n",(0,s.jsxs)(e.p,{children:["In the following example, the React widget component is located at ",(0,s.jsx)(e.code,{children:"docs/src/components/ChatWidget/index.tsx"}),", and ",(0,s.jsx)(e.code,{children:"index.tsx"})," includes a script to load the chat widget code from CDN, along with the declaration and definition from the previous step:"]}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"import",props:{style:{color:"#FF7B72"}}},{content:" React, { useEffect } ",props:{style:{color:"#C9D1D9"}}},{content:"from ",props:{style:{color:"#FF7B72"}}},{content:"'react'",props:{style:{color:"#A5D6FF"}}},{content:";",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"// Component to load the chat widget script",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:"const ",props:{style:{color:"#FF7B72"}}},{content:"ChatScriptLoader ",props:{style:{color:"#D2A8FF"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" () ",props:{style:{color:"#C9D1D9"}}},{content:"=>",props:{style:{color:"#FF7B72"}}},{content:" {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"useEffect",props:{style:{color:"#D2A8FF"}}},{content:"(() ",props:{style:{color:"#C9D1D9"}}},{content:"=>",props:{style:{color:"#FF7B72"}}},{content:" {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" if",props:{style:{color:"#FF7B72"}}},{content:" (",props:{style:{color:"#C9D1D9"}}},{content:"!",props:{style:{color:"#FF7B72"}}},{content:"document.",props:{style:{color:"#C9D1D9"}}},{content:"querySelector",props:{style:{color:"#D2A8FF"}}},{content:"(",props:{style:{color:"#C9D1D9"}}},{content:"'script[src*=\"langflow-embedded-chat\"]'",props:{style:{color:"#A5D6FF"}}},{content:")) {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" const ",props:{style:{color:"#FF7B72"}}},{content:"script ",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" document.",props:{style:{color:"#C9D1D9"}}},{content:"createElement",props:{style:{color:"#D2A8FF"}}},{content:"(",props:{style:{color:"#C9D1D9"}}},{content:"'script'",props:{style:{color:"#A5D6FF"}}},{content:");",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" script.src ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:"'https://cdn.jsdelivr.net/gh/langflow-ai/langflow-embedded-chat@main/dist/build/static/js/bundle.min.js'",props:{style:{color:"#A5D6FF"}}},{content:";",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" script.async ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:"true",props:{style:{color:"#79C0FF"}}},{content:";",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" document.body.",props:{style:{color:"#C9D1D9"}}},{content:"appendChild",props:{style:{color:"#D2A8FF"}}},{content:"(script);",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" }",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"}, []);",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"return ",props:{style:{color:"#FF7B72"}}},{content:"null",props:{style:{color:"#79C0FF"}}},{content:";",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"};",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"//Declaration of langflow-chat web component",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:"declare",props:{style:{color:"#FF7B72"}}},{content:" global {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"namespace ",props:{style:{color:"#FF7B72"}}},{content:"JSX",props:{style:{color:"#FFA657"}}},{content:" {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" interface ",props:{style:{color:"#FF7B72"}}},{content:"IntrinsicElements",props:{style:{color:"#FFA657"}}},{content:" {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "langflow-chat"',props:{style:{color:"#A5D6FF"}}},{content:": ",props:{style:{color:"#FF7B72"}}},{content:"any",props:{style:{color:"#79C0FF"}}},{content:";",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" }",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"//Definition for langflow-chat React component",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:"export default function ",props:{style:{color:"#FF7B72"}}},{content:"ChatWidget",props:{style:{color:"#D2A8FF"}}},{content:"({ className }) ",props:{style:{color:"#FFA657"}}},{content:"{",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"return",props:{style:{color:"#FF7B72"}}},{content:" (",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" <",props:{style:{color:"#C9D1D9"}}},{content:"div ",props:{style:{color:"#7EE787"}}},{content:"className",props:{style:{color:"#79C0FF"}}},{content:"={",props:{style:{color:"#FF7B72"}}},{content:"className",props:{style:{color:"#C9D1D9"}}},{content:"}",props:{style:{color:"#FF7B72"}}},{content:">",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" <",props:{style:{color:"#C9D1D9"}}},{content:"ChatScriptLoader",props:{style:{color:"#7EE787"}}},{content:" />",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" <",props:{style:{color:"#C9D1D9"}}},{content:"langflow-chat",props:{style:{color:"#7EE787"}}}]},{tokens:[{content:" host_url",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"https://c822-73-64-93-151.ngrok-free.app"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" flow_id",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"dcbed533-859f-4b99-b1f5-16fce884f28f"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" api_key",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"$LANGFLOW_API_KEY"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" >",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:");",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]}],lang:"javascript"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:["Import the ",(0,s.jsx)(e.code,{children:"langflow-chat"})," React component to make it available for use on a page.\nModify the following import statement with your React component's name and path:"]}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"import",props:{style:{color:"#FF7B72"}}},{content:" ChatWidget ",props:{style:{color:"#C9D1D9"}}},{content:"from ",props:{style:{color:"#FF7B72"}}},{content:"'@site/src/components/ChatWidget'",props:{style:{color:"#A5D6FF"}}},{content:";",props:{style:{color:"#C9D1D9"}}}]}],lang:"jsx"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:["To display the widget, call your ",(0,s.jsx)(e.code,{children:"langflow-chat"})," component in the desired location on the page.\nModify the following reference for your React component's name and the desired ",(0,s.jsx)(e.code,{children:"className"}),":"]}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:'',props:{}}]}],lang:"text"},annotations:[]}]}),"\n"]}),"\n"]})]}),(0,s.jsxs)(p.A,{value:"angular",label:"Angular",children:[(0,s.jsx)(e.p,{children:"To use the chat widget in your Angular application, create a component that loads the widget script and renders the chat interface."}),(0,s.jsxs)(e.p,{children:["In an Angular application, ",(0,s.jsx)(e.code,{children:"langflow-chat"})," is a custom web component that you must explicitly allow in your site's ",(0,s.jsx)(e.code,{children:".components.ts"}),".\nTherefore, to use the embedded chat widget, you must add ",(0,s.jsx)(e.code,{children:"CUSTOM_ELEMENTS_SCHEMA"})," to your module's configuration, and then integrate the ",(0,s.jsx)(e.code,{children:""})," element."]}),(0,s.jsxs)(e.p,{children:["Angular requires you to explicitly allow custom web components, like ",(0,s.jsx)(e.code,{children:"langflow-chat"}),", in your site's ",(0,s.jsx)(e.code,{children:"components"}),".\nTherefore, you must add the ",(0,s.jsx)(e.code,{children:""})," element to your Angular template and configure Angular to recognize it.\nYou must add ",(0,s.jsx)(e.code,{children:"CUSTOM_ELEMENTS_SCHEMA"})," to your module's configuration to enable this."]}),(0,s.jsxs)(e.ol,{children:["\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:["In your Angular application, edit the ",(0,s.jsx)(e.code,{children:".module.ts"})," file where you want to add the ",(0,s.jsx)(e.code,{children:"langflow-chat"})," web component."]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:["At the top of ",(0,s.jsx)(e.code,{children:".module.ts"}),", import ",(0,s.jsx)(e.code,{children:"CUSTOM_ELEMENTS_SCHEMA"}),":"]}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';",props:{}}]}],lang:"text"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:["In the ",(0,s.jsx)(e.code,{children:"@NgModule"})," decorator, add ",(0,s.jsx)(e.code,{children:"CUSTOM_ELEMENTS_SCHEMA"})," to the ",(0,s.jsx)(e.code,{children:"schemas"})," array:"]}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"import",props:{style:{color:"#FF7B72"}}},{content:" { NgModule, CUSTOM_ELEMENTS_SCHEMA } ",props:{style:{color:"#C9D1D9"}}},{content:"from ",props:{style:{color:"#FF7B72"}}},{content:"'@angular/core'",props:{style:{color:"#A5D6FF"}}},{content:";",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"import",props:{style:{color:"#FF7B72"}}},{content:" { BrowserModule } ",props:{style:{color:"#C9D1D9"}}},{content:"from ",props:{style:{color:"#FF7B72"}}},{content:"'@angular/platform-browser'",props:{style:{color:"#A5D6FF"}}},{content:";",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"import",props:{style:{color:"#FF7B72"}}},{content:" { AppComponent } ",props:{style:{color:"#C9D1D9"}}},{content:"from ",props:{style:{color:"#FF7B72"}}},{content:"'./app.component'",props:{style:{color:"#A5D6FF"}}},{content:";",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"@",props:{style:{color:"#C9D1D9"}}},{content:"NgModule",props:{style:{color:"#D2A8FF"}}},{content:"({",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"declarations: [",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" AppComponent",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"],",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"imports: [",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" BrowserModule",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"],",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"schemas: [",props:{style:{color:"#C9D1D9"}}},{content:"CUSTOM_ELEMENTS_SCHEMA",props:{style:{color:"#79C0FF"}}},{content:"],",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"providers: [],",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"bootstrap: [AppComponent]",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"})",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"export class ",props:{style:{color:"#FF7B72"}}},{content:"AppModule",props:{style:{color:"#FFA657"}}},{content:" { }",props:{style:{color:"#C9D1D9"}}}]}],lang:"javascript"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:["Edit the ",(0,s.jsx)(e.code,{children:".component.ts"})," file where you want to use the embedded chat widget."]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:["In the ",(0,s.jsx)(e.code,{children:"@Component"})," decorator, add the ",(0,s.jsx)(e.code,{children:""})," element to the ",(0,s.jsx)(e.code,{children:"template"})," key:"]}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"import",props:{style:{color:"#FF7B72"}}},{content:" { Component } ",props:{style:{color:"#C9D1D9"}}},{content:"from ",props:{style:{color:"#FF7B72"}}},{content:"'@angular/core'",props:{style:{color:"#A5D6FF"}}},{content:";",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"@",props:{style:{color:"#C9D1D9"}}},{content:"Component",props:{style:{color:"#D2A8FF"}}},{content:"({",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"selector: ",props:{style:{color:"#C9D1D9"}}},{content:"'app-root'",props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"template: ",props:{style:{color:"#C9D1D9"}}},{content:"`",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:'

      ',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"

      Langflow Chat Test

      ",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" ",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"
      ",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"`",props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"styles: [",props:{style:{color:"#C9D1D9"}}},{content:"`",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" .container {",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" padding: 20px;",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" text-align: center;",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" }",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"`",props:{style:{color:"#A5D6FF"}}},{content:"]",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"})",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"export class ",props:{style:{color:"#FF7B72"}}},{content:"AppComponent",props:{style:{color:"#FFA657"}}},{content:" {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"title ",props:{style:{color:"#FFA657"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:"'Langflow Chat Test'",props:{style:{color:"#A5D6FF"}}},{content:";",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]}],lang:"javascript"},annotations:[]}]}),"\n"]}),"\n"]})]}),(0,s.jsx)(p.A,{value:"html",label:"HTML",children:(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"<",props:{style:{color:"#C9D1D9"}}},{content:"html ",props:{style:{color:"#7EE787"}}},{content:"lang",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"en"',props:{style:{color:"#A5D6FF"}}},{content:">",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"<",props:{style:{color:"#C9D1D9"}}},{content:"head",props:{style:{color:"#7EE787"}}},{content:">",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"<",props:{style:{color:"#C9D1D9"}}},{content:"script ",props:{style:{color:"#7EE787"}}},{content:"src",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"https://cdn.jsdelivr.net/gh/langflow-ai/langflow-embedded-chat@v1.0.7/dist/build/static/js/bundle.min.js"',props:{style:{color:"#A5D6FF"}}},{content:">",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"<",props:{style:{color:"#C9D1D9"}}},{content:"body",props:{style:{color:"#7EE787"}}},{content:">",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"<",props:{style:{color:"#C9D1D9"}}},{content:"langflow-chat",props:{style:{color:"#7EE787"}}}]},{tokens:[{content:" host_url",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"https://c822-73-64-93-151.ngrok-free.app"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" flow_id",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"dcbed533-859f-4b99-b1f5-16fce884f28f"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" api_key",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"$LANGFLOW_API_KEY"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" >",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]}],lang:"html"},annotations:[]}]})})]}),"\n",(0,s.jsx)(e.h3,{id:"configure-the-langflow-chat-web-component",children:"Configure the langflow-chat web component"}),"\n",(0,s.jsxs)(e.p,{children:["To use the embedded chat widget in your HTML, the ",(0,s.jsx)(e.code,{children:"langflow-chat"})," web component must include the following minimum inputs (also known as ",(0,s.jsx)(e.em,{children:"props"})," in React):"]}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.code,{children:"host_url"}),": Your Langflow server URL. Must be ",(0,s.jsx)(e.code,{children:"HTTPS"}),". Don't include a trailing slash (",(0,s.jsx)(e.code,{children:"/"}),")."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.code,{children:"flow_id"}),": The ID of the flow you want to embed."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.code,{children:"api_key"}),": A ",(0,s.jsx)(e.a,{href:"/api-keys-and-authentication",children:"Langflow API key"}),".\nThis prop is recommended to ensure the widget has permission to run the flow."]}),"\n"]}),"\n",(0,s.jsxs)(e.p,{children:["The minimum inputs are automatically populated in the ",(0,s.jsxs)(e.a,{href:"#get-a-langflow-chat-snippet",children:[(0,s.jsx)(e.strong,{children:"Embed into site"})," code snippet"]})," that is generated by Langflow."]}),"\n",(0,s.jsxs)(e.p,{children:["You can use additional inputs (props) to modify the embedded chat widget.\nFor a list of all props, types, and descriptions, see the ",(0,s.jsx)(e.a,{href:"https://github.com/langflow-ai/langflow-embedded-chat?tab=readme-ov-file#configuration",children:"langflow-embedded-chat README"}),"."]}),"\n",(0,s.jsxs)(n,{children:[(0,s.jsx)("summary",{children:"Example: Langflow API key prop"}),(0,s.jsxs)(e.p,{children:["The ",(0,s.jsx)(e.code,{children:"api_key"})," prop stores a Langflow API key that the chat widget can use to authenticate the underlying Langflow API request."]}),(0,s.jsx)(e.p,{children:"The Langflow team recommends following industry best practices for handling sensitive credentials.\nFor example, securely store your API key, and then retrieve with an environment variable:"}),(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"<",props:{style:{color:"#C9D1D9"}}},{content:"langflow-chat",props:{style:{color:"#7EE787"}}}]},{tokens:[{content:" host_url",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"https://c822-73-64-93-151.ngrok-free.app"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" flow_id",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"dcbed533-859f-4b99-b1f5-16fce884f28f"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" api_key",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"$LANGFLOW_API_KEY"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:">",props:{style:{color:"#C9D1D9"}}}]}],lang:"html"},annotations:[]}]})]}),"\n",(0,s.jsxs)(n,{children:[(0,s.jsx)("summary",{children:"Example: Style props"}),(0,s.jsxs)(e.p,{children:["There are many props you can use to customize the style and positioning of the embedded chat widget.\nMany of these props are of type JSON, and they require specific formatting, depending on where you embed the ",(0,s.jsx)(e.code,{children:"langflow-chat"})," web component."]}),(0,s.jsxs)(e.p,{children:["In React and plain HTML, JSON props are expressed as JSON objects or stringified JSON, such as ",(0,s.jsx)(e.code,{children:'\\{"key":"value"\\}'}),":"]}),(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"<",props:{style:{color:"#C9D1D9"}}},{content:"langflow-chat",props:{style:{color:"#7EE787"}}}]},{tokens:[{content:" host_url",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"https://c822-73-64-93-151.ngrok-free.app"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" flow_id",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"dcbed533-859f-4b99-b1f5-16fce884f28f"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" api_key",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"$LANGFLOW_API_KEY"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" chat_window_style",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:"'{",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "backgroundColor": "#1a0d0d",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "border": "4px solid #b30000",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "borderRadius": "16px",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "boxShadow": "0 8px 32px #b30000",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "color": "#fff",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "fontFamily": "Georgia, serif",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "padding": "16px"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" }'",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" window_title",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"Custom Styled Chat"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" height",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"600"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" width",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"400"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:">",props:{style:{color:"#C9D1D9"}}}]}],lang:"html"},annotations:[]}]}),(0,s.jsxs)(e.p,{children:["For Angular applications, use ",(0,s.jsx)(e.a,{href:"https://angular.dev/guide/templates/binding#binding-dynamic-properties-and-attributes",children:"property binding syntax"})," to pass JSON props as JavaScript objects.\nFor example:"]}),(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"import",props:{style:{color:"#FF7B72"}}},{content:" { Component } ",props:{style:{color:"#C9D1D9"}}},{content:"from ",props:{style:{color:"#FF7B72"}}},{content:"'@angular/core'",props:{style:{color:"#A5D6FF"}}},{content:";",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"@",props:{style:{color:"#C9D1D9"}}},{content:"Component",props:{style:{color:"#D2A8FF"}}},{content:"({",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" selector: ",props:{style:{color:"#C9D1D9"}}},{content:"'app-root'",props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" template: ",props:{style:{color:"#C9D1D9"}}},{content:"`",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:'
      ',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"

      Langflow Chat Test

      ",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" ",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"
      ",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" `",props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" styles: [",props:{style:{color:"#C9D1D9"}}},{content:"`",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" .container {",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" padding: 20px;",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" text-align: center;",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" }",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" `",props:{style:{color:"#A5D6FF"}}},{content:"]",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"})",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"export class ",props:{style:{color:"#FF7B72"}}},{content:"AppComponent",props:{style:{color:"#FFA657"}}},{content:" {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" title ",props:{style:{color:"#FFA657"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:"'Langflow Chat Test'",props:{style:{color:"#A5D6FF"}}},{content:";",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]}],lang:"javascript"},annotations:[]}]})]}),"\n",(0,s.jsxs)(n,{children:[(0,s.jsx)("summary",{children:"Example: Session ID prop"}),(0,s.jsxs)(e.p,{children:["The following example adds a custom ",(0,s.jsx)(e.a,{href:"/session-id",children:"session ID"})," to help identify flow runs started by the embedded chat widget:"]}),(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"<",props:{style:{color:"#C9D1D9"}}},{content:"langflow-chat",props:{style:{color:"#7EE787"}}}]},{tokens:[{content:" host_url",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"https://c822-73-64-93-151.ngrok-free.app"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" flow_id",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"dcbed533-859f-4b99-b1f5-16fce884f28f"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" api_key",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"$LANGFLOW_API_KEY"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" session_id",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"$SESSION_ID"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:">",props:{style:{color:"#C9D1D9"}}}]}],lang:"html"},annotations:[]}]})]}),"\n",(0,s.jsxs)(n,{children:[(0,s.jsx)("summary",{children:"Example: Tweaks prop"}),(0,s.jsxs)(e.p,{children:["Use the ",(0,s.jsx)(e.code,{children:"tweaks"})," prop to modify flow parameters at runtime.\nThe available keys for the ",(0,s.jsx)(e.code,{children:"tweaks"})," object depend on the flow you are serving through the embedded chat widget."]}),(0,s.jsxs)(e.p,{children:["In React and plain HTML, ",(0,s.jsx)(e.code,{children:"tweaks"})," are declared as a JSON object, similar to how you would pass them to a Langflow API endpoint like ",(0,s.jsx)(e.a,{href:"/api-flows-run#run-flow",children:(0,s.jsx)(e.code,{children:"/v1/run/$FLOW_ID"})}),".\nFor example:"]}),(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"<",props:{style:{color:"#C9D1D9"}}},{content:"langflow-chat",props:{style:{color:"#7EE787"}}}]},{tokens:[{content:" host_url",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"https://c822-73-64-93-151.ngrok-free.app"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" flow_id",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"dcbed533-859f-4b99-b1f5-16fce884f28f"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" api_key",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"$LANGFLOW_API_KEY"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" tweaks",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:"'{",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "model_name": "llama-3.1-8b-instant"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" }'",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:">",props:{style:{color:"#C9D1D9"}}}]}],lang:"html"},annotations:[]}]}),(0,s.jsxs)(e.p,{children:["For Angular applications, use ",(0,s.jsx)(e.a,{href:"https://angular.dev/guide/templates/binding#binding-dynamic-properties-and-attributes",children:"property binding syntax"})," to pass JSON props as JavaScript objects.\nFor example:"]}),(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"import",props:{style:{color:"#FF7B72"}}},{content:" { Component } ",props:{style:{color:"#C9D1D9"}}},{content:"from ",props:{style:{color:"#FF7B72"}}},{content:"'@angular/core'",props:{style:{color:"#A5D6FF"}}},{content:";",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"@",props:{style:{color:"#C9D1D9"}}},{content:"Component",props:{style:{color:"#D2A8FF"}}},{content:"({",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" selector: ",props:{style:{color:"#C9D1D9"}}},{content:"'app-root'",props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" template: ",props:{style:{color:"#C9D1D9"}}},{content:"`",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:'
      ',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"

      Langflow Chat Test

      ",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" ",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"
      ",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" `",props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" styles: [",props:{style:{color:"#C9D1D9"}}},{content:"`",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" .container {",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" padding: 20px;",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" text-align: center;",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" }",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" `",props:{style:{color:"#A5D6FF"}}},{content:"]",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"})",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"export class ",props:{style:{color:"#FF7B72"}}},{content:"AppComponent",props:{style:{color:"#FFA657"}}},{content:" {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" title ",props:{style:{color:"#FFA657"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:"'Langflow Chat Test'",props:{style:{color:"#A5D6FF"}}},{content:";",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]}],lang:"javascript"},annotations:[]}]})]}),"\n",(0,s.jsx)(e.h2,{id:"serve-flows-through-a-langflow-mcp-server",children:"Serve flows through a Langflow MCP server"}),"\n",(0,s.jsxs)(e.p,{children:["Each ",(0,s.jsx)(e.a,{href:"/concepts-flows#projects",children:"Langflow project"})," has an MCP server that exposes the project's flows as ",(0,s.jsx)(e.a,{href:"https://modelcontextprotocol.io/docs/concepts/tools",children:"tools"})," that ",(0,s.jsx)(e.a,{href:"https://modelcontextprotocol.io/clients",children:"MCP clients"})," can use to generate responses."]}),"\n",(0,s.jsx)(e.p,{children:"In addition to serving flows through Langflow MCP servers, you can use Langflow as an MCP client to access any MCP server, including your Langflow MCP servers."}),"\n",(0,s.jsxs)(e.p,{children:["Interactions with Langflow MCP servers happen through the Langflow API's ",(0,s.jsx)(e.code,{children:"/mcp"})," endpoints."]}),"\n",(0,s.jsxs)(e.p,{children:["For more information, see ",(0,s.jsx)(e.a,{href:"/mcp-server",children:"Use Langflow as an MCP server"})," and ",(0,s.jsx)(e.a,{href:"/mcp-client",children:"Use Langflow as an MCP client"}),"."]}),"\n",(0,s.jsx)(e.h2,{id:"openai-responses-api",children:"Run flows with the OpenAI Responses compatible endpoint"}),"\n",(0,s.jsxs)(e.p,{children:["Langflow includes an OpenAI Responses API-compatible endpoint at ",(0,s.jsx)(e.code,{children:"/api/v1/responses"})," that allows you to use existing OpenAI client libraries and code with minimal modifications."]}),"\n",(0,s.jsxs)(e.p,{children:["For more information, see ",(0,s.jsx)(e.a,{href:"/api-openai-responses",children:"OpenAI Responses API"}),"."]}),"\n",(0,s.jsx)(e.h2,{id:"see-also",children:"See also"}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsx)(e.li,{children:(0,s.jsx)(e.a,{href:"/concepts-flows-import",children:"Import and export flows"})}),"\n",(0,s.jsx)(e.li,{children:(0,s.jsx)(e.a,{href:"/api-files",children:"Files endpoints"})}),"\n",(0,s.jsx)(e.li,{children:(0,s.jsx)(e.a,{href:"/concepts-playground",children:"Test flows in the Playground"})}),"\n"]})]})}function D(o={}){const{wrapper:e}={...(0,l.R)(),...o.components};return e?(0,s.jsx)(e,{...o,children:(0,s.jsx)(f,{...o})}):f(o)}function F(o,e){throw new Error("Expected "+(e?"component":"object")+" `"+o+"` to be defined: you likely forgot to import, pass, or provide it.")}},43806:(o,e,t)=>{t.d(e,{A:()=>n});const n=t.p+"assets/images/chat-widget-default-50fbdf351e2e984e4103a225be85f9a4.png"}}]); \ No newline at end of file diff --git a/assets/js/07e388ca.c57db9f4.js b/assets/js/07e388ca.c57db9f4.js deleted file mode 100644 index 336013909d..0000000000 --- a/assets/js/07e388ca.c57db9f4.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[1628],{4558:(o,e,t)=>{t.d(e,{A:()=>n});const n=t.p+"assets/images/api-pane-9cb07c8f812374268f94e3f8e65c6be3.png"},11470:(o,e,t)=>{t.d(e,{A:()=>x});var n=t(96540),s=t(18215),l=t(23104),r=t(56347),c=t(205),p=t(57485),a=t(31682),i=t(70679);function d(o){return n.Children.toArray(o).filter(o=>"\n"!==o).map(o=>{if(!o||(0,n.isValidElement)(o)&&function(o){const{props:e}=o;return!!e&&"object"==typeof e&&"value"in e}(o))return o;throw new Error(`Docusaurus error: Bad child <${"string"==typeof o.type?o.type:o.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function h(o){const{values:e,children:t}=o;return(0,n.useMemo)(()=>{const o=e??function(o){return d(o).map(({props:{value:o,label:e,attributes:t,default:n}})=>({value:o,label:e,attributes:t,default:n}))}(t);return function(o){const e=(0,a.XI)(o,(o,e)=>o.value===e.value);if(e.length>0)throw new Error(`Docusaurus error: Duplicate values "${e.map(o=>o.value).join(", ")}" found in . Every value needs to be unique.`)}(o),o},[e,t])}function y({value:o,tabValues:e}){return e.some(e=>e.value===o)}function u({queryString:o=!1,groupId:e}){const t=(0,r.W6)(),s=function({queryString:o=!1,groupId:e}){if("string"==typeof o)return o;if(!1===o)return null;if(!0===o&&!e)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return e??null}({queryString:o,groupId:e});return[(0,p.aZ)(s),(0,n.useCallback)(o=>{if(!s)return;const e=new URLSearchParams(t.location.search);e.set(s,o),t.replace({...t.location,search:e.toString()})},[s,t])]}function f(o){const{defaultValue:e,queryString:t=!1,groupId:s}=o,l=h(o),[r,p]=(0,n.useState)(()=>function({defaultValue:o,tabValues:e}){if(0===e.length)throw new Error("Docusaurus error: the component requires at least one children component");if(o){if(!y({value:o,tabValues:e}))throw new Error(`Docusaurus error: The has a defaultValue "${o}" but none of its children has the corresponding value. Available values are: ${e.map(o=>o.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return o}const t=e.find(o=>o.default)??e[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:e,tabValues:l})),[a,d]=u({queryString:t,groupId:s}),[f,D]=function({groupId:o}){const e=function(o){return o?`docusaurus.tab.${o}`:null}(o),[t,s]=(0,i.Dv)(e);return[t,(0,n.useCallback)(o=>{e&&s.set(o)},[e,s])]}({groupId:s}),F=(()=>{const o=a??f;return y({value:o,tabValues:l})?o:null})();(0,c.A)(()=>{F&&p(F)},[F]);return{selectedValue:r,selectValue:(0,n.useCallback)(o=>{if(!y({value:o,tabValues:l}))throw new Error(`Can't select invalid tab value=${o}`);p(o),d(o),D(o)},[d,D,l]),tabValues:l}}var D=t(92303);const F={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var g=t(74848);function m({className:o,block:e,selectedValue:t,selectValue:n,tabValues:r}){const c=[],{blockElementScrollPositionUntilNextRender:p}=(0,l.a_)(),a=o=>{const e=o.currentTarget,s=c.indexOf(e),l=r[s].value;l!==t&&(p(e),n(l))},i=o=>{let e=null;switch(o.key){case"Enter":a(o);break;case"ArrowRight":{const t=c.indexOf(o.currentTarget)+1;e=c[t]??c[0];break}case"ArrowLeft":{const t=c.indexOf(o.currentTarget)-1;e=c[t]??c[c.length-1];break}}e?.focus()};return(0,g.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.A)("tabs",{"tabs--block":e},o),children:r.map(({value:o,label:e,attributes:n})=>(0,g.jsx)("li",{role:"tab",tabIndex:t===o?0:-1,"aria-selected":t===o,ref:o=>{c.push(o)},onKeyDown:i,onClick:a,...n,className:(0,s.A)("tabs__item",F.tabItem,n?.className,{"tabs__item--active":t===o}),children:e??o},o))})}function w({lazy:o,children:e,selectedValue:t}){const l=(Array.isArray(e)?e:[e]).filter(Boolean);if(o){const o=l.find(o=>o.props.value===t);return o?(0,n.cloneElement)(o,{className:(0,s.A)("margin-top--md",o.props.className)}):null}return(0,g.jsx)("div",{className:"margin-top--md",children:l.map((o,e)=>(0,n.cloneElement)(o,{key:e,hidden:o.props.value!==t}))})}function C(o){const e=f(o);return(0,g.jsxs)("div",{className:(0,s.A)("tabs-container",F.tabList),children:[(0,g.jsx)(m,{...e,...o}),(0,g.jsx)(w,{...e,...o})]})}function x(o){const e=(0,D.A)();return(0,g.jsx)(C,{...o,children:d(o.children)},String(e))}},19365:(o,e,t)=>{t.d(e,{A:()=>r});t(96540);var n=t(18215);const s={tabItem:"tabItem_Ymn6"};var l=t(74848);function r({children:o,hidden:e,className:t}){return(0,l.jsx)("div",{role:"tabpanel",className:(0,n.A)(s.tabItem,t),hidden:e,children:o})}},28453:(o,e,t)=>{t.d(e,{R:()=>r,x:()=>c});var n=t(96540);const s={},l=n.createContext(s);function r(o){const e=n.useContext(l);return n.useMemo(function(){return"function"==typeof o?o(e):{...e,...o}},[e,o])}function c(o){let e;return e=o.disableParentContext?"function"==typeof o.components?o.components(s):o.components||s:r(o.components),n.createElement(l.Provider,{value:e},o.children)}},42373:(o,e,t)=>{t.r(e),t.d(e,{CH:()=>h,assets:()=>d,chCodeConfig:()=>y,contentTitle:()=>i,default:()=>D,frontMatter:()=>a,metadata:()=>n,toc:()=>u});const n=JSON.parse('{"id":"Concepts/concepts-publish","title":"Trigger flows with the Langflow API","description":"After you build a flow, you probably want to run it within an application, such as a chatbot within a mobile app or website.","source":"@site/docs/Concepts/concepts-publish.mdx","sourceDirName":"Concepts","slug":"/concepts-publish","permalink":"/concepts-publish","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Trigger flows with the Langflow API","slug":"/concepts-publish"},"sidebar":"docs","previous":{"title":"Build flows","permalink":"/concepts-flows"},"next":{"title":"Trigger flows with webhooks","permalink":"/webhook"}}');var s=t(74848),l=t(28453),r=t(24754),c=t(11470),p=t(19365);const a={title:"Trigger flows with the Langflow API",slug:"/concepts-publish"},i=void 0,d={},h={annotations:r.hk,Code:r.Cy},y={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},u=[{value:"Use the Langflow API to run flows",id:"api-access",level:2},{value:"Generate API code snippets",id:"generate-api-code-snippets",level:3},{value:"Langflow API authentication",id:"langflow-api-authentication",level:3},{value:"Input Schema (tweaks)",id:"input-schema",level:3},{value:"Use a flow ID alias",id:"use-a-flow-id-alias",level:3},{value:"Embed a flow into a website",id:"embedded-chat-widget",level:2},{value:"Get a langflow-chat snippet",id:"get-a-langflow-chat-snippet",level:3},{value:"Embed the chat widget with React, Angular, or HTML",id:"embed-the-chat-widget",level:3},{value:"Configure the langflow-chat web component",id:"configure-the-langflow-chat-web-component",level:3},{value:"Serve flows through a Langflow MCP server",id:"serve-flows-through-a-langflow-mcp-server",level:2},{value:"Run flows with the OpenAI Responses compatible endpoint",id:"openai-responses-api",level:2},{value:"See also",id:"see-also",level:2}];function f(o){const e={a:"a",admonition:"admonition",code:"code",em:"em",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,l.R)(),...o.components},{Details:n}=e;return h||F("CH",!1),h.Code||F("CH.Code",!0),n||F("Details",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n","\n",(0,s.jsx)(e.p,{children:"After you build a flow, you probably want to run it within an application, such as a chatbot within a mobile app or website."}),"\n",(0,s.jsx)(e.p,{children:"Langflow provides several ways to run flows from external applications:"}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsx)(e.li,{children:(0,s.jsx)(e.a,{href:"#api-access",children:"Trigger flows with the Langflow API"})}),"\n",(0,s.jsx)(e.li,{children:(0,s.jsx)(e.a,{href:"#embedded-chat-widget",children:"Add an embedded chat widget to a website"})}),"\n",(0,s.jsx)(e.li,{children:(0,s.jsx)(e.a,{href:"#serve-flows-through-a-langflow-mcp-server",children:"Serve flows through a Langflow MCP server"})}),"\n",(0,s.jsx)(e.li,{children:(0,s.jsx)(e.a,{href:"#openai-responses-api",children:"Run flows with the OpenAI Responses compatible endpoint"})}),"\n"]}),"\n",(0,s.jsxs)(e.p,{children:["Although you can use these options with an isolated, local Langflow instance, they are typically more valuable when you have ",(0,s.jsx)(e.a,{href:"/deployment-overview",children:"deployed a Langflow server"})," or ",(0,s.jsx)(e.a,{href:"/develop-application",children:"packaged Langflow as a dependency of an application"}),"."]}),"\n",(0,s.jsx)(e.h2,{id:"api-access",children:"Use the Langflow API to run flows"}),"\n",(0,s.jsx)(e.p,{children:"The Langflow API is the primary way to access your flows and Langflow servers programmatically."}),"\n",(0,s.jsx)(e.admonition,{title:"Try it",type:"tip",children:(0,s.jsxs)(e.p,{children:["For an example of a script that calls the Langflow API, see the ",(0,s.jsx)(e.a,{href:"/get-started-quickstart",children:"Quickstart"}),"."]})}),"\n",(0,s.jsx)(e.h3,{id:"generate-api-code-snippets",children:"Generate API code snippets"}),"\n",(0,s.jsx)(e.p,{children:"To help you embed Langflow API requests in your scripts, Langflow automatically generates Python, JavaScript, and curl code snippets for your flows.\nTo get these code snippets, do the following:"}),"\n",(0,s.jsxs)(e.ol,{children:["\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsx)(e.p,{children:"In Langflow, open the flow that you want to embed in your application."}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:["Click ",(0,s.jsx)(e.strong,{children:"Share"}),", and then select ",(0,s.jsx)(e.strong,{children:"API access"}),"."]}),"\n",(0,s.jsxs)(e.p,{children:["These code snippets call the ",(0,s.jsx)(e.code,{children:"/v1/run/$FLOW_ID"})," endpoint, and they automatically populate minimum values, like the Langflow server URL, flow ID, headers, and request parameters."]}),"\n",(0,s.jsx)(e.admonition,{title:"Windows",type:"tip",children:(0,s.jsx)(e.p,{children:"The paths generated by the API access pane assume a *nix environment.\nIf you use Microsoft Windows or WSL, you might need to adjust the filepaths given in the code snippets."})}),"\n",(0,s.jsx)(e.p,{children:(0,s.jsx)(e.img,{alt:"API access pane",src:t(4558).A+"",width:"4000",height:"2212"})}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:["Optional: Click ",(0,s.jsx)(e.a,{href:"#input-schema",children:(0,s.jsx)(e.strong,{children:"Input Schema"})})," to modify component parameters in the code snippets without changing the flow itself."]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsx)(e.p,{children:"Copy the snippet for the language that you want to use."}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsx)(e.p,{children:"Run the snippet as is, or use the snippet in the context of a larger script."}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(e.p,{children:["For more information and examples of other Langflow API endpoints, see ",(0,s.jsx)(e.a,{href:"/api-reference-api-examples",children:"Get started with the Langflow API"}),"."]}),"\n",(0,s.jsx)(e.h3,{id:"langflow-api-authentication",children:"Langflow API authentication"}),"\n",(0,s.jsx)(e.p,{children:"In Langflow versions 1.5 and later, most API endpoints require authentication with a Langflow API key."}),"\n",(0,s.jsxs)(e.p,{children:["Code snippets generated in the ",(0,s.jsx)(e.strong,{children:"API access"})," pane include a script that checks for a ",(0,s.jsx)(e.code,{children:"LANGFLOW_API_KEY"})," environment variable set in the local terminal session.\nThis script doesn't check for Langflow API keys set anywhere besides the local terminal session."]}),"\n",(0,s.jsxs)(e.p,{children:["For this script to work, you must set a ",(0,s.jsx)(e.code,{children:"LANGFLOW_API_KEY"})," variable in the terminal session where you intend to run the code snippet, such as ",(0,s.jsx)(e.code,{children:'export LANGFLOW_API_KEY="sk..."'}),"."]}),"\n",(0,s.jsxs)(e.p,{children:["Alternatively, you can edit the code snippet to include an ",(0,s.jsx)(e.code,{children:"x-api-key"})," header and ensure that the request can authenticate to the Langflow API."]}),"\n",(0,s.jsxs)(e.p,{children:["For more information, see ",(0,s.jsx)(e.a,{href:"/api-keys-and-authentication",children:"API keys and authentication"})," and ",(0,s.jsx)(e.a,{href:"/api-reference-api-examples",children:"Get started with the Langflow API"}),"."]}),"\n",(0,s.jsx)(e.h3,{id:"input-schema",children:"Input Schema (tweaks)"}),"\n",(0,s.jsxs)(e.p,{children:["Tweaks are one-time overrides that modify component parameters at runtime, rather than permanently modifying the flow itself.\nFor an example of tweaks in a script, see the ",(0,s.jsx)(e.a,{href:"/get-started-quickstart",children:"Quickstart"}),"."]}),"\n",(0,s.jsxs)(e.admonition,{type:"tip",children:[(0,s.jsx)(e.p,{children:"Tweaks make your flows more dynamic and reusable."}),(0,s.jsx)(e.p,{children:"You can create one flow and use it for multiple applications by passing application-specific tweaks in each application's Langflow API requests."})]}),"\n",(0,s.jsxs)(e.p,{children:["In the ",(0,s.jsx)(e.strong,{children:"API access"})," pane, click ",(0,s.jsx)(e.strong,{children:"Input Schema"})," to add ",(0,s.jsx)(e.code,{children:"tweaks"})," to the request payload in a flow's code snippets."]}),"\n",(0,s.jsxs)(e.p,{children:["Changes to a flow's ",(0,s.jsx)(e.strong,{children:"Input Schema"})," are saved exclusively as tweaks for that flow's ",(0,s.jsx)(e.strong,{children:"API access"})," code snippets.\nThese tweaks don't change the flow parameters set in the ",(0,s.jsx)(e.a,{href:"/concepts-overview#workspace",children:"workspace"}),", and they don't apply to other flows."]}),"\n",(0,s.jsxs)(e.p,{children:["Adding tweaks through the ",(0,s.jsx)(e.strong,{children:"Input Schema"})," can help you troubleshoot formatting issues with tweaks that you manually added to Langflow API requests."]}),"\n",(0,s.jsxs)(e.p,{children:["For example, the following curl command includes a tweak that disables the ",(0,s.jsx)(e.strong,{children:"Store Messages"})," setting in a flow's ",(0,s.jsx)(e.strong,{children:"Chat Input"})," component:"]}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"--request ",props:{style:{color:"#79C0FF"}}},{content:"POST ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" --url ",props:{style:{color:"#79C0FF"}}},{content:'"http://LANGFLOW_SERVER_ADDRESS/api/v1/run/FLOW_ID" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" --header ",props:{style:{color:"#79C0FF"}}},{content:'"Content-Type: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" --header ",props:{style:{color:"#79C0FF"}}},{content:'"x-api-key: LANGFLOW_API_KEY" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" --data ",props:{style:{color:"#79C0FF"}}},{content:"'{",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "input_value": "Text to input to the flow",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "output_type": "chat",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "input_type": "chat",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "tweaks": {',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "ChatInput-4WKag": {',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "should_store_message": false',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" }",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" }",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"}'",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,s.jsx)(e.h3,{id:"use-a-flow-id-alias",children:"Use a flow ID alias"}),"\n",(0,s.jsxs)(e.p,{children:["If you want your requests to use an alias instead of the actual flow ID, you can rename the flow's ",(0,s.jsx)(e.code,{children:"/v1/run/$FLOW_ID"})," endpoint:"]}),"\n",(0,s.jsxs)(e.ol,{children:["\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:["In Langflow, open the flow, click ",(0,s.jsx)(e.strong,{children:"Share"}),", and then select ",(0,s.jsx)(e.strong,{children:"API access"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:["Click ",(0,s.jsx)(e.strong,{children:"Input Schema"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:["In the ",(0,s.jsx)(e.strong,{children:"Endpoint Name"})," field, enter an alias for your flow's ID, such as a memorable, human-readable name."]}),"\n",(0,s.jsxs)(e.p,{children:["The name can contain only letters, numbers, hyphens, and underscores, such as ",(0,s.jsx)(e.code,{children:"flow-customer-database-agent"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:["To save the change, close the ",(0,s.jsx)(e.strong,{children:"Input Schema"})," pane."]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(e.p,{children:["The automatically generated code snippets now use your new endpoint name instead of the original flow ID, such as ",(0,s.jsx)(e.code,{children:'url = "http://localhost:7868/api/v1/run/flow-customer-database-agent"'}),"."]}),"\n",(0,s.jsx)(e.h2,{id:"embedded-chat-widget",children:"Embed a flow into a website"}),"\n",(0,s.jsxs)(e.p,{children:["For each flow, Langflow provides a code snippet that you can insert into the ",(0,s.jsx)(e.code,{children:""})," of your website's HTML to interact with your flow through an embedded chat widget."]}),"\n",(0,s.jsxs)(e.admonition,{title:"Required components",type:"important",children:[(0,s.jsxs)(e.p,{children:["The chat widget only supports flows that have ",(0,s.jsx)(e.strong,{children:"Chat Input"})," and ",(0,s.jsx)(e.strong,{children:"Chat Output"})," components, which are required for the chat experience.\n",(0,s.jsx)(e.strong,{children:"Text Input"})," and ",(0,s.jsx)(e.strong,{children:"Text Output"})," components can send and receive messages, but they don't include ongoing LLM chat context."]}),(0,s.jsxs)(e.p,{children:["Attempting to chat with a flow that doesn't have ",(0,s.jsxs)(e.a,{href:"/components-io",children:[(0,s.jsx)(e.strong,{children:"Chat Input"})," component"]})," will trigger the flow, but the response only indicates that the input was empty."]})]}),"\n",(0,s.jsx)(e.h3,{id:"get-a-langflow-chat-snippet",children:"Get a langflow-chat snippet"}),"\n",(0,s.jsx)(e.p,{children:"To get a flow's embedded chat widget code snippet, do the following:"}),"\n",(0,s.jsxs)(e.ol,{children:["\n",(0,s.jsx)(e.li,{children:"In Langflow, open the flow you want to embed."}),"\n",(0,s.jsxs)(e.li,{children:["Click ",(0,s.jsx)(e.strong,{children:"Share"}),", and then select ",(0,s.jsx)(e.strong,{children:"Embed into site"}),"."]}),"\n",(0,s.jsxs)(e.li,{children:["Copy the code snippet and use it in the ",(0,s.jsx)(e.code,{children:""})," of your website's HTML.\nFor more information, see ",(0,s.jsx)(e.a,{href:"#embed-the-chat-widget",children:"Embed the chat widget with React, Angular, or HTML"}),"."]}),"\n",(0,s.jsxs)(e.li,{children:["Add the ",(0,s.jsx)(e.code,{children:"api_key"})," prop to ensure the widget has permission to run the flow, as explained in ",(0,s.jsx)(e.a,{href:"#configure-the-langflow-chat-web-component",children:"Configure the langflow-chat web component"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(e.p,{children:["The chat widget is implemented as a web component called ",(0,s.jsx)(e.code,{children:"langflow-chat"})," that is loaded from a CDN. For more information, see the ",(0,s.jsx)(e.a,{href:"https://github.com/langflow-ai/langflow-embedded-chat",children:"langflow-embedded-chat repository"}),"."]}),"\n",(0,s.jsxs)(e.p,{children:["For example, the following HTML embeds a chat widget for a ",(0,s.jsx)(e.strong,{children:"Basic Prompting"})," template flow hosted on a Langflow server deployed on ngrok:"]}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"<",props:{style:{color:"#C9D1D9"}}},{content:"html",props:{style:{color:"#7EE787"}}},{content:">",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" <",props:{style:{color:"#C9D1D9"}}},{content:"head",props:{style:{color:"#7EE787"}}},{content:">",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" <",props:{style:{color:"#C9D1D9"}}},{content:"script ",props:{style:{color:"#7EE787"}}},{content:"src",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"https://cdn.jsdelivr.net/gh/langflow-ai/langflow-embedded-chat@main/dist/build/static/js/bundle.min.js"',props:{style:{color:"#A5D6FF"}}},{content:">",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" <",props:{style:{color:"#C9D1D9"}}},{content:"body",props:{style:{color:"#7EE787"}}},{content:">",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" <",props:{style:{color:"#C9D1D9"}}},{content:"langflow-chat",props:{style:{color:"#7EE787"}}}]},{tokens:[{content:" host_url",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"https://c822-73-64-93-151.ngrok-free.app"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" flow_id",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"dcbed533-859f-4b99-b1f5-16fce884f28f"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" api_key",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"$LANGFLOW_API_KEY"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" >",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]}],lang:"html"},annotations:[]}]}),"\n",(0,s.jsx)(e.p,{children:"When this code is deployed to a live site, it renders as a responsive chatbot.\nIf a user interacts with the chatbot, the input triggers the specified flow, and then the chatbot returns the output from the flow run."}),"\n",(0,s.jsx)(e.p,{children:(0,s.jsx)(e.img,{alt:"Default chat widget",src:t(43806).A+"",width:"1852",height:"2668"})}),"\n",(0,s.jsx)(e.admonition,{title:"Try it",type:"tip",children:(0,s.jsxs)(e.p,{children:["Use the ",(0,s.jsx)(e.a,{href:"https://codesandbox.io/p/sandbox/langflow-embedded-chat-example-dv9zpx",children:"Langflow embedded chat CodeSandbox"})," for an interactive live demo of the embedded chat widget that uses your own flow.\nFor more information, see the ",(0,s.jsx)(e.a,{href:"https://github.com/langflow-ai/langflow-embedded-chat?tab=readme-ov-file#live-example",children:"langflow-embedded-chat README"}),"."]})}),"\n",(0,s.jsx)(e.h3,{id:"embed-the-chat-widget",children:"Embed the chat widget with React, Angular, or HTML"}),"\n",(0,s.jsx)(e.p,{children:"The following examples show how to use embedded chat widget in React, Angular, and plain HTML."}),"\n",(0,s.jsxs)(c.A,{children:[(0,s.jsxs)(p.A,{value:"react",label:"React",default:!0,children:[(0,s.jsx)(e.p,{children:"To use the chat widget in your React application, create a component that loads the widget script and renders the chat interface:"}),(0,s.jsxs)(e.ol,{children:["\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsx)(e.p,{children:"Declare your web component, and then encapsulate it in a React component:"}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"//Declaration of langflow-chat web component",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:"declare",props:{style:{color:"#FF7B72"}}},{content:" global {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"namespace ",props:{style:{color:"#FF7B72"}}},{content:"JSX",props:{style:{color:"#FFA657"}}},{content:" {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" interface ",props:{style:{color:"#FF7B72"}}},{content:"IntrinsicElements",props:{style:{color:"#FFA657"}}},{content:" {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "langflow-chat"',props:{style:{color:"#A5D6FF"}}},{content:": ",props:{style:{color:"#FF7B72"}}},{content:"any",props:{style:{color:"#79C0FF"}}},{content:";",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" }",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"//Definition for langflow-chat React component",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:"export default function ",props:{style:{color:"#FF7B72"}}},{content:"ChatWidget",props:{style:{color:"#D2A8FF"}}},{content:"({ className }) ",props:{style:{color:"#FFA657"}}},{content:"{",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"return",props:{style:{color:"#FF7B72"}}},{content:" (",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" <",props:{style:{color:"#C9D1D9"}}},{content:"div ",props:{style:{color:"#7EE787"}}},{content:"className",props:{style:{color:"#79C0FF"}}},{content:"={",props:{style:{color:"#FF7B72"}}},{content:"className",props:{style:{color:"#C9D1D9"}}},{content:"}",props:{style:{color:"#FF7B72"}}},{content:">",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" <",props:{style:{color:"#C9D1D9"}}},{content:"langflow-chat",props:{style:{color:"#7EE787"}}}]},{tokens:[{content:" host_url",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"https://c822-73-64-93-151.ngrok-free.app"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" flow_id",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"dcbed533-859f-4b99-b1f5-16fce884f28f"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" api_key",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"$LANGFLOW_API_KEY"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" >",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:");",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]}],lang:"javascript"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsx)(e.p,{children:"Place the component anywhere in your code to render the chat widget."}),"\n",(0,s.jsxs)(e.p,{children:["In the following example, the React widget component is located at ",(0,s.jsx)(e.code,{children:"docs/src/components/ChatWidget/index.tsx"}),", and ",(0,s.jsx)(e.code,{children:"index.tsx"})," includes a script to load the chat widget code from CDN, along with the declaration and definition from the previous step:"]}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"import",props:{style:{color:"#FF7B72"}}},{content:" React, { useEffect } ",props:{style:{color:"#C9D1D9"}}},{content:"from ",props:{style:{color:"#FF7B72"}}},{content:"'react'",props:{style:{color:"#A5D6FF"}}},{content:";",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"// Component to load the chat widget script",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:"const ",props:{style:{color:"#FF7B72"}}},{content:"ChatScriptLoader ",props:{style:{color:"#D2A8FF"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" () ",props:{style:{color:"#C9D1D9"}}},{content:"=>",props:{style:{color:"#FF7B72"}}},{content:" {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"useEffect",props:{style:{color:"#D2A8FF"}}},{content:"(() ",props:{style:{color:"#C9D1D9"}}},{content:"=>",props:{style:{color:"#FF7B72"}}},{content:" {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" if",props:{style:{color:"#FF7B72"}}},{content:" (",props:{style:{color:"#C9D1D9"}}},{content:"!",props:{style:{color:"#FF7B72"}}},{content:"document.",props:{style:{color:"#C9D1D9"}}},{content:"querySelector",props:{style:{color:"#D2A8FF"}}},{content:"(",props:{style:{color:"#C9D1D9"}}},{content:"'script[src*=\"langflow-embedded-chat\"]'",props:{style:{color:"#A5D6FF"}}},{content:")) {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" const ",props:{style:{color:"#FF7B72"}}},{content:"script ",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" document.",props:{style:{color:"#C9D1D9"}}},{content:"createElement",props:{style:{color:"#D2A8FF"}}},{content:"(",props:{style:{color:"#C9D1D9"}}},{content:"'script'",props:{style:{color:"#A5D6FF"}}},{content:");",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" script.src ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:"'https://cdn.jsdelivr.net/gh/langflow-ai/langflow-embedded-chat@main/dist/build/static/js/bundle.min.js'",props:{style:{color:"#A5D6FF"}}},{content:";",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" script.async ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:"true",props:{style:{color:"#79C0FF"}}},{content:";",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" document.body.",props:{style:{color:"#C9D1D9"}}},{content:"appendChild",props:{style:{color:"#D2A8FF"}}},{content:"(script);",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" }",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"}, []);",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"return ",props:{style:{color:"#FF7B72"}}},{content:"null",props:{style:{color:"#79C0FF"}}},{content:";",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"};",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"//Declaration of langflow-chat web component",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:"declare",props:{style:{color:"#FF7B72"}}},{content:" global {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"namespace ",props:{style:{color:"#FF7B72"}}},{content:"JSX",props:{style:{color:"#FFA657"}}},{content:" {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" interface ",props:{style:{color:"#FF7B72"}}},{content:"IntrinsicElements",props:{style:{color:"#FFA657"}}},{content:" {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "langflow-chat"',props:{style:{color:"#A5D6FF"}}},{content:": ",props:{style:{color:"#FF7B72"}}},{content:"any",props:{style:{color:"#79C0FF"}}},{content:";",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" }",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"//Definition for langflow-chat React component",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:"export default function ",props:{style:{color:"#FF7B72"}}},{content:"ChatWidget",props:{style:{color:"#D2A8FF"}}},{content:"({ className }) ",props:{style:{color:"#FFA657"}}},{content:"{",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"return",props:{style:{color:"#FF7B72"}}},{content:" (",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" <",props:{style:{color:"#C9D1D9"}}},{content:"div ",props:{style:{color:"#7EE787"}}},{content:"className",props:{style:{color:"#79C0FF"}}},{content:"={",props:{style:{color:"#FF7B72"}}},{content:"className",props:{style:{color:"#C9D1D9"}}},{content:"}",props:{style:{color:"#FF7B72"}}},{content:">",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" <",props:{style:{color:"#C9D1D9"}}},{content:"ChatScriptLoader",props:{style:{color:"#7EE787"}}},{content:" />",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" <",props:{style:{color:"#C9D1D9"}}},{content:"langflow-chat",props:{style:{color:"#7EE787"}}}]},{tokens:[{content:" host_url",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"https://c822-73-64-93-151.ngrok-free.app"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" flow_id",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"dcbed533-859f-4b99-b1f5-16fce884f28f"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" api_key",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"$LANGFLOW_API_KEY"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" >",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:");",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]}],lang:"javascript"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:["Import the ",(0,s.jsx)(e.code,{children:"langflow-chat"})," React component to make it available for use on a page.\nModify the following import statement with your React component's name and path:"]}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"import",props:{style:{color:"#FF7B72"}}},{content:" ChatWidget ",props:{style:{color:"#C9D1D9"}}},{content:"from ",props:{style:{color:"#FF7B72"}}},{content:"'@site/src/components/ChatWidget'",props:{style:{color:"#A5D6FF"}}},{content:";",props:{style:{color:"#C9D1D9"}}}]}],lang:"jsx"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:["To display the widget, call your ",(0,s.jsx)(e.code,{children:"langflow-chat"})," component in the desired location on the page.\nModify the following reference for your React component's name and the desired ",(0,s.jsx)(e.code,{children:"className"}),":"]}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:'',props:{}}]}],lang:"text"},annotations:[]}]}),"\n"]}),"\n"]})]}),(0,s.jsxs)(p.A,{value:"angular",label:"Angular",children:[(0,s.jsx)(e.p,{children:"To use the chat widget in your Angular application, create a component that loads the widget script and renders the chat interface."}),(0,s.jsxs)(e.p,{children:["In an Angular application, ",(0,s.jsx)(e.code,{children:"langflow-chat"})," is a custom web component that you must explicitly allow in your site's ",(0,s.jsx)(e.code,{children:".components.ts"}),".\nTherefore, to use the embedded chat widget, you must add ",(0,s.jsx)(e.code,{children:"CUSTOM_ELEMENTS_SCHEMA"})," to your module's configuration, and then integrate the ",(0,s.jsx)(e.code,{children:""})," element."]}),(0,s.jsxs)(e.p,{children:["Angular requires you to explicitly allow custom web components, like ",(0,s.jsx)(e.code,{children:"langflow-chat"}),", in your site's ",(0,s.jsx)(e.code,{children:"components"}),".\nTherefore, you must add the ",(0,s.jsx)(e.code,{children:""})," element to your Angular template and configure Angular to recognize it.\nYou must add ",(0,s.jsx)(e.code,{children:"CUSTOM_ELEMENTS_SCHEMA"})," to your module's configuration to enable this."]}),(0,s.jsxs)(e.ol,{children:["\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:["In your Angular application, edit the ",(0,s.jsx)(e.code,{children:".module.ts"})," file where you want to add the ",(0,s.jsx)(e.code,{children:"langflow-chat"})," web component."]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:["At the top of ",(0,s.jsx)(e.code,{children:".module.ts"}),", import ",(0,s.jsx)(e.code,{children:"CUSTOM_ELEMENTS_SCHEMA"}),":"]}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';",props:{}}]}],lang:"text"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:["In the ",(0,s.jsx)(e.code,{children:"@NgModule"})," decorator, add ",(0,s.jsx)(e.code,{children:"CUSTOM_ELEMENTS_SCHEMA"})," to the ",(0,s.jsx)(e.code,{children:"schemas"})," array:"]}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"import",props:{style:{color:"#FF7B72"}}},{content:" { NgModule, CUSTOM_ELEMENTS_SCHEMA } ",props:{style:{color:"#C9D1D9"}}},{content:"from ",props:{style:{color:"#FF7B72"}}},{content:"'@angular/core'",props:{style:{color:"#A5D6FF"}}},{content:";",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"import",props:{style:{color:"#FF7B72"}}},{content:" { BrowserModule } ",props:{style:{color:"#C9D1D9"}}},{content:"from ",props:{style:{color:"#FF7B72"}}},{content:"'@angular/platform-browser'",props:{style:{color:"#A5D6FF"}}},{content:";",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"import",props:{style:{color:"#FF7B72"}}},{content:" { AppComponent } ",props:{style:{color:"#C9D1D9"}}},{content:"from ",props:{style:{color:"#FF7B72"}}},{content:"'./app.component'",props:{style:{color:"#A5D6FF"}}},{content:";",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"@",props:{style:{color:"#C9D1D9"}}},{content:"NgModule",props:{style:{color:"#D2A8FF"}}},{content:"({",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"declarations: [",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" AppComponent",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"],",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"imports: [",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" BrowserModule",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"],",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"schemas: [",props:{style:{color:"#C9D1D9"}}},{content:"CUSTOM_ELEMENTS_SCHEMA",props:{style:{color:"#79C0FF"}}},{content:"],",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"providers: [],",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"bootstrap: [AppComponent]",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"})",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"export class ",props:{style:{color:"#FF7B72"}}},{content:"AppModule",props:{style:{color:"#FFA657"}}},{content:" { }",props:{style:{color:"#C9D1D9"}}}]}],lang:"javascript"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:["Edit the ",(0,s.jsx)(e.code,{children:".component.ts"})," file where you want to use the embedded chat widget."]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:["In the ",(0,s.jsx)(e.code,{children:"@Component"})," decorator, add the ",(0,s.jsx)(e.code,{children:""})," element to the ",(0,s.jsx)(e.code,{children:"template"})," key:"]}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"import",props:{style:{color:"#FF7B72"}}},{content:" { Component } ",props:{style:{color:"#C9D1D9"}}},{content:"from ",props:{style:{color:"#FF7B72"}}},{content:"'@angular/core'",props:{style:{color:"#A5D6FF"}}},{content:";",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"@",props:{style:{color:"#C9D1D9"}}},{content:"Component",props:{style:{color:"#D2A8FF"}}},{content:"({",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"selector: ",props:{style:{color:"#C9D1D9"}}},{content:"'app-root'",props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"template: ",props:{style:{color:"#C9D1D9"}}},{content:"`",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:'
      ',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"

      Langflow Chat Test

      ",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" ",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"
      ",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"`",props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"styles: [",props:{style:{color:"#C9D1D9"}}},{content:"`",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" .container {",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" padding: 20px;",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" text-align: center;",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" }",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"`",props:{style:{color:"#A5D6FF"}}},{content:"]",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"})",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"export class ",props:{style:{color:"#FF7B72"}}},{content:"AppComponent",props:{style:{color:"#FFA657"}}},{content:" {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"title ",props:{style:{color:"#FFA657"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:"'Langflow Chat Test'",props:{style:{color:"#A5D6FF"}}},{content:";",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]}],lang:"javascript"},annotations:[]}]}),"\n"]}),"\n"]})]}),(0,s.jsx)(p.A,{value:"html",label:"HTML",children:(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"<",props:{style:{color:"#C9D1D9"}}},{content:"html ",props:{style:{color:"#7EE787"}}},{content:"lang",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"en"',props:{style:{color:"#A5D6FF"}}},{content:">",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"<",props:{style:{color:"#C9D1D9"}}},{content:"head",props:{style:{color:"#7EE787"}}},{content:">",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"<",props:{style:{color:"#C9D1D9"}}},{content:"script ",props:{style:{color:"#7EE787"}}},{content:"src",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"https://cdn.jsdelivr.net/gh/langflow-ai/langflow-embedded-chat@v1.0.7/dist/build/static/js/bundle.min.js"',props:{style:{color:"#A5D6FF"}}},{content:">",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"<",props:{style:{color:"#C9D1D9"}}},{content:"body",props:{style:{color:"#7EE787"}}},{content:">",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"<",props:{style:{color:"#C9D1D9"}}},{content:"langflow-chat",props:{style:{color:"#7EE787"}}}]},{tokens:[{content:" host_url",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"https://c822-73-64-93-151.ngrok-free.app"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" flow_id",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"dcbed533-859f-4b99-b1f5-16fce884f28f"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" api_key",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"$LANGFLOW_API_KEY"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" >",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]}],lang:"html"},annotations:[]}]})})]}),"\n",(0,s.jsx)(e.h3,{id:"configure-the-langflow-chat-web-component",children:"Configure the langflow-chat web component"}),"\n",(0,s.jsxs)(e.p,{children:["To use the embedded chat widget in your HTML, the ",(0,s.jsx)(e.code,{children:"langflow-chat"})," web component must include the following minimum inputs (also known as ",(0,s.jsx)(e.em,{children:"props"})," in React):"]}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.code,{children:"host_url"}),": Your Langflow server URL. Must be ",(0,s.jsx)(e.code,{children:"HTTPS"}),". Don't include a trailing slash (",(0,s.jsx)(e.code,{children:"/"}),")."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.code,{children:"flow_id"}),": The ID of the flow you want to embed."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.code,{children:"api_key"}),": A ",(0,s.jsx)(e.a,{href:"/api-keys-and-authentication",children:"Langflow API key"}),".\nThis prop is recommended to ensure the widget has permission to run the flow."]}),"\n"]}),"\n",(0,s.jsxs)(e.p,{children:["The minimum inputs are automatically populated in the ",(0,s.jsxs)(e.a,{href:"#get-a-langflow-chat-snippet",children:[(0,s.jsx)(e.strong,{children:"Embed into site"})," code snippet"]})," that is generated by Langflow."]}),"\n",(0,s.jsxs)(e.p,{children:["You can use additional inputs (props) to modify the embedded chat widget.\nFor a list of all props, types, and descriptions, see the ",(0,s.jsx)(e.a,{href:"https://github.com/langflow-ai/langflow-embedded-chat?tab=readme-ov-file#configuration",children:"langflow-embedded-chat README"}),"."]}),"\n",(0,s.jsxs)(n,{children:[(0,s.jsx)("summary",{children:"Example: Langflow API key prop"}),(0,s.jsxs)(e.p,{children:["The ",(0,s.jsx)(e.code,{children:"api_key"})," prop stores a Langflow API key that the chat widget can use to authenticate the underlying Langflow API request."]}),(0,s.jsx)(e.p,{children:"The Langflow team recommends following industry best practices for handling sensitive credentials.\nFor example, securely store your API key, and then retrieve with an environment variable:"}),(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"<",props:{style:{color:"#C9D1D9"}}},{content:"langflow-chat",props:{style:{color:"#7EE787"}}}]},{tokens:[{content:" host_url",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"https://c822-73-64-93-151.ngrok-free.app"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" flow_id",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"dcbed533-859f-4b99-b1f5-16fce884f28f"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" api_key",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"$LANGFLOW_API_KEY"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:">",props:{style:{color:"#C9D1D9"}}}]}],lang:"html"},annotations:[]}]})]}),"\n",(0,s.jsxs)(n,{children:[(0,s.jsx)("summary",{children:"Example: Style props"}),(0,s.jsxs)(e.p,{children:["There are many props you can use to customize the style and positioning of the embedded chat widget.\nMany of these props are of type JSON, and they require specific formatting, depending on where you embed the ",(0,s.jsx)(e.code,{children:"langflow-chat"})," web component."]}),(0,s.jsxs)(e.p,{children:["In React and plain HTML, JSON props are expressed as JSON objects or stringified JSON, such as ",(0,s.jsx)(e.code,{children:'\\{"key":"value"\\}'}),":"]}),(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"<",props:{style:{color:"#C9D1D9"}}},{content:"langflow-chat",props:{style:{color:"#7EE787"}}}]},{tokens:[{content:" host_url",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"https://c822-73-64-93-151.ngrok-free.app"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" flow_id",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"dcbed533-859f-4b99-b1f5-16fce884f28f"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" api_key",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"$LANGFLOW_API_KEY"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" chat_window_style",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:"'{",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "backgroundColor": "#1a0d0d",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "border": "4px solid #b30000",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "borderRadius": "16px",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "boxShadow": "0 8px 32px #b30000",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "color": "#fff",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "fontFamily": "Georgia, serif",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "padding": "16px"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" }'",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" window_title",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"Custom Styled Chat"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" height",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"600"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" width",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"400"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:">",props:{style:{color:"#C9D1D9"}}}]}],lang:"html"},annotations:[]}]}),(0,s.jsxs)(e.p,{children:["For Angular applications, use ",(0,s.jsx)(e.a,{href:"https://angular.dev/guide/templates/binding#binding-dynamic-properties-and-attributes",children:"property binding syntax"})," to pass JSON props as JavaScript objects.\nFor example:"]}),(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"import",props:{style:{color:"#FF7B72"}}},{content:" { Component } ",props:{style:{color:"#C9D1D9"}}},{content:"from ",props:{style:{color:"#FF7B72"}}},{content:"'@angular/core'",props:{style:{color:"#A5D6FF"}}},{content:";",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"@",props:{style:{color:"#C9D1D9"}}},{content:"Component",props:{style:{color:"#D2A8FF"}}},{content:"({",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" selector: ",props:{style:{color:"#C9D1D9"}}},{content:"'app-root'",props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" template: ",props:{style:{color:"#C9D1D9"}}},{content:"`",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:'
      ',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"

      Langflow Chat Test

      ",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" ",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"
      ",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" `",props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" styles: [",props:{style:{color:"#C9D1D9"}}},{content:"`",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" .container {",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" padding: 20px;",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" text-align: center;",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" }",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" `",props:{style:{color:"#A5D6FF"}}},{content:"]",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"})",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"export class ",props:{style:{color:"#FF7B72"}}},{content:"AppComponent",props:{style:{color:"#FFA657"}}},{content:" {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" title ",props:{style:{color:"#FFA657"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:"'Langflow Chat Test'",props:{style:{color:"#A5D6FF"}}},{content:";",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]}],lang:"javascript"},annotations:[]}]})]}),"\n",(0,s.jsxs)(n,{children:[(0,s.jsx)("summary",{children:"Example: Session ID prop"}),(0,s.jsxs)(e.p,{children:["The following example adds a custom ",(0,s.jsx)(e.a,{href:"/session-id",children:"session ID"})," to help identify flow runs started by the embedded chat widget:"]}),(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"<",props:{style:{color:"#C9D1D9"}}},{content:"langflow-chat",props:{style:{color:"#7EE787"}}}]},{tokens:[{content:" host_url",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"https://c822-73-64-93-151.ngrok-free.app"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" flow_id",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"dcbed533-859f-4b99-b1f5-16fce884f28f"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" api_key",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"$LANGFLOW_API_KEY"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" session_id",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"$SESSION_ID"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:">",props:{style:{color:"#C9D1D9"}}}]}],lang:"html"},annotations:[]}]})]}),"\n",(0,s.jsxs)(n,{children:[(0,s.jsx)("summary",{children:"Example: Tweaks prop"}),(0,s.jsxs)(e.p,{children:["Use the ",(0,s.jsx)(e.code,{children:"tweaks"})," prop to modify flow parameters at runtime.\nThe available keys for the ",(0,s.jsx)(e.code,{children:"tweaks"})," object depend on the flow you are serving through the embedded chat widget."]}),(0,s.jsxs)(e.p,{children:["In React and plain HTML, ",(0,s.jsx)(e.code,{children:"tweaks"})," are declared as a JSON object, similar to how you would pass them to a Langflow API endpoint like ",(0,s.jsx)(e.a,{href:"/api-flows-run#run-flow",children:(0,s.jsx)(e.code,{children:"/v1/run/$FLOW_ID"})}),".\nFor example:"]}),(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"<",props:{style:{color:"#C9D1D9"}}},{content:"langflow-chat",props:{style:{color:"#7EE787"}}}]},{tokens:[{content:" host_url",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"https://c822-73-64-93-151.ngrok-free.app"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" flow_id",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"dcbed533-859f-4b99-b1f5-16fce884f28f"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" api_key",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"$LANGFLOW_API_KEY"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" tweaks",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:"'{",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "model_name": "llama-3.1-8b-instant"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" }'",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:">",props:{style:{color:"#C9D1D9"}}}]}],lang:"html"},annotations:[]}]}),(0,s.jsxs)(e.p,{children:["For Angular applications, use ",(0,s.jsx)(e.a,{href:"https://angular.dev/guide/templates/binding#binding-dynamic-properties-and-attributes",children:"property binding syntax"})," to pass JSON props as JavaScript objects.\nFor example:"]}),(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"import",props:{style:{color:"#FF7B72"}}},{content:" { Component } ",props:{style:{color:"#C9D1D9"}}},{content:"from ",props:{style:{color:"#FF7B72"}}},{content:"'@angular/core'",props:{style:{color:"#A5D6FF"}}},{content:";",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"@",props:{style:{color:"#C9D1D9"}}},{content:"Component",props:{style:{color:"#D2A8FF"}}},{content:"({",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" selector: ",props:{style:{color:"#C9D1D9"}}},{content:"'app-root'",props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" template: ",props:{style:{color:"#C9D1D9"}}},{content:"`",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:'
      ',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"

      Langflow Chat Test

      ",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" ",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"
      ",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" `",props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" styles: [",props:{style:{color:"#C9D1D9"}}},{content:"`",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" .container {",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" padding: 20px;",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" text-align: center;",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" }",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" `",props:{style:{color:"#A5D6FF"}}},{content:"]",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"})",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"export class ",props:{style:{color:"#FF7B72"}}},{content:"AppComponent",props:{style:{color:"#FFA657"}}},{content:" {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" title ",props:{style:{color:"#FFA657"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:"'Langflow Chat Test'",props:{style:{color:"#A5D6FF"}}},{content:";",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]}],lang:"javascript"},annotations:[]}]})]}),"\n",(0,s.jsx)(e.h2,{id:"serve-flows-through-a-langflow-mcp-server",children:"Serve flows through a Langflow MCP server"}),"\n",(0,s.jsxs)(e.p,{children:["Each ",(0,s.jsx)(e.a,{href:"/concepts-flows#projects",children:"Langflow project"})," has an MCP server that exposes the project's flows as ",(0,s.jsx)(e.a,{href:"https://modelcontextprotocol.io/docs/concepts/tools",children:"tools"})," that ",(0,s.jsx)(e.a,{href:"https://modelcontextprotocol.io/clients",children:"MCP clients"})," can use to generate responses."]}),"\n",(0,s.jsx)(e.p,{children:"In addition to serving flows through Langflow MCP servers, you can use Langflow as an MCP client to access any MCP server, including your Langflow MCP servers."}),"\n",(0,s.jsxs)(e.p,{children:["Interactions with Langflow MCP servers happen through the Langflow API's ",(0,s.jsx)(e.code,{children:"/mcp"})," endpoints."]}),"\n",(0,s.jsxs)(e.p,{children:["For more information, see ",(0,s.jsx)(e.a,{href:"/mcp-server",children:"Use Langflow as an MCP server"})," and ",(0,s.jsx)(e.a,{href:"/mcp-client",children:"Use Langflow as an MCP client"}),"."]}),"\n",(0,s.jsx)(e.h2,{id:"openai-responses-api",children:"Run flows with the OpenAI Responses compatible endpoint"}),"\n",(0,s.jsxs)(e.p,{children:["Langflow includes an OpenAI Responses API-compatible endpoint at ",(0,s.jsx)(e.code,{children:"/api/v1/responses"})," that allows you to use existing OpenAI client libraries and code with minimal modifications."]}),"\n",(0,s.jsxs)(e.p,{children:["For more information, see ",(0,s.jsx)(e.a,{href:"/api-openai-responses",children:"OpenAI Responses API"}),"."]}),"\n",(0,s.jsx)(e.h2,{id:"see-also",children:"See also"}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsx)(e.li,{children:(0,s.jsx)(e.a,{href:"/concepts-flows-import",children:"Import and export flows"})}),"\n",(0,s.jsx)(e.li,{children:(0,s.jsx)(e.a,{href:"/api-files",children:"Files endpoints"})}),"\n",(0,s.jsx)(e.li,{children:(0,s.jsx)(e.a,{href:"/concepts-playground",children:"Test flows in the Playground"})}),"\n"]})]})}function D(o={}){const{wrapper:e}={...(0,l.R)(),...o.components};return e?(0,s.jsx)(e,{...o,children:(0,s.jsx)(f,{...o})}):f(o)}function F(o,e){throw new Error("Expected "+(e?"component":"object")+" `"+o+"` to be defined: you likely forgot to import, pass, or provide it.")}},43806:(o,e,t)=>{t.d(e,{A:()=>n});const n=t.p+"assets/images/chat-widget-default-50fbdf351e2e984e4103a225be85f9a4.png"}}]); \ No newline at end of file diff --git a/assets/js/08d5c80a.de078962.js b/assets/js/08d5c80a.40e4cff8.js similarity index 86% rename from assets/js/08d5c80a.de078962.js rename to assets/js/08d5c80a.40e4cff8.js index 2129c16d38..84695c6c1f 100644 --- a/assets/js/08d5c80a.de078962.js +++ b/assets/js/08d5c80a.40e4cff8.js @@ -1 +1 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[8082],{6569:(e,n,s)=>{s.d(n,{A:()=>t});const t=s.p+"assets/images/playground-with-agent-423894429e02da778dc975dd1680436c.png"},11470:(e,n,s)=>{s.d(n,{A:()=>v});var t=s(96540),o=s(18215),r=s(23104),a=s(56347),i=s(205),l=s(57485),c=s(31682),d=s(70679);function h(e){return t.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,t.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function u(e){const{values:n,children:s}=e;return(0,t.useMemo)(()=>{const e=n??function(e){return h(e).map(({props:{value:e,label:n,attributes:s,default:t}})=>({value:e,label:n,attributes:s,default:t}))}(s);return function(e){const n=(0,c.XI)(e,(e,n)=>e.value===n.value);if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map(e=>e.value).join(", ")}" found in . Every value needs to be unique.`)}(e),e},[n,s])}function p({value:e,tabValues:n}){return n.some(n=>n.value===e)}function g({queryString:e=!1,groupId:n}){const s=(0,a.W6)(),o=function({queryString:e=!1,groupId:n}){if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:e,groupId:n});return[(0,l.aZ)(o),(0,t.useCallback)(e=>{if(!o)return;const n=new URLSearchParams(s.location.search);n.set(o,e),s.replace({...s.location,search:n.toString()})},[o,s])]}function f(e){const{defaultValue:n,queryString:s=!1,groupId:o}=e,r=u(e),[a,l]=(0,t.useState)(()=>function({defaultValue:e,tabValues:n}){if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(e){if(!p({value:e,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${n.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}const s=n.find(e=>e.default)??n[0];if(!s)throw new Error("Unexpected error: 0 tabValues");return s.value}({defaultValue:n,tabValues:r})),[c,h]=g({queryString:s,groupId:o}),[f,m]=function({groupId:e}){const n=function(e){return e?`docusaurus.tab.${e}`:null}(e),[s,o]=(0,d.Dv)(n);return[s,(0,t.useCallback)(e=>{n&&o.set(e)},[n,o])]}({groupId:o}),y=(()=>{const e=c??f;return p({value:e,tabValues:r})?e:null})();(0,i.A)(()=>{y&&l(y)},[y]);return{selectedValue:a,selectValue:(0,t.useCallback)(e=>{if(!p({value:e,tabValues:r}))throw new Error(`Can't select invalid tab value=${e}`);l(e),h(e),m(e)},[h,m,r]),tabValues:r}}var m=s(92303);const y={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var x=s(74848);function w({className:e,block:n,selectedValue:s,selectValue:t,tabValues:a}){const i=[],{blockElementScrollPositionUntilNextRender:l}=(0,r.a_)(),c=e=>{const n=e.currentTarget,o=i.indexOf(n),r=a[o].value;r!==s&&(l(n),t(r))},d=e=>{let n=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const s=i.indexOf(e.currentTarget)+1;n=i[s]??i[0];break}case"ArrowLeft":{const s=i.indexOf(e.currentTarget)-1;n=i[s]??i[i.length-1];break}}n?.focus()};return(0,x.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.A)("tabs",{"tabs--block":n},e),children:a.map(({value:e,label:n,attributes:t})=>(0,x.jsx)("li",{role:"tab",tabIndex:s===e?0:-1,"aria-selected":s===e,ref:e=>{i.push(e)},onKeyDown:d,onClick:c,...t,className:(0,o.A)("tabs__item",y.tabItem,t?.className,{"tabs__item--active":s===e}),children:n??e},e))})}function j({lazy:e,children:n,selectedValue:s}){const r=(Array.isArray(n)?n:[n]).filter(Boolean);if(e){const e=r.find(e=>e.props.value===s);return e?(0,t.cloneElement)(e,{className:(0,o.A)("margin-top--md",e.props.className)}):null}return(0,x.jsx)("div",{className:"margin-top--md",children:r.map((e,n)=>(0,t.cloneElement)(e,{key:n,hidden:e.props.value!==s}))})}function b(e){const n=f(e);return(0,x.jsxs)("div",{className:(0,o.A)("tabs-container",y.tabList),children:[(0,x.jsx)(w,{...n,...e}),(0,x.jsx)(j,{...n,...e})]})}function v(e){const n=(0,m.A)();return(0,x.jsx)(b,{...e,children:h(e.children)},String(n))}},17886:(e,n,s)=>{s.d(n,{A:()=>r});s(96540);var t=s(64058),o=s(74848);function r({name:e,...n}){const s=t[e];return s?(0,o.jsx)(s,{...n}):null}},19365:(e,n,s)=>{s.d(n,{A:()=>a});s(96540);var t=s(18215);const o={tabItem:"tabItem_Ymn6"};var r=s(74848);function a({children:e,hidden:n,className:s}){return(0,r.jsx)("div",{role:"tabpanel",className:(0,t.A)(o.tabItem,s),hidden:n,children:e})}},75918:(e,n,s)=>{s.d(n,{A:()=>t});const t=s.p+"assets/images/playground-f076ef0d964c1c159da751ec119fa744.png"},85629:(e,n,s)=>{s.d(n,{A:()=>t});const t=s.p+"assets/images/messages-logs-0253cad77c1fb946dc1e2f0fe239261f.png"},95495:(e,n,s)=>{s.r(n),s.d(n,{CH:()=>p,assets:()=>u,chCodeConfig:()=>g,contentTitle:()=>h,default:()=>y,frontMatter:()=>d,metadata:()=>t,toc:()=>f});const t=JSON.parse('{"id":"Concepts/concepts-playground","title":"Test flows in the Playground","description":"Langflow\'s Playground is a dynamic interface you can use to test your LLM-based flows in real-time.","source":"@site/docs/Concepts/concepts-playground.mdx","sourceDirName":"Concepts","slug":"/concepts-playground","permalink":"/concepts-playground","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Test flows in the Playground","slug":"/concepts-playground"},"sidebar":"docs","previous":{"title":"Trigger flows with webhooks","permalink":"/webhook"},"next":{"title":"Import and export flows","permalink":"/concepts-flows-import"}}');var o=s(74848),r=s(28453),a=s(24754),i=s(11470),l=s(19365),c=s(17886);const d={title:"Test flows in the Playground",slug:"/concepts-playground"},h=void 0,u={},p={annotations:a.hk,Code:a.Cy},g={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},f=[{value:"Run a flow in the Playground",id:"run-a-flow-in-the-playground",level:2},{value:"Review agent logic",id:"review-agent-logic",level:3},{value:"View chat history",id:"view-chat-history",level:3},{value:"Modify memories in the Playground",id:"modify-memories-in-the-playground",level:3},{value:"Set custom session IDs",id:"session-ids",level:2},{value:"Share a flow's Playground",id:"share-a-flows-playground",level:2},{value:"See also",id:"see-also",level:2}];function m(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return p||x("CH",!1),p.Code||x("CH.Code",!0),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n","\n",(0,o.jsxs)(n.p,{children:["Langflow's ",(0,o.jsx)(n.strong,{children:"Playground"})," is a dynamic interface you can use to test your LLM-based flows in real-time."]}),"\n",(0,o.jsx)(n.p,{children:"You can test how a flow responds to different inputs, review and modify memories, and monitor flow output and logic.\nFor example, you can make sure agent flows use the appropriate tools to respond to different inputs."}),"\n",(0,o.jsxs)(n.p,{children:["The ",(0,o.jsx)(n.strong,{children:"Playground"})," allows you to quickly iterate over your flow's logic and behavior, making it easier to prototype and refine your applications."]}),"\n",(0,o.jsx)(n.h2,{id:"run-a-flow-in-the-playground",children:"Run a flow in the Playground"}),"\n",(0,o.jsxs)(n.p,{children:["To run a flow in the ",(0,o.jsx)(n.strong,{children:"Playground"}),", open the flow, and then click ",(0,o.jsx)(c.A,{name:"Play","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Playground"}),".\nThen, if your flow has a ",(0,o.jsxs)(n.a,{href:"/components-io",children:[(0,o.jsx)(n.strong,{children:"Chat Input"})," component"]}),", enter a prompt or ",(0,o.jsx)(n.a,{href:"/concepts-voice-mode",children:"use voice mode"})," to trigger the flow and start a chat session."]}),"\n",(0,o.jsxs)(n.admonition,{type:"tip",children:[(0,o.jsxs)(n.p,{children:["If there is no message input field in the ",(0,o.jsx)(n.strong,{children:"Playground"}),", make sure your flow has a ",(0,o.jsx)(n.strong,{children:"Chat Input"})," component that is connected, directly or indirectly, to the ",(0,o.jsx)(n.strong,{children:"Input"})," port of a ",(0,o.jsx)(n.strong,{children:"Language Model"})," or ",(0,o.jsx)(n.strong,{children:"Agent"})," component."]}),(0,o.jsxs)(n.p,{children:["Because the ",(0,o.jsx)(n.strong,{children:"Playground"})," is designed for flows that use an LLM in a query-and-response format, such as chatbots and agents, a flow must have ",(0,o.jsx)(n.strong,{children:"Chat Input"}),", ",(0,o.jsx)(n.strong,{children:"Language Model"}),"/",(0,o.jsx)(n.strong,{children:"Agent"}),", and ",(0,o.jsx)(n.strong,{children:"Chat Output"})," components to be fully supported by the ",(0,o.jsx)(n.strong,{children:"Playground"})," chat interface"]}),(0,o.jsxs)(n.p,{children:["For flows that require another type of input, such as a webhook event, file upload, or text input, you can ",(0,o.jsx)(n.a,{href:"/api-flows-run",children:"use the Langflow API to trigger the flow"}),", and then open the ",(0,o.jsx)(n.strong,{children:"Playground"})," to review the LLM activity for the flow run, if applicable."]})]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.img,{alt:"Playground window",src:s(75918).A+"",width:"4000",height:"2182"})}),"\n",(0,o.jsxs)(n.p,{children:["For technical details about how the ",(0,o.jsx)(n.strong,{children:"Playground"})," works, see ",(0,o.jsx)(n.a,{href:"/api-monitor",children:"Monitor endpoints"}),"."]}),"\n",(0,o.jsx)(n.h3,{id:"review-agent-logic",children:"Review agent logic"}),"\n",(0,o.jsxs)(n.p,{children:["If your flow has an ",(0,o.jsx)(n.strong,{children:"Agent"})," component, the ",(0,o.jsx)(n.strong,{children:"Playground"})," prints the tools used by the agent and the output from each tool.\nThis helps you monitor the agent's tool use and understand the logic behind the agent's responses.\nFor example, the following agent used a connected ",(0,o.jsx)(n.code,{children:"fetch_content"})," tool to perform a web search:"]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.img,{alt:"Playground with agent response",src:s(6569).A+"",width:"2864",height:"1856"})}),"\n",(0,o.jsx)(n.h3,{id:"view-chat-history",children:"View chat history"}),"\n",(0,o.jsxs)(n.p,{children:["In the ",(0,o.jsx)(n.strong,{children:"Playground"}),", you can view message logs for each of your flow's chat sessions, including timestamps, content, and senders."]}),"\n",(0,o.jsxs)(n.p,{children:["In the ",(0,o.jsx)(n.strong,{children:"Playground"})," sidebar, find the chat session you want to review, click ",(0,o.jsx)(c.A,{name:"Ellipsis","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Options"}),", and then select ",(0,o.jsx)(n.strong,{children:"Message Logs"}),"."]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.img,{alt:"Playground logs",src:s(85629).A+"",width:"4000",height:"2182"})}),"\n",(0,o.jsxs)(n.p,{children:["Message logs break apart the ",(0,o.jsxs)(n.a,{href:"/data-types#message",children:[(0,o.jsx)(n.code,{children:"Message"})," data"]})," for each chat message.\nClick any cell in the message logs to view the full contents of that cell."]}),"\n",(0,o.jsx)(n.h3,{id:"modify-memories-in-the-playground",children:"Modify memories in the Playground"}),"\n",(0,o.jsxs)(n.p,{children:["To help debug and test your flows, you can edit or delete individual messages in ",(0,o.jsx)(n.a,{href:"#view-chat-history",children:"message logs"}),".\nFor example, you might want to delete messages that you sent while testing a component that is no longer part of your flow."]}),"\n",(0,o.jsxs)(n.p,{children:["You can also delete entire chat sessions from the sidebar: click ",(0,o.jsx)(c.A,{name:"Ellipsis","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Options"}),", and then select ",(0,o.jsx)(n.strong,{children:"Delete"}),"."]}),"\n",(0,o.jsx)(n.p,{children:"Modifying memories influences the behavior of the chatbot responses if you continue the chat session or if you preserve memories over multiple chat sessions."}),"\n",(0,o.jsxs)(n.p,{children:[(0,o.jsxs)(n.strong,{children:["Editing message logs edits Langflow's internal ",(0,o.jsx)(n.code,{children:"messages"})," table, which is the default chat memory storage."]}),"\nFor more information about managing sessions and chat memory in Langflow, see ",(0,o.jsx)(n.a,{href:"#session-ids",children:"Use custom session IDs"})," and ",(0,o.jsx)(n.a,{href:"/memory",children:"Memory management options"}),"."]}),"\n",(0,o.jsx)(n.h2,{id:"session-ids",children:"Set custom session IDs"}),"\n",(0,o.jsxs)(n.p,{children:["Chat sessions are identified by session ID (",(0,o.jsx)(n.code,{children:"session_id"}),"), which is a unique identifier for a flow run."]}),"\n",(0,o.jsx)(n.p,{children:"The default session ID is the flow ID, which means that all chat messages for a flow are stored under the same session ID as one enormous chat session."}),"\n",(0,o.jsxs)(n.p,{children:["If you need to preserve chat context over multiple flow runs or differentiate chat sessions when debugging flows, you can set a custom ",(0,o.jsx)(n.code,{children:"session_id"}),"."]}),"\n",(0,o.jsx)(n.p,{children:"Custom session IDs are helpful for multiple reasons:"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"Separate chat sessions in situations where one flow has multiple chat sessions, such as a chatbot that can have multiple simultaneous user interactions."}),"\n",(0,o.jsx)(n.li,{children:"Preserve memory when continuing a chat session across multiple flow runs or when passing context from one flow to another."}),"\n",(0,o.jsx)(n.li,{children:"Differentiate activity from multiple users within the same flow."}),"\n",(0,o.jsx)(n.li,{children:"Identify your own chat sessions when debugging and testing flows."}),"\n"]}),"\n",(0,o.jsx)(n.p,{children:"You can set custom session IDs in the visual editor and programmatically."}),"\n",(0,o.jsxs)(i.A,{children:[(0,o.jsxs)(l.A,{value:"visual",label:"Visual editor",default:!0,children:[(0,o.jsxs)(n.p,{children:["In your ",(0,o.jsx)(n.a,{href:"/components-io",children:"input and output components"}),", use the ",(0,o.jsx)(n.strong,{children:"Session ID"})," field:"]}),(0,o.jsxs)(n.ol,{children:["\n",(0,o.jsx)(n.li,{children:"Click the component where you want to set a custom session ID."}),"\n",(0,o.jsxs)(n.li,{children:["In the ",(0,o.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),", click ",(0,o.jsx)(c.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Controls"}),"."]}),"\n",(0,o.jsxs)(n.li,{children:["Enable ",(0,o.jsx)(n.strong,{children:"Session ID"}),"."]}),"\n",(0,o.jsxs)(n.li,{children:["Click ",(0,o.jsx)(n.strong,{children:"Close"}),"."]}),"\n",(0,o.jsx)(n.li,{children:"Enter a custom session ID.\nIf the field is empty, the flow uses the default session ID."}),"\n",(0,o.jsxs)(n.li,{children:["Open the ",(0,o.jsx)(n.strong,{children:"Playground"})," to start a chat under your custom session ID."]}),"\n"]}),(0,o.jsxs)(n.p,{children:["Make sure to change the ",(0,o.jsx)(n.strong,{children:"Session ID"})," when you want to start a new chat session or continue an earlier chat session with a different session ID."]})]}),(0,o.jsxs)(l.A,{value:"api",label:"Langflow API",children:[(0,o.jsxs)(n.p,{children:["When you trigger a flow with the Langflow API, include the ",(0,o.jsx)(n.code,{children:"session_id"})," parameter in the request payload.\nFor example:"]}),(0,o.jsx)(p.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:'POST "http://',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_SERVER_ADDRESS",props:{style:{color:"#C9D1D9"}}},{content:"/api/v1/run/",props:{style:{color:"#A5D6FF"}}},{content:"$FLOW_ID",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:"-H ",props:{style:{color:"#C9D1D9"}}},{content:'"Content-Type: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:"-H ",props:{style:{color:"#C9D1D9"}}},{content:'"x-api-key: ',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:"-d ",props:{style:{color:"#C9D1D9"}}},{content:"'{",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "session_id": "CUSTOM_SESSION_ID",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "input_value": "message",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "input_type": "chat",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "output_type": "chat"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"}'",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),(0,o.jsxs)(n.p,{children:["This command starts a new chat sessions with the specified ",(0,o.jsx)(n.code,{children:"session_id"})," or it retrieves an existing session with that ID, if one exists."]})]})]}),"\n",(0,o.jsxs)(n.admonition,{type:"tip",children:[(0,o.jsx)(n.p,{children:"In a production environment, consider using a variable for the session ID rather than a hardcoded value."}),(0,o.jsx)(n.p,{children:"For example, if you want to preserve context for authenticated users, user ID could be a useful variable for the session ID.\nAlternatively, if you want every chat to be unique, you might want to automatically generate a UUID for each session ID."})]}),"\n",(0,o.jsxs)(n.p,{children:["For more information, see ",(0,o.jsx)(n.a,{href:"/session-id",children:"Use session ID to manage communication between components"}),"."]}),"\n",(0,o.jsx)(n.h2,{id:"share-a-flows-playground",children:"Share a flow's Playground"}),"\n",(0,o.jsxs)(n.admonition,{type:"important",children:[(0,o.jsxs)(n.p,{children:["The ",(0,o.jsx)(n.strong,{children:"Shareable Playground"})," is for testing purposes only.\nThe ",(0,o.jsx)(n.strong,{children:"Playground"})," isn't meant for embedding flows in applications. For information about running flows in applications or websites, see ",(0,o.jsx)(n.a,{href:"/concepts-publish",children:"Trigger flows with the Langflow API"}),"."]}),(0,o.jsxs)(n.p,{children:["The ",(0,o.jsx)(n.strong,{children:"Shareable Playground"})," isn't available in Langflow Desktop."]})]}),"\n",(0,o.jsxs)(n.p,{children:["The ",(0,o.jsx)(n.strong,{children:"Shareable Playground"})," option exposes the ",(0,o.jsx)(n.strong,{children:"Playground"})," for a single flow at the ",(0,o.jsx)(n.code,{children:"/public_flow/$FLOW_ID"})," endpoint."]}),"\n",(0,o.jsxs)(n.p,{children:["After you ",(0,o.jsx)(n.a,{href:"/deployment-overview",children:"deploy a public Langflow server"}),", you can share this public URL with another user to allow them to access the specified flow's ",(0,o.jsx)(n.strong,{children:"Playground"})," only.\nThe user can interact with the flow's chat input and output and view the results without installing Langflow or generating a Langflow API key."]}),"\n",(0,o.jsxs)(n.p,{children:["To share a flow's ",(0,o.jsx)(n.strong,{children:"Playground"})," with another user, do the following:"]}),"\n",(0,o.jsxs)(n.ol,{children:["\n",(0,o.jsx)(n.li,{children:"In Langflow, open the flow you want share."}),"\n",(0,o.jsxs)(n.li,{children:["In the ",(0,o.jsx)(n.a,{href:"/concepts-overview#workspace",children:"workspace"}),", click ",(0,o.jsx)(n.strong,{children:"Share"}),", and then enable ",(0,o.jsx)(n.strong,{children:"Shareable Playground"}),"."]}),"\n",(0,o.jsxs)(n.li,{children:["Click ",(0,o.jsx)(n.strong,{children:"Shareable Playground"})," again to open the ",(0,o.jsx)(n.strong,{children:"Playground"})," window.\nThis window's URL is the flow's ",(0,o.jsx)(n.strong,{children:"Shareable Playground"})," address, such as ",(0,o.jsx)(n.code,{children:"https://3f7c-73-64-93-151.ngrok-free.app/playground/d764c4b8-5cec-4c0f-9de0-4b419b11901a"}),"."]}),"\n",(0,o.jsxs)(n.li,{children:["Send the URL to another user to give them access to the flow's ",(0,o.jsx)(n.strong,{children:"Playground"}),"."]}),"\n"]}),"\n",(0,o.jsx)(n.h2,{id:"see-also",children:"See also"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.a,{href:"/concepts-file-management#upload-images",children:"Upload images"})}),"\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.a,{href:"/concepts-voice-mode",children:"Use voice mode"})}),"\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.a,{href:"/concepts-publish",children:"Trigger flows with the Langflow API"})}),"\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.a,{href:"/session-id",children:"Session ID"})}),"\n"]})]})}function y(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(m,{...e})}):m(e)}function x(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}}}]); \ No newline at end of file +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[8082],{6569:(e,n,s)=>{s.d(n,{A:()=>t});const t=s.p+"assets/images/playground-with-agent-423894429e02da778dc975dd1680436c.png"},11470:(e,n,s)=>{s.d(n,{A:()=>v});var t=s(96540),o=s(18215),r=s(23104),a=s(56347),i=s(205),l=s(57485),c=s(31682),d=s(70679);function h(e){return t.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,t.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function u(e){const{values:n,children:s}=e;return(0,t.useMemo)(()=>{const e=n??function(e){return h(e).map(({props:{value:e,label:n,attributes:s,default:t}})=>({value:e,label:n,attributes:s,default:t}))}(s);return function(e){const n=(0,c.XI)(e,(e,n)=>e.value===n.value);if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map(e=>e.value).join(", ")}" found in . Every value needs to be unique.`)}(e),e},[n,s])}function p({value:e,tabValues:n}){return n.some(n=>n.value===e)}function g({queryString:e=!1,groupId:n}){const s=(0,a.W6)(),o=function({queryString:e=!1,groupId:n}){if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:e,groupId:n});return[(0,l.aZ)(o),(0,t.useCallback)(e=>{if(!o)return;const n=new URLSearchParams(s.location.search);n.set(o,e),s.replace({...s.location,search:n.toString()})},[o,s])]}function f(e){const{defaultValue:n,queryString:s=!1,groupId:o}=e,r=u(e),[a,l]=(0,t.useState)(()=>function({defaultValue:e,tabValues:n}){if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(e){if(!p({value:e,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${n.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}const s=n.find(e=>e.default)??n[0];if(!s)throw new Error("Unexpected error: 0 tabValues");return s.value}({defaultValue:n,tabValues:r})),[c,h]=g({queryString:s,groupId:o}),[f,m]=function({groupId:e}){const n=function(e){return e?`docusaurus.tab.${e}`:null}(e),[s,o]=(0,d.Dv)(n);return[s,(0,t.useCallback)(e=>{n&&o.set(e)},[n,o])]}({groupId:o}),y=(()=>{const e=c??f;return p({value:e,tabValues:r})?e:null})();(0,i.A)(()=>{y&&l(y)},[y]);return{selectedValue:a,selectValue:(0,t.useCallback)(e=>{if(!p({value:e,tabValues:r}))throw new Error(`Can't select invalid tab value=${e}`);l(e),h(e),m(e)},[h,m,r]),tabValues:r}}var m=s(92303);const y={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var x=s(74848);function w({className:e,block:n,selectedValue:s,selectValue:t,tabValues:a}){const i=[],{blockElementScrollPositionUntilNextRender:l}=(0,r.a_)(),c=e=>{const n=e.currentTarget,o=i.indexOf(n),r=a[o].value;r!==s&&(l(n),t(r))},d=e=>{let n=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const s=i.indexOf(e.currentTarget)+1;n=i[s]??i[0];break}case"ArrowLeft":{const s=i.indexOf(e.currentTarget)-1;n=i[s]??i[i.length-1];break}}n?.focus()};return(0,x.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.A)("tabs",{"tabs--block":n},e),children:a.map(({value:e,label:n,attributes:t})=>(0,x.jsx)("li",{role:"tab",tabIndex:s===e?0:-1,"aria-selected":s===e,ref:e=>{i.push(e)},onKeyDown:d,onClick:c,...t,className:(0,o.A)("tabs__item",y.tabItem,t?.className,{"tabs__item--active":s===e}),children:n??e},e))})}function j({lazy:e,children:n,selectedValue:s}){const r=(Array.isArray(n)?n:[n]).filter(Boolean);if(e){const e=r.find(e=>e.props.value===s);return e?(0,t.cloneElement)(e,{className:(0,o.A)("margin-top--md",e.props.className)}):null}return(0,x.jsx)("div",{className:"margin-top--md",children:r.map((e,n)=>(0,t.cloneElement)(e,{key:n,hidden:e.props.value!==s}))})}function b(e){const n=f(e);return(0,x.jsxs)("div",{className:(0,o.A)("tabs-container",y.tabList),children:[(0,x.jsx)(w,{...n,...e}),(0,x.jsx)(j,{...n,...e})]})}function v(e){const n=(0,m.A)();return(0,x.jsx)(b,{...e,children:h(e.children)},String(n))}},17886:(e,n,s)=>{s.d(n,{A:()=>r});s(96540);var t=s(64058),o=s(74848);function r({name:e,...n}){const s=t[e];return s?(0,o.jsx)(s,{...n}):null}},19365:(e,n,s)=>{s.d(n,{A:()=>a});s(96540);var t=s(18215);const o={tabItem:"tabItem_Ymn6"};var r=s(74848);function a({children:e,hidden:n,className:s}){return(0,r.jsx)("div",{role:"tabpanel",className:(0,t.A)(o.tabItem,s),hidden:n,children:e})}},75918:(e,n,s)=>{s.d(n,{A:()=>t});const t=s.p+"assets/images/playground-f076ef0d964c1c159da751ec119fa744.png"},85629:(e,n,s)=>{s.d(n,{A:()=>t});const t=s.p+"assets/images/messages-logs-0253cad77c1fb946dc1e2f0fe239261f.png"},95495:(e,n,s)=>{s.r(n),s.d(n,{CH:()=>p,assets:()=>u,chCodeConfig:()=>g,contentTitle:()=>h,default:()=>y,frontMatter:()=>d,metadata:()=>t,toc:()=>f});const t=JSON.parse('{"id":"Concepts/concepts-playground","title":"Test flows in the Playground","description":"Langflow\'s Playground is a dynamic interface you can use to test your LLM-based flows in real-time.","source":"@site/docs/Concepts/concepts-playground.mdx","sourceDirName":"Concepts","slug":"/concepts-playground","permalink":"/concepts-playground","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Test flows in the Playground","slug":"/concepts-playground"},"sidebar":"docs","previous":{"title":"Trigger flows with webhooks","permalink":"/webhook"},"next":{"title":"Import and export flows","permalink":"/concepts-flows-import"}}');var o=s(74848),r=s(28453),a=s(24754),i=s(11470),l=s(19365),c=s(17886);const d={title:"Test flows in the Playground",slug:"/concepts-playground"},h=void 0,u={},p={annotations:a.hk,Code:a.Cy},g={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},f=[{value:"Run a flow in the Playground",id:"run-a-flow-in-the-playground",level:2},{value:"Review agent logic",id:"review-agent-logic",level:3},{value:"View chat history",id:"view-chat-history",level:3},{value:"Modify memories in the Playground",id:"modify-memories-in-the-playground",level:3},{value:"Set custom session IDs",id:"session-ids",level:2},{value:"Share a flow's Playground",id:"share-a-flows-playground",level:2},{value:"See also",id:"see-also",level:2}];function m(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return p||x("CH",!1),p.Code||x("CH.Code",!0),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n","\n",(0,o.jsxs)(n.p,{children:["Langflow's ",(0,o.jsx)(n.strong,{children:"Playground"})," is a dynamic interface you can use to test your LLM-based flows in real-time."]}),"\n",(0,o.jsx)(n.p,{children:"You can test how a flow responds to different inputs, review and modify memories, and monitor flow output and logic.\nFor example, you can make sure agent flows use the appropriate tools to respond to different inputs."}),"\n",(0,o.jsxs)(n.p,{children:["The ",(0,o.jsx)(n.strong,{children:"Playground"})," allows you to quickly iterate over your flow's logic and behavior, making it easier to prototype and refine your applications."]}),"\n",(0,o.jsx)(n.h2,{id:"run-a-flow-in-the-playground",children:"Run a flow in the Playground"}),"\n",(0,o.jsxs)(n.p,{children:["To run a flow in the ",(0,o.jsx)(n.strong,{children:"Playground"}),", open the flow, and then click ",(0,o.jsx)(c.A,{name:"Play","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Playground"}),".\nThen, if your flow has a ",(0,o.jsxs)(n.a,{href:"/components-io",children:[(0,o.jsx)(n.strong,{children:"Chat Input"})," component"]}),", enter a prompt or ",(0,o.jsx)(n.a,{href:"/concepts-voice-mode",children:"use voice mode"})," to trigger the flow and start a chat session."]}),"\n",(0,o.jsxs)(n.admonition,{type:"tip",children:[(0,o.jsxs)(n.p,{children:["If there is no message input field in the ",(0,o.jsx)(n.strong,{children:"Playground"}),", make sure your flow has a ",(0,o.jsx)(n.strong,{children:"Chat Input"})," component that is connected, directly or indirectly, to the ",(0,o.jsx)(n.strong,{children:"Input"})," port of a ",(0,o.jsx)(n.strong,{children:"Language Model"})," or ",(0,o.jsx)(n.strong,{children:"Agent"})," component."]}),(0,o.jsxs)(n.p,{children:["Because the ",(0,o.jsx)(n.strong,{children:"Playground"})," is designed for flows that use an LLM in a query-and-response format, such as chatbots and agents, a flow must have ",(0,o.jsx)(n.strong,{children:"Chat Input"}),", ",(0,o.jsx)(n.strong,{children:"Language Model"}),"/",(0,o.jsx)(n.strong,{children:"Agent"}),", and ",(0,o.jsx)(n.strong,{children:"Chat Output"})," components to be fully supported by the ",(0,o.jsx)(n.strong,{children:"Playground"})," chat interface"]}),(0,o.jsxs)(n.p,{children:["For flows that require another type of input, such as a webhook event, file upload, or text input, you can ",(0,o.jsx)(n.a,{href:"/api-flows-run",children:"use the Langflow API to trigger the flow"}),", and then open the ",(0,o.jsx)(n.strong,{children:"Playground"})," to review the LLM activity for the flow run, if applicable."]})]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.img,{alt:"Playground window",src:s(75918).A+"",width:"4000",height:"2182"})}),"\n",(0,o.jsxs)(n.p,{children:["For technical details about how the ",(0,o.jsx)(n.strong,{children:"Playground"})," works, see ",(0,o.jsx)(n.a,{href:"/api-monitor",children:"Monitor endpoints"}),"."]}),"\n",(0,o.jsx)(n.h3,{id:"review-agent-logic",children:"Review agent logic"}),"\n",(0,o.jsxs)(n.p,{children:["If your flow has an ",(0,o.jsx)(n.strong,{children:"Agent"})," component, the ",(0,o.jsx)(n.strong,{children:"Playground"})," prints the tools used by the agent and the output from each tool.\nThis helps you monitor the agent's tool use and understand the logic behind the agent's responses.\nFor example, the following agent used a connected ",(0,o.jsx)(n.code,{children:"fetch_content"})," tool to perform a web search:"]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.img,{alt:"Playground with agent response",src:s(6569).A+"",width:"2864",height:"1856"})}),"\n",(0,o.jsx)(n.h3,{id:"view-chat-history",children:"View chat history"}),"\n",(0,o.jsxs)(n.p,{children:["In the ",(0,o.jsx)(n.strong,{children:"Playground"}),", you can view message logs for each of your flow's chat sessions, including timestamps, content, and senders."]}),"\n",(0,o.jsxs)(n.p,{children:["In the ",(0,o.jsx)(n.strong,{children:"Playground"})," sidebar, find the chat session you want to review, click ",(0,o.jsx)(c.A,{name:"Ellipsis","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Options"}),", and then select ",(0,o.jsx)(n.strong,{children:"Message Logs"}),"."]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.img,{alt:"Playground logs",src:s(85629).A+"",width:"4000",height:"2182"})}),"\n",(0,o.jsxs)(n.p,{children:["Message logs break apart the ",(0,o.jsxs)(n.a,{href:"/data-types#message",children:[(0,o.jsx)(n.code,{children:"Message"})," data"]})," for each chat message.\nClick any cell in the message logs to view the full contents of that cell."]}),"\n",(0,o.jsx)(n.h3,{id:"modify-memories-in-the-playground",children:"Modify memories in the Playground"}),"\n",(0,o.jsxs)(n.p,{children:["To help debug and test your flows, you can edit or delete individual messages in ",(0,o.jsx)(n.a,{href:"#view-chat-history",children:"message logs"}),".\nFor example, you might want to delete messages that you sent while testing a component that is no longer part of your flow."]}),"\n",(0,o.jsxs)(n.p,{children:["You can also delete entire chat sessions from the sidebar: click ",(0,o.jsx)(c.A,{name:"Ellipsis","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Options"}),", and then select ",(0,o.jsx)(n.strong,{children:"Delete"}),"."]}),"\n",(0,o.jsx)(n.p,{children:"Modifying memories influences the behavior of the chatbot responses if you continue the chat session or if you preserve memories over multiple chat sessions."}),"\n",(0,o.jsxs)(n.p,{children:[(0,o.jsxs)(n.strong,{children:["Editing message logs edits Langflow's internal ",(0,o.jsx)(n.code,{children:"messages"})," table, which is the default chat memory storage."]}),"\nFor more information about managing sessions and chat memory in Langflow, see ",(0,o.jsx)(n.a,{href:"#session-ids",children:"Use custom session IDs"})," and ",(0,o.jsx)(n.a,{href:"/memory",children:"Memory management options"}),"."]}),"\n",(0,o.jsx)(n.h2,{id:"session-ids",children:"Set custom session IDs"}),"\n",(0,o.jsxs)(n.p,{children:["Chat sessions are identified by session ID (",(0,o.jsx)(n.code,{children:"session_id"}),"), which is a unique identifier for a flow run."]}),"\n",(0,o.jsx)(n.p,{children:"The default session ID is the flow ID, which means that all chat messages for a flow are stored under the same session ID as one enormous chat session."}),"\n",(0,o.jsxs)(n.p,{children:["If you need to preserve chat context over multiple flow runs or differentiate chat sessions when debugging flows, you can set a custom ",(0,o.jsx)(n.code,{children:"session_id"}),"."]}),"\n",(0,o.jsx)(n.p,{children:"Custom session IDs are helpful for multiple reasons:"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"Separate chat sessions in situations where one flow has multiple chat sessions, such as a chatbot that can have multiple simultaneous user interactions."}),"\n",(0,o.jsx)(n.li,{children:"Preserve memory when continuing a chat session across multiple flow runs or when passing context from one flow to another."}),"\n",(0,o.jsx)(n.li,{children:"Differentiate activity from multiple users within the same flow."}),"\n",(0,o.jsx)(n.li,{children:"Identify your own chat sessions when debugging and testing flows."}),"\n"]}),"\n",(0,o.jsx)(n.p,{children:"You can set custom session IDs in the visual editor and programmatically."}),"\n",(0,o.jsxs)(i.A,{children:[(0,o.jsxs)(l.A,{value:"visual",label:"Visual editor",default:!0,children:[(0,o.jsxs)(n.p,{children:["In your ",(0,o.jsx)(n.a,{href:"/components-io",children:"input and output components"}),", use the ",(0,o.jsx)(n.strong,{children:"Session ID"})," field:"]}),(0,o.jsxs)(n.ol,{children:["\n",(0,o.jsx)(n.li,{children:"Click the component where you want to set a custom session ID."}),"\n",(0,o.jsxs)(n.li,{children:["In the ",(0,o.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),", click ",(0,o.jsx)(c.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Controls"}),"."]}),"\n",(0,o.jsxs)(n.li,{children:["Enable ",(0,o.jsx)(n.strong,{children:"Session ID"}),"."]}),"\n",(0,o.jsxs)(n.li,{children:["Click ",(0,o.jsx)(n.strong,{children:"Close"}),"."]}),"\n",(0,o.jsx)(n.li,{children:"Enter a custom session ID.\nIf the field is empty, the flow uses the default session ID."}),"\n",(0,o.jsxs)(n.li,{children:["Open the ",(0,o.jsx)(n.strong,{children:"Playground"})," to start a chat under your custom session ID."]}),"\n"]}),(0,o.jsxs)(n.p,{children:["Make sure to change the ",(0,o.jsx)(n.strong,{children:"Session ID"})," when you want to start a new chat session or continue an earlier chat session with a different session ID."]})]}),(0,o.jsxs)(l.A,{value:"api",label:"Langflow API",children:[(0,o.jsxs)(n.p,{children:["When you trigger a flow with the Langflow API, include the ",(0,o.jsx)(n.code,{children:"session_id"})," parameter in the request payload.\nFor example:"]}),(0,o.jsx)(p.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:'POST "http://',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_SERVER_ADDRESS",props:{style:{color:"#C9D1D9"}}},{content:"/api/v1/run/",props:{style:{color:"#A5D6FF"}}},{content:"$FLOW_ID",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:"-H ",props:{style:{color:"#C9D1D9"}}},{content:'"Content-Type: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:"-H ",props:{style:{color:"#C9D1D9"}}},{content:'"x-api-key: ',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:"-d ",props:{style:{color:"#C9D1D9"}}},{content:"'{",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "session_id": "CUSTOM_SESSION_ID",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "input_value": "message",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "input_type": "chat",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "output_type": "chat"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"}'",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),(0,o.jsxs)(n.p,{children:["This command starts a new chat sessions with the specified ",(0,o.jsx)(n.code,{children:"session_id"})," or it retrieves an existing session with that ID, if one exists."]})]})]}),"\n",(0,o.jsxs)(n.admonition,{type:"tip",children:[(0,o.jsx)(n.p,{children:"In a production environment, consider using a variable for the session ID rather than a hardcoded value."}),(0,o.jsx)(n.p,{children:"For example, if you want to preserve context for authenticated users, user ID could be a useful variable for the session ID.\nAlternatively, if you want every chat to be unique, you might want to automatically generate a UUID for each session ID."})]}),"\n",(0,o.jsxs)(n.p,{children:["For more information, see ",(0,o.jsx)(n.a,{href:"/session-id",children:"Use session ID to manage communication between components"}),"."]}),"\n",(0,o.jsx)(n.h2,{id:"share-a-flows-playground",children:"Share a flow's Playground"}),"\n",(0,o.jsxs)(n.admonition,{type:"warning",children:[(0,o.jsxs)(n.p,{children:["The ",(0,o.jsx)(n.strong,{children:"Shareable Playground"})," is for testing purposes only.\nThe ",(0,o.jsx)(n.strong,{children:"Playground"})," isn't meant for embedding flows in applications. For information about running flows in applications or websites, see ",(0,o.jsx)(n.a,{href:"/concepts-publish",children:"Trigger flows with the Langflow API"}),"."]}),(0,o.jsxs)(n.p,{children:["The ",(0,o.jsx)(n.strong,{children:"Shareable Playground"})," isn't available in Langflow Desktop."]})]}),"\n",(0,o.jsxs)(n.p,{children:["The ",(0,o.jsx)(n.strong,{children:"Shareable Playground"})," option exposes the ",(0,o.jsx)(n.strong,{children:"Playground"})," for a single flow at the ",(0,o.jsx)(n.code,{children:"/public_flow/$FLOW_ID"})," endpoint."]}),"\n",(0,o.jsxs)(n.p,{children:["After you ",(0,o.jsx)(n.a,{href:"/deployment-overview",children:"deploy a public Langflow server"}),", you can share this public URL with another user to allow them to access the specified flow's ",(0,o.jsx)(n.strong,{children:"Playground"})," only.\nThe user can interact with the flow's chat input and output and view the results without installing Langflow or generating a Langflow API key."]}),"\n",(0,o.jsxs)(n.p,{children:["To share a flow's ",(0,o.jsx)(n.strong,{children:"Playground"})," with another user, do the following:"]}),"\n",(0,o.jsxs)(n.ol,{children:["\n",(0,o.jsx)(n.li,{children:"In Langflow, open the flow you want share."}),"\n",(0,o.jsxs)(n.li,{children:["In the ",(0,o.jsx)(n.a,{href:"/concepts-overview#workspace",children:"workspace"}),", click ",(0,o.jsx)(n.strong,{children:"Share"}),", and then enable ",(0,o.jsx)(n.strong,{children:"Shareable Playground"}),"."]}),"\n",(0,o.jsxs)(n.li,{children:["Click ",(0,o.jsx)(n.strong,{children:"Shareable Playground"})," again to open the ",(0,o.jsx)(n.strong,{children:"Playground"})," window.\nThis window's URL is the flow's ",(0,o.jsx)(n.strong,{children:"Shareable Playground"})," address, such as ",(0,o.jsx)(n.code,{children:"https://3f7c-73-64-93-151.ngrok-free.app/playground/d764c4b8-5cec-4c0f-9de0-4b419b11901a"}),"."]}),"\n",(0,o.jsxs)(n.li,{children:["Send the URL to another user to give them access to the flow's ",(0,o.jsx)(n.strong,{children:"Playground"}),"."]}),"\n"]}),"\n",(0,o.jsx)(n.h2,{id:"see-also",children:"See also"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.a,{href:"/concepts-file-management#upload-images",children:"Upload images"})}),"\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.a,{href:"/concepts-voice-mode",children:"Use voice mode"})}),"\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.a,{href:"/concepts-publish",children:"Trigger flows with the Langflow API"})}),"\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.a,{href:"/session-id",children:"Session ID"})}),"\n"]})]})}function y(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(m,{...e})}):m(e)}function x(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}}}]); \ No newline at end of file diff --git a/assets/js/16ceb5d2.f79f8fa9.js b/assets/js/16ceb5d2.3ff11244.js similarity index 83% rename from assets/js/16ceb5d2.f79f8fa9.js rename to assets/js/16ceb5d2.3ff11244.js index 83fe5948a0..3aec3d683c 100644 --- a/assets/js/16ceb5d2.f79f8fa9.js +++ b/assets/js/16ceb5d2.3ff11244.js @@ -1 +1 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[1399],{11470:(e,o,n)=>{n.d(o,{A:()=>m});var t=n(96540),s=n(18215),r=n(23104),l=n(56347),c=n(205),i=n(57485),a=n(31682),p=n(70679);function d(e){return t.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,t.isValidElement)(e)&&function(e){const{props:o}=e;return!!o&&"object"==typeof o&&"value"in o}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function h(e){const{values:o,children:n}=e;return(0,t.useMemo)(()=>{const e=o??function(e){return d(e).map(({props:{value:e,label:o,attributes:n,default:t}})=>({value:e,label:o,attributes:n,default:t}))}(n);return function(e){const o=(0,a.XI)(e,(e,o)=>e.value===o.value);if(o.length>0)throw new Error(`Docusaurus error: Duplicate values "${o.map(e=>e.value).join(", ")}" found in . Every value needs to be unique.`)}(e),e},[o,n])}function u({value:e,tabValues:o}){return o.some(o=>o.value===e)}function y({queryString:e=!1,groupId:o}){const n=(0,l.W6)(),s=function({queryString:e=!1,groupId:o}){if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!o)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return o??null}({queryString:e,groupId:o});return[(0,i.aZ)(s),(0,t.useCallback)(e=>{if(!s)return;const o=new URLSearchParams(n.location.search);o.set(s,e),n.replace({...n.location,search:o.toString()})},[s,n])]}function F(e){const{defaultValue:o,queryString:n=!1,groupId:s}=e,r=h(e),[l,i]=(0,t.useState)(()=>function({defaultValue:e,tabValues:o}){if(0===o.length)throw new Error("Docusaurus error: the component requires at least one children component");if(e){if(!u({value:e,tabValues:o}))throw new Error(`Docusaurus error: The has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${o.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}const n=o.find(e=>e.default)??o[0];if(!n)throw new Error("Unexpected error: 0 tabValues");return n.value}({defaultValue:o,tabValues:r})),[a,d]=y({queryString:n,groupId:s}),[F,L]=function({groupId:e}){const o=function(e){return e?`docusaurus.tab.${e}`:null}(e),[n,s]=(0,p.Dv)(o);return[n,(0,t.useCallback)(e=>{o&&s.set(e)},[o,s])]}({groupId:s}),D=(()=>{const e=a??F;return u({value:e,tabValues:r})?e:null})();(0,c.A)(()=>{D&&i(D)},[D]);return{selectedValue:l,selectValue:(0,t.useCallback)(e=>{if(!u({value:e,tabValues:r}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),L(e)},[d,L,r]),tabValues:r}}var L=n(92303);const D={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var x=n(74848);function f({className:e,block:o,selectedValue:n,selectValue:t,tabValues:l}){const c=[],{blockElementScrollPositionUntilNextRender:i}=(0,r.a_)(),a=e=>{const o=e.currentTarget,s=c.indexOf(o),r=l[s].value;r!==n&&(i(o),t(r))},p=e=>{let o=null;switch(e.key){case"Enter":a(e);break;case"ArrowRight":{const n=c.indexOf(e.currentTarget)+1;o=c[n]??c[0];break}case"ArrowLeft":{const n=c.indexOf(e.currentTarget)-1;o=c[n]??c[c.length-1];break}}o?.focus()};return(0,x.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.A)("tabs",{"tabs--block":o},e),children:l.map(({value:e,label:o,attributes:t})=>(0,x.jsx)("li",{role:"tab",tabIndex:n===e?0:-1,"aria-selected":n===e,ref:e=>{c.push(e)},onKeyDown:p,onClick:a,...t,className:(0,s.A)("tabs__item",D.tabItem,t?.className,{"tabs__item--active":n===e}),children:o??e},e))})}function A({lazy:e,children:o,selectedValue:n}){const r=(Array.isArray(o)?o:[o]).filter(Boolean);if(e){const e=r.find(e=>e.props.value===n);return e?(0,t.cloneElement)(e,{className:(0,s.A)("margin-top--md",e.props.className)}):null}return(0,x.jsx)("div",{className:"margin-top--md",children:r.map((e,o)=>(0,t.cloneElement)(e,{key:o,hidden:e.props.value!==n}))})}function j(e){const o=F(e);return(0,x.jsxs)("div",{className:(0,s.A)("tabs-container",D.tabList),children:[(0,x.jsx)(f,{...o,...e}),(0,x.jsx)(A,{...o,...e})]})}function m(e){const o=(0,L.A)();return(0,x.jsx)(j,{...e,children:d(e.children)},String(o))}},19365:(e,o,n)=>{n.d(o,{A:()=>l});n(96540);var t=n(18215);const s={tabItem:"tabItem_Ymn6"};var r=n(74848);function l({children:e,hidden:o,className:n}){return(0,r.jsx)("div",{role:"tabpanel",className:(0,t.A)(s.tabItem,n),hidden:o,children:e})}},28453:(e,o,n)=>{n.d(o,{R:()=>l,x:()=>c});var t=n(96540);const s={},r=t.createContext(s);function l(e){const o=t.useContext(r);return t.useMemo(function(){return"function"==typeof e?e(o):{...o,...e}},[o,e])}function c(e){let o;return o=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:l(e.components),t.createElement(r.Provider,{value:o},e.children)}},33439:(e,o,n)=>{n.r(o),n.d(o,{CH:()=>h,assets:()=>d,chCodeConfig:()=>u,contentTitle:()=>p,default:()=>L,frontMatter:()=>a,metadata:()=>t,toc:()=>y});const t=JSON.parse('{"id":"Configuration/environment-variables","title":"Environment variables","description":"In general, environment variables, like LANGFLOWPORT or LANGFLOWLOG_LEVEL, configure how Langflow runs.","source":"@site/docs/Configuration/environment-variables.mdx","sourceDirName":"Configuration","slug":"/environment-variables","permalink":"/environment-variables","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Environment variables","slug":"/environment-variables"},"sidebar":"docs","previous":{"title":"Global variables","permalink":"/configuration-global-variables"},"next":{"title":"Manage files","permalink":"/concepts-file-management"}}');var s=n(74848),r=n(28453),l=n(24754),c=n(11470),i=n(19365);n(28774);const a={title:"Environment variables",slug:"/environment-variables"},p=void 0,d={},h={annotations:l.hk,Code:l.Cy},u={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},y=[{value:"Configure environment variables for Langflow OSS",id:"configure-environment-variables-for-langflow-oss",level:2},{value:"Precedence",id:"precedence",level:3},{value:"Set environment variables in your terminal",id:"configure-variables-terminal",level:3},{value:"Import environment variables from a .env file",id:"configure-variables-env-file",level:3},{value:"Configure environment variables for development",id:"configure-environment-variables-for-development",level:3},{value:"Set environment variables for Langflow Desktop",id:"set-environment-variables-for-langflow-desktop",level:2},{value:"Supported environment variables",id:"supported-variables",level:2},{value:"Authentication and security",id:"authentication-and-security",level:3},{value:"Global variables",id:"global-variables",level:3},{value:"Logs",id:"logging",level:3},{value:"MCP servers",id:"mcp",level:3},{value:"Monitoring and metrics",id:"monitoring-and-metrics",level:3},{value:"Server",id:"server",level:3},{value:"Storage",id:"storage",level:3},{value:"Telemetry",id:"telemetry",level:3},{value:"Visual editor and Playground behavior",id:"visual-editor-and-playground-behavior",level:3}];function F(e){const o={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,r.R)(),...e.components},{Details:n}=o;return h||D("CH",!1),h.Code||D("CH.Code",!0),n||D("Details",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n","\n",(0,s.jsxs)(o.p,{children:["In general, environment variables, like ",(0,s.jsx)(o.code,{children:"LANGFLOW_PORT"})," or ",(0,s.jsx)(o.code,{children:"LANGFLOW_LOG_LEVEL"}),", configure how Langflow runs.\nThese are broad settings that apply to your entire Langflow deployment."]}),"\n",(0,s.jsxs)(o.p,{children:["In contrast, global variables are user-defined values stored in Langflow's database for use in flows, such as ",(0,s.jsx)(o.code,{children:"OPENAI_API_KEY"}),".\nLangflow can also source global variables from environment variables.\nFor more information, see ",(0,s.jsx)(o.a,{href:"/configuration-global-variables",children:"Langflow global variables"}),"."]}),"\n",(0,s.jsx)(o.h2,{id:"configure-environment-variables-for-langflow-oss",children:"Configure environment variables for Langflow OSS"}),"\n",(0,s.jsxs)(o.p,{children:["Langflow recognizes ",(0,s.jsx)(o.a,{href:"#supported-variables",children:"supported environment variables"})," from the following sources:"]}),"\n",(0,s.jsxs)(o.ul,{children:["\n",(0,s.jsx)(o.li,{children:"Environment variables set in your terminal."}),"\n",(0,s.jsxs)(o.li,{children:["Environment variables imported from a ",(0,s.jsx)(o.code,{children:".env"})," file when starting Langflow."]}),"\n",(0,s.jsxs)(o.li,{children:["Environment variables set with the ",(0,s.jsx)(o.a,{href:"./configuration-cli",children:"Langflow CLI"}),", including the ",(0,s.jsx)(o.code,{children:"--env-file"})," option and direct options, such as ",(0,s.jsx)(o.code,{children:"--port"}),"."]}),"\n"]}),"\n",(0,s.jsx)(o.p,{children:"You can choose to use one or more of these sources."}),"\n",(0,s.jsx)(o.h3,{id:"precedence",children:"Precedence"}),"\n",(0,s.jsx)(o.p,{children:"If the same environment variable is set in multiple places, the following hierarchy applies:"}),"\n",(0,s.jsxs)(o.ol,{children:["\n",(0,s.jsx)(o.li,{children:"Langflow CLI options override all other sources."}),"\n",(0,s.jsxs)(o.li,{children:["The ",(0,s.jsx)(o.code,{children:".env"})," file overrides system environment variables."]}),"\n",(0,s.jsxs)(o.li,{children:["System environment variables are used only if not set elsewhere.\nWhen running a Langflow Docker image, the ",(0,s.jsx)(o.code,{children:"-e"})," flag can be used to set additional system environment variables."]}),"\n"]}),"\n",(0,s.jsx)(o.p,{children:"For example:"}),"\n",(0,s.jsxs)(o.ul,{children:["\n",(0,s.jsxs)(o.li,{children:["If you set ",(0,s.jsx)(o.code,{children:"LANGFLOW_PORT=8080"})," in your system environment and ",(0,s.jsx)(o.code,{children:"LANGFLOW_PORT=7860"})," in ",(0,s.jsx)(o.code,{children:".env"}),", Langflow uses ",(0,s.jsx)(o.code,{children:"7860"})," from ",(0,s.jsx)(o.code,{children:".env"}),"."]}),"\n",(0,s.jsxs)(o.li,{children:["If you use the Langflow CLI to run ",(0,s.jsx)(o.code,{children:"langflow run --env-file .env --port 9000"}),", and you set ",(0,s.jsx)(o.code,{children:"LANGFLOW_PORT=7860"})," in ",(0,s.jsx)(o.code,{children:".env"}),", then Langflow uses ",(0,s.jsx)(o.code,{children:"9000"})," from the CLI option."]}),"\n"]}),"\n",(0,s.jsx)(o.h3,{id:"configure-variables-terminal",children:"Set environment variables in your terminal"}),"\n",(0,s.jsx)(o.p,{children:"Run the following commands to set environment variables for your current terminal session:"}),"\n",(0,s.jsxs)(c.A,{children:[(0,s.jsx)(i.A,{value:"linux-macos",label:"Linux or macOS",default:!0,children:(0,s.jsx)(h.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"export",props:{style:{color:"#FF7B72"}}},{content:" VARIABLE_NAME",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"'VALUE'",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]})}),(0,s.jsx)(i.A,{value:"windows",label:"Windows",children:(0,s.jsx)(h.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"set VARIABLE_NAME='VALUE'",props:{}}]}],lang:"text"},annotations:[]}]})}),(0,s.jsx)(i.A,{value:"docker",label:"Docker",children:(0,s.jsx)(h.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"docker ",props:{style:{color:"#FFA657"}}},{content:"run ",props:{style:{color:"#A5D6FF"}}},{content:"-it --rm \\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -p ",props:{style:{color:"#79C0FF"}}},{content:"7860:",props:{style:{color:"#A5D6FF"}}},{content:"7860 \\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -e ",props:{style:{color:"#79C0FF"}}},{content:"VARIABLE_NAME='VALUE' ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" langflowai/langflow:latest",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]})})]}),"\n",(0,s.jsxs)(o.p,{children:["When you start Langflow, it looks for environment variables that you've set in your terminal.\nIf it detects a supported environment variable, then it automatically adopts the specified value, subject to ",(0,s.jsx)(o.a,{href:"#precedence",children:"precedence rules"}),"."]}),"\n",(0,s.jsx)(o.h3,{id:"configure-variables-env-file",children:"Import environment variables from a .env file"}),"\n",(0,s.jsxs)(o.ol,{children:["\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsx)(o.p,{children:"If Langflow is running, quit Langflow."}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Create a ",(0,s.jsx)(o.code,{children:".env"})," file, and then open it in your preferred editor."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Define ",(0,s.jsx)(o.a,{href:"#supported-variables",children:"Langflow environment variables"})," in the ",(0,s.jsx)(o.code,{children:".env"})," file."]}),"\n",(0,s.jsxs)(n,{children:[(0,s.jsx)("summary",{children:"Example: .env"}),(0,s.jsx)(h.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"DO_NOT_TRACK=True",props:{}}]},{tokens:[{content:"LANGFLOW_AUTO_LOGIN=False",props:{}}]},{tokens:[{content:"LANGFLOW_AUTO_SAVING=True",props:{}}]},{tokens:[{content:"LANGFLOW_AUTO_SAVING_INTERVAL=1000",props:{}}]},{tokens:[{content:"LANGFLOW_BACKEND_ONLY=False",props:{}}]},{tokens:[{content:'LANGFLOW_BUNDLE_URLS=["https://github.com/user/repo/commit/hash"]',props:{}}]},{tokens:[{content:"LANGFLOW_CACHE_TYPE=async",props:{}}]},{tokens:[{content:"LANGFLOW_COMPONENTS_PATH=/path/to/components/",props:{}}]},{tokens:[{content:"LANGFLOW_CONFIG_DIR=/path/to/config/",props:{}}]},{tokens:[{content:"LANGFLOW_DATABASE_URL=postgresql://user:password@localhost:5432/langflow",props:{}}]},{tokens:[{content:"LANGFLOW_DEV=False",props:{}}]},{tokens:[{content:"LANGFLOW_FALLBACK_TO_ENV_VAR=False",props:{}}]},{tokens:[{content:"LANGFLOW_HEALTH_CHECK_MAX_RETRIES=5",props:{}}]},{tokens:[{content:"LANGFLOW_HOST=localhost",props:{}}]},{tokens:[{content:"LANGFLOW_LANGCHAIN_CACHE=InMemoryCache",props:{}}]},{tokens:[{content:"LANGFLOW_MAX_FILE_SIZE_UPLOAD=10000",props:{}}]},{tokens:[{content:"LANGFLOW_MAX_ITEMS_LENGTH=100",props:{}}]},{tokens:[{content:"LANGFLOW_MAX_TEXT_LENGTH=1000",props:{}}]},{tokens:[{content:"LANGFLOW_LOG_LEVEL=error",props:{}}]},{tokens:[{content:"LANGFLOW_OPEN_BROWSER=False",props:{}}]},{tokens:[{content:"LANGFLOW_PORT=7860",props:{}}]},{tokens:[{content:"LANGFLOW_REMOVE_API_KEYS=False",props:{}}]},{tokens:[{content:"LANGFLOW_SAVE_DB_IN_CONFIG_DIR=True",props:{}}]},{tokens:[{content:"LANGFLOW_SECRET_KEY=somesecretkey",props:{}}]},{tokens:[{content:"LANGFLOW_STORE_ENVIRONMENT_VARIABLES=True",props:{}}]},{tokens:[{content:"LANGFLOW_SUPERUSER=adminuser",props:{}}]},{tokens:[{content:"LANGFLOW_SUPERUSER_PASSWORD=adminpass",props:{}}]},{tokens:[{content:"LANGFLOW_WORKER_TIMEOUT=60000",props:{}}]},{tokens:[{content:"LANGFLOW_WORKERS=3",props:{}}]}],lang:"text"},annotations:[]}]}),(0,s.jsxs)(o.p,{children:["For additional examples, see ",(0,s.jsx)(o.a,{href:"https://github.com/langflow-ai/langflow/blob/main/.env.example",children:(0,s.jsx)(o.code,{children:".env.example"})})," in the Langflow repository."]})]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Save and close ",(0,s.jsx)(o.code,{children:".env"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Start Langflow with your ",(0,s.jsx)(o.code,{children:".env"})," file:"]}),"\n",(0,s.jsxs)(c.A,{children:[(0,s.jsx)(i.A,{value:"local",label:"Local",default:!0,children:(0,s.jsx)(h.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"uv ",props:{style:{color:"#FFA657"}}},{content:"run langflow run ",props:{style:{color:"#A5D6FF"}}},{content:"--env-file ",props:{style:{color:"#79C0FF"}}},{content:".env",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]})}),(0,s.jsx)(i.A,{value:"docker",label:"Docker",children:(0,s.jsx)(h.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"docker ",props:{style:{color:"#FFA657"}}},{content:"run ",props:{style:{color:"#A5D6FF"}}},{content:"-it --rm \\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -p ",props:{style:{color:"#79C0FF"}}},{content:"7860:",props:{style:{color:"#A5D6FF"}}},{content:"7860 \\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" --env-file ",props:{style:{color:"#79C0FF"}}},{content:".env ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" langflowai/langflow:latest",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]})})]}),"\n",(0,s.jsxs)(o.p,{children:["If your ",(0,s.jsx)(o.code,{children:".env"})," file isn't in the same directory, provide the path to your ",(0,s.jsx)(o.code,{children:".env"})," file."]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(o.p,{children:["On startup, Langflow imports the environment variables from your ",(0,s.jsx)(o.code,{children:".env"})," file, as well as any others that you set in your terminal, and then adopts their specified values."]}),"\n",(0,s.jsx)(o.h3,{id:"configure-environment-variables-for-development",children:"Configure environment variables for development"}),"\n",(0,s.jsx)(o.p,{children:"The following examples show how to configure Langflow using environment variables in different development scenarios."}),"\n",(0,s.jsxs)(c.A,{children:[(0,s.jsxs)(i.A,{value:"env",label:".env file",default:!0,children:[(0,s.jsxs)(o.p,{children:["The ",(0,s.jsx)(o.code,{children:".env"})," file is a text file that contains key-value pairs of environment variables."]}),(0,s.jsxs)(o.p,{children:["Create or edit a ",(0,s.jsx)(o.code,{children:".env"})," file in the root directory of your application or Langflow environment, and then add your configuration variables to the file:"]}),(0,s.jsxs)(n,{children:[(0,s.jsx)("summary",{children:"Example: .env"}),(0,s.jsx)(h.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",title:'".env"',focus:"",code:{lines:[{tokens:[{content:"DO_NOT_TRACK=True",props:{}}]},{tokens:[{content:"LANGFLOW_AUTO_LOGIN=False",props:{}}]},{tokens:[{content:"LANGFLOW_AUTO_SAVING=True",props:{}}]},{tokens:[{content:"LANGFLOW_AUTO_SAVING_INTERVAL=1000",props:{}}]},{tokens:[{content:"LANGFLOW_BACKEND_ONLY=False",props:{}}]},{tokens:[{content:'LANGFLOW_BUNDLE_URLS=["https://github.com/user/repo/commit/hash"]',props:{}}]},{tokens:[{content:"LANGFLOW_CACHE_TYPE=async",props:{}}]},{tokens:[{content:"LANGFLOW_COMPONENTS_PATH=/path/to/components/",props:{}}]},{tokens:[{content:"LANGFLOW_CONFIG_DIR=/path/to/config/",props:{}}]},{tokens:[{content:"LANGFLOW_DATABASE_URL=postgresql://user:password@localhost:5432/langflow",props:{}}]},{tokens:[{content:"LANGFLOW_DEV=False",props:{}}]},{tokens:[{content:"LANGFLOW_FALLBACK_TO_ENV_VAR=False",props:{}}]},{tokens:[{content:"LANGFLOW_HEALTH_CHECK_MAX_RETRIES=5",props:{}}]},{tokens:[{content:"LANGFLOW_HOST=localhost",props:{}}]},{tokens:[{content:"LANGFLOW_LANGCHAIN_CACHE=InMemoryCache",props:{}}]},{tokens:[{content:"LANGFLOW_MAX_FILE_SIZE_UPLOAD=10000",props:{}}]},{tokens:[{content:"LANGFLOW_MAX_ITEMS_LENGTH=100",props:{}}]},{tokens:[{content:"LANGFLOW_MAX_TEXT_LENGTH=1000",props:{}}]},{tokens:[{content:"LANGFLOW_LOG_LEVEL=error",props:{}}]},{tokens:[{content:"LANGFLOW_OPEN_BROWSER=False",props:{}}]},{tokens:[{content:"LANGFLOW_PORT=7860",props:{}}]},{tokens:[{content:"LANGFLOW_REMOVE_API_KEYS=False",props:{}}]},{tokens:[{content:"LANGFLOW_SAVE_DB_IN_CONFIG_DIR=True",props:{}}]},{tokens:[{content:"LANGFLOW_SECRET_KEY=somesecretkey",props:{}}]},{tokens:[{content:"LANGFLOW_STORE_ENVIRONMENT_VARIABLES=True",props:{}}]},{tokens:[{content:"LANGFLOW_SUPERUSER=adminuser",props:{}}]},{tokens:[{content:"LANGFLOW_SUPERUSER_PASSWORD=adminpass",props:{}}]},{tokens:[{content:"LANGFLOW_WORKER_TIMEOUT=60000",props:{}}]},{tokens:[{content:"LANGFLOW_WORKERS=3",props:{}}]}],lang:"text"},annotations:[]}]})]})]}),(0,s.jsxs)(i.A,{value:"systemd",label:"Systemd service",children:[(0,s.jsx)(o.p,{children:"A systemd service configuration file configures Linux system services."}),(0,s.jsxs)(o.p,{children:["To add environment variables, create or edit a service configuration file and add an ",(0,s.jsx)(o.code,{children:"override.conf"})," file. This file allows you to override the default environment variables for the service."]}),(0,s.jsxs)(n,{children:[(0,s.jsx)("summary",{children:"Example: override.conf"}),(0,s.jsx)(h.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",title:'"override.conf"',focus:"",code:{lines:[{tokens:[{content:"[Service]",props:{style:{color:"#FFA657"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"DO_NOT_TRACK=true"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_AUTO_LOGIN=false"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_AUTO_SAVING=true"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_AUTO_SAVING_INTERVAL=1000"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_BACKEND_ONLY=false"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_BUNDLE_URLS=[\\"',props:{style:{color:"#A5D6FF"}}},{content:"https://github.com/user/repo/commit/hash\\",props:{style:{color:"#C9D1D9"}}},{content:'"]"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_CACHE_TYPE=async"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_COMPONENTS_PATH=/path/to/components/"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_CONFIG_DIR=/path/to/config"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_DATABASE_URL=postgresql://user:password@localhost:5432/langflow"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_DEV=false"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_FALLBACK_TO_ENV_VAR=false"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_HEALTH_CHECK_MAX_RETRIES=5"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_HOST=localhost"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_LANGCHAIN_CACHE=InMemoryCache"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_MAX_FILE_SIZE_UPLOAD=10000"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_MAX_ITEMS_LENGTH=100"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_MAX_TEXT_LENGTH=1000"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_LOG_ENV=container_json"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_LOG_FILE=logs/langflow.log"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_LOG_LEVEL=error"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_OPEN_BROWSER=false"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_PORT=7860"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_REMOVE_API_KEYS=false"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_SAVE_DB_IN_CONFIG_DIR=true"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_SECRET_KEY=somesecretkey"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_STORE_ENVIRONMENT_VARIABLES=true"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_SUPERUSER=adminuser"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_SUPERUSER_PASSWORD=adminpass"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_WORKER_TIMEOUT=60000"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_WORKERS=3"',props:{style:{color:"#A5D6FF"}}}]}],lang:"ini"},annotations:[]}]})]}),(0,s.jsxs)(o.p,{children:["For more information on systemd, see the ",(0,s.jsx)(o.a,{href:"https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/9/html/using_systemd_unit_files_to_customize_and_optimize_your_system/assembly_working-with-systemd-unit-files_working-with-systemd",children:"Red Hat documentation"}),"."]})]}),(0,s.jsxs)(i.A,{value:"vscode",label:"VSCode tasks.json",children:[(0,s.jsxs)(o.p,{children:["The ",(0,s.jsx)(o.code,{children:"tasks.json"})," file located in ",(0,s.jsx)(o.code,{children:".vscode/tasks.json"})," is a configuration file for development environments using Visual Studio Code."]}),(0,s.jsxs)(o.p,{children:["Create or edit the ",(0,s.jsx)(o.code,{children:".vscode/tasks.json"})," file in your project root."]}),(0,s.jsxs)(n,{children:[(0,s.jsx)("summary",{children:"Example: .vscode/tasks.json"}),(0,s.jsx)(h.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",title:'".vscode/tasks.json"',focus:"",code:{lines:[{tokens:[{content:"{",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "version"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"2.0.0"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "options"',props:{style:{color:"#7EE787"}}},{content:": {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "env"',props:{style:{color:"#7EE787"}}},{content:": {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "DO_NOT_TRACK"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"true"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_AUTO_LOGIN"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"false"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_AUTO_SAVING"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"true"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_AUTO_SAVING_INTERVAL"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"1000"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_BACKEND_ONLY"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"false"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_BUNDLE_URLS"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"[',props:{style:{color:"#A5D6FF"}}},{content:'\\"',props:{style:{color:"#79C0FF"}}},{content:"https://github.com/user/repo/commit/hash",props:{style:{color:"#A5D6FF"}}},{content:'\\"',props:{style:{color:"#79C0FF"}}},{content:']"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_CACHE_TYPE"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"async"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_COMPONENTS_PATH"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"D:/path/to/components/"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_CONFIG_DIR"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"D:/path/to/config/"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_DATABASE_URL"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"postgresql://postgres:password@localhost:5432/langflow"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_DEV"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"false"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_FALLBACK_TO_ENV_VAR"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"false"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_HEALTH_CHECK_MAX_RETRIES"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"5"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_HOST"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"localhost"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_LANGCHAIN_CACHE"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"InMemoryCache"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_MAX_FILE_SIZE_UPLOAD"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"10000"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_MAX_ITEMS_LENGTH"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"100"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_MAX_TEXT_LENGTH"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"1000"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_LOG_ENV"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"container_csv"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_LOG_FILE"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"langflow.log"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_LOG_LEVEL"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"error"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_OPEN_BROWSER"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"false"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_PORT"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"7860"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_REMOVE_API_KEYS"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"true"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_SAVE_DB_IN_CONFIG_DIR"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"false"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_SECRET_KEY"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"somesecretkey"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_STORE_ENVIRONMENT_VARIABLES"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"true"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_SUPERUSER"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"adminuser"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_SUPERUSER_PASSWORD"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"adminpass"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_WORKER_TIMEOUT"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"60000"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_WORKERS"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"3"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" }",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" },",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "tasks"',props:{style:{color:"#7EE787"}}},{content:": [",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "label"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"langflow backend"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "type"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"shell"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "command"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'". ./langflownightly/Scripts/activate && langflow run"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "isBackground"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"true",props:{style:{color:"#79C0FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "problemMatcher"',props:{style:{color:"#7EE787"}}},{content:": []",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" }",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ]",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]}],lang:"json"},annotations:[]}]})]}),(0,s.jsxs)(o.p,{children:["To run Langflow using the above VSCode ",(0,s.jsx)(o.code,{children:"tasks.json"})," file, in the VSCode command palette, select ",(0,s.jsx)(o.strong,{children:"Tasks: Run Task"})," > ",(0,s.jsx)(o.strong,{children:"langflow backend"}),"."]})]})]}),"\n",(0,s.jsx)(o.h2,{id:"set-environment-variables-for-langflow-desktop",children:"Set environment variables for Langflow Desktop"}),"\n",(0,s.jsx)(o.p,{children:"Environment variables set in your terminal aren't automatically available to GUI-based applications like Langflow Desktop when you launch them from the Windows or macOS GUI."}),"\n",(0,s.jsx)(o.p,{children:"For Windows, this means any GUI-based app launched from the Start menu, desktop shortcuts, or Windows Explorer."}),"\n",(0,s.jsx)(o.p,{children:"For macOS, this means any GUI-based app launched from Finder, Spotlight, Launchpad, or the Dock."}),"\n",(0,s.jsx)(o.p,{children:"To set environment variables for Langflow Desktop, you need to use specific commands or files, depending on your OS."}),"\n",(0,s.jsxs)(c.A,{children:[(0,s.jsxs)(i.A,{value:"macos",label:"macOS",default:!0,children:[(0,s.jsxs)(o.p,{children:["Langflow Desktop for macOS cannot automatically use variables set in your terminal, such as those in",(0,s.jsx)(o.code,{children:".zshrc"})," or ",(0,s.jsx)(o.code,{children:".bash_profile"}),", when launched from the macOS GUI."]}),(0,s.jsxs)(o.p,{children:["To make environment variables available to GUI apps on macOS, you need to use ",(0,s.jsx)(o.code,{children:"launchctl"})," with a ",(0,s.jsx)(o.code,{children:"plist"})," file:"]}),(0,s.jsxs)(o.ol,{children:["\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Create the ",(0,s.jsx)(o.code,{children:"LaunchAgents"})," directory if it doesn't exist:"]}),"\n",(0,s.jsx)(h.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"mkdir ",props:{style:{color:"#FFA657"}}},{content:"-p ",props:{style:{color:"#79C0FF"}}},{content:"~/Library/LaunchAgents",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["In the ",(0,s.jsx)(o.code,{children:"LaunchAgents"})," directory, create a ",(0,s.jsx)(o.code,{children:".plist"})," file called ",(0,s.jsx)(o.code,{children:"dev.langflow.env"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Add the following content to ",(0,s.jsx)(o.code,{children:"dev.langflow.env.plist"}),", and then add, change, or remove Langflow environment variables as needed for your configuration."]}),"\n",(0,s.jsx)(o.p,{children:"This example sets multiple environmental variables for all GUI apps launched from the macOS GUI."}),"\n",(0,s.jsx)(h.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:" ",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ',props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" <",props:{style:{color:"#C9D1D9"}}},{content:"plist ",props:{style:{color:"#7EE787"}}},{content:"version",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"1.0"',props:{style:{color:"#A5D6FF"}}},{content:">",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" <",props:{style:{color:"#C9D1D9"}}},{content:"dict",props:{style:{color:"#7EE787"}}},{content:">",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" <",props:{style:{color:"#C9D1D9"}}},{content:"key",props:{style:{color:"#7EE787"}}},{content:">Label",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" <",props:{style:{color:"#C9D1D9"}}},{content:"string",props:{style:{color:"#7EE787"}}},{content:">dev.langflow.env",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" <",props:{style:{color:"#C9D1D9"}}},{content:"key",props:{style:{color:"#7EE787"}}},{content:">ProgramArguments",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" <",props:{style:{color:"#C9D1D9"}}},{content:"array",props:{style:{color:"#7EE787"}}},{content:">",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" <",props:{style:{color:"#C9D1D9"}}},{content:"string",props:{style:{color:"#7EE787"}}},{content:">/bin/sh",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" <",props:{style:{color:"#C9D1D9"}}},{content:"string",props:{style:{color:"#7EE787"}}},{content:">-c",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" <",props:{style:{color:"#C9D1D9"}}},{content:"string",props:{style:{color:"#7EE787"}}},{content:">",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" launchctl setenv LANGFLOW_CONFIG_DIR /Users/your_user/custom/config ",props:{style:{color:"#C9D1D9"}}},{content:"&&",props:{style:{color:"#FFA198",fontStyle:"italic"}}}]},{tokens:[{content:" launchctl setenv LANGFLOW_PORT 7860 ",props:{style:{color:"#C9D1D9"}}},{content:"&&",props:{style:{color:"#FFA198",fontStyle:"italic"}}}]},{tokens:[{content:" launchctl setenv LANGFLOW_HOST localhost ",props:{style:{color:"#C9D1D9"}}},{content:"&&",props:{style:{color:"#FFA198",fontStyle:"italic"}}}]},{tokens:[{content:" launchctl setenv ARIZE_API_KEY ak-...",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" <",props:{style:{color:"#C9D1D9"}}},{content:"key",props:{style:{color:"#7EE787"}}},{content:">RunAtLoad",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" <",props:{style:{color:"#C9D1D9"}}},{content:"true",props:{style:{color:"#7EE787"}}},{content:"/>",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ",props:{style:{color:"#C9D1D9"}}}]}],lang:"xml"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Load the file with ",(0,s.jsx)(o.code,{children:"launchctl"}),":"]}),"\n",(0,s.jsx)(h.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"launchctl ",props:{style:{color:"#FFA657"}}},{content:"load ~/Library/LaunchAgents/dev.langflow.env.plist",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n"]}),"\n"]})]}),(0,s.jsxs)(i.A,{value:"windows1",label:"Window System Properties",children:[(0,s.jsxs)(o.p,{children:["Langflow Desktop for Windows cannot automatically use variables set in your terminal, such as those defined with ",(0,s.jsx)(o.code,{children:"set"})," in ",(0,s.jsx)(o.code,{children:"cmd"})," or ",(0,s.jsx)(o.code,{children:"$env:VAR=..."})," in PowerShell, when launched from the Windows GUI."]}),(0,s.jsxs)(o.p,{children:["To make environment variables available to the Langflow Desktop app, you must set them at the user or system level using the ",(0,s.jsx)(o.strong,{children:"System Properties"})," interface or the Terminal."]}),(0,s.jsx)(o.p,{children:"To set environment variables using the System Properties interface, do the following:"}),(0,s.jsxs)(o.ol,{children:["\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Press ",(0,s.jsx)("kbd",{children:"Win + R"}),", enter ",(0,s.jsx)(o.code,{children:"SystemPropertiesAdvanced"}),", and then press ",(0,s.jsx)("kbd",{children:"Enter"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Click ",(0,s.jsx)(o.strong,{children:"Environment Variables"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Under ",(0,s.jsx)(o.strong,{children:"User variables"}),", click ",(0,s.jsx)(o.strong,{children:"New"}),"."]}),"\n",(0,s.jsx)(o.admonition,{type:"tip",children:(0,s.jsxs)(o.p,{children:["To apply the setting to all users, select ",(0,s.jsx)(o.strong,{children:"System variables"}),"."]})}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Enter the name of the Langflow variable you want to set, such as ",(0,s.jsx)(o.code,{children:"LANGFLOW_CONFIG_DIR"}),", and the desired value, such as ",(0,s.jsx)(o.code,{children:"C:\\Users\\your_user\\.langflow_config"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Click ",(0,s.jsx)(o.strong,{children:"OK"})," to save the variable."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsx)(o.p,{children:"Repeat until you have set all necessary Langflow environment variables."}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsx)(o.p,{children:"Launch or restart Langflow Desktop to apply the environment variables."}),"\n"]}),"\n"]})]}),(0,s.jsxs)(i.A,{value:"windows2",label:"Powershell",children:[(0,s.jsx)(o.p,{children:"To define environment variables for Windows using PowerShell, do the following:"}),(0,s.jsxs)(o.ol,{children:["\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Enter the name of the Langflow variable you want to set, such as ",(0,s.jsx)(o.code,{children:"LANGFLOW_CONFIG_DIR"}),", and the desired value, such as ",(0,s.jsx)(o.code,{children:"C:\\Users\\your_user\\.langflow_config"}),"."]}),"\n",(0,s.jsx)(o.p,{children:"To set an environment variable for the current user:"}),"\n",(0,s.jsx)(h.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"[",props:{style:{color:"#C9D1D9"}}},{content:"System.Environment",props:{style:{color:"#FF7B72"}}},{content:"]::SetEnvironmentVariable(",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_CONFIG_DIR"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#FF7B72"}}},{content:'"C:\\Users\\your_user\\.langflow_config"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#FF7B72"}}},{content:'"User"',props:{style:{color:"#A5D6FF"}}},{content:")",props:{style:{color:"#C9D1D9"}}}]}],lang:"powershell"},annotations:[]}]}),"\n",(0,s.jsx)(o.p,{children:"To set an environment variable for all users (you must have Administrator priveleges):"}),"\n",(0,s.jsx)(h.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"[",props:{style:{color:"#C9D1D9"}}},{content:"System.Environment",props:{style:{color:"#FF7B72"}}},{content:"]::SetEnvironmentVariable(",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_CONFIG_DIR"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#FF7B72"}}},{content:'"C:\\Langflow\\Config"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#FF7B72"}}},{content:'"Machine"',props:{style:{color:"#A5D6FF"}}},{content:")",props:{style:{color:"#C9D1D9"}}}]}],lang:"powershell"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsx)(o.p,{children:"Repeat until you have set all necessary Langflow environment variables."}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsx)(o.p,{children:"Launch or restart Langflow Desktop to apply the environment variables."}),"\n"]}),"\n"]})]})]}),"\n",(0,s.jsx)(o.h2,{id:"supported-variables",children:"Supported environment variables"}),"\n",(0,s.jsx)(o.p,{children:"The following sections provide information about specific Langflow environment variables."}),"\n",(0,s.jsx)(o.h3,{id:"authentication-and-security",children:"Authentication and security"}),"\n",(0,s.jsxs)(o.p,{children:["See ",(0,s.jsx)(o.a,{href:"/api-keys-and-authentication",children:"API keys and authentication"}),"."]}),"\n",(0,s.jsx)(o.h3,{id:"global-variables",children:"Global variables"}),"\n",(0,s.jsxs)(o.p,{children:["For information about the relationship between Langflow global variables and environment variables, as well as environment variables that control handling of global variables, see ",(0,s.jsx)(o.a,{href:"/configuration-global-variables",children:"Global variables"}),"."]}),"\n",(0,s.jsx)(o.h3,{id:"logging",children:"Logs"}),"\n",(0,s.jsxs)(o.p,{children:["See ",(0,s.jsx)(o.a,{href:"/logging#log-storage",children:"Configure log options"}),"."]}),"\n",(0,s.jsx)(o.h3,{id:"mcp",children:"MCP servers"}),"\n",(0,s.jsxs)(o.p,{children:["See ",(0,s.jsx)(o.a,{href:"/mcp-server",children:"Use Langflow as an MCP server"}),"."]}),"\n",(0,s.jsx)(o.h3,{id:"monitoring-and-metrics",children:"Monitoring and metrics"}),"\n",(0,s.jsxs)(o.p,{children:["For environment variables for specific monitoring service providers, see the Langflow monitoring integration guides, such as ",(0,s.jsx)(o.a,{href:"/integrations-langfuse",children:"Langfuse"})," and ",(0,s.jsx)(o.a,{href:"/deployment-prod-best-practices",children:"Best practices for Langflow on Kubernetes"}),"."]}),"\n",(0,s.jsx)(o.h3,{id:"server",children:"Server"}),"\n",(0,s.jsx)(o.p,{children:"The following environment variables set base Langflow server configuration, such as where the server is hosted, required files for SSL encryption, and the deployment type (frontend and backend, backend-only, development mode)."}),"\n",(0,s.jsxs)(o.table,{children:[(0,s.jsx)(o.thead,{children:(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.th,{children:"Variable"}),(0,s.jsx)(o.th,{children:"Format"}),(0,s.jsx)(o.th,{children:"Default"}),(0,s.jsx)(o.th,{children:"Description"})]})}),(0,s.jsxs)(o.tbody,{children:[(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_HOST"})}),(0,s.jsx)(o.td,{children:"String"}),(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"localhost"})}),(0,s.jsx)(o.td,{children:"The host on which the Langflow server will run."})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_PORT"})}),(0,s.jsx)(o.td,{children:"Integer"}),(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"7860"})}),(0,s.jsx)(o.td,{children:"The port on which the Langflow server runs. The server automatically selects a free port if the specified port is in use."})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_BACKEND_ONLY"})}),(0,s.jsx)(o.td,{children:"Boolean"}),(0,s.jsx)(o.td,{children:"False"}),(0,s.jsx)(o.td,{children:"Run only the Langflow backend service (no frontend)."})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_DEV"})}),(0,s.jsx)(o.td,{children:"Boolean"}),(0,s.jsx)(o.td,{children:"False"}),(0,s.jsx)(o.td,{children:"Whether to run Langflow in development mode (may contain bugs)."})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_OPEN_BROWSER"})}),(0,s.jsx)(o.td,{children:"Boolean"}),(0,s.jsx)(o.td,{children:"False"}),(0,s.jsx)(o.td,{children:"Open the system web browser on startup."})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_HEALTH_CHECK_MAX_RETRIES"})}),(0,s.jsx)(o.td,{children:"Integer"}),(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"5"})}),(0,s.jsx)(o.td,{children:"Set the maximum number of retries for Langflow's server status health checks."})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_WORKERS"})}),(0,s.jsx)(o.td,{children:"Integer"}),(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"1"})}),(0,s.jsx)(o.td,{children:"Number of worker processes."})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_WORKER_TIMEOUT"})}),(0,s.jsx)(o.td,{children:"Integer"}),(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"300"})}),(0,s.jsx)(o.td,{children:"Worker timeout in seconds."})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_SSL_CERT_FILE"})}),(0,s.jsx)(o.td,{children:"String"}),(0,s.jsx)(o.td,{children:"Not set"}),(0,s.jsx)(o.td,{children:"Path to the SSL certificate file on the local system for SSL-encrypted connections."})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_SSL_KEY_FILE"})}),(0,s.jsx)(o.td,{children:"String"}),(0,s.jsx)(o.td,{children:"Not set"}),(0,s.jsx)(o.td,{children:"Path to the SSL key file on the local system for SSL-encrypted connections."})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_DEACTIVATE_TRACING"})}),(0,s.jsx)(o.td,{children:"Boolean"}),(0,s.jsx)(o.td,{children:"False"}),(0,s.jsx)(o.td,{children:"Deactivate tracing functionality."})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_CELERY_ENABLED"})}),(0,s.jsx)(o.td,{children:"Boolean"}),(0,s.jsx)(o.td,{children:"False"}),(0,s.jsx)(o.td,{children:"Enable Celery for distributed task processing."})]})]})]}),"\n",(0,s.jsxs)(o.p,{children:["For more information about deploying Langflow servers, see ",(0,s.jsx)(o.a,{href:"/deployment-overview",children:"Langflow deployment overview"}),"."]}),"\n",(0,s.jsx)(o.h3,{id:"storage",children:"Storage"}),"\n",(0,s.jsxs)(o.p,{children:["See ",(0,s.jsx)(o.a,{href:"/memory",children:"Memory management options"})," and ",(0,s.jsx)(o.a,{href:"/concepts-file-management",children:"Manage files"}),"."]}),"\n",(0,s.jsx)(o.h3,{id:"telemetry",children:"Telemetry"}),"\n",(0,s.jsxs)(o.p,{children:["See ",(0,s.jsx)(o.a,{href:"/contributing-telemetry",children:"Telemetry"}),"."]}),"\n",(0,s.jsx)(o.h3,{id:"visual-editor-and-playground-behavior",children:"Visual editor and Playground behavior"}),"\n",(0,s.jsxs)(o.table,{children:[(0,s.jsx)(o.thead,{children:(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.th,{children:"Variable"}),(0,s.jsx)(o.th,{children:"Format"}),(0,s.jsx)(o.th,{children:"Default"}),(0,s.jsx)(o.th,{children:"Description"})]})}),(0,s.jsxs)(o.tbody,{children:[(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_AUTO_SAVING"})}),(0,s.jsx)(o.td,{children:"Boolean"}),(0,s.jsx)(o.td,{children:"True"}),(0,s.jsx)(o.td,{children:"Whether to automatically save flows."})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_AUTO_SAVING_INTERVAL"})}),(0,s.jsx)(o.td,{children:"Integer"}),(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"1000"})}),(0,s.jsxs)(o.td,{children:["Set the auto-save interval in milliseconds if ",(0,s.jsx)(o.code,{children:"LANGFLOW_AUTO_SAVING=True"}),"."]})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_BUNDLE_URLS"})}),(0,s.jsx)(o.td,{children:"List[String]"}),(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"[]"})}),(0,s.jsxs)(o.td,{children:["A list of URLs from which to load custom bundles. Supports GitHub URLs. If ",(0,s.jsx)(o.code,{children:"LANGFLOW_AUTO_LOGIN=True"}),", flows from these bundles are loaded into the database."]})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_COMPONENTS_PATH"})}),(0,s.jsx)(o.td,{children:"String"}),(0,s.jsx)(o.td,{children:"Not set"}),(0,s.jsx)(o.td,{children:"Path to a directory containing custom components. Typically used if you have local custom components or you are building a Docker image with custom components."})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_LOAD_FLOWS_PATH"})}),(0,s.jsx)(o.td,{children:"String"}),(0,s.jsx)(o.td,{children:"Not set"}),(0,s.jsxs)(o.td,{children:["Path to a directory containing flow JSON files to be loaded on startup. Typically used when creating a Docker image with prepackaged flows. Requires ",(0,s.jsx)(o.code,{children:"LANGFLOW_AUTO_LOGIN=True"}),"."]})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_CREATE_STARTER_PROJECTS"})}),(0,s.jsx)(o.td,{children:"Boolean"}),(0,s.jsx)(o.td,{children:"True"}),(0,s.jsxs)(o.td,{children:["Whether to create templates during initialization. If false, Langflow doesn't create templates, and ",(0,s.jsx)(o.code,{children:"LANGFLOW_UPDATE_STARTER_PROJECTS"})," is treated as false."]})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_UPDATE_STARTER_PROJECTS"})}),(0,s.jsx)(o.td,{children:"Boolean"}),(0,s.jsx)(o.td,{children:"True"}),(0,s.jsx)(o.td,{children:"Whether to update templates with the latest component versions when initializing after an upgrade."})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_LAZY_LOAD_COMPONENTS"})}),(0,s.jsx)(o.td,{children:"Boolean"}),(0,s.jsx)(o.td,{children:"False"}),(0,s.jsx)(o.td,{children:"If true, Langflow only partially loads components at startup and fully loads them on demand. This significantly reduces startup time but can cause a slight delay when a component is first used."})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_EVENT_DELIVERY"})}),(0,s.jsx)(o.td,{children:"String"}),(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"streaming"})}),(0,s.jsxs)(o.td,{children:["How to deliver build events to the frontend: ",(0,s.jsx)(o.code,{children:"polling"}),", ",(0,s.jsx)(o.code,{children:"streaming"})," or ",(0,s.jsx)(o.code,{children:"direct"}),"."]})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_FRONTEND_PATH"})}),(0,s.jsx)(o.td,{children:"String"}),(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"./frontend"})}),(0,s.jsx)(o.td,{children:"Path to the frontend directory containing build files. For development purposes only when you need to serve specific frontend code."})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_MAX_ITEMS_LENGTH"})}),(0,s.jsx)(o.td,{children:"Integer"}),(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"100"})}),(0,s.jsx)(o.td,{children:"Maximum number of items to store and display in the visual editor. Lists longer than this will be truncated when displayed in the visual editor. Doesn't affect outputs or data passed between components."})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_MAX_TEXT_LENGTH"})}),(0,s.jsx)(o.td,{children:"Integer"}),(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"1000"})}),(0,s.jsx)(o.td,{children:"Maximum number of characters to store and display in the visual editor. Responses longer than this will be truncated when displayed in the visual editor. Doesn't truncate outputs or responses passed between components."})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_MAX_TRANSACTIONS_TO_KEEP"})}),(0,s.jsx)(o.td,{children:"Integer"}),(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"3000"})}),(0,s.jsx)(o.td,{children:"Maximum number of flow transaction events to keep in the database."})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_MAX_VERTEX_BUILDS_TO_KEEP"})}),(0,s.jsx)(o.td,{children:"Integer"}),(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"3000"})}),(0,s.jsxs)(o.td,{children:["Maximum number of vertex builds to keep in the database. Relates to ",(0,s.jsx)(o.a,{href:"/concepts-playground",children:"Playground"})," functionality."]})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_MAX_VERTEX_BUILDS_PER_VERTEX"})}),(0,s.jsx)(o.td,{children:"Integer"}),(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"2"})}),(0,s.jsxs)(o.td,{children:["Maximum number of builds to keep per vertex. Older builds are deleted. Relates to ",(0,s.jsx)(o.a,{href:"/concepts-playground",children:"Playground"})," functionality."]})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_PUBLIC_FLOW_CLEANUP_INTERVAL"})}),(0,s.jsx)(o.td,{children:"Integer"}),(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"3600"})}),(0,s.jsxs)(o.td,{children:["The interval in seconds at which data for ",(0,s.jsx)(o.a,{href:"/concepts-playground#share-a-flows-playground",children:"shared Playground"})," flows are cleaned up. Default: 3600 seconds (1 hour). Minimum: 600 seconds (10 minutes)."]})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_PUBLIC_FLOW_EXPIRATION"})}),(0,s.jsx)(o.td,{children:"Integer"}),(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"86400"})}),(0,s.jsxs)(o.td,{children:["The time in seconds after which a ",(0,s.jsx)(o.a,{href:"/concepts-playground#share-a-flows-playground",children:"shared Playground"})," flow is considered expired and eligible for cleanup. Default: 86400 seconds (24 hours). Minimum: 600 seconds (10 minutes)."]})]})]})]})]})}function L(e={}){const{wrapper:o}={...(0,r.R)(),...e.components};return o?(0,s.jsx)(o,{...e,children:(0,s.jsx)(F,{...e})}):F(e)}function D(e,o){throw new Error("Expected "+(o?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}}}]); \ No newline at end of file +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[1399],{11470:(e,o,n)=>{n.d(o,{A:()=>m});var t=n(96540),s=n(18215),r=n(23104),l=n(56347),c=n(205),i=n(57485),a=n(31682),p=n(70679);function d(e){return t.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,t.isValidElement)(e)&&function(e){const{props:o}=e;return!!o&&"object"==typeof o&&"value"in o}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function h(e){const{values:o,children:n}=e;return(0,t.useMemo)(()=>{const e=o??function(e){return d(e).map(({props:{value:e,label:o,attributes:n,default:t}})=>({value:e,label:o,attributes:n,default:t}))}(n);return function(e){const o=(0,a.XI)(e,(e,o)=>e.value===o.value);if(o.length>0)throw new Error(`Docusaurus error: Duplicate values "${o.map(e=>e.value).join(", ")}" found in . Every value needs to be unique.`)}(e),e},[o,n])}function u({value:e,tabValues:o}){return o.some(o=>o.value===e)}function y({queryString:e=!1,groupId:o}){const n=(0,l.W6)(),s=function({queryString:e=!1,groupId:o}){if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!o)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return o??null}({queryString:e,groupId:o});return[(0,i.aZ)(s),(0,t.useCallback)(e=>{if(!s)return;const o=new URLSearchParams(n.location.search);o.set(s,e),n.replace({...n.location,search:o.toString()})},[s,n])]}function F(e){const{defaultValue:o,queryString:n=!1,groupId:s}=e,r=h(e),[l,i]=(0,t.useState)(()=>function({defaultValue:e,tabValues:o}){if(0===o.length)throw new Error("Docusaurus error: the component requires at least one children component");if(e){if(!u({value:e,tabValues:o}))throw new Error(`Docusaurus error: The has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${o.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}const n=o.find(e=>e.default)??o[0];if(!n)throw new Error("Unexpected error: 0 tabValues");return n.value}({defaultValue:o,tabValues:r})),[a,d]=y({queryString:n,groupId:s}),[F,L]=function({groupId:e}){const o=function(e){return e?`docusaurus.tab.${e}`:null}(e),[n,s]=(0,p.Dv)(o);return[n,(0,t.useCallback)(e=>{o&&s.set(e)},[o,s])]}({groupId:s}),D=(()=>{const e=a??F;return u({value:e,tabValues:r})?e:null})();(0,c.A)(()=>{D&&i(D)},[D]);return{selectedValue:l,selectValue:(0,t.useCallback)(e=>{if(!u({value:e,tabValues:r}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),L(e)},[d,L,r]),tabValues:r}}var L=n(92303);const D={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var x=n(74848);function f({className:e,block:o,selectedValue:n,selectValue:t,tabValues:l}){const c=[],{blockElementScrollPositionUntilNextRender:i}=(0,r.a_)(),a=e=>{const o=e.currentTarget,s=c.indexOf(o),r=l[s].value;r!==n&&(i(o),t(r))},p=e=>{let o=null;switch(e.key){case"Enter":a(e);break;case"ArrowRight":{const n=c.indexOf(e.currentTarget)+1;o=c[n]??c[0];break}case"ArrowLeft":{const n=c.indexOf(e.currentTarget)-1;o=c[n]??c[c.length-1];break}}o?.focus()};return(0,x.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.A)("tabs",{"tabs--block":o},e),children:l.map(({value:e,label:o,attributes:t})=>(0,x.jsx)("li",{role:"tab",tabIndex:n===e?0:-1,"aria-selected":n===e,ref:e=>{c.push(e)},onKeyDown:p,onClick:a,...t,className:(0,s.A)("tabs__item",D.tabItem,t?.className,{"tabs__item--active":n===e}),children:o??e},e))})}function j({lazy:e,children:o,selectedValue:n}){const r=(Array.isArray(o)?o:[o]).filter(Boolean);if(e){const e=r.find(e=>e.props.value===n);return e?(0,t.cloneElement)(e,{className:(0,s.A)("margin-top--md",e.props.className)}):null}return(0,x.jsx)("div",{className:"margin-top--md",children:r.map((e,o)=>(0,t.cloneElement)(e,{key:o,hidden:e.props.value!==n}))})}function A(e){const o=F(e);return(0,x.jsxs)("div",{className:(0,s.A)("tabs-container",D.tabList),children:[(0,x.jsx)(f,{...o,...e}),(0,x.jsx)(j,{...o,...e})]})}function m(e){const o=(0,L.A)();return(0,x.jsx)(A,{...e,children:d(e.children)},String(o))}},19365:(e,o,n)=>{n.d(o,{A:()=>l});n(96540);var t=n(18215);const s={tabItem:"tabItem_Ymn6"};var r=n(74848);function l({children:e,hidden:o,className:n}){return(0,r.jsx)("div",{role:"tabpanel",className:(0,t.A)(s.tabItem,n),hidden:o,children:e})}},28453:(e,o,n)=>{n.d(o,{R:()=>l,x:()=>c});var t=n(96540);const s={},r=t.createContext(s);function l(e){const o=t.useContext(r);return t.useMemo(function(){return"function"==typeof e?e(o):{...o,...e}},[o,e])}function c(e){let o;return o=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:l(e.components),t.createElement(r.Provider,{value:o},e.children)}},33439:(e,o,n)=>{n.r(o),n.d(o,{CH:()=>h,assets:()=>d,chCodeConfig:()=>u,contentTitle:()=>p,default:()=>L,frontMatter:()=>a,metadata:()=>t,toc:()=>y});const t=JSON.parse('{"id":"Configuration/environment-variables","title":"Environment variables","description":"In general, environment variables, like LANGFLOWPORT or LANGFLOWLOG_LEVEL, configure how Langflow runs.","source":"@site/docs/Configuration/environment-variables.mdx","sourceDirName":"Configuration","slug":"/environment-variables","permalink":"/environment-variables","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Environment variables","slug":"/environment-variables"},"sidebar":"docs","previous":{"title":"Global variables","permalink":"/configuration-global-variables"},"next":{"title":"Manage files","permalink":"/concepts-file-management"}}');var s=n(74848),r=n(28453),l=n(24754),c=n(11470),i=n(19365);n(28774);const a={title:"Environment variables",slug:"/environment-variables"},p=void 0,d={},h={annotations:l.hk,Code:l.Cy},u={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},y=[{value:"Configure environment variables for Langflow OSS",id:"configure-environment-variables-for-langflow-oss",level:2},{value:"Precedence",id:"precedence",level:3},{value:"Set environment variables in your terminal",id:"configure-variables-terminal",level:3},{value:"Import environment variables from a .env file",id:"configure-variables-env-file",level:3},{value:"Configure environment variables for development",id:"configure-environment-variables-for-development",level:3},{value:"Set environment variables for Langflow Desktop",id:"set-environment-variables-for-langflow-desktop",level:2},{value:"Supported environment variables",id:"supported-variables",level:2},{value:"Authentication and security",id:"authentication-and-security",level:3},{value:"Global variables",id:"global-variables",level:3},{value:"Logs",id:"logging",level:3},{value:"MCP servers",id:"mcp",level:3},{value:"Monitoring and metrics",id:"monitoring-and-metrics",level:3},{value:"Server",id:"server",level:3},{value:"Storage",id:"storage",level:3},{value:"Telemetry",id:"telemetry",level:3},{value:"Visual editor and Playground behavior",id:"visual-editor-and-playground-behavior",level:3}];function F(e){const o={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,r.R)(),...e.components},{Details:n}=o;return h||D("CH",!1),h.Code||D("CH.Code",!0),n||D("Details",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n","\n",(0,s.jsxs)(o.p,{children:["In general, environment variables, like ",(0,s.jsx)(o.code,{children:"LANGFLOW_PORT"})," or ",(0,s.jsx)(o.code,{children:"LANGFLOW_LOG_LEVEL"}),", configure how Langflow runs.\nThese are broad settings that apply to your entire Langflow deployment."]}),"\n",(0,s.jsxs)(o.p,{children:["In contrast, global variables are user-defined values stored in Langflow's database for use in flows, such as ",(0,s.jsx)(o.code,{children:"OPENAI_API_KEY"}),".\nLangflow can also source global variables from environment variables.\nFor more information, see ",(0,s.jsx)(o.a,{href:"/configuration-global-variables",children:"Langflow global variables"}),"."]}),"\n",(0,s.jsx)(o.h2,{id:"configure-environment-variables-for-langflow-oss",children:"Configure environment variables for Langflow OSS"}),"\n",(0,s.jsxs)(o.p,{children:["Langflow recognizes ",(0,s.jsx)(o.a,{href:"#supported-variables",children:"supported environment variables"})," from the following sources:"]}),"\n",(0,s.jsxs)(o.ul,{children:["\n",(0,s.jsx)(o.li,{children:"Environment variables set in your terminal."}),"\n",(0,s.jsxs)(o.li,{children:["Environment variables imported from a ",(0,s.jsx)(o.code,{children:".env"})," file when starting Langflow."]}),"\n",(0,s.jsxs)(o.li,{children:["Environment variables set with the ",(0,s.jsx)(o.a,{href:"./configuration-cli",children:"Langflow CLI"}),", including the ",(0,s.jsx)(o.code,{children:"--env-file"})," option and direct options, such as ",(0,s.jsx)(o.code,{children:"--port"}),"."]}),"\n"]}),"\n",(0,s.jsx)(o.p,{children:"You can choose to use one or more of these sources."}),"\n",(0,s.jsx)(o.h3,{id:"precedence",children:"Precedence"}),"\n",(0,s.jsx)(o.p,{children:"If the same environment variable is set in multiple places, the following hierarchy applies:"}),"\n",(0,s.jsxs)(o.ol,{children:["\n",(0,s.jsx)(o.li,{children:"Langflow CLI options override all other sources."}),"\n",(0,s.jsxs)(o.li,{children:["The ",(0,s.jsx)(o.code,{children:".env"})," file overrides system environment variables."]}),"\n",(0,s.jsxs)(o.li,{children:["System environment variables are used only if not set elsewhere.\nWhen running a Langflow Docker image, the ",(0,s.jsx)(o.code,{children:"-e"})," flag can be used to set additional system environment variables."]}),"\n"]}),"\n",(0,s.jsx)(o.p,{children:"For example:"}),"\n",(0,s.jsxs)(o.ul,{children:["\n",(0,s.jsxs)(o.li,{children:["If you set ",(0,s.jsx)(o.code,{children:"LANGFLOW_PORT=8080"})," in your system environment and ",(0,s.jsx)(o.code,{children:"LANGFLOW_PORT=7860"})," in ",(0,s.jsx)(o.code,{children:".env"}),", Langflow uses ",(0,s.jsx)(o.code,{children:"7860"})," from ",(0,s.jsx)(o.code,{children:".env"}),"."]}),"\n",(0,s.jsxs)(o.li,{children:["If you use the Langflow CLI to run ",(0,s.jsx)(o.code,{children:"langflow run --env-file .env --port 9000"}),", and you set ",(0,s.jsx)(o.code,{children:"LANGFLOW_PORT=7860"})," in ",(0,s.jsx)(o.code,{children:".env"}),", then Langflow uses ",(0,s.jsx)(o.code,{children:"9000"})," from the CLI option."]}),"\n"]}),"\n",(0,s.jsx)(o.h3,{id:"configure-variables-terminal",children:"Set environment variables in your terminal"}),"\n",(0,s.jsx)(o.p,{children:"Run the following commands to set environment variables for your current terminal session:"}),"\n",(0,s.jsxs)(c.A,{children:[(0,s.jsx)(i.A,{value:"linux-macos",label:"Linux or macOS",default:!0,children:(0,s.jsx)(h.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"export",props:{style:{color:"#FF7B72"}}},{content:" VARIABLE_NAME",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"'VALUE'",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]})}),(0,s.jsx)(i.A,{value:"windows",label:"Windows",children:(0,s.jsx)(h.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"set VARIABLE_NAME='VALUE'",props:{}}]}],lang:"text"},annotations:[]}]})}),(0,s.jsx)(i.A,{value:"docker",label:"Docker",children:(0,s.jsx)(h.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"docker ",props:{style:{color:"#FFA657"}}},{content:"run ",props:{style:{color:"#A5D6FF"}}},{content:"-it --rm \\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -p ",props:{style:{color:"#79C0FF"}}},{content:"7860:",props:{style:{color:"#A5D6FF"}}},{content:"7860 \\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -e ",props:{style:{color:"#79C0FF"}}},{content:"VARIABLE_NAME='VALUE' ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" langflowai/langflow:latest",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]})})]}),"\n",(0,s.jsxs)(o.p,{children:["When you start Langflow, it looks for environment variables that you've set in your terminal.\nIf it detects a supported environment variable, then it automatically adopts the specified value, subject to ",(0,s.jsx)(o.a,{href:"#precedence",children:"precedence rules"}),"."]}),"\n",(0,s.jsx)(o.h3,{id:"configure-variables-env-file",children:"Import environment variables from a .env file"}),"\n",(0,s.jsxs)(o.ol,{children:["\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsx)(o.p,{children:"If Langflow is running, quit Langflow."}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Create a ",(0,s.jsx)(o.code,{children:".env"})," file, and then open it in your preferred editor."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Define ",(0,s.jsx)(o.a,{href:"#supported-variables",children:"Langflow environment variables"})," in the ",(0,s.jsx)(o.code,{children:".env"})," file."]}),"\n",(0,s.jsxs)(n,{children:[(0,s.jsx)("summary",{children:"Example: .env"}),(0,s.jsx)(h.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"DO_NOT_TRACK=True",props:{}}]},{tokens:[{content:"LANGFLOW_AUTO_LOGIN=False",props:{}}]},{tokens:[{content:"LANGFLOW_AUTO_SAVING=True",props:{}}]},{tokens:[{content:"LANGFLOW_AUTO_SAVING_INTERVAL=1000",props:{}}]},{tokens:[{content:"LANGFLOW_BACKEND_ONLY=False",props:{}}]},{tokens:[{content:'LANGFLOW_BUNDLE_URLS=["https://github.com/user/repo/commit/hash"]',props:{}}]},{tokens:[{content:"LANGFLOW_CACHE_TYPE=async",props:{}}]},{tokens:[{content:"LANGFLOW_COMPONENTS_PATH=/path/to/components/",props:{}}]},{tokens:[{content:"LANGFLOW_CONFIG_DIR=/path/to/config/",props:{}}]},{tokens:[{content:"LANGFLOW_DATABASE_URL=postgresql://user:password@localhost:5432/langflow",props:{}}]},{tokens:[{content:"LANGFLOW_DEV=False",props:{}}]},{tokens:[{content:"LANGFLOW_FALLBACK_TO_ENV_VAR=False",props:{}}]},{tokens:[{content:"LANGFLOW_HEALTH_CHECK_MAX_RETRIES=5",props:{}}]},{tokens:[{content:"LANGFLOW_HOST=localhost",props:{}}]},{tokens:[{content:"LANGFLOW_LANGCHAIN_CACHE=InMemoryCache",props:{}}]},{tokens:[{content:"LANGFLOW_MAX_FILE_SIZE_UPLOAD=10000",props:{}}]},{tokens:[{content:"LANGFLOW_MAX_ITEMS_LENGTH=100",props:{}}]},{tokens:[{content:"LANGFLOW_MAX_TEXT_LENGTH=1000",props:{}}]},{tokens:[{content:"LANGFLOW_LOG_LEVEL=error",props:{}}]},{tokens:[{content:"LANGFLOW_OPEN_BROWSER=False",props:{}}]},{tokens:[{content:"LANGFLOW_PORT=7860",props:{}}]},{tokens:[{content:"LANGFLOW_REMOVE_API_KEYS=False",props:{}}]},{tokens:[{content:"LANGFLOW_SAVE_DB_IN_CONFIG_DIR=True",props:{}}]},{tokens:[{content:"LANGFLOW_SECRET_KEY=somesecretkey",props:{}}]},{tokens:[{content:"LANGFLOW_STORE_ENVIRONMENT_VARIABLES=True",props:{}}]},{tokens:[{content:"LANGFLOW_SUPERUSER=adminuser",props:{}}]},{tokens:[{content:"LANGFLOW_SUPERUSER_PASSWORD=adminpass",props:{}}]},{tokens:[{content:"LANGFLOW_WORKER_TIMEOUT=60000",props:{}}]},{tokens:[{content:"LANGFLOW_WORKERS=3",props:{}}]}],lang:"text"},annotations:[]}]}),(0,s.jsxs)(o.p,{children:["For additional examples, see ",(0,s.jsx)(o.a,{href:"https://github.com/langflow-ai/langflow/blob/main/.env.example",children:(0,s.jsx)(o.code,{children:".env.example"})})," in the Langflow repository."]})]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Save and close ",(0,s.jsx)(o.code,{children:".env"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Start Langflow with your ",(0,s.jsx)(o.code,{children:".env"})," file:"]}),"\n",(0,s.jsxs)(c.A,{children:[(0,s.jsx)(i.A,{value:"local",label:"Local",default:!0,children:(0,s.jsx)(h.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"uv ",props:{style:{color:"#FFA657"}}},{content:"run langflow run ",props:{style:{color:"#A5D6FF"}}},{content:"--env-file ",props:{style:{color:"#79C0FF"}}},{content:".env",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]})}),(0,s.jsx)(i.A,{value:"docker",label:"Docker",children:(0,s.jsx)(h.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"docker ",props:{style:{color:"#FFA657"}}},{content:"run ",props:{style:{color:"#A5D6FF"}}},{content:"-it --rm \\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -p ",props:{style:{color:"#79C0FF"}}},{content:"7860:",props:{style:{color:"#A5D6FF"}}},{content:"7860 \\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" --env-file ",props:{style:{color:"#79C0FF"}}},{content:".env ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" langflowai/langflow:latest",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]})})]}),"\n",(0,s.jsxs)(o.p,{children:["If your ",(0,s.jsx)(o.code,{children:".env"})," file isn't in the same directory, provide the path to your ",(0,s.jsx)(o.code,{children:".env"})," file."]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(o.p,{children:["On startup, Langflow imports the environment variables from your ",(0,s.jsx)(o.code,{children:".env"})," file, as well as any others that you set in your terminal, and then adopts their specified values."]}),"\n",(0,s.jsx)(o.h3,{id:"configure-environment-variables-for-development",children:"Configure environment variables for development"}),"\n",(0,s.jsx)(o.p,{children:"The following examples show how to configure Langflow using environment variables in different development scenarios."}),"\n",(0,s.jsxs)(c.A,{children:[(0,s.jsxs)(i.A,{value:"env",label:".env file",default:!0,children:[(0,s.jsxs)(o.p,{children:["The ",(0,s.jsx)(o.code,{children:".env"})," file is a text file that contains key-value pairs of environment variables."]}),(0,s.jsxs)(o.p,{children:["Create or edit a ",(0,s.jsx)(o.code,{children:".env"})," file in the root directory of your application or Langflow environment, and then add your configuration variables to the file:"]}),(0,s.jsxs)(n,{children:[(0,s.jsx)("summary",{children:"Example: .env"}),(0,s.jsx)(h.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",title:'".env"',focus:"",code:{lines:[{tokens:[{content:"DO_NOT_TRACK=True",props:{}}]},{tokens:[{content:"LANGFLOW_AUTO_LOGIN=False",props:{}}]},{tokens:[{content:"LANGFLOW_AUTO_SAVING=True",props:{}}]},{tokens:[{content:"LANGFLOW_AUTO_SAVING_INTERVAL=1000",props:{}}]},{tokens:[{content:"LANGFLOW_BACKEND_ONLY=False",props:{}}]},{tokens:[{content:'LANGFLOW_BUNDLE_URLS=["https://github.com/user/repo/commit/hash"]',props:{}}]},{tokens:[{content:"LANGFLOW_CACHE_TYPE=async",props:{}}]},{tokens:[{content:"LANGFLOW_COMPONENTS_PATH=/path/to/components/",props:{}}]},{tokens:[{content:"LANGFLOW_CONFIG_DIR=/path/to/config/",props:{}}]},{tokens:[{content:"LANGFLOW_DATABASE_URL=postgresql://user:password@localhost:5432/langflow",props:{}}]},{tokens:[{content:"LANGFLOW_DEV=False",props:{}}]},{tokens:[{content:"LANGFLOW_FALLBACK_TO_ENV_VAR=False",props:{}}]},{tokens:[{content:"LANGFLOW_HEALTH_CHECK_MAX_RETRIES=5",props:{}}]},{tokens:[{content:"LANGFLOW_HOST=localhost",props:{}}]},{tokens:[{content:"LANGFLOW_LANGCHAIN_CACHE=InMemoryCache",props:{}}]},{tokens:[{content:"LANGFLOW_MAX_FILE_SIZE_UPLOAD=10000",props:{}}]},{tokens:[{content:"LANGFLOW_MAX_ITEMS_LENGTH=100",props:{}}]},{tokens:[{content:"LANGFLOW_MAX_TEXT_LENGTH=1000",props:{}}]},{tokens:[{content:"LANGFLOW_LOG_LEVEL=error",props:{}}]},{tokens:[{content:"LANGFLOW_OPEN_BROWSER=False",props:{}}]},{tokens:[{content:"LANGFLOW_PORT=7860",props:{}}]},{tokens:[{content:"LANGFLOW_REMOVE_API_KEYS=False",props:{}}]},{tokens:[{content:"LANGFLOW_SAVE_DB_IN_CONFIG_DIR=True",props:{}}]},{tokens:[{content:"LANGFLOW_SECRET_KEY=somesecretkey",props:{}}]},{tokens:[{content:"LANGFLOW_STORE_ENVIRONMENT_VARIABLES=True",props:{}}]},{tokens:[{content:"LANGFLOW_SUPERUSER=adminuser",props:{}}]},{tokens:[{content:"LANGFLOW_SUPERUSER_PASSWORD=adminpass",props:{}}]},{tokens:[{content:"LANGFLOW_WORKER_TIMEOUT=60000",props:{}}]},{tokens:[{content:"LANGFLOW_WORKERS=3",props:{}}]}],lang:"text"},annotations:[]}]})]})]}),(0,s.jsxs)(i.A,{value:"systemd",label:"Systemd service",children:[(0,s.jsx)(o.p,{children:"A systemd service configuration file configures Linux system services."}),(0,s.jsxs)(o.p,{children:["To add environment variables, create or edit a service configuration file and add an ",(0,s.jsx)(o.code,{children:"override.conf"})," file. This file allows you to override the default environment variables for the service."]}),(0,s.jsxs)(n,{children:[(0,s.jsx)("summary",{children:"Example: override.conf"}),(0,s.jsx)(h.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",title:'"override.conf"',focus:"",code:{lines:[{tokens:[{content:"[Service]",props:{style:{color:"#FFA657"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"DO_NOT_TRACK=true"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_AUTO_LOGIN=false"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_AUTO_SAVING=true"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_AUTO_SAVING_INTERVAL=1000"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_BACKEND_ONLY=false"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_BUNDLE_URLS=[\\"',props:{style:{color:"#A5D6FF"}}},{content:"https://github.com/user/repo/commit/hash\\",props:{style:{color:"#C9D1D9"}}},{content:'"]"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_CACHE_TYPE=async"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_COMPONENTS_PATH=/path/to/components/"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_CONFIG_DIR=/path/to/config"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_DATABASE_URL=postgresql://user:password@localhost:5432/langflow"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_DEV=false"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_FALLBACK_TO_ENV_VAR=false"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_HEALTH_CHECK_MAX_RETRIES=5"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_HOST=localhost"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_LANGCHAIN_CACHE=InMemoryCache"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_MAX_FILE_SIZE_UPLOAD=10000"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_MAX_ITEMS_LENGTH=100"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_MAX_TEXT_LENGTH=1000"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_LOG_ENV=container_json"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_LOG_FILE=logs/langflow.log"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_LOG_LEVEL=error"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_OPEN_BROWSER=false"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_PORT=7860"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_REMOVE_API_KEYS=false"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_SAVE_DB_IN_CONFIG_DIR=true"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_SECRET_KEY=somesecretkey"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_STORE_ENVIRONMENT_VARIABLES=true"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_SUPERUSER=adminuser"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_SUPERUSER_PASSWORD=adminpass"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_WORKER_TIMEOUT=60000"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"Environment",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_WORKERS=3"',props:{style:{color:"#A5D6FF"}}}]}],lang:"ini"},annotations:[]}]})]}),(0,s.jsxs)(o.p,{children:["For more information on systemd, see the ",(0,s.jsx)(o.a,{href:"https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/9/html/using_systemd_unit_files_to_customize_and_optimize_your_system/assembly_working-with-systemd-unit-files_working-with-systemd",children:"Red Hat documentation"}),"."]})]}),(0,s.jsxs)(i.A,{value:"vscode",label:"VSCode tasks.json",children:[(0,s.jsxs)(o.p,{children:["The ",(0,s.jsx)(o.code,{children:"tasks.json"})," file located in ",(0,s.jsx)(o.code,{children:".vscode/tasks.json"})," is a configuration file for development environments using Visual Studio Code."]}),(0,s.jsxs)(o.p,{children:["Create or edit the ",(0,s.jsx)(o.code,{children:".vscode/tasks.json"})," file in your project root."]}),(0,s.jsxs)(n,{children:[(0,s.jsx)("summary",{children:"Example: .vscode/tasks.json"}),(0,s.jsx)(h.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",title:'".vscode/tasks.json"',focus:"",code:{lines:[{tokens:[{content:"{",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "version"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"2.0.0"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "options"',props:{style:{color:"#7EE787"}}},{content:": {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "env"',props:{style:{color:"#7EE787"}}},{content:": {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "DO_NOT_TRACK"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"true"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_AUTO_LOGIN"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"false"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_AUTO_SAVING"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"true"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_AUTO_SAVING_INTERVAL"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"1000"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_BACKEND_ONLY"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"false"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_BUNDLE_URLS"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"[',props:{style:{color:"#A5D6FF"}}},{content:'\\"',props:{style:{color:"#79C0FF"}}},{content:"https://github.com/user/repo/commit/hash",props:{style:{color:"#A5D6FF"}}},{content:'\\"',props:{style:{color:"#79C0FF"}}},{content:']"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_CACHE_TYPE"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"async"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_COMPONENTS_PATH"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"D:/path/to/components/"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_CONFIG_DIR"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"D:/path/to/config/"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_DATABASE_URL"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"postgresql://postgres:password@localhost:5432/langflow"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_DEV"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"false"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_FALLBACK_TO_ENV_VAR"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"false"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_HEALTH_CHECK_MAX_RETRIES"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"5"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_HOST"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"localhost"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_LANGCHAIN_CACHE"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"InMemoryCache"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_MAX_FILE_SIZE_UPLOAD"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"10000"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_MAX_ITEMS_LENGTH"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"100"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_MAX_TEXT_LENGTH"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"1000"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_LOG_ENV"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"container_csv"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_LOG_FILE"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"langflow.log"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_LOG_LEVEL"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"error"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_OPEN_BROWSER"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"false"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_PORT"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"7860"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_REMOVE_API_KEYS"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"true"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_SAVE_DB_IN_CONFIG_DIR"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"false"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_SECRET_KEY"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"somesecretkey"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_STORE_ENVIRONMENT_VARIABLES"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"true"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_SUPERUSER"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"adminuser"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_SUPERUSER_PASSWORD"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"adminpass"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_WORKER_TIMEOUT"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"60000"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "LANGFLOW_WORKERS"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"3"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" }",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" },",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "tasks"',props:{style:{color:"#7EE787"}}},{content:": [",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "label"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"langflow backend"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "type"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"shell"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "command"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'". ./langflownightly/Scripts/activate && langflow run"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "isBackground"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"true",props:{style:{color:"#79C0FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "problemMatcher"',props:{style:{color:"#7EE787"}}},{content:": []",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" }",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ]",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]}],lang:"json"},annotations:[]}]})]}),(0,s.jsxs)(o.p,{children:["To run Langflow using the above VSCode ",(0,s.jsx)(o.code,{children:"tasks.json"})," file, in the VSCode command palette, select ",(0,s.jsx)(o.strong,{children:"Tasks: Run Task"})," > ",(0,s.jsx)(o.strong,{children:"langflow backend"}),"."]})]})]}),"\n",(0,s.jsx)(o.h2,{id:"set-environment-variables-for-langflow-desktop",children:"Set environment variables for Langflow Desktop"}),"\n",(0,s.jsx)(o.p,{children:"Environment variables set in your terminal aren't automatically available to GUI-based applications like Langflow Desktop when you launch them from the Windows or macOS GUI."}),"\n",(0,s.jsx)(o.p,{children:"For Windows, this means any GUI-based app launched from the Start menu, desktop shortcuts, or Windows Explorer."}),"\n",(0,s.jsx)(o.p,{children:"For macOS, this means any GUI-based app launched from Finder, Spotlight, Launchpad, or the Dock."}),"\n",(0,s.jsx)(o.p,{children:"To set environment variables for Langflow Desktop, you need to use specific commands or files, depending on your OS."}),"\n",(0,s.jsxs)(c.A,{children:[(0,s.jsxs)(i.A,{value:"macos",label:"macOS",default:!0,children:[(0,s.jsxs)(o.p,{children:["Langflow Desktop for macOS cannot automatically use variables set in your terminal, such as those in",(0,s.jsx)(o.code,{children:".zshrc"})," or ",(0,s.jsx)(o.code,{children:".bash_profile"}),", when launched from the macOS GUI."]}),(0,s.jsxs)(o.p,{children:["To make environment variables available to GUI apps on macOS, you need to use ",(0,s.jsx)(o.code,{children:"launchctl"})," with a ",(0,s.jsx)(o.code,{children:"plist"})," file:"]}),(0,s.jsxs)(o.ol,{children:["\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Create the ",(0,s.jsx)(o.code,{children:"LaunchAgents"})," directory if it doesn't exist:"]}),"\n",(0,s.jsx)(h.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"mkdir ",props:{style:{color:"#FFA657"}}},{content:"-p ",props:{style:{color:"#79C0FF"}}},{content:"~/Library/LaunchAgents",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["In the ",(0,s.jsx)(o.code,{children:"LaunchAgents"})," directory, create a ",(0,s.jsx)(o.code,{children:".plist"})," file called ",(0,s.jsx)(o.code,{children:"dev.langflow.env"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Add the following content to ",(0,s.jsx)(o.code,{children:"dev.langflow.env.plist"}),", and then add, change, or remove Langflow environment variables as needed for your configuration."]}),"\n",(0,s.jsx)(o.p,{children:"This example sets multiple environmental variables for all GUI apps launched from the macOS GUI."}),"\n",(0,s.jsx)(h.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:" ",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ',props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" <",props:{style:{color:"#C9D1D9"}}},{content:"plist ",props:{style:{color:"#7EE787"}}},{content:"version",props:{style:{color:"#79C0FF"}}},{content:"=",props:{style:{color:"#C9D1D9"}}},{content:'"1.0"',props:{style:{color:"#A5D6FF"}}},{content:">",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" <",props:{style:{color:"#C9D1D9"}}},{content:"dict",props:{style:{color:"#7EE787"}}},{content:">",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" <",props:{style:{color:"#C9D1D9"}}},{content:"key",props:{style:{color:"#7EE787"}}},{content:">Label",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" <",props:{style:{color:"#C9D1D9"}}},{content:"string",props:{style:{color:"#7EE787"}}},{content:">dev.langflow.env",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" <",props:{style:{color:"#C9D1D9"}}},{content:"key",props:{style:{color:"#7EE787"}}},{content:">ProgramArguments",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" <",props:{style:{color:"#C9D1D9"}}},{content:"array",props:{style:{color:"#7EE787"}}},{content:">",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" <",props:{style:{color:"#C9D1D9"}}},{content:"string",props:{style:{color:"#7EE787"}}},{content:">/bin/sh",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" <",props:{style:{color:"#C9D1D9"}}},{content:"string",props:{style:{color:"#7EE787"}}},{content:">-c",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" <",props:{style:{color:"#C9D1D9"}}},{content:"string",props:{style:{color:"#7EE787"}}},{content:">",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" launchctl setenv LANGFLOW_CONFIG_DIR /Users/your_user/custom/config ",props:{style:{color:"#C9D1D9"}}},{content:"&&",props:{style:{color:"#FFA198",fontStyle:"italic"}}}]},{tokens:[{content:" launchctl setenv LANGFLOW_PORT 7860 ",props:{style:{color:"#C9D1D9"}}},{content:"&&",props:{style:{color:"#FFA198",fontStyle:"italic"}}}]},{tokens:[{content:" launchctl setenv LANGFLOW_HOST localhost ",props:{style:{color:"#C9D1D9"}}},{content:"&&",props:{style:{color:"#FFA198",fontStyle:"italic"}}}]},{tokens:[{content:" launchctl setenv ARIZE_API_KEY ak-...",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" <",props:{style:{color:"#C9D1D9"}}},{content:"key",props:{style:{color:"#7EE787"}}},{content:">RunAtLoad",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" <",props:{style:{color:"#C9D1D9"}}},{content:"true",props:{style:{color:"#7EE787"}}},{content:"/>",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ",props:{style:{color:"#C9D1D9"}}}]}],lang:"xml"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Load the file with ",(0,s.jsx)(o.code,{children:"launchctl"}),":"]}),"\n",(0,s.jsx)(h.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"launchctl ",props:{style:{color:"#FFA657"}}},{content:"load ~/Library/LaunchAgents/dev.langflow.env.plist",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n"]}),"\n"]})]}),(0,s.jsxs)(i.A,{value:"windows1",label:"Window System Properties",children:[(0,s.jsxs)(o.p,{children:["Langflow Desktop for Windows cannot automatically use variables set in your terminal, such as those defined with ",(0,s.jsx)(o.code,{children:"set"})," in ",(0,s.jsx)(o.code,{children:"cmd"})," or ",(0,s.jsx)(o.code,{children:"$env:VAR=..."})," in PowerShell, when launched from the Windows GUI."]}),(0,s.jsxs)(o.p,{children:["To make environment variables available to the Langflow Desktop app, you must set them at the user or system level using the ",(0,s.jsx)(o.strong,{children:"System Properties"})," interface or the Terminal."]}),(0,s.jsx)(o.p,{children:"To set environment variables using the System Properties interface, do the following:"}),(0,s.jsxs)(o.ol,{children:["\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Press ",(0,s.jsx)("kbd",{children:"Win + R"}),", enter ",(0,s.jsx)(o.code,{children:"SystemPropertiesAdvanced"}),", and then press ",(0,s.jsx)("kbd",{children:"Enter"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Click ",(0,s.jsx)(o.strong,{children:"Environment Variables"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Under ",(0,s.jsx)(o.strong,{children:"User variables"}),", click ",(0,s.jsx)(o.strong,{children:"New"}),"."]}),"\n",(0,s.jsx)(o.admonition,{type:"tip",children:(0,s.jsxs)(o.p,{children:["To apply the setting to all users, select ",(0,s.jsx)(o.strong,{children:"System variables"}),"."]})}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Enter the name of the Langflow variable you want to set, such as ",(0,s.jsx)(o.code,{children:"LANGFLOW_CONFIG_DIR"}),", and the desired value, such as ",(0,s.jsx)(o.code,{children:"C:\\Users\\your_user\\.langflow_config"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Click ",(0,s.jsx)(o.strong,{children:"OK"})," to save the variable."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsx)(o.p,{children:"Repeat until you have set all necessary Langflow environment variables."}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsx)(o.p,{children:"Launch or restart Langflow Desktop to apply the environment variables."}),"\n"]}),"\n"]})]}),(0,s.jsxs)(i.A,{value:"windows2",label:"Powershell",children:[(0,s.jsx)(o.p,{children:"To define environment variables for Windows using PowerShell, do the following:"}),(0,s.jsxs)(o.ol,{children:["\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Enter the name of the Langflow variable you want to set, such as ",(0,s.jsx)(o.code,{children:"LANGFLOW_CONFIG_DIR"}),", and the desired value, such as ",(0,s.jsx)(o.code,{children:"C:\\Users\\your_user\\.langflow_config"}),"."]}),"\n",(0,s.jsx)(o.p,{children:"To set an environment variable for the current user:"}),"\n",(0,s.jsx)(h.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"[",props:{style:{color:"#C9D1D9"}}},{content:"System.Environment",props:{style:{color:"#FF7B72"}}},{content:"]::SetEnvironmentVariable(",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_CONFIG_DIR"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#FF7B72"}}},{content:'"C:\\Users\\your_user\\.langflow_config"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#FF7B72"}}},{content:'"User"',props:{style:{color:"#A5D6FF"}}},{content:")",props:{style:{color:"#C9D1D9"}}}]}],lang:"powershell"},annotations:[]}]}),"\n",(0,s.jsx)(o.p,{children:"To set an environment variable for all users (you must have Administrator priveleges):"}),"\n",(0,s.jsx)(h.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"[",props:{style:{color:"#C9D1D9"}}},{content:"System.Environment",props:{style:{color:"#FF7B72"}}},{content:"]::SetEnvironmentVariable(",props:{style:{color:"#C9D1D9"}}},{content:'"LANGFLOW_CONFIG_DIR"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#FF7B72"}}},{content:'"C:\\Langflow\\Config"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#FF7B72"}}},{content:'"Machine"',props:{style:{color:"#A5D6FF"}}},{content:")",props:{style:{color:"#C9D1D9"}}}]}],lang:"powershell"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsx)(o.p,{children:"Repeat until you have set all necessary Langflow environment variables."}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsx)(o.p,{children:"Launch or restart Langflow Desktop to apply the environment variables."}),"\n"]}),"\n"]})]})]}),"\n",(0,s.jsx)(o.h2,{id:"supported-variables",children:"Supported environment variables"}),"\n",(0,s.jsx)(o.p,{children:"The following sections provide information about specific Langflow environment variables."}),"\n",(0,s.jsx)(o.h3,{id:"authentication-and-security",children:"Authentication and security"}),"\n",(0,s.jsxs)(o.p,{children:["See ",(0,s.jsx)(o.a,{href:"/api-keys-and-authentication",children:"API keys and authentication"}),"."]}),"\n",(0,s.jsx)(o.h3,{id:"global-variables",children:"Global variables"}),"\n",(0,s.jsxs)(o.p,{children:["For information about the relationship between Langflow global variables and environment variables, as well as environment variables that control handling of global variables, see ",(0,s.jsx)(o.a,{href:"/configuration-global-variables",children:"Global variables"}),"."]}),"\n",(0,s.jsx)(o.h3,{id:"logging",children:"Logs"}),"\n",(0,s.jsxs)(o.p,{children:["See ",(0,s.jsx)(o.a,{href:"/logging#log-storage",children:"Configure log options"}),"."]}),"\n",(0,s.jsx)(o.h3,{id:"mcp",children:"MCP servers"}),"\n",(0,s.jsxs)(o.p,{children:["See ",(0,s.jsx)(o.a,{href:"/mcp-server",children:"Use Langflow as an MCP server"}),"."]}),"\n",(0,s.jsx)(o.h3,{id:"monitoring-and-metrics",children:"Monitoring and metrics"}),"\n",(0,s.jsxs)(o.p,{children:["For environment variables for specific monitoring service providers, see the Langflow monitoring integration guides, such as ",(0,s.jsx)(o.a,{href:"/integrations-langfuse",children:"Langfuse"})," and ",(0,s.jsx)(o.a,{href:"/deployment-prod-best-practices",children:"Best practices for Langflow on Kubernetes"}),"."]}),"\n",(0,s.jsx)(o.h3,{id:"server",children:"Server"}),"\n",(0,s.jsx)(o.p,{children:"The following environment variables set base Langflow server configuration, such as where the server is hosted, required files for SSL encryption, and the deployment type (frontend and backend, backend-only, development mode)."}),"\n",(0,s.jsxs)(o.table,{children:[(0,s.jsx)(o.thead,{children:(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.th,{children:"Variable"}),(0,s.jsx)(o.th,{children:"Format"}),(0,s.jsx)(o.th,{children:"Default"}),(0,s.jsx)(o.th,{children:"Description"})]})}),(0,s.jsxs)(o.tbody,{children:[(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_HOST"})}),(0,s.jsx)(o.td,{children:"String"}),(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"localhost"})}),(0,s.jsx)(o.td,{children:"The host on which the Langflow server will run."})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_PORT"})}),(0,s.jsx)(o.td,{children:"Integer"}),(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"7860"})}),(0,s.jsx)(o.td,{children:"The port on which the Langflow server runs. The server automatically selects a free port if the specified port is in use."})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_BACKEND_ONLY"})}),(0,s.jsx)(o.td,{children:"Boolean"}),(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"False"})}),(0,s.jsx)(o.td,{children:"Run only the Langflow backend service (no frontend)."})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_DEV"})}),(0,s.jsx)(o.td,{children:"Boolean"}),(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"False"})}),(0,s.jsx)(o.td,{children:"Whether to run Langflow in development mode (may contain bugs)."})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_OPEN_BROWSER"})}),(0,s.jsx)(o.td,{children:"Boolean"}),(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"False"})}),(0,s.jsx)(o.td,{children:"Open the system web browser on startup."})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_HEALTH_CHECK_MAX_RETRIES"})}),(0,s.jsx)(o.td,{children:"Integer"}),(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"5"})}),(0,s.jsx)(o.td,{children:"Set the maximum number of retries for Langflow's server status health checks."})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_WORKERS"})}),(0,s.jsx)(o.td,{children:"Integer"}),(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"1"})}),(0,s.jsx)(o.td,{children:"Number of worker processes."})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_WORKER_TIMEOUT"})}),(0,s.jsx)(o.td,{children:"Integer"}),(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"300"})}),(0,s.jsx)(o.td,{children:"Worker timeout in seconds."})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_SSL_CERT_FILE"})}),(0,s.jsx)(o.td,{children:"String"}),(0,s.jsx)(o.td,{children:"Not set"}),(0,s.jsx)(o.td,{children:"Path to the SSL certificate file on the local system for SSL-encrypted connections."})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_SSL_KEY_FILE"})}),(0,s.jsx)(o.td,{children:"String"}),(0,s.jsx)(o.td,{children:"Not set"}),(0,s.jsx)(o.td,{children:"Path to the SSL key file on the local system for SSL-encrypted connections."})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_DEACTIVATE_TRACING"})}),(0,s.jsx)(o.td,{children:"Boolean"}),(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"False"})}),(0,s.jsx)(o.td,{children:"Deactivate tracing functionality."})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_CELERY_ENABLED"})}),(0,s.jsx)(o.td,{children:"Boolean"}),(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"False"})}),(0,s.jsx)(o.td,{children:"Enable Celery for distributed task processing."})]})]})]}),"\n",(0,s.jsxs)(o.p,{children:["For more information about deploying Langflow servers, see ",(0,s.jsx)(o.a,{href:"/deployment-overview",children:"Langflow deployment overview"}),"."]}),"\n",(0,s.jsx)(o.h3,{id:"storage",children:"Storage"}),"\n",(0,s.jsxs)(o.p,{children:["See ",(0,s.jsx)(o.a,{href:"/memory",children:"Memory management options"})," and ",(0,s.jsx)(o.a,{href:"/concepts-file-management",children:"Manage files"}),"."]}),"\n",(0,s.jsx)(o.h3,{id:"telemetry",children:"Telemetry"}),"\n",(0,s.jsxs)(o.p,{children:["See ",(0,s.jsx)(o.a,{href:"/contributing-telemetry",children:"Telemetry"}),"."]}),"\n",(0,s.jsx)(o.h3,{id:"visual-editor-and-playground-behavior",children:"Visual editor and Playground behavior"}),"\n",(0,s.jsxs)(o.table,{children:[(0,s.jsx)(o.thead,{children:(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.th,{children:"Variable"}),(0,s.jsx)(o.th,{children:"Format"}),(0,s.jsx)(o.th,{children:"Default"}),(0,s.jsx)(o.th,{children:"Description"})]})}),(0,s.jsxs)(o.tbody,{children:[(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_AUTO_SAVING"})}),(0,s.jsx)(o.td,{children:"Boolean"}),(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"True"})}),(0,s.jsx)(o.td,{children:"Whether to automatically save flows."})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_AUTO_SAVING_INTERVAL"})}),(0,s.jsx)(o.td,{children:"Integer"}),(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"1000"})}),(0,s.jsxs)(o.td,{children:["Set the auto-save interval in milliseconds if ",(0,s.jsx)(o.code,{children:"LANGFLOW_AUTO_SAVING=True"}),"."]})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_BUNDLE_URLS"})}),(0,s.jsx)(o.td,{children:"List[String]"}),(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"[]"})}),(0,s.jsxs)(o.td,{children:["A list of URLs from which to load custom bundles. Supports GitHub URLs. If ",(0,s.jsx)(o.code,{children:"LANGFLOW_AUTO_LOGIN=True"}),", flows from these bundles are loaded into the database."]})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_COMPONENTS_PATH"})}),(0,s.jsx)(o.td,{children:"String"}),(0,s.jsx)(o.td,{children:"Not set"}),(0,s.jsx)(o.td,{children:"Path to a directory containing custom components. Typically used if you have local custom components or you are building a Docker image with custom components."})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_LOAD_FLOWS_PATH"})}),(0,s.jsx)(o.td,{children:"String"}),(0,s.jsx)(o.td,{children:"Not set"}),(0,s.jsxs)(o.td,{children:["Path to a directory containing flow JSON files to be loaded on startup. Typically used when creating a Docker image with prepackaged flows. Requires ",(0,s.jsx)(o.code,{children:"LANGFLOW_AUTO_LOGIN=True"}),"."]})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_CREATE_STARTER_PROJECTS"})}),(0,s.jsx)(o.td,{children:"Boolean"}),(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"True"})}),(0,s.jsxs)(o.td,{children:["Whether to create templates during initialization. If ",(0,s.jsx)(o.code,{children:"false"}),", Langflow doesn't create templates, and ",(0,s.jsx)(o.code,{children:"LANGFLOW_UPDATE_STARTER_PROJECTS"})," is treated as ",(0,s.jsx)(o.code,{children:"false"}),"."]})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_UPDATE_STARTER_PROJECTS"})}),(0,s.jsx)(o.td,{children:"Boolean"}),(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"True"})}),(0,s.jsx)(o.td,{children:"Whether to update templates with the latest component versions when initializing after an upgrade."})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_LAZY_LOAD_COMPONENTS"})}),(0,s.jsx)(o.td,{children:"Boolean"}),(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"False"})}),(0,s.jsxs)(o.td,{children:["If ",(0,s.jsx)(o.code,{children:"true"}),", Langflow only partially loads components at startup and fully loads them on demand. This significantly reduces startup time but can cause a slight delay when a component is first used."]})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_EVENT_DELIVERY"})}),(0,s.jsx)(o.td,{children:"String"}),(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"streaming"})}),(0,s.jsxs)(o.td,{children:["How to deliver build events to the frontend: ",(0,s.jsx)(o.code,{children:"polling"}),", ",(0,s.jsx)(o.code,{children:"streaming"})," or ",(0,s.jsx)(o.code,{children:"direct"}),"."]})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_FRONTEND_PATH"})}),(0,s.jsx)(o.td,{children:"String"}),(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"./frontend"})}),(0,s.jsx)(o.td,{children:"Path to the frontend directory containing build files. For development purposes only when you need to serve specific frontend code."})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_MAX_ITEMS_LENGTH"})}),(0,s.jsx)(o.td,{children:"Integer"}),(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"100"})}),(0,s.jsx)(o.td,{children:"Maximum number of items to store and display in the visual editor. Lists longer than this will be truncated when displayed in the visual editor. Doesn't affect outputs or data passed between components."})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_MAX_TEXT_LENGTH"})}),(0,s.jsx)(o.td,{children:"Integer"}),(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"1000"})}),(0,s.jsx)(o.td,{children:"Maximum number of characters to store and display in the visual editor. Responses longer than this will be truncated when displayed in the visual editor. Doesn't truncate outputs or responses passed between components."})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_MAX_TRANSACTIONS_TO_KEEP"})}),(0,s.jsx)(o.td,{children:"Integer"}),(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"3000"})}),(0,s.jsx)(o.td,{children:"Maximum number of flow transaction events to keep in the database."})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_MAX_VERTEX_BUILDS_TO_KEEP"})}),(0,s.jsx)(o.td,{children:"Integer"}),(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"3000"})}),(0,s.jsxs)(o.td,{children:["Maximum number of vertex builds to keep in the database. Relates to ",(0,s.jsx)(o.a,{href:"/concepts-playground",children:"Playground"})," functionality."]})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_MAX_VERTEX_BUILDS_PER_VERTEX"})}),(0,s.jsx)(o.td,{children:"Integer"}),(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"2"})}),(0,s.jsxs)(o.td,{children:["Maximum number of builds to keep per vertex. Older builds are deleted. Relates to ",(0,s.jsx)(o.a,{href:"/concepts-playground",children:"Playground"})," functionality."]})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_PUBLIC_FLOW_CLEANUP_INTERVAL"})}),(0,s.jsx)(o.td,{children:"Integer"}),(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"3600"})}),(0,s.jsxs)(o.td,{children:["The interval in seconds at which data for ",(0,s.jsx)(o.a,{href:"/concepts-playground#share-a-flows-playground",children:"shared Playground"})," flows are cleaned up. Default: 3600 seconds (1 hour). Minimum: 600 seconds (10 minutes)."]})]}),(0,s.jsxs)(o.tr,{children:[(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"LANGFLOW_PUBLIC_FLOW_EXPIRATION"})}),(0,s.jsx)(o.td,{children:"Integer"}),(0,s.jsx)(o.td,{children:(0,s.jsx)(o.code,{children:"86400"})}),(0,s.jsxs)(o.td,{children:["The time in seconds after which a ",(0,s.jsx)(o.a,{href:"/concepts-playground#share-a-flows-playground",children:"shared Playground"})," flow is considered expired and eligible for cleanup. Default: 86400 seconds (24 hours). Minimum: 600 seconds (10 minutes)."]})]})]})]})]})}function L(e={}){const{wrapper:o}={...(0,r.R)(),...e.components};return o?(0,s.jsx)(o,{...e,children:(0,s.jsx)(F,{...e})}):F(e)}function D(e,o){throw new Error("Expected "+(o?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}}}]); \ No newline at end of file diff --git a/assets/js/16faf8bf.02a9c935.js b/assets/js/16faf8bf.06370702.js similarity index 70% rename from assets/js/16faf8bf.02a9c935.js rename to assets/js/16faf8bf.06370702.js index fded250c65..0bd445b378 100644 --- a/assets/js/16faf8bf.02a9c935.js +++ b/assets/js/16faf8bf.06370702.js @@ -1 +1 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[9315],{17886:(e,t,n)=>{n.d(t,{A:()=>r});n(96540);var s=n(64058),d=n(74848);function r({name:e,...t}){const n=s[e];return n?(0,d.jsx)(n,{...t}):null}},31929:(e,t,n)=>{n.d(t,{Ay:()=>l,RM:()=>i});var s=n(74848),d=n(28453),r=n(17886);const i=[];function o(e){const t={a:"a",p:"p",strong:"strong",...(0,d.R)(),...e.components};return(0,s.jsxs)(t.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,s.jsx)(r.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,s.jsx)(t.strong,{children:"Controls"})," in the ",(0,s.jsx)(t.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function l(e={}){const{wrapper:t}={...(0,d.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(o,{...e})}):o(e)}},34531:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>a,default:()=>m,frontMatter:()=>l,metadata:()=>s,toc:()=>h});const s=JSON.parse('{"id":"Components/bundles-lmstudio","title":"LM Studio","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/bundles-lmstudio.mdx","sourceDirName":"Components","slug":"/bundles-lmstudio","permalink":"/bundles-lmstudio","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"LM Studio","slug":"/bundles-lmstudio"},"sidebar":"docs","previous":{"title":"LangChain","permalink":"/bundles-langchain"},"next":{"title":"MariTalk","permalink":"/bundles-maritalk"}}');var d=n(74848),r=n(28453),i=n(17886),o=n(31929);const l={title:"LM Studio",slug:"/bundles-lmstudio"},a=void 0,c={},h=[{value:"LM Studio text generation",id:"lm-studio-text-generation",level:2},{value:"LM Studio text generation parameters",id:"lm-studio-text-generation-parameters",level:3},...o.RM,{value:"LM Studio Embeddings",id:"lm-studio-embeddings",level:2},{value:"LM Studio Embeddings parameters",id:"lm-studio-embeddings-parameters",level:3},...o.RM];function u(e){const t={a:"a",code:"code",h2:"h2",h3:"h3",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,r.R)(),...e.components};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(t.p,{children:[(0,d.jsx)(i.A,{name:"Blocks","aria-hidden":"true"})," ",(0,d.jsx)(t.a,{href:"/components-bundle-components",children:(0,d.jsx)(t.strong,{children:"Bundles"})})," contain custom components that support specific third-party integrations with Langflow."]}),"\n",(0,d.jsxs)(t.p,{children:["The components in the ",(0,d.jsx)(t.strong,{children:"LM Studio"})," bundle let you use models from a local or hosted instance of LM Studio.\nComponents can require authentication with an LM Studio API key. For information about LM Studio models, connections, and credentials, see the ",(0,d.jsx)(t.a,{href:"https://lmstudio.ai/docs",children:"LM Studio documentation"}),"."]}),"\n",(0,d.jsx)(t.h2,{id:"lm-studio-text-generation",children:"LM Studio text generation"}),"\n",(0,d.jsxs)(t.p,{children:["The ",(0,d.jsx)(t.strong,{children:"LM Studio"})," component generates text using LM Studio's local language models."]}),"\n",(0,d.jsxs)(t.p,{children:["It can output either a ",(0,d.jsx)(t.strong,{children:"Model Response"})," (",(0,d.jsx)(t.a,{href:"/data-types#message",children:(0,d.jsx)(t.code,{children:"Message"})}),") or a ",(0,d.jsx)(t.strong,{children:"Language Model"})," (",(0,d.jsx)(t.a,{href:"/data-types#languagemodel",children:(0,d.jsx)(t.code,{children:"LanguageModel"})}),")."]}),"\n",(0,d.jsxs)(t.p,{children:["Use the ",(0,d.jsx)(t.strong,{children:"Language Model"})," output when you want to use an LM Studio model as the LLM for another LLM-driven component, such as an ",(0,d.jsx)(t.strong,{children:"Agent"})," or ",(0,d.jsx)(t.strong,{children:"Smart Function"})," component."]}),"\n",(0,d.jsxs)(t.p,{children:["For more information, see ",(0,d.jsx)(t.a,{href:"/components-models",children:"Language model components"}),"."]}),"\n",(0,d.jsx)(t.h3,{id:"lm-studio-text-generation-parameters",children:"LM Studio text generation parameters"}),"\n",(0,d.jsx)(o.Ay,{}),"\n",(0,d.jsxs)(t.table,{children:[(0,d.jsx)(t.thead,{children:(0,d.jsxs)(t.tr,{children:[(0,d.jsx)(t.th,{children:"Name"}),(0,d.jsx)(t.th,{children:"Type"}),(0,d.jsx)(t.th,{children:"Description"})]})}),(0,d.jsxs)(t.tbody,{children:[(0,d.jsxs)(t.tr,{children:[(0,d.jsx)(t.td,{children:"base_url"}),(0,d.jsx)(t.td,{children:"String"}),(0,d.jsxs)(t.td,{children:["Input parameter. The URL where LM Studio is running. Default: ",(0,d.jsx)(t.code,{children:'"http://localhost:1234"'}),"."]})]}),(0,d.jsxs)(t.tr,{children:[(0,d.jsx)(t.td,{children:"api_key"}),(0,d.jsx)(t.td,{children:"LM Studio API Key"}),(0,d.jsx)(t.td,{children:"Input parameter. The API key for authentication with LM Studio, if required."})]}),(0,d.jsxs)(t.tr,{children:[(0,d.jsx)(t.td,{children:"max_tokens"}),(0,d.jsx)(t.td,{children:"Integer"}),(0,d.jsxs)(t.td,{children:["Input parameter. Maximum number of tokens to generate in the response. Default: ",(0,d.jsx)(t.code,{children:"512"}),"."]})]}),(0,d.jsxs)(t.tr,{children:[(0,d.jsx)(t.td,{children:"temperature"}),(0,d.jsx)(t.td,{children:"Float"}),(0,d.jsxs)(t.td,{children:["Input parameter. Controls randomness in the output. Range: ",(0,d.jsx)(t.code,{children:"[0.0, 2.0]"}),". Default: ",(0,d.jsx)(t.code,{children:"0.7"}),"."]})]}),(0,d.jsxs)(t.tr,{children:[(0,d.jsx)(t.td,{children:"top_p"}),(0,d.jsx)(t.td,{children:"Float"}),(0,d.jsxs)(t.td,{children:["Input parameter. Controls diversity with nucleus sampling. Range: ",(0,d.jsx)(t.code,{children:"[0.0, 1.0]"}),". Default: ",(0,d.jsx)(t.code,{children:"1.0"}),"."]})]}),(0,d.jsxs)(t.tr,{children:[(0,d.jsx)(t.td,{children:"stop"}),(0,d.jsx)(t.td,{children:"List[String]"}),(0,d.jsx)(t.td,{children:"Input parameter. List of strings that stop generation when encountered."})]}),(0,d.jsxs)(t.tr,{children:[(0,d.jsx)(t.td,{children:"stream"}),(0,d.jsx)(t.td,{children:"Boolean"}),(0,d.jsx)(t.td,{children:"Input parameter. Whether to stream the response. Default: false."})]}),(0,d.jsxs)(t.tr,{children:[(0,d.jsx)(t.td,{children:"presence_penalty"}),(0,d.jsx)(t.td,{children:"Float"}),(0,d.jsxs)(t.td,{children:["Input parameter. Penalizes repeated tokens. Range: ",(0,d.jsx)(t.code,{children:"[-2.0, 2.0]"}),". Default: ",(0,d.jsx)(t.code,{children:"0.0"}),"."]})]}),(0,d.jsxs)(t.tr,{children:[(0,d.jsx)(t.td,{children:"frequency_penalty"}),(0,d.jsx)(t.td,{children:"Float"}),(0,d.jsxs)(t.td,{children:["Input parameter. Penalizes frequent tokens. Range: ",(0,d.jsx)(t.code,{children:"[-2.0, 2.0]"}),". Default: ",(0,d.jsx)(t.code,{children:"0.0"}),"."]})]})]})]}),"\n",(0,d.jsx)(t.h2,{id:"lm-studio-embeddings",children:"LM Studio Embeddings"}),"\n",(0,d.jsxs)(t.p,{children:["The ",(0,d.jsx)(t.strong,{children:"LM Studio Embeddings"})," component generates embeddings using LM Studio models."]}),"\n",(0,d.jsxs)(t.p,{children:["For more information about using embedding model components in flows, see ",(0,d.jsx)(t.a,{href:"/components-embedding-models",children:"Embedding model components"}),"."]}),"\n",(0,d.jsx)(t.h3,{id:"lm-studio-embeddings-parameters",children:"LM Studio Embeddings parameters"}),"\n",(0,d.jsx)(o.Ay,{}),"\n",(0,d.jsxs)(t.table,{children:[(0,d.jsx)(t.thead,{children:(0,d.jsxs)(t.tr,{children:[(0,d.jsx)(t.th,{children:"Name"}),(0,d.jsx)(t.th,{children:"Display Name"}),(0,d.jsx)(t.th,{children:"Info"})]})}),(0,d.jsxs)(t.tbody,{children:[(0,d.jsxs)(t.tr,{children:[(0,d.jsx)(t.td,{children:"model"}),(0,d.jsx)(t.td,{children:"Model"}),(0,d.jsx)(t.td,{children:"Input parameter. The LM Studio model to use for generating embeddings."})]}),(0,d.jsxs)(t.tr,{children:[(0,d.jsx)(t.td,{children:"base_url"}),(0,d.jsx)(t.td,{children:"LM Studio Base URL"}),(0,d.jsx)(t.td,{children:"Input parameter. The base URL for the LM Studio API."})]}),(0,d.jsxs)(t.tr,{children:[(0,d.jsx)(t.td,{children:"api_key"}),(0,d.jsx)(t.td,{children:"LM Studio API Key"}),(0,d.jsx)(t.td,{children:"Input parameter. The API key for authentication with LM Studio."})]}),(0,d.jsxs)(t.tr,{children:[(0,d.jsx)(t.td,{children:"temperature"}),(0,d.jsx)(t.td,{children:"Model Temperature"}),(0,d.jsx)(t.td,{children:"Input parameter. The temperature setting for the model."})]})]})]})]})}function m(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,d.jsx)(t,{...e,children:(0,d.jsx)(u,{...e})}):u(e)}}}]); \ No newline at end of file +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[9315],{17886:(e,t,n)=>{n.d(t,{A:()=>r});n(96540);var s=n(64058),d=n(74848);function r({name:e,...t}){const n=s[e];return n?(0,d.jsx)(n,{...t}):null}},31929:(e,t,n)=>{n.d(t,{Ay:()=>l,RM:()=>i});var s=n(74848),d=n(28453),r=n(17886);const i=[];function o(e){const t={a:"a",p:"p",strong:"strong",...(0,d.R)(),...e.components};return(0,s.jsxs)(t.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,s.jsx)(r.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,s.jsx)(t.strong,{children:"Controls"})," in the ",(0,s.jsx)(t.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function l(e={}){const{wrapper:t}={...(0,d.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(o,{...e})}):o(e)}},34531:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>a,default:()=>m,frontMatter:()=>l,metadata:()=>s,toc:()=>h});const s=JSON.parse('{"id":"Components/bundles-lmstudio","title":"LM Studio","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/bundles-lmstudio.mdx","sourceDirName":"Components","slug":"/bundles-lmstudio","permalink":"/bundles-lmstudio","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"LM Studio","slug":"/bundles-lmstudio"},"sidebar":"docs","previous":{"title":"LangChain","permalink":"/bundles-langchain"},"next":{"title":"MariTalk","permalink":"/bundles-maritalk"}}');var d=n(74848),r=n(28453),i=n(17886),o=n(31929);const l={title:"LM Studio",slug:"/bundles-lmstudio"},a=void 0,c={},h=[{value:"LM Studio text generation",id:"lm-studio-text-generation",level:2},{value:"LM Studio text generation parameters",id:"lm-studio-text-generation-parameters",level:3},...o.RM,{value:"LM Studio Embeddings",id:"lm-studio-embeddings",level:2},{value:"LM Studio Embeddings parameters",id:"lm-studio-embeddings-parameters",level:3},...o.RM];function u(e){const t={a:"a",code:"code",h2:"h2",h3:"h3",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,r.R)(),...e.components};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(t.p,{children:[(0,d.jsx)(i.A,{name:"Blocks","aria-hidden":"true"})," ",(0,d.jsx)(t.a,{href:"/components-bundle-components",children:(0,d.jsx)(t.strong,{children:"Bundles"})})," contain custom components that support specific third-party integrations with Langflow."]}),"\n",(0,d.jsxs)(t.p,{children:["The components in the ",(0,d.jsx)(t.strong,{children:"LM Studio"})," bundle let you use models from a local or hosted instance of LM Studio.\nComponents can require authentication with an LM Studio API key. For information about LM Studio models, connections, and credentials, see the ",(0,d.jsx)(t.a,{href:"https://lmstudio.ai/docs",children:"LM Studio documentation"}),"."]}),"\n",(0,d.jsx)(t.h2,{id:"lm-studio-text-generation",children:"LM Studio text generation"}),"\n",(0,d.jsxs)(t.p,{children:["The ",(0,d.jsx)(t.strong,{children:"LM Studio"})," component generates text using LM Studio's local language models."]}),"\n",(0,d.jsxs)(t.p,{children:["It can output either a ",(0,d.jsx)(t.strong,{children:"Model Response"})," (",(0,d.jsx)(t.a,{href:"/data-types#message",children:(0,d.jsx)(t.code,{children:"Message"})}),") or a ",(0,d.jsx)(t.strong,{children:"Language Model"})," (",(0,d.jsx)(t.a,{href:"/data-types#languagemodel",children:(0,d.jsx)(t.code,{children:"LanguageModel"})}),")."]}),"\n",(0,d.jsxs)(t.p,{children:["Use the ",(0,d.jsx)(t.strong,{children:"Language Model"})," output when you want to use an LM Studio model as the LLM for another LLM-driven component, such as an ",(0,d.jsx)(t.strong,{children:"Agent"})," or ",(0,d.jsx)(t.strong,{children:"Smart Function"})," component."]}),"\n",(0,d.jsxs)(t.p,{children:["For more information, see ",(0,d.jsx)(t.a,{href:"/components-models",children:"Language model components"}),"."]}),"\n",(0,d.jsx)(t.h3,{id:"lm-studio-text-generation-parameters",children:"LM Studio text generation parameters"}),"\n",(0,d.jsx)(o.Ay,{}),"\n",(0,d.jsxs)(t.table,{children:[(0,d.jsx)(t.thead,{children:(0,d.jsxs)(t.tr,{children:[(0,d.jsx)(t.th,{children:"Name"}),(0,d.jsx)(t.th,{children:"Type"}),(0,d.jsx)(t.th,{children:"Description"})]})}),(0,d.jsxs)(t.tbody,{children:[(0,d.jsxs)(t.tr,{children:[(0,d.jsx)(t.td,{children:"base_url"}),(0,d.jsx)(t.td,{children:"String"}),(0,d.jsxs)(t.td,{children:["Input parameter. The URL where LM Studio is running. Default: ",(0,d.jsx)(t.code,{children:'"http://localhost:1234"'}),"."]})]}),(0,d.jsxs)(t.tr,{children:[(0,d.jsx)(t.td,{children:"api_key"}),(0,d.jsx)(t.td,{children:"LM Studio API Key"}),(0,d.jsx)(t.td,{children:"Input parameter. The API key for authentication with LM Studio, if required."})]}),(0,d.jsxs)(t.tr,{children:[(0,d.jsx)(t.td,{children:"max_tokens"}),(0,d.jsx)(t.td,{children:"Integer"}),(0,d.jsxs)(t.td,{children:["Input parameter. Maximum number of tokens to generate in the response. Default: ",(0,d.jsx)(t.code,{children:"512"}),"."]})]}),(0,d.jsxs)(t.tr,{children:[(0,d.jsx)(t.td,{children:"temperature"}),(0,d.jsx)(t.td,{children:"Float"}),(0,d.jsxs)(t.td,{children:["Input parameter. Controls randomness in the output. Range: ",(0,d.jsx)(t.code,{children:"[0.0, 2.0]"}),". Default: ",(0,d.jsx)(t.code,{children:"0.7"}),"."]})]}),(0,d.jsxs)(t.tr,{children:[(0,d.jsx)(t.td,{children:"top_p"}),(0,d.jsx)(t.td,{children:"Float"}),(0,d.jsxs)(t.td,{children:["Input parameter. Controls diversity with nucleus sampling. Range: ",(0,d.jsx)(t.code,{children:"[0.0, 1.0]"}),". Default: ",(0,d.jsx)(t.code,{children:"1.0"}),"."]})]}),(0,d.jsxs)(t.tr,{children:[(0,d.jsx)(t.td,{children:"stop"}),(0,d.jsx)(t.td,{children:"List[String]"}),(0,d.jsx)(t.td,{children:"Input parameter. List of strings that stop generation when encountered."})]}),(0,d.jsxs)(t.tr,{children:[(0,d.jsx)(t.td,{children:"stream"}),(0,d.jsx)(t.td,{children:"Boolean"}),(0,d.jsxs)(t.td,{children:["Input parameter. Whether to stream the response. Default: ",(0,d.jsx)(t.code,{children:"false"}),"."]})]}),(0,d.jsxs)(t.tr,{children:[(0,d.jsx)(t.td,{children:"presence_penalty"}),(0,d.jsx)(t.td,{children:"Float"}),(0,d.jsxs)(t.td,{children:["Input parameter. Penalizes repeated tokens. Range: ",(0,d.jsx)(t.code,{children:"[-2.0, 2.0]"}),". Default: ",(0,d.jsx)(t.code,{children:"0.0"}),"."]})]}),(0,d.jsxs)(t.tr,{children:[(0,d.jsx)(t.td,{children:"frequency_penalty"}),(0,d.jsx)(t.td,{children:"Float"}),(0,d.jsxs)(t.td,{children:["Input parameter. Penalizes frequent tokens. Range: ",(0,d.jsx)(t.code,{children:"[-2.0, 2.0]"}),". Default: ",(0,d.jsx)(t.code,{children:"0.0"}),"."]})]})]})]}),"\n",(0,d.jsx)(t.h2,{id:"lm-studio-embeddings",children:"LM Studio Embeddings"}),"\n",(0,d.jsxs)(t.p,{children:["The ",(0,d.jsx)(t.strong,{children:"LM Studio Embeddings"})," component generates embeddings using LM Studio models."]}),"\n",(0,d.jsxs)(t.p,{children:["For more information about using embedding model components in flows, see ",(0,d.jsx)(t.a,{href:"/components-embedding-models",children:"Embedding model components"}),"."]}),"\n",(0,d.jsx)(t.h3,{id:"lm-studio-embeddings-parameters",children:"LM Studio Embeddings parameters"}),"\n",(0,d.jsx)(o.Ay,{}),"\n",(0,d.jsxs)(t.table,{children:[(0,d.jsx)(t.thead,{children:(0,d.jsxs)(t.tr,{children:[(0,d.jsx)(t.th,{children:"Name"}),(0,d.jsx)(t.th,{children:"Display Name"}),(0,d.jsx)(t.th,{children:"Info"})]})}),(0,d.jsxs)(t.tbody,{children:[(0,d.jsxs)(t.tr,{children:[(0,d.jsx)(t.td,{children:"model"}),(0,d.jsx)(t.td,{children:"Model"}),(0,d.jsx)(t.td,{children:"Input parameter. The LM Studio model to use for generating embeddings."})]}),(0,d.jsxs)(t.tr,{children:[(0,d.jsx)(t.td,{children:"base_url"}),(0,d.jsx)(t.td,{children:"LM Studio Base URL"}),(0,d.jsx)(t.td,{children:"Input parameter. The base URL for the LM Studio API."})]}),(0,d.jsxs)(t.tr,{children:[(0,d.jsx)(t.td,{children:"api_key"}),(0,d.jsx)(t.td,{children:"LM Studio API Key"}),(0,d.jsx)(t.td,{children:"Input parameter. The API key for authentication with LM Studio."})]}),(0,d.jsxs)(t.tr,{children:[(0,d.jsx)(t.td,{children:"temperature"}),(0,d.jsx)(t.td,{children:"Model Temperature"}),(0,d.jsx)(t.td,{children:"Input parameter. The temperature setting for the model."})]})]})]})]})}function m(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,d.jsx)(t,{...e,children:(0,d.jsx)(u,{...e})}):u(e)}}}]); \ No newline at end of file diff --git a/assets/js/1ab69cbd.2adece5b.js b/assets/js/1ab69cbd.2adece5b.js deleted file mode 100644 index 22c1e85406..0000000000 --- a/assets/js/1ab69cbd.2adece5b.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[2475],{8593:(o,t,e)=>{e.r(t),e.d(t,{CH:()=>d,assets:()=>i,chCodeConfig:()=>a,contentTitle:()=>p,default:()=>h,frontMatter:()=>c,metadata:()=>n,toc:()=>y});const n=JSON.parse('{"id":"API-Reference/api-build","title":"Build endpoints","description":"The /build endpoints are used by Langflow\'s frontend visual editor code.","source":"@site/docs/API-Reference/api-build.mdx","sourceDirName":"API-Reference","slug":"/api-build","permalink":"/api-build","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Build endpoints","slug":"/api-build"},"sidebar":"docs","previous":{"title":"Monitor endpoints","permalink":"/api-monitor"},"next":{"title":"Users endpoints","permalink":"/api-users"}}');var s=e(74848),r=e(28453),l=e(24754);const c={title:"Build endpoints",slug:"/api-build"},p=void 0,i={},d={annotations:l.hk,Code:l.Cy},a={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},y=[{value:"Build flow and stream events",id:"build-flow-and-stream-events",level:2},{value:"Build headers",id:"build-headers",level:2},{value:"Build parameters",id:"build-parameters",level:2},{value:"Set start and stop points",id:"set-start-and-stop-points",level:3},{value:"Override flow parameters",id:"override-flow-parameters",level:3},{value:"See also",id:"see-also",level:2}];function F(o){const t={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,r.R)(),...o.components},{Details:e}=t;return d||D("CH",!1),d.Code||D("CH.Code",!0),e||D("Details",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n",(0,s.jsxs)(t.admonition,{type:"important",children:[(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.code,{children:"/build"})," endpoints are used by Langflow's frontend visual editor code.\nThese endpoints are part of the internal Langflow codebase."]}),(0,s.jsxs)(t.p,{children:["Don't use these endpoints to run flows in applications that use your Langflow flows.\nTo run flows in your apps, see ",(0,s.jsx)(t.a,{href:"/api-flows-run",children:"Flow trigger endpoints"}),"."]})]}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.code,{children:"/build"})," endpoints support Langflow's frontend code for building flows in the Langflow visual editor.\nYou can use these endpoints to build vertices and flows, as well as execute flows with streaming event responses.\nYou might need to use or understand these endpoints when contributing to the Langflow codebase."]}),"\n",(0,s.jsx)(t.h2,{id:"build-flow-and-stream-events",children:"Build flow and stream events"}),"\n",(0,s.jsx)(t.p,{children:"This endpoint builds and executes a flow, returning a job ID that can be used to stream execution events."}),"\n",(0,s.jsxs)(t.ol,{children:["\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["Send a POST request to the ",(0,s.jsx)(t.code,{children:"/build/$FLOW_ID/flow"})," endpoint:"]}),"\n",(0,s.jsx)(d.Code,{codeConfig:a,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:"POST ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:' "',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_URL",props:{style:{color:"#C9D1D9"}}},{content:"/api/v1/build/",props:{style:{color:"#A5D6FF"}}},{content:"$FLOW_ID",props:{style:{color:"#C9D1D9"}}},{content:'/flow" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"accept: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"Content-Type: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"x-api-key: ',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -d ",props:{style:{color:"#79C0FF"}}},{content:"'{",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "inputs": {',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "input_value": "Tell me a story"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" }",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" }'",props:{style:{color:"#A5D6FF"}}}]}],lang:"shell"},annotations:[]}]}),"\n",(0,s.jsxs)(e,{children:[(0,s.jsx)("summary",{children:"Result"}),(0,s.jsx)(d.Code,{codeConfig:a,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"{",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "job_id"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"123e4567-e89b-12d3-a456-426614174000"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]}],lang:"json"},annotations:[]}]})]}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["After receiving a job ID from the build endpoint, use the ",(0,s.jsx)(t.code,{children:"/build/$JOB_ID/events"})," endpoint to stream the execution results:"]}),"\n",(0,s.jsx)(d.Code,{codeConfig:a,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:"GET ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:' "',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_URL",props:{style:{color:"#C9D1D9"}}},{content:'/api/v1/build/123e4567-e89b-12d3-a456-426614174000/events" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"accept: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"x-api-key: ',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'"',props:{style:{color:"#A5D6FF"}}}]}],lang:"shell"},annotations:[]}]}),"\n",(0,s.jsxs)(e,{children:[(0,s.jsx)("summary",{children:"Result"}),(0,s.jsx)(d.Code,{codeConfig:a,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"{",props:{style:{color:"#C9D1D9"}}},{content:'"event"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"vertices_sorted"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"data"',props:{style:{color:"#7EE787"}}},{content:": {",props:{style:{color:"#C9D1D9"}}},{content:'"ids"',props:{style:{color:"#7EE787"}}},{content:": [",props:{style:{color:"#C9D1D9"}}},{content:'"ChatInput-XtBLx"',props:{style:{color:"#A5D6FF"}}},{content:"], ",props:{style:{color:"#C9D1D9"}}},{content:'"to_run"',props:{style:{color:"#7EE787"}}},{content:": [",props:{style:{color:"#C9D1D9"}}},{content:'"Prompt-x74Ze"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"ChatOutput-ylMzN"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"ChatInput-XtBLx"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"OpenAIModel-d1wOZ"',props:{style:{color:"#A5D6FF"}}},{content:"]}}",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"{",props:{style:{color:"#C9D1D9"}}},{content:'"event"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"add_message"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"data"',props:{style:{color:"#7EE787"}}},{content:": {",props:{style:{color:"#C9D1D9"}}},{content:'"timestamp"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"2025-03-03T17:42:23"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"sender"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"User"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"sender_name"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"User"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"session_id"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"d2bbd92b-187e-4c84-b2d4-5df365704201"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"text"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"Tell me a story"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"files"',props:{style:{color:"#7EE787"}}},{content:": [], ",props:{style:{color:"#C9D1D9"}}},{content:'"error"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"false",props:{style:{color:"#79C0FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"edit"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"false",props:{style:{color:"#79C0FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"properties"',props:{style:{color:"#7EE787"}}},{content:": {",props:{style:{color:"#C9D1D9"}}},{content:'"text_color"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'""',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"background_color"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'""',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"edited"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"false",props:{style:{color:"#79C0FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"source"',props:{style:{color:"#7EE787"}}},{content:": {",props:{style:{color:"#C9D1D9"}}},{content:'"id"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"null",props:{style:{color:"#79C0FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"display_name"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"null",props:{style:{color:"#79C0FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"source"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"null",props:{style:{color:"#79C0FF"}}},{content:"}, ",props:{style:{color:"#C9D1D9"}}},{content:'"icon"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'""',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"allow_markdown"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"false",props:{style:{color:"#79C0FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"positive_feedback"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"null",props:{style:{color:"#79C0FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"state"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"complete"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"targets"',props:{style:{color:"#7EE787"}}},{content:": []}, ",props:{style:{color:"#C9D1D9"}}},{content:'"category"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"message"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"content_blocks"',props:{style:{color:"#7EE787"}}},{content:": [], ",props:{style:{color:"#C9D1D9"}}},{content:'"id"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"28879bd8-6a68-4dd5-b658-74d643a4dd92"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"flow_id"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"d2bbd92b-187e-4c84-b2d4-5df365704201"',props:{style:{color:"#A5D6FF"}}},{content:"}}",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"// ... Additional events as the flow executes ...",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"{",props:{style:{color:"#C9D1D9"}}},{content:'"event"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"end"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"data"',props:{style:{color:"#7EE787"}}},{content:": {}}",props:{style:{color:"#C9D1D9"}}}]}],lang:"json"},annotations:[]}]})]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.code,{children:"/build/$FLOW_ID/events"})," endpoint has a ",(0,s.jsx)(t.code,{children:"stream"})," query parameter that defaults to true.\nTo disable streaming and get all events at once, set ",(0,s.jsx)(t.code,{children:"?stream=false"}),"."]}),"\n",(0,s.jsx)(d.Code,{codeConfig:a,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:"GET ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:' "',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_URL",props:{style:{color:"#C9D1D9"}}},{content:'/api/v1/build/123e4567-e89b-12d3-a456-426614174000/events?stream=false" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"accept: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"x-api-key: ',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'"',props:{style:{color:"#A5D6FF"}}}]}],lang:"shell"},annotations:[]}]}),"\n",(0,s.jsx)(t.h2,{id:"build-headers",children:"Build headers"}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Header"}),(0,s.jsx)(t.th,{children:"Info"}),(0,s.jsx)(t.th,{children:"Example"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Content-Type"}),(0,s.jsx)(t.td,{children:"Required. Specifies the JSON format."}),(0,s.jsx)(t.td,{children:'"application/json"'})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"accept"}),(0,s.jsx)(t.td,{children:"Optional. Specifies the response format."}),(0,s.jsx)(t.td,{children:'"application/json"'})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"x-api-key"}),(0,s.jsx)(t.td,{children:"Optional. Required only if authentication is enabled."}),(0,s.jsx)(t.td,{children:'"sk-..."'})]})]})]}),"\n",(0,s.jsx)(t.h2,{id:"build-parameters",children:"Build parameters"}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Parameter"}),(0,s.jsx)(t.th,{children:"Type"}),(0,s.jsx)(t.th,{children:"Description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"inputs"}),(0,s.jsx)(t.td,{children:"object"}),(0,s.jsx)(t.td,{children:"Optional. Input values for flow components."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"data"}),(0,s.jsx)(t.td,{children:"object"}),(0,s.jsx)(t.td,{children:"Optional. Flow data to override stored configuration."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"files"}),(0,s.jsx)(t.td,{children:"array[string]"}),(0,s.jsx)(t.td,{children:"Optional. List of file paths to use."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"start_component_id"}),(0,s.jsx)(t.td,{children:"string"}),(0,s.jsxs)(t.td,{children:["Optional. ID of the component where the execution should start. Component ",(0,s.jsx)(t.code,{children:"id"})," values can be found in ",(0,s.jsx)(t.a,{href:"/concepts-flows-import#langflow-json-file-contents",children:"Langflow JSON files"})]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"stop_component_id"}),(0,s.jsx)(t.td,{children:"string"}),(0,s.jsxs)(t.td,{children:["Optional. ID of the component where the execution should stop. Component ",(0,s.jsx)(t.code,{children:"id"})," values can be found in ",(0,s.jsx)(t.a,{href:"/concepts-flows-import#langflow-json-file-contents",children:"Langflow JSON files"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"log_builds"}),(0,s.jsx)(t.td,{children:"Boolean"}),(0,s.jsx)(t.td,{children:"Whether to record build logs. Default: Enabled (true)."})]})]})]}),"\n",(0,s.jsx)(t.h3,{id:"set-start-and-stop-points",children:"Set start and stop points"}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.code,{children:"/build"})," endpoint accepts optional values for ",(0,s.jsx)(t.code,{children:"start_component_id"})," and ",(0,s.jsx)(t.code,{children:"stop_component_id"})," to control where the flow run starts and stops.\nSetting ",(0,s.jsx)(t.code,{children:"stop_component_id"})," for a component triggers the same behavior as clicking ",(0,s.jsx)(t.strong,{children:"Run component"})," on that component in the visual editor: The specified component and all dependent components leading up to that component will run."]}),"\n",(0,s.jsxs)(t.p,{children:["The following example stops flow execution at an ",(0,s.jsx)(t.strong,{children:"OpenAI"})," component:"]}),"\n",(0,s.jsx)(d.Code,{codeConfig:a,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:"POST ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:' "',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_URL",props:{style:{color:"#C9D1D9"}}},{content:"/api/v1/build/",props:{style:{color:"#A5D6FF"}}},{content:"$FLOW_ID",props:{style:{color:"#C9D1D9"}}},{content:'/flow" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"accept: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"Content-Type: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"x-api-key: ',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -d ",props:{style:{color:"#79C0FF"}}},{content:'\'{"stop_component_id": "OpenAIModel-Uksag"}\'',props:{style:{color:"#A5D6FF"}}}]}],lang:"shell"},annotations:[]}]}),"\n",(0,s.jsx)(t.h3,{id:"override-flow-parameters",children:"Override flow parameters"}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.code,{children:"/build"})," endpoint also accepts inputs for ",(0,s.jsx)(t.code,{children:"data"})," directly, instead of using the values stored in the Langflow database.\nThis is useful for running flows without having to pass custom values through the visual editor."]}),"\n",(0,s.jsx)(d.Code,{codeConfig:a,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:"POST ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:' "',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_URL",props:{style:{color:"#C9D1D9"}}},{content:"/api/v1/build/",props:{style:{color:"#A5D6FF"}}},{content:"$FLOW_ID",props:{style:{color:"#C9D1D9"}}},{content:'/flow" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"accept: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"Content-Type: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"x-api-key: ',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -d ",props:{style:{color:"#79C0FF"}}},{content:"'{",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "data": {',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "nodes": [],',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "edges": []',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" },",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "inputs": {',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "input_value": "Your custom input here",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "session": "session_id"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" }",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" }'",props:{style:{color:"#A5D6FF"}}}]}],lang:"shell"},annotations:[]}]}),"\n",(0,s.jsxs)(e,{children:[(0,s.jsx)("summary",{children:"Result"}),(0,s.jsx)(d.Code,{codeConfig:a,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"{ ",props:{style:{color:"#C9D1D9"}}},{content:'"job_id"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"0bcc7f23-40b4-4bfa-9b8a-a44181fd1175"',props:{style:{color:"#A5D6FF"}}},{content:" }",props:{style:{color:"#C9D1D9"}}}]}],lang:"json"},annotations:[]}]})]}),"\n",(0,s.jsx)(t.h2,{id:"see-also",children:"See also"}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsx)(t.li,{children:(0,s.jsx)(t.a,{href:"/api-monitor#get-vertex-builds",children:"Get Vertex builds"})}),"\n",(0,s.jsx)(t.li,{children:(0,s.jsx)(t.a,{href:"/api-monitor#delete-vertex-builds",children:"Delete Vertex builds"})}),"\n",(0,s.jsx)(t.li,{children:(0,s.jsx)(t.a,{href:"/session-id",children:"Session ID"})}),"\n"]})]})}function h(o={}){const{wrapper:t}={...(0,r.R)(),...o.components};return t?(0,s.jsx)(t,{...o,children:(0,s.jsx)(F,{...o})}):F(o)}function D(o,t){throw new Error("Expected "+(t?"component":"object")+" `"+o+"` to be defined: you likely forgot to import, pass, or provide it.")}},28453:(o,t,e)=>{e.d(t,{R:()=>l,x:()=>c});var n=e(96540);const s={},r=n.createContext(s);function l(o){const t=n.useContext(r);return n.useMemo(function(){return"function"==typeof o?o(t):{...t,...o}},[t,o])}function c(o){let t;return t=o.disableParentContext?"function"==typeof o.components?o.components(s):o.components||s:l(o.components),n.createElement(r.Provider,{value:t},o.children)}}}]); \ No newline at end of file diff --git a/assets/js/1ab69cbd.a4ec1cf3.js b/assets/js/1ab69cbd.a4ec1cf3.js new file mode 100644 index 0000000000..58b4f4f251 --- /dev/null +++ b/assets/js/1ab69cbd.a4ec1cf3.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[2475],{8593:(o,t,e)=>{e.r(t),e.d(t,{CH:()=>d,assets:()=>i,chCodeConfig:()=>a,contentTitle:()=>p,default:()=>h,frontMatter:()=>c,metadata:()=>n,toc:()=>y});const n=JSON.parse('{"id":"API-Reference/api-build","title":"Build endpoints","description":"The /build endpoints are used by Langflow\'s frontend visual editor code.","source":"@site/docs/API-Reference/api-build.mdx","sourceDirName":"API-Reference","slug":"/api-build","permalink":"/api-build","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Build endpoints","slug":"/api-build"},"sidebar":"docs","previous":{"title":"Monitor endpoints","permalink":"/api-monitor"},"next":{"title":"Users endpoints","permalink":"/api-users"}}');var s=e(74848),r=e(28453),l=e(24754);const c={title:"Build endpoints",slug:"/api-build"},p=void 0,i={},d={annotations:l.hk,Code:l.Cy},a={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},y=[{value:"Build flow and stream events",id:"build-flow-and-stream-events",level:2},{value:"Build headers",id:"build-headers",level:2},{value:"Build parameters",id:"build-parameters",level:2},{value:"Set start and stop points",id:"set-start-and-stop-points",level:3},{value:"Override flow parameters",id:"override-flow-parameters",level:3},{value:"See also",id:"see-also",level:2}];function F(o){const t={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,r.R)(),...o.components},{Details:e}=t;return d||D("CH",!1),d.Code||D("CH.Code",!0),e||D("Details",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n",(0,s.jsxs)(t.admonition,{type:"info",children:[(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.code,{children:"/build"})," endpoints are used by Langflow's frontend visual editor code.\nThese endpoints are part of the internal Langflow codebase."]}),(0,s.jsxs)(t.p,{children:["Don't use these endpoints to run flows in applications that use your Langflow flows.\nTo run flows in your apps, see ",(0,s.jsx)(t.a,{href:"/api-flows-run",children:"Flow trigger endpoints"}),"."]})]}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.code,{children:"/build"})," endpoints support Langflow's frontend code for building flows in the Langflow visual editor.\nYou can use these endpoints to build vertices and flows, as well as execute flows with streaming event responses.\nYou might need to use or understand these endpoints when contributing to the Langflow codebase."]}),"\n",(0,s.jsx)(t.h2,{id:"build-flow-and-stream-events",children:"Build flow and stream events"}),"\n",(0,s.jsx)(t.p,{children:"This endpoint builds and executes a flow, returning a job ID that can be used to stream execution events."}),"\n",(0,s.jsxs)(t.ol,{children:["\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["Send a POST request to the ",(0,s.jsx)(t.code,{children:"/build/$FLOW_ID/flow"})," endpoint:"]}),"\n",(0,s.jsx)(d.Code,{codeConfig:a,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:"POST ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:' "',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_URL",props:{style:{color:"#C9D1D9"}}},{content:"/api/v1/build/",props:{style:{color:"#A5D6FF"}}},{content:"$FLOW_ID",props:{style:{color:"#C9D1D9"}}},{content:'/flow" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"accept: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"Content-Type: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"x-api-key: ',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -d ",props:{style:{color:"#79C0FF"}}},{content:"'{",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "inputs": {',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "input_value": "Tell me a story"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" }",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" }'",props:{style:{color:"#A5D6FF"}}}]}],lang:"shell"},annotations:[]}]}),"\n",(0,s.jsxs)(e,{children:[(0,s.jsx)("summary",{children:"Result"}),(0,s.jsx)(d.Code,{codeConfig:a,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"{",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "job_id"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"123e4567-e89b-12d3-a456-426614174000"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]}],lang:"json"},annotations:[]}]})]}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["After receiving a job ID from the build endpoint, use the ",(0,s.jsx)(t.code,{children:"/build/$JOB_ID/events"})," endpoint to stream the execution results:"]}),"\n",(0,s.jsx)(d.Code,{codeConfig:a,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:"GET ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:' "',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_URL",props:{style:{color:"#C9D1D9"}}},{content:'/api/v1/build/123e4567-e89b-12d3-a456-426614174000/events" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"accept: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"x-api-key: ',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'"',props:{style:{color:"#A5D6FF"}}}]}],lang:"shell"},annotations:[]}]}),"\n",(0,s.jsxs)(e,{children:[(0,s.jsx)("summary",{children:"Result"}),(0,s.jsx)(d.Code,{codeConfig:a,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"{",props:{style:{color:"#C9D1D9"}}},{content:'"event"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"vertices_sorted"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"data"',props:{style:{color:"#7EE787"}}},{content:": {",props:{style:{color:"#C9D1D9"}}},{content:'"ids"',props:{style:{color:"#7EE787"}}},{content:": [",props:{style:{color:"#C9D1D9"}}},{content:'"ChatInput-XtBLx"',props:{style:{color:"#A5D6FF"}}},{content:"], ",props:{style:{color:"#C9D1D9"}}},{content:'"to_run"',props:{style:{color:"#7EE787"}}},{content:": [",props:{style:{color:"#C9D1D9"}}},{content:'"Prompt-x74Ze"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"ChatOutput-ylMzN"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"ChatInput-XtBLx"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"OpenAIModel-d1wOZ"',props:{style:{color:"#A5D6FF"}}},{content:"]}}",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"{",props:{style:{color:"#C9D1D9"}}},{content:'"event"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"add_message"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"data"',props:{style:{color:"#7EE787"}}},{content:": {",props:{style:{color:"#C9D1D9"}}},{content:'"timestamp"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"2025-03-03T17:42:23"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"sender"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"User"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"sender_name"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"User"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"session_id"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"d2bbd92b-187e-4c84-b2d4-5df365704201"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"text"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"Tell me a story"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"files"',props:{style:{color:"#7EE787"}}},{content:": [], ",props:{style:{color:"#C9D1D9"}}},{content:'"error"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"false",props:{style:{color:"#79C0FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"edit"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"false",props:{style:{color:"#79C0FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"properties"',props:{style:{color:"#7EE787"}}},{content:": {",props:{style:{color:"#C9D1D9"}}},{content:'"text_color"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'""',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"background_color"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'""',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"edited"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"false",props:{style:{color:"#79C0FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"source"',props:{style:{color:"#7EE787"}}},{content:": {",props:{style:{color:"#C9D1D9"}}},{content:'"id"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"null",props:{style:{color:"#79C0FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"display_name"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"null",props:{style:{color:"#79C0FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"source"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"null",props:{style:{color:"#79C0FF"}}},{content:"}, ",props:{style:{color:"#C9D1D9"}}},{content:'"icon"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'""',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"allow_markdown"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"false",props:{style:{color:"#79C0FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"positive_feedback"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"null",props:{style:{color:"#79C0FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"state"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"complete"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"targets"',props:{style:{color:"#7EE787"}}},{content:": []}, ",props:{style:{color:"#C9D1D9"}}},{content:'"category"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"message"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"content_blocks"',props:{style:{color:"#7EE787"}}},{content:": [], ",props:{style:{color:"#C9D1D9"}}},{content:'"id"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"28879bd8-6a68-4dd5-b658-74d643a4dd92"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"flow_id"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"d2bbd92b-187e-4c84-b2d4-5df365704201"',props:{style:{color:"#A5D6FF"}}},{content:"}}",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"// ... Additional events as the flow executes ...",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"{",props:{style:{color:"#C9D1D9"}}},{content:'"event"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"end"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"data"',props:{style:{color:"#7EE787"}}},{content:": {}}",props:{style:{color:"#C9D1D9"}}}]}],lang:"json"},annotations:[]}]})]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.code,{children:"/build/$FLOW_ID/events"})," endpoint has a ",(0,s.jsx)(t.code,{children:"stream"})," query parameter that defaults to ",(0,s.jsx)(t.code,{children:"true"}),".\nTo disable streaming and get all events at once, set ",(0,s.jsx)(t.code,{children:"?stream=false"}),"."]}),"\n",(0,s.jsx)(d.Code,{codeConfig:a,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:"GET ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:' "',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_URL",props:{style:{color:"#C9D1D9"}}},{content:'/api/v1/build/123e4567-e89b-12d3-a456-426614174000/events?stream=false" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"accept: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"x-api-key: ',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'"',props:{style:{color:"#A5D6FF"}}}]}],lang:"shell"},annotations:[]}]}),"\n",(0,s.jsx)(t.h2,{id:"build-headers",children:"Build headers"}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Header"}),(0,s.jsx)(t.th,{children:"Info"}),(0,s.jsx)(t.th,{children:"Example"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Content-Type"}),(0,s.jsx)(t.td,{children:"Required. Specifies the JSON format."}),(0,s.jsx)(t.td,{children:'"application/json"'})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"accept"}),(0,s.jsx)(t.td,{children:"Optional. Specifies the response format."}),(0,s.jsx)(t.td,{children:'"application/json"'})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"x-api-key"}),(0,s.jsx)(t.td,{children:"Optional. Required only if authentication is enabled."}),(0,s.jsx)(t.td,{children:'"sk-..."'})]})]})]}),"\n",(0,s.jsx)(t.h2,{id:"build-parameters",children:"Build parameters"}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Parameter"}),(0,s.jsx)(t.th,{children:"Type"}),(0,s.jsx)(t.th,{children:"Description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"inputs"}),(0,s.jsx)(t.td,{children:"object"}),(0,s.jsx)(t.td,{children:"Optional. Input values for flow components."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"data"}),(0,s.jsx)(t.td,{children:"object"}),(0,s.jsx)(t.td,{children:"Optional. Flow data to override stored configuration."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"files"}),(0,s.jsx)(t.td,{children:"array[string]"}),(0,s.jsx)(t.td,{children:"Optional. List of file paths to use."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"start_component_id"}),(0,s.jsx)(t.td,{children:"string"}),(0,s.jsxs)(t.td,{children:["Optional. ID of the component where the execution should start. Component ",(0,s.jsx)(t.code,{children:"id"})," values can be found in ",(0,s.jsx)(t.a,{href:"/concepts-flows-import#langflow-json-file-contents",children:"Langflow JSON files"})]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"stop_component_id"}),(0,s.jsx)(t.td,{children:"string"}),(0,s.jsxs)(t.td,{children:["Optional. ID of the component where the execution should stop. Component ",(0,s.jsx)(t.code,{children:"id"})," values can be found in ",(0,s.jsx)(t.a,{href:"/concepts-flows-import#langflow-json-file-contents",children:"Langflow JSON files"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"log_builds"}),(0,s.jsx)(t.td,{children:"Boolean"}),(0,s.jsxs)(t.td,{children:["Whether to record build logs. Default: Enabled (",(0,s.jsx)(t.code,{children:"true"}),")."]})]})]})]}),"\n",(0,s.jsx)(t.h3,{id:"set-start-and-stop-points",children:"Set start and stop points"}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.code,{children:"/build"})," endpoint accepts optional values for ",(0,s.jsx)(t.code,{children:"start_component_id"})," and ",(0,s.jsx)(t.code,{children:"stop_component_id"})," to control where the flow run starts and stops.\nSetting ",(0,s.jsx)(t.code,{children:"stop_component_id"})," for a component triggers the same behavior as clicking ",(0,s.jsx)(t.strong,{children:"Run component"})," on that component in the visual editor: The specified component and all dependent components leading up to that component will run."]}),"\n",(0,s.jsxs)(t.p,{children:["The following example stops flow execution at an ",(0,s.jsx)(t.strong,{children:"OpenAI"})," component:"]}),"\n",(0,s.jsx)(d.Code,{codeConfig:a,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:"POST ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:' "',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_URL",props:{style:{color:"#C9D1D9"}}},{content:"/api/v1/build/",props:{style:{color:"#A5D6FF"}}},{content:"$FLOW_ID",props:{style:{color:"#C9D1D9"}}},{content:'/flow" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"accept: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"Content-Type: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"x-api-key: ',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -d ",props:{style:{color:"#79C0FF"}}},{content:'\'{"stop_component_id": "OpenAIModel-Uksag"}\'',props:{style:{color:"#A5D6FF"}}}]}],lang:"shell"},annotations:[]}]}),"\n",(0,s.jsx)(t.h3,{id:"override-flow-parameters",children:"Override flow parameters"}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.code,{children:"/build"})," endpoint also accepts inputs for ",(0,s.jsx)(t.code,{children:"data"})," directly, instead of using the values stored in the Langflow database.\nThis is useful for running flows without having to pass custom values through the visual editor."]}),"\n",(0,s.jsx)(d.Code,{codeConfig:a,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:"POST ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:' "',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_URL",props:{style:{color:"#C9D1D9"}}},{content:"/api/v1/build/",props:{style:{color:"#A5D6FF"}}},{content:"$FLOW_ID",props:{style:{color:"#C9D1D9"}}},{content:'/flow" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"accept: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"Content-Type: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"x-api-key: ',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -d ",props:{style:{color:"#79C0FF"}}},{content:"'{",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "data": {',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "nodes": [],',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "edges": []',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" },",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "inputs": {',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "input_value": "Your custom input here",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "session": "session_id"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" }",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" }'",props:{style:{color:"#A5D6FF"}}}]}],lang:"shell"},annotations:[]}]}),"\n",(0,s.jsxs)(e,{children:[(0,s.jsx)("summary",{children:"Result"}),(0,s.jsx)(d.Code,{codeConfig:a,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"{ ",props:{style:{color:"#C9D1D9"}}},{content:'"job_id"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"0bcc7f23-40b4-4bfa-9b8a-a44181fd1175"',props:{style:{color:"#A5D6FF"}}},{content:" }",props:{style:{color:"#C9D1D9"}}}]}],lang:"json"},annotations:[]}]})]}),"\n",(0,s.jsx)(t.h2,{id:"see-also",children:"See also"}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsx)(t.li,{children:(0,s.jsx)(t.a,{href:"/api-monitor#get-vertex-builds",children:"Get Vertex builds"})}),"\n",(0,s.jsx)(t.li,{children:(0,s.jsx)(t.a,{href:"/api-monitor#delete-vertex-builds",children:"Delete Vertex builds"})}),"\n",(0,s.jsx)(t.li,{children:(0,s.jsx)(t.a,{href:"/session-id",children:"Session ID"})}),"\n"]})]})}function h(o={}){const{wrapper:t}={...(0,r.R)(),...o.components};return t?(0,s.jsx)(t,{...o,children:(0,s.jsx)(F,{...o})}):F(o)}function D(o,t){throw new Error("Expected "+(t?"component":"object")+" `"+o+"` to be defined: you likely forgot to import, pass, or provide it.")}},28453:(o,t,e)=>{e.d(t,{R:()=>l,x:()=>c});var n=e(96540);const s={},r=n.createContext(s);function l(o){const t=n.useContext(r);return n.useMemo(function(){return"function"==typeof o?o(t):{...t,...o}},[t,o])}function c(o){let t;return t=o.disableParentContext?"function"==typeof o.components?o.components(s):o.components||s:l(o.components),n.createElement(r.Provider,{value:t},o.children)}}}]); \ No newline at end of file diff --git a/assets/js/20177945.653e9358.js b/assets/js/20177945.653e9358.js new file mode 100644 index 0000000000..724b88db2c --- /dev/null +++ b/assets/js/20177945.653e9358.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[8392],{11470:(o,e,t)=>{t.d(e,{A:()=>C});var n=t(96540),s=t(18215),r=t(23104),l=t(56347),c=t(205),p=t(57485),i=t(31682),a=t(70679);function d(o){return n.Children.toArray(o).filter(o=>"\n"!==o).map(o=>{if(!o||(0,n.isValidElement)(o)&&function(o){const{props:e}=o;return!!e&&"object"==typeof e&&"value"in e}(o))return o;throw new Error(`Docusaurus error: Bad child <${"string"==typeof o.type?o.type:o.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function u(o){const{values:e,children:t}=o;return(0,n.useMemo)(()=>{const o=e??function(o){return d(o).map(({props:{value:o,label:e,attributes:t,default:n}})=>({value:o,label:e,attributes:t,default:n}))}(t);return function(o){const e=(0,i.XI)(o,(o,e)=>o.value===e.value);if(e.length>0)throw new Error(`Docusaurus error: Duplicate values "${e.map(o=>o.value).join(", ")}" found in . Every value needs to be unique.`)}(o),o},[e,t])}function h({value:o,tabValues:e}){return e.some(e=>e.value===o)}function y({queryString:o=!1,groupId:e}){const t=(0,l.W6)(),s=function({queryString:o=!1,groupId:e}){if("string"==typeof o)return o;if(!1===o)return null;if(!0===o&&!e)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return e??null}({queryString:o,groupId:e});return[(0,p.aZ)(s),(0,n.useCallback)(o=>{if(!s)return;const e=new URLSearchParams(t.location.search);e.set(s,o),t.replace({...t.location,search:e.toString()})},[s,t])]}function F(o){const{defaultValue:e,queryString:t=!1,groupId:s}=o,r=u(o),[l,p]=(0,n.useState)(()=>function({defaultValue:o,tabValues:e}){if(0===e.length)throw new Error("Docusaurus error: the component requires at least one children component");if(o){if(!h({value:o,tabValues:e}))throw new Error(`Docusaurus error: The has a defaultValue "${o}" but none of its children has the corresponding value. Available values are: ${e.map(o=>o.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return o}const t=e.find(o=>o.default)??e[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:e,tabValues:r})),[i,d]=y({queryString:t,groupId:s}),[F,D]=function({groupId:o}){const e=function(o){return o?`docusaurus.tab.${o}`:null}(o),[t,s]=(0,a.Dv)(e);return[t,(0,n.useCallback)(o=>{e&&s.set(o)},[e,s])]}({groupId:s}),m=(()=>{const o=i??F;return h({value:o,tabValues:r})?o:null})();(0,c.A)(()=>{m&&p(m)},[m]);return{selectedValue:l,selectValue:(0,n.useCallback)(o=>{if(!h({value:o,tabValues:r}))throw new Error(`Can't select invalid tab value=${o}`);p(o),d(o),D(o)},[d,D,r]),tabValues:r}}var D=t(92303);const m={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var x=t(74848);function f({className:o,block:e,selectedValue:t,selectValue:n,tabValues:l}){const c=[],{blockElementScrollPositionUntilNextRender:p}=(0,r.a_)(),i=o=>{const e=o.currentTarget,s=c.indexOf(e),r=l[s].value;r!==t&&(p(e),n(r))},a=o=>{let e=null;switch(o.key){case"Enter":i(o);break;case"ArrowRight":{const t=c.indexOf(o.currentTarget)+1;e=c[t]??c[0];break}case"ArrowLeft":{const t=c.indexOf(o.currentTarget)-1;e=c[t]??c[c.length-1];break}}e?.focus()};return(0,x.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.A)("tabs",{"tabs--block":e},o),children:l.map(({value:o,label:e,attributes:n})=>(0,x.jsx)("li",{role:"tab",tabIndex:t===o?0:-1,"aria-selected":t===o,ref:o=>{c.push(o)},onKeyDown:a,onClick:i,...n,className:(0,s.A)("tabs__item",m.tabItem,n?.className,{"tabs__item--active":t===o}),children:e??o},o))})}function j({lazy:o,children:e,selectedValue:t}){const r=(Array.isArray(e)?e:[e]).filter(Boolean);if(o){const o=r.find(o=>o.props.value===t);return o?(0,n.cloneElement)(o,{className:(0,s.A)("margin-top--md",o.props.className)}):null}return(0,x.jsx)("div",{className:"margin-top--md",children:r.map((o,e)=>(0,n.cloneElement)(o,{key:e,hidden:o.props.value!==t}))})}function g(o){const e=F(o);return(0,x.jsxs)("div",{className:(0,s.A)("tabs-container",m.tabList),children:[(0,x.jsx)(f,{...e,...o}),(0,x.jsx)(j,{...e,...o})]})}function C(o){const e=(0,D.A)();return(0,x.jsx)(g,{...o,children:d(o.children)},String(e))}},17886:(o,e,t)=>{t.d(e,{A:()=>r});t(96540);var n=t(64058),s=t(74848);function r({name:o,...e}){const t=n[o];return t?(0,s.jsx)(t,{...e}):null}},19365:(o,e,t)=>{t.d(e,{A:()=>l});t(96540);var n=t(18215);const s={tabItem:"tabItem_Ymn6"};var r=t(74848);function l({children:o,hidden:e,className:t}){return(0,r.jsx)("div",{role:"tabpanel",className:(0,n.A)(s.tabItem,t),hidden:e,children:o})}},58950:(o,e,t)=>{t.r(e),t.d(e,{CH:()=>h,assets:()=>u,chCodeConfig:()=>y,contentTitle:()=>d,default:()=>m,frontMatter:()=>a,metadata:()=>n,toc:()=>F});const n=JSON.parse('{"id":"Components/components-custom-components","title":"Create custom Python components","description":"Custom components extend Langflow\'s functionality through Python classes that inherit from Component. This enables integration of new features, data manipulation, external services, and specialized tools.","source":"@site/docs/Components/components-custom-components.mdx","sourceDirName":"Components","slug":"/components-custom-components","permalink":"/components-custom-components","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Create custom Python components","slug":"/components-custom-components"},"sidebar":"docs","previous":{"title":"xAI","permalink":"/bundles-xai"},"next":{"title":"Get started with the Langflow API","permalink":"/api-reference-api-examples"}}');var s=t(74848),r=t(28453),l=t(24754),c=t(17886),p=t(11470),i=t(19365);const a={title:"Create custom Python components",slug:"/components-custom-components"},d=void 0,u={},h={annotations:l.hk,Code:l.Cy},y={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},F=[{value:"Class-level attributes",id:"class-level-attributes",level:2},{value:"Structure of a custom component",id:"structure-of-a-custom-component",level:3},{value:"Internal Lifecycle and Execution Flow",id:"internal-lifecycle-and-execution-flow",level:3},{value:"Inputs and outputs",id:"inputs-and-outputs",level:3},{value:"Associated Methods",id:"associated-methods",level:3},{value:"Components with multiple outputs",id:"components-with-multiple-outputs",level:3},{value:"Output Grouping Behavior with group_outputs",id:"output-grouping-behavior-with-group_outputs",level:4},{value:"Common internal patterns",id:"common-internal-patterns",level:3},{value:"_pre_run_setup()",id:"_pre_run_setup",level:4},{value:"Override run or _run",id:"override-run-or-_run",level:4},{value:"Store data in self.ctx",id:"store-data-in-selfctx",level:4},{value:"Directory structure requirements",id:"directory-structure-requirements",level:2},{value:"Custom component inputs and outputs",id:"custom-component-inputs-and-outputs",level:2},{value:"Inputs",id:"inputs",level:3},{value:"Outputs",id:"outputs",level:3},{value:"Tool Mode",id:"tool-mode",level:3},{value:"Typed annotations",id:"typed-annotations",level:2},{value:"Common Return Types",id:"common-return-types",level:3},{value:"Tips for typed annotations",id:"tips-for-typed-annotations",level:3},{value:"Enable dynamic fields",id:"enable-dynamic-fields",level:2},{value:"Implement update_build_config",id:"implement-update_build_config",level:3},{value:"Additional Dynamic Field Controls",id:"additional-dynamic-field-controls",level:3},{value:"Tips for Managing Dynamic Fields",id:"tips-for-managing-dynamic-fields",level:3},{value:"Error handling and logging",id:"error-handling-and-logging",level:2},{value:"Error handling techniques",id:"error-handling-techniques",level:3},{value:"Improve debugging and flow management",id:"improve-debugging-and-flow-management",level:3},{value:"Tips for error handling and logging",id:"tips-for-error-handling-and-logging",level:3},{value:"Contribute custom components to Langflow",id:"contribute-custom-components-to-langflow",level:2}];function D(o){const e={a:"a",code:"code",em:"em",h2:"h2",h3:"h3",h4:"h4",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,r.R)(),...o.components};return h||x("CH",!1),h.Code||x("CH.Code",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n","\n",(0,s.jsxs)(e.p,{children:["Custom components extend Langflow's functionality through Python classes that inherit from ",(0,s.jsx)(e.code,{children:"Component"}),". This enables integration of new features, data manipulation, external services, and specialized tools."]}),"\n",(0,s.jsx)(e.p,{children:'In Langflow\'s node-based environment, each node is a "component" that performs discrete functions. Custom components are Python classes which define:'}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Inputs"})," \u2014 Data or parameters your component requires."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Outputs"})," \u2014 Data your component provides to downstream nodes."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Logic"})," \u2014 How you process inputs to produce outputs."]}),"\n"]}),"\n",(0,s.jsx)(e.p,{children:"The benefits of creating custom components include unlimited extensibility, reusability, automatic field generation in the visual editor based on inputs, and type-safe connections between nodes."}),"\n",(0,s.jsx)(e.p,{children:"Create custom components for performing specialized tasks, calling APIs, or adding advanced logic."}),"\n",(0,s.jsx)(e.p,{children:"Custom components in Langflow are built upon:"}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:["The Python class that inherits from ",(0,s.jsx)(e.code,{children:"Component"}),"."]}),"\n",(0,s.jsx)(e.li,{children:"Class-level attributes that identify and describe the component."}),"\n",(0,s.jsx)(e.li,{children:"Input and output lists that determine data flow."}),"\n",(0,s.jsx)(e.li,{children:"Internal variables for logging and advanced logic."}),"\n"]}),"\n",(0,s.jsx)(e.h2,{id:"class-level-attributes",children:"Class-level attributes"}),"\n",(0,s.jsx)(e.p,{children:"Define these attributes to control a custom component's appearance and behavior:"}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"class ",props:{style:{color:"#FF7B72"}}},{content:"MyCsvReader",props:{style:{color:"#FFA657"}}},{content:"(",props:{style:{color:"#C9D1D9"}}},{content:"Component",props:{style:{color:"#79C0FF"}}},{content:"):",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"CSV Reader"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" description ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"Reads CSV files"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" icon ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"file-text"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" name ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"CSVReader"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" documentation ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"http://docs.example.com/csv_reader"',props:{style:{color:"#A5D6FF"}}}]}],lang:"python"},annotations:[]}]}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.code,{children:"display_name"}),": A user-friendly label shown in the visual editor."]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.code,{children:"description"}),": A brief summary shown in tooltips and printed below the component name when added to a flow."]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.code,{children:"icon"}),": A decorative icon from Langflow's icon library, printed next to the name."]}),"\n",(0,s.jsxs)(e.p,{children:["Langflow uses ",(0,s.jsx)(e.a,{href:"https://lucide.dev/icons",children:"Lucide"})," for icons. To assign an icon to your component, set the icon attribute to the name of a Lucide icon as a string, such as ",(0,s.jsx)(e.code,{children:'icon = "file-text"'}),". Langflow renders icons from the Lucide library automatically."]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.code,{children:"name"}),": A unique internal identifier, typically the same name as the folder containing your component code."]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.code,{children:"documentation"}),": An optional link to external documentation, such as API or product documentation."]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(e.h3,{id:"structure-of-a-custom-component",children:"Structure of a custom component"}),"\n",(0,s.jsx)(e.p,{children:"A Langflow custom component is more than a class with inputs and outputs. It includes an internal structure with optional lifecycle steps, output generation, front-end interaction, and logic organization."}),"\n",(0,s.jsx)(e.p,{children:"A basic component:"}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:["Inherits from ",(0,s.jsx)(e.code,{children:"langflow.custom.Component"}),"."]}),"\n",(0,s.jsxs)(e.li,{children:["Declares metadata like ",(0,s.jsx)(e.code,{children:"display_name"}),", ",(0,s.jsx)(e.code,{children:"description"}),", ",(0,s.jsx)(e.code,{children:"icon"}),", and more."]}),"\n",(0,s.jsxs)(e.li,{children:["Defines ",(0,s.jsx)(e.code,{children:"inputs"})," and ",(0,s.jsx)(e.code,{children:"outputs"})," lists."]}),"\n",(0,s.jsx)(e.li,{children:"Implements methods matching output specifications."}),"\n"]}),"\n",(0,s.jsx)(e.p,{children:"A minimal custom component skeleton contains the following:"}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"from",props:{style:{color:"#FF7B72"}}},{content:" langflow.custom ",props:{style:{color:"#C9D1D9"}}},{content:"import",props:{style:{color:"#FF7B72"}}},{content:" Component",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"from",props:{style:{color:"#FF7B72"}}},{content:" langflow.template ",props:{style:{color:"#C9D1D9"}}},{content:"import",props:{style:{color:"#FF7B72"}}},{content:" Output",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"class ",props:{style:{color:"#FF7B72"}}},{content:"MyComponent",props:{style:{color:"#FFA657"}}},{content:"(",props:{style:{color:"#C9D1D9"}}},{content:"Component",props:{style:{color:"#79C0FF"}}},{content:"):",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"My Component"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" description ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"A short summary."',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" icon ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"sparkles"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" name ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"MyComponent"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" inputs ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" []",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" outputs ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" []",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" def ",props:{style:{color:"#FF7B72"}}},{content:"some_output_method",props:{style:{color:"#D2A8FF"}}},{content:"(self):",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" return ",props:{style:{color:"#FF7B72"}}},{content:"...",props:{style:{color:"#79C0FF"}}}]}],lang:"python"},annotations:[]}]}),"\n",(0,s.jsx)(e.h3,{id:"internal-lifecycle-and-execution-flow",children:"Internal Lifecycle and Execution Flow"}),"\n",(0,s.jsx)(e.p,{children:"Langflow's engine manages:"}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Instantiation"}),": A component is created and internal structures are initialized."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Assigning Inputs"}),": Values from the visual editor or connections are assigned to component fields."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Validation and Setup"}),": Optional hooks like ",(0,s.jsx)(e.code,{children:"_pre_run_setup"}),"."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Outputs Generation"}),": ",(0,s.jsx)(e.code,{children:"run()"})," or ",(0,s.jsx)(e.code,{children:"build_results()"})," triggers output methods."]}),"\n"]}),"\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.strong,{children:"Optional Hooks"}),":"]}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.code,{children:"initialize_data"})," or ",(0,s.jsx)(e.code,{children:"_pre_run_setup"})," can run setup logic before the component's main execution."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.code,{children:"__call__"}),", ",(0,s.jsx)(e.code,{children:"run()"}),", or ",(0,s.jsx)(e.code,{children:"_run()"})," can be overridden to customize how the component is called or to define custom execution logic."]}),"\n"]}),"\n",(0,s.jsx)(e.h3,{id:"inputs-and-outputs",children:"Inputs and outputs"}),"\n",(0,s.jsx)(e.p,{children:"Custom component inputs are defined with properties like:"}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.code,{children:"name"}),", ",(0,s.jsx)(e.code,{children:"display_name"})]}),"\n",(0,s.jsxs)(e.li,{children:["Optional: ",(0,s.jsx)(e.code,{children:"info"}),", ",(0,s.jsx)(e.code,{children:"value"}),", ",(0,s.jsx)(e.code,{children:"advanced"}),", ",(0,s.jsx)(e.code,{children:"is_list"}),", ",(0,s.jsx)(e.code,{children:"tool_mode"}),", ",(0,s.jsx)(e.code,{children:"real_time_refresh"})]}),"\n"]}),"\n",(0,s.jsx)(e.p,{children:"For example:"}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.code,{children:"StrInput"}),": simple text input."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.code,{children:"DropdownInput"}),": selectable options."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.code,{children:"HandleInput"}),": specialized connections."]}),"\n"]}),"\n",(0,s.jsxs)(e.p,{children:["Custom component ",(0,s.jsx)(e.code,{children:"Output"})," properties define:"]}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.code,{children:"name"}),", ",(0,s.jsx)(e.code,{children:"display_name"}),", ",(0,s.jsx)(e.code,{children:"method"})]}),"\n",(0,s.jsxs)(e.li,{children:["Optional: ",(0,s.jsx)(e.code,{children:"info"})]}),"\n"]}),"\n",(0,s.jsxs)(e.p,{children:["For more information, see ",(0,s.jsx)(e.a,{href:"/components-custom-components#custom-component-inputs-and-outputs",children:"Custom component inputs and outputs"}),"."]}),"\n",(0,s.jsx)(e.h3,{id:"associated-methods",children:"Associated Methods"}),"\n",(0,s.jsx)(e.p,{children:"Each output is linked to a method:"}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsx)(e.li,{children:"The output method name must match the method name."}),"\n",(0,s.jsx)(e.li,{children:"The method typically returns objects like Message, Data, or DataFrame."}),"\n",(0,s.jsxs)(e.li,{children:["The method can use inputs with ",(0,s.jsx)(e.code,{children:"self."}),"."]}),"\n"]}),"\n",(0,s.jsx)(e.p,{children:"For example:"}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"Output(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"File Contents"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"file_contents"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" method",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"read_file"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:")",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"#...",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:"def ",props:{style:{color:"#FF7B72"}}},{content:"read_file",props:{style:{color:"#D2A8FF"}}},{content:"(self) -> Data:",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" path ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:"self",props:{style:{color:"#79C0FF"}}},{content:".filename",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" with ",props:{style:{color:"#FF7B72"}}},{content:"open",props:{style:{color:"#79C0FF"}}},{content:"(path, ",props:{style:{color:"#C9D1D9"}}},{content:'"r"',props:{style:{color:"#A5D6FF"}}},{content:") ",props:{style:{color:"#C9D1D9"}}},{content:"as",props:{style:{color:"#FF7B72"}}},{content:" f:",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" content ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" f.read()",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" self",props:{style:{color:"#79C0FF"}}},{content:".status ",props:{style:{color:"#C9D1D9"}}},{content:"= f",props:{style:{color:"#FF7B72"}}},{content:'"Read ',props:{style:{color:"#A5D6FF"}}},{content:"{len",props:{style:{color:"#79C0FF"}}},{content:"(content)",props:{style:{color:"#C9D1D9"}}},{content:"}",props:{style:{color:"#79C0FF"}}},{content:" chars from ",props:{style:{color:"#A5D6FF"}}},{content:"{",props:{style:{color:"#79C0FF"}}},{content:"path",props:{style:{color:"#C9D1D9"}}},{content:"}",props:{style:{color:"#79C0FF"}}},{content:'"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" return",props:{style:{color:"#FF7B72"}}},{content:" Data(",props:{style:{color:"#C9D1D9"}}},{content:"data",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"{",props:{style:{color:"#C9D1D9"}}},{content:'"content"',props:{style:{color:"#A5D6FF"}}},{content:": content})",props:{style:{color:"#C9D1D9"}}}]}],lang:"python"},annotations:[]}]}),"\n",(0,s.jsx)(e.h3,{id:"components-with-multiple-outputs",children:"Components with multiple outputs"}),"\n",(0,s.jsx)(e.p,{children:"A component can define multiple outputs.\nEach output can have a different corresponding method.\nFor example:"}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"outputs ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" [",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" Output(",props:{style:{color:"#C9D1D9"}}},{content:"display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Processed Data"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"processed_data"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"method",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"process_data"',props:{style:{color:"#A5D6FF"}}},{content:"),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" Output(",props:{style:{color:"#C9D1D9"}}},{content:"display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Debug Info"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"debug_info"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"method",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"provide_debug_info"',props:{style:{color:"#A5D6FF"}}},{content:"),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"]",props:{style:{color:"#C9D1D9"}}}]}],lang:"python"},annotations:[]}]}),"\n",(0,s.jsxs)(e.h4,{id:"output-grouping-behavior-with-group_outputs",children:["Output Grouping Behavior with ",(0,s.jsx)(e.code,{children:"group_outputs"})]}),"\n",(0,s.jsx)(e.p,{children:"By default, components in Langflow that produce multiple outputs only allow one output selection in the visual editor.\nThe component will have only one output port where the user can select the preferred output type."}),"\n",(0,s.jsxs)(e.p,{children:["This behavior is controlled by the ",(0,s.jsx)(e.code,{children:"group_outputs"})," parameter:"]}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:[(0,s.jsxs)(e.strong,{children:[(0,s.jsx)(e.code,{children:"group_outputs=False"})," (default)"]}),": When a component has more than one output and ",(0,s.jsx)(e.code,{children:"group_outputs"})," is ",(0,s.jsx)(e.code,{children:"false"})," or not set, the outputs are grouped in the visual editor, and the user must select one."]}),"\n",(0,s.jsx)(e.p,{children:"Use this option when the component is expected to return only one type of output when used in a flow."}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"group_outputs=True"})}),": All outputs are available simultaneously in the visual editor. The component has one output port for each output, and the user can connect zero or more outputs to other components."]}),"\n",(0,s.jsx)(e.p,{children:"Use this option when the component is expected to return multiple values that are used in parallel by downstream components or processes."}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(p.A,{children:[(0,s.jsxs)(i.A,{value:"false",label:"False or not set",default:!0,children:[(0,s.jsxs)(e.p,{children:["In this example, the visual editor provides a single output port, and the user can select one of the outputs.\nSince ",(0,s.jsx)(e.code,{children:"group_outputs=False"})," is the default behavior, it doesn't need to be explicitly set in the component, as shown in this example:"]}),(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"outputs ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" [",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" Output(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"structured_output"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Structured Output"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" method",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"build_structured_output"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" Output(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"dataframe_output"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"DataFrame Output"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" method",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"build_structured_dataframe"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"]",props:{style:{color:"#C9D1D9"}}}]}],lang:"python"},annotations:[]}]})]}),(0,s.jsxs)(i.A,{value:"true",label:"True",children:[(0,s.jsx)(e.p,{children:"In this example, all outputs are available simultaneously in the visual editor:"}),(0,s.jsxs)(e.ol,{start:"2",children:["\n",(0,s.jsx)(e.li,{children:(0,s.jsx)(e.code,{children:"group_outputs=True"})}),"\n"]}),(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"outputs ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" [",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" Output(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"true_result"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"True"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" method",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"true_response"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" group_outputs",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"True",props:{style:{color:"#79C0FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" Output(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"false_result"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"False"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" method",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"false_response"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" group_outputs",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"True",props:{style:{color:"#79C0FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"]",props:{style:{color:"#C9D1D9"}}}]}],lang:"python"},annotations:[]}]})]})]}),"\n",(0,s.jsx)(e.h3,{id:"common-internal-patterns",children:"Common internal patterns"}),"\n",(0,s.jsx)(e.h4,{id:"_pre_run_setup",children:(0,s.jsx)(e.code,{children:"_pre_run_setup()"})}),"\n",(0,s.jsx)(e.p,{children:"To initialize a custom component with counters set:"}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"def ",props:{style:{color:"#FF7B72"}}},{content:"_pre_run_setup",props:{style:{color:"#D2A8FF"}}},{content:"(self):",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" if not ",props:{style:{color:"#FF7B72"}}},{content:"hasattr",props:{style:{color:"#79C0FF"}}},{content:"(",props:{style:{color:"#C9D1D9"}}},{content:"self",props:{style:{color:"#79C0FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"_initialized"',props:{style:{color:"#A5D6FF"}}},{content:"):",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" self",props:{style:{color:"#79C0FF"}}},{content:"._initialized ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:"True",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" self",props:{style:{color:"#79C0FF"}}},{content:".iteration ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:"0",props:{style:{color:"#79C0FF"}}}]}],lang:"python"},annotations:[]}]}),"\n",(0,s.jsxs)(e.h4,{id:"override-run-or-_run",children:["Override ",(0,s.jsx)(e.code,{children:"run"})," or ",(0,s.jsx)(e.code,{children:"_run"})]}),"\n",(0,s.jsxs)(e.p,{children:["You can override ",(0,s.jsx)(e.code,{children:"async def _run(self): ..."})," to define custom execution logic, although the default behavior from the base class usually covers most cases."]}),"\n",(0,s.jsxs)(e.h4,{id:"store-data-in-selfctx",children:["Store data in ",(0,s.jsx)(e.code,{children:"self.ctx"})]}),"\n",(0,s.jsxs)(e.p,{children:["Use ",(0,s.jsx)(e.code,{children:"self.ctx"})," as a shared storage for data or counters across the component's execution flow:"]}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"def ",props:{style:{color:"#FF7B72"}}},{content:"some_method",props:{style:{color:"#D2A8FF"}}},{content:"(self):",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" count ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:"self",props:{style:{color:"#79C0FF"}}},{content:".ctx.get(",props:{style:{color:"#C9D1D9"}}},{content:'"my_count"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"0",props:{style:{color:"#79C0FF"}}},{content:")",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" self",props:{style:{color:"#79C0FF"}}},{content:".ctx[",props:{style:{color:"#C9D1D9"}}},{content:'"my_count"',props:{style:{color:"#A5D6FF"}}},{content:"] ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" count ",props:{style:{color:"#C9D1D9"}}},{content:"+ ",props:{style:{color:"#FF7B72"}}},{content:"1",props:{style:{color:"#79C0FF"}}}]}],lang:"python"},annotations:[]}]}),"\n",(0,s.jsx)(e.h2,{id:"directory-structure-requirements",children:"Directory structure requirements"}),"\n",(0,s.jsxs)(e.p,{children:["By default, Langflow looks for custom components in the ",(0,s.jsx)(e.code,{children:"/components"})," directory."]}),"\n",(0,s.jsxs)(e.p,{children:["If you're creating custom components in a different location using the ",(0,s.jsx)(e.code,{children:"LANGFLOW_COMPONENTS_PATH"})," ",(0,s.jsx)(e.a,{href:"/environment-variables",children:"environment variable"}),", components must be organized in a specific directory structure to be properly loaded and displayed in the visual editor:"]}),"\n",(0,s.jsxs)(e.p,{children:["Each category directory ",(0,s.jsx)(e.strong,{children:"must"})," contain an ",(0,s.jsx)(e.code,{children:"__init__.py"})," file for Langflow to properly recognize and load the components.\nThis is a Python package requirement that ensures the directory is treated as a module."]}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"/your/custom/components/path/ # Base directory set by LANGFLOW_COMPONENTS_PATH",props:{}}]},{tokens:[{content:" \u2514\u2500\u2500 category_name/ # Required category subfolder that determines menu name",props:{}}]},{tokens:[{content:" \u251c\u2500\u2500 __init__.py # Required",props:{}}]},{tokens:[{content:" \u2514\u2500\u2500 custom_component.py # Component file",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,s.jsx)(e.p,{children:"Components must be placed inside category folders, not directly in the base directory."}),"\n",(0,s.jsxs)(e.p,{children:["The category folder name determines where the component appears in the Langflow ",(0,s.jsx)(c.A,{name:"Component","aria-hidden":"true"})," ",(0,s.jsx)(e.strong,{children:"Core components"})," menu.\nFor example, to add a component to the ",(0,s.jsx)(e.strong,{children:"Helpers"})," category, place it in the ",(0,s.jsx)(e.code,{children:"helpers"})," subfolder:"]}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"/app/custom_components/ # LANGFLOW_COMPONENTS_PATH",props:{}}]},{tokens:[{content:' \u2514\u2500\u2500 helpers/ # Displayed within the "Helpers" category',props:{}}]},{tokens:[{content:" \u251c\u2500\u2500 __init__.py # Required",props:{}}]},{tokens:[{content:" \u2514\u2500\u2500 custom_component.py # Your component",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,s.jsx)(e.p,{children:"You can have multiple category folders to organize components into different categories:"}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"/app/custom_components/",props:{}}]},{tokens:[{content:" \u251c\u2500\u2500 helpers/",props:{}}]},{tokens:[{content:" \u2502 \u251c\u2500\u2500 __init__.py",props:{}}]},{tokens:[{content:" \u2502 \u2514\u2500\u2500 helper_component.py",props:{}}]},{tokens:[{content:" \u2514\u2500\u2500 tools/",props:{}}]},{tokens:[{content:" \u251c\u2500\u2500 __init__.py",props:{}}]},{tokens:[{content:" \u2514\u2500\u2500 tool_component.py",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,s.jsx)(e.p,{children:"This folder structure is required for Langflow to properly discover and load your custom components. Components placed directly in the base directory aren't loaded."}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"/app/custom_components/ # LANGFLOW_COMPONENTS_PATH",props:{}}]},{tokens:[{content:" \u2514\u2500\u2500 custom_component.py # Won't be loaded - missing category folder!",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,s.jsx)(e.h2,{id:"custom-component-inputs-and-outputs",children:"Custom component inputs and outputs"}),"\n",(0,s.jsx)(e.p,{children:"Inputs and outputs define how data flows through the component, how it appears in the visual editor, and how connections to other components are validated."}),"\n",(0,s.jsx)(e.h3,{id:"inputs",children:"Inputs"}),"\n",(0,s.jsxs)(e.p,{children:["Inputs are defined in a class-level ",(0,s.jsx)(e.code,{children:"inputs"})," list. When Langflow loads the component, it uses this list to render component fields and ",(0,s.jsx)(e.a,{href:"/concepts-components#component-ports",children:"ports"})," in the visual editor. Users or other components provide values or connections to fill these inputs."]}),"\n",(0,s.jsxs)(e.p,{children:["An input is usually an instance of a class from ",(0,s.jsx)(e.code,{children:"langflow.io"})," (such as ",(0,s.jsx)(e.code,{children:"StrInput"}),", ",(0,s.jsx)(e.code,{children:"DataInput"}),", or ",(0,s.jsx)(e.code,{children:"MessageTextInput"}),"). The most common constructor parameters are:"]}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"name"})}),": The internal variable name, accessed with ",(0,s.jsx)(e.code,{children:"self."}),"."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"display_name"})}),": The label shown to users in the visual editor."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"info"})})," ",(0,s.jsx)(e.em,{children:"(optional)"}),": A tooltip or short description."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"value"})})," ",(0,s.jsx)(e.em,{children:"(optional)"}),": The default value."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"advanced"})})," ",(0,s.jsx)(e.em,{children:"(optional)"}),": If ",(0,s.jsx)(e.code,{children:"true"}),', moves the field into the "Advanced" section.']}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"required"})})," ",(0,s.jsx)(e.em,{children:"(optional)"}),": If ",(0,s.jsx)(e.code,{children:"true"}),", forces the user to provide a value."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"is_list"})})," ",(0,s.jsx)(e.em,{children:"(optional)"}),": If ",(0,s.jsx)(e.code,{children:"true"}),", allows multiple values."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"input_types"})})," ",(0,s.jsx)(e.em,{children:"(optional)"}),": Restricts allowed connection types (e.g., ",(0,s.jsx)(e.code,{children:'["Data"]'}),", ",(0,s.jsx)(e.code,{children:'["LanguageModel"]'}),")."]}),"\n"]}),"\n",(0,s.jsx)(e.p,{children:"Here are the most commonly used input classes and their typical usage."}),"\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.strong,{children:"Text Inputs"}),": For simple text entries."]}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"StrInput"})})," creates a single-line text field."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"MultilineInput"})})," creates a multi-line text area."]}),"\n"]}),"\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.strong,{children:"Numeric and Boolean Inputs"}),": Ensures users can only enter valid numeric or Boolean data."]}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"BoolInput"})}),", ",(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"IntInput"})}),", and ",(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"FloatInput"})})," provide fields for Boolean, integer, and float values, ensuring type consistency."]}),"\n"]}),"\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.strong,{children:"Dropdowns"}),": For selecting from predefined options, useful for modes or levels."]}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsx)(e.li,{children:(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"DropdownInput"})})}),"\n"]}),"\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.strong,{children:"Secrets"}),": A specialized input for sensitive data, ensuring input is hidden in the visual editor."]}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"SecretStrInput"})})," for API keys and passwords."]}),"\n"]}),"\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.strong,{children:"Specialized Data Inputs"}),": Ensures type-checking and color-coded connections in the visual editor."]}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"DataInput"})})," expects a ",(0,s.jsx)(e.code,{children:"Data"})," object (typically with ",(0,s.jsx)(e.code,{children:".data"})," and optional ",(0,s.jsx)(e.code,{children:".text"}),")."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"MessageInput"})})," expects a ",(0,s.jsx)(e.code,{children:"Message"})," object, used in chat or agent flows."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"MessageTextInput"})})," simplifies access to the ",(0,s.jsx)(e.code,{children:".text"})," field of a ",(0,s.jsx)(e.code,{children:"Message"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.strong,{children:"Handle-Based Inputs"}),": Used to connect outputs of specific types, ensuring correct pipeline connections."]}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsx)(e.li,{children:(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"HandleInput"})})}),"\n"]}),"\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.strong,{children:"File Uploads"}),": Allows users to upload files directly through the visual editor or receive file paths from other components."]}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsx)(e.li,{children:(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"FileInput"})})}),"\n"]}),"\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.strong,{children:"Lists"}),": Set ",(0,s.jsx)(e.code,{children:"is_list=True"})," to accept multiple values, ideal for batch or grouped operations."]}),"\n",(0,s.jsxs)(e.p,{children:["This example defines three inputs: a text field (",(0,s.jsx)(e.code,{children:"StrInput"}),"), a Boolean toggle (",(0,s.jsx)(e.code,{children:"BoolInput"}),"), and a dropdown selection (",(0,s.jsx)(e.code,{children:"DropdownInput"}),")."]}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"from",props:{style:{color:"#FF7B72"}}},{content:" langflow.io ",props:{style:{color:"#C9D1D9"}}},{content:"import",props:{style:{color:"#FF7B72"}}},{content:" StrInput, BoolInput, DropdownInput",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"inputs ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" [",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" StrInput(",props:{style:{color:"#C9D1D9"}}},{content:"name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"title"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Title"',props:{style:{color:"#A5D6FF"}}},{content:"),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" BoolInput(",props:{style:{color:"#C9D1D9"}}},{content:"name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"enabled"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Enabled"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"value",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"True",props:{style:{color:"#79C0FF"}}},{content:"),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" DropdownInput(",props:{style:{color:"#C9D1D9"}}},{content:"name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"mode"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Mode"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"options",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"[",props:{style:{color:"#C9D1D9"}}},{content:'"Fast"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"Safe"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"Experimental"',props:{style:{color:"#A5D6FF"}}},{content:"], ",props:{style:{color:"#C9D1D9"}}},{content:"value",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Safe"',props:{style:{color:"#A5D6FF"}}},{content:")",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"]",props:{style:{color:"#C9D1D9"}}}]}],lang:"python"},annotations:[]}]}),"\n",(0,s.jsx)(e.h3,{id:"outputs",children:"Outputs"}),"\n",(0,s.jsxs)(e.p,{children:["Outputs are defined in a class-level ",(0,s.jsx)(e.code,{children:"outputs"})," list. When Langflow renders a component, each output becomes a connector point in the visual editor. When you connect something to an output, Langflow automatically calls the corresponding method and passes the returned object to the next component."]}),"\n",(0,s.jsxs)(e.p,{children:["An output is usually an instance of ",(0,s.jsx)(e.code,{children:"Output"})," from ",(0,s.jsx)(e.code,{children:"langflow.io"}),", with common parameters:"]}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"name"})}),": The internal variable name."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"display_name"})}),": The label shown in the visual editor."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"method"})}),": The name of the method called to produce the output."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"info"})})," ",(0,s.jsx)(e.em,{children:"(optional)"}),": Help text shown on hover."]}),"\n"]}),"\n",(0,s.jsxs)(e.p,{children:["The method must exist in the class, and it is recommended to annotate its return type for better type checking.\nYou can also set a ",(0,s.jsx)(e.code,{children:"self.status"})," message inside the method to show progress or logs."]}),"\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.strong,{children:"Common Return Types"}),":"]}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"Message"})}),": Structured chat messages."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"Data"})}),": Flexible object with ",(0,s.jsx)(e.code,{children:".data"})," and optional ",(0,s.jsx)(e.code,{children:".text"}),"."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"DataFrame"})}),": Pandas-based tables (",(0,s.jsx)(e.code,{children:"langflow.schema.DataFrame"}),")."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Primitive types"}),": ",(0,s.jsx)(e.code,{children:"str"}),", ",(0,s.jsx)(e.code,{children:"int"}),", ",(0,s.jsx)(e.code,{children:"bool"})," (not recommended if you need type/color consistency)."]}),"\n"]}),"\n",(0,s.jsxs)(e.p,{children:["In this example, the ",(0,s.jsx)(e.code,{children:"DataToDataFrame"})," component defines its output using the outputs list. The ",(0,s.jsx)(e.code,{children:"df_out"})," output is linked to the ",(0,s.jsx)(e.code,{children:"build_df"})," method, so when connected to another component (node), Langflow calls this method and passes its returned ",(0,s.jsx)(e.code,{children:"DataFrame"})," to the next node. This demonstrates how each output maps to a method that generates the actual output data."]}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"from",props:{style:{color:"#FF7B72"}}},{content:" langflow.custom ",props:{style:{color:"#C9D1D9"}}},{content:"import",props:{style:{color:"#FF7B72"}}},{content:" Component",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"from",props:{style:{color:"#FF7B72"}}},{content:" langflow.io ",props:{style:{color:"#C9D1D9"}}},{content:"import",props:{style:{color:"#FF7B72"}}},{content:" DataInput, Output",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"from",props:{style:{color:"#FF7B72"}}},{content:" langflow.schema ",props:{style:{color:"#C9D1D9"}}},{content:"import",props:{style:{color:"#FF7B72"}}},{content:" Data, DataFrame",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"class ",props:{style:{color:"#FF7B72"}}},{content:"DataToDataFrame",props:{style:{color:"#FFA657"}}},{content:"(",props:{style:{color:"#C9D1D9"}}},{content:"Component",props:{style:{color:"#79C0FF"}}},{content:"):",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"Data to DataFrame"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" description ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"Convert multiple Data objects into a DataFrame"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" icon ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"table"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" name ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"DataToDataFrame"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" inputs ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" [",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" DataInput(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"items"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Data Items"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" info",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"List of Data objects to convert"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" is_list",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"True",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" )",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ]",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" outputs ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" [",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" Output(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"df_out"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"DataFrame Output"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" method",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"build_df"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" )",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ]",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" def ",props:{style:{color:"#FF7B72"}}},{content:"build_df",props:{style:{color:"#D2A8FF"}}},{content:"(self) -> DataFrame:",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" rows ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" []",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" for",props:{style:{color:"#FF7B72"}}},{content:" item ",props:{style:{color:"#C9D1D9"}}},{content:"in ",props:{style:{color:"#FF7B72"}}},{content:"self",props:{style:{color:"#79C0FF"}}},{content:".items:",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" row_dict ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" item.data.copy() ",props:{style:{color:"#C9D1D9"}}},{content:"if",props:{style:{color:"#FF7B72"}}},{content:" item.data ",props:{style:{color:"#C9D1D9"}}},{content:"else",props:{style:{color:"#FF7B72"}}},{content:" {}",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" row_dict[",props:{style:{color:"#C9D1D9"}}},{content:'"text"',props:{style:{color:"#A5D6FF"}}},{content:"] ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" item.get_text() ",props:{style:{color:"#C9D1D9"}}},{content:"or ",props:{style:{color:"#FF7B72"}}},{content:'""',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" rows.append(row_dict)",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" df ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" DataFrame(rows)",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" self",props:{style:{color:"#79C0FF"}}},{content:".status ",props:{style:{color:"#C9D1D9"}}},{content:"= f",props:{style:{color:"#FF7B72"}}},{content:'"Built DataFrame with ',props:{style:{color:"#A5D6FF"}}},{content:"{len",props:{style:{color:"#79C0FF"}}},{content:"(rows)",props:{style:{color:"#C9D1D9"}}},{content:"}",props:{style:{color:"#79C0FF"}}},{content:' rows."',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" return",props:{style:{color:"#FF7B72"}}},{content:" df",props:{style:{color:"#C9D1D9"}}}]}],lang:"python"},annotations:[]}]}),"\n",(0,s.jsx)(e.h3,{id:"tool-mode",children:"Tool Mode"}),"\n",(0,s.jsxs)(e.p,{children:["Components that support ",(0,s.jsx)(e.strong,{children:"Tool Mode"})," can be used as standalone components (when ",(0,s.jsx)(e.em,{children:"not"})," in ",(0,s.jsx)(e.strong,{children:"Tool Mode"}),") or as tools for other components with a ",(0,s.jsx)(e.strong,{children:"Tools"})," input, such as ",(0,s.jsx)(e.strong,{children:"Agent"})," components."]}),"\n",(0,s.jsxs)(e.p,{children:["You can allow a custom component to support ",(0,s.jsx)(e.strong,{children:"Tool Mode"})," by setting ",(0,s.jsx)(e.code,{children:"tool_mode=True"}),":"]}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"inputs ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" [",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" MessageTextInput(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"message"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Mensage"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" info",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Enter the message that will be processed directly by the tool"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" tool_mode",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"True",props:{style:{color:"#79C0FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"]",props:{style:{color:"#C9D1D9"}}}]}],lang:"python"},annotations:[]}]}),"\n",(0,s.jsxs)(e.p,{children:["Langflow currently supports the following input types for ",(0,s.jsx)(e.strong,{children:"Tool Mode"}),":"]}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsx)(e.li,{children:(0,s.jsx)(e.code,{children:"DataInput"})}),"\n",(0,s.jsx)(e.li,{children:(0,s.jsx)(e.code,{children:"DataFrameInput"})}),"\n",(0,s.jsx)(e.li,{children:(0,s.jsx)(e.code,{children:"PromptInput"})}),"\n",(0,s.jsx)(e.li,{children:(0,s.jsx)(e.code,{children:"MessageTextInput"})}),"\n",(0,s.jsx)(e.li,{children:(0,s.jsx)(e.code,{children:"MultilineInput"})}),"\n",(0,s.jsx)(e.li,{children:(0,s.jsx)(e.code,{children:"DropdownInput"})}),"\n"]}),"\n",(0,s.jsx)(e.h2,{id:"typed-annotations",children:"Typed annotations"}),"\n",(0,s.jsxs)(e.p,{children:["In Langflow, ",(0,s.jsx)(e.strong,{children:"typed annotations"})," allow Langflow to visually guide users and maintain flow consistency."]}),"\n",(0,s.jsx)(e.p,{children:"Typed annotations provide:"}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Color-coding"}),": Outputs like ",(0,s.jsx)(e.code,{children:"-> Data"})," or ",(0,s.jsx)(e.code,{children:"-> Message"})," get distinct colors."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Validation"}),": Langflow blocks incompatible connections automatically."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Readability"}),": Developers can quickly understand data flow."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Development tools"}),": Better code suggestions and error checking in your code editor."]}),"\n"]}),"\n",(0,s.jsx)(e.h3,{id:"common-return-types",children:"Common Return Types"}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.code,{children:"Message"}),": For chat-style outputs. Connects to any of several ",(0,s.jsx)(e.code,{children:"Message"}),"-compatible inputs."]}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"def ",props:{style:{color:"#FF7B72"}}},{content:"produce_message",props:{style:{color:"#D2A8FF"}}},{content:"(self) -> Message:",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" return",props:{style:{color:"#FF7B72"}}},{content:" Message(",props:{style:{color:"#C9D1D9"}}},{content:"text",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Hello! from typed method!"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"sender",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"System"',props:{style:{color:"#A5D6FF"}}},{content:")",props:{style:{color:"#C9D1D9"}}}]}],lang:"python"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.code,{children:"Data"}),": For structured data like dicts or partial texts. Connects only to ",(0,s.jsx)(e.code,{children:"DataInput"})," (ports that accept ",(0,s.jsx)(e.code,{children:"Data"}),")."]}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"def ",props:{style:{color:"#FF7B72"}}},{content:"get_processed_data",props:{style:{color:"#D2A8FF"}}},{content:"(self) -> Data:",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" processed ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" {",props:{style:{color:"#C9D1D9"}}},{content:'"key1"',props:{style:{color:"#A5D6FF"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"value1"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"key2"',props:{style:{color:"#A5D6FF"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"123",props:{style:{color:"#79C0FF"}}},{content:"}",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" return",props:{style:{color:"#FF7B72"}}},{content:" Data(",props:{style:{color:"#C9D1D9"}}},{content:"data",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"processed)",props:{style:{color:"#C9D1D9"}}}]}],lang:"python"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.code,{children:"DataFrame"}),": For tabular data. Connects only to ",(0,s.jsx)(e.code,{children:"DataFrameInput"})," (ports that accept ",(0,s.jsx)(e.code,{children:"DataFrame"}),")."]}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"def ",props:{style:{color:"#FF7B72"}}},{content:"build_df",props:{style:{color:"#D2A8FF"}}},{content:"(self) -> DataFrame:",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" pdf ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" pd.DataFrame({",props:{style:{color:"#C9D1D9"}}},{content:'"A"',props:{style:{color:"#A5D6FF"}}},{content:": [",props:{style:{color:"#C9D1D9"}}},{content:"1",props:{style:{color:"#79C0FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"2",props:{style:{color:"#79C0FF"}}},{content:"], ",props:{style:{color:"#C9D1D9"}}},{content:'"B"',props:{style:{color:"#A5D6FF"}}},{content:": [",props:{style:{color:"#C9D1D9"}}},{content:"3",props:{style:{color:"#79C0FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"4",props:{style:{color:"#79C0FF"}}},{content:"]})",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" return",props:{style:{color:"#FF7B72"}}},{content:" DataFrame(pdf)",props:{style:{color:"#C9D1D9"}}}]}],lang:"python"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:["Primitive Types (",(0,s.jsx)(e.code,{children:"str"}),", ",(0,s.jsx)(e.code,{children:"int"}),", ",(0,s.jsx)(e.code,{children:"bool"}),"): Returning primitives is allowed but wrapping in ",(0,s.jsx)(e.code,{children:"Data"})," or ",(0,s.jsx)(e.code,{children:"Message"})," is recommended for better consistency in the visual editor."]}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"def ",props:{style:{color:"#FF7B72"}}},{content:"compute_sum",props:{style:{color:"#D2A8FF"}}},{content:"(self) -> ",props:{style:{color:"#C9D1D9"}}},{content:"int",props:{style:{color:"#79C0FF"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" return ",props:{style:{color:"#FF7B72"}}},{content:"sum",props:{style:{color:"#79C0FF"}}},{content:"(",props:{style:{color:"#C9D1D9"}}},{content:"self",props:{style:{color:"#79C0FF"}}},{content:".numbers)",props:{style:{color:"#C9D1D9"}}}]}],lang:"python"},annotations:[]}]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(e.h3,{id:"tips-for-typed-annotations",children:"Tips for typed annotations"}),"\n",(0,s.jsx)(e.p,{children:"When using typed annotations, consider the following best practices:"}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Always Annotate Outputs"}),": Specify return types like ",(0,s.jsx)(e.code,{children:"-> Data"}),", ",(0,s.jsx)(e.code,{children:"-> Message"}),", or ",(0,s.jsx)(e.code,{children:"-> DataFrame"})," to enable proper visual editor color-coding and validation."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Wrap Raw Data"}),": Use ",(0,s.jsx)(e.code,{children:"Data"}),", ",(0,s.jsx)(e.code,{children:"Message"}),", or ",(0,s.jsx)(e.code,{children:"DataFrame"})," wrappers instead of returning plain structures."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Use Primitives Carefully"}),": Direct ",(0,s.jsx)(e.code,{children:"str"})," or ",(0,s.jsx)(e.code,{children:"int"})," returns are fine for simple flows, but wrapping improves flexibility."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Annotate Helpers Too"}),": Even if internal, typing improves maintainability and clarity."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Handle Edge Cases"}),": Prefer returning structured ",(0,s.jsx)(e.code,{children:"Data"})," with error fields when needed."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Stay Consistent"}),": Use the same types across your components to make flows predictable and easier to build."]}),"\n"]}),"\n",(0,s.jsx)(e.h2,{id:"enable-dynamic-fields",children:"Enable dynamic fields"}),"\n",(0,s.jsxs)(e.p,{children:["In ",(0,s.jsx)(e.strong,{children:"Langflow"}),", dynamic fields allow inputs to change or appear based on user interactions. You can make an input dynamic by setting ",(0,s.jsx)(e.code,{children:"dynamic=True"}),".\nOptionally, setting ",(0,s.jsx)(e.code,{children:"real_time_refresh=True"})," triggers the ",(0,s.jsx)(e.code,{children:"update_build_config"})," method to adjust the input's visibility or properties in real time, creating a contextual visual editor experience that only exposes relevant fields based on the user's choices."]}),"\n",(0,s.jsxs)(e.p,{children:["In this example, the operator field triggers updates with ",(0,s.jsx)(e.code,{children:"real_time_refresh=True"}),".\nThe ",(0,s.jsx)(e.code,{children:"regex_pattern"})," field is initially hidden and controlled with ",(0,s.jsx)(e.code,{children:"dynamic=True"}),"."]}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"from",props:{style:{color:"#FF7B72"}}},{content:" langflow.io ",props:{style:{color:"#C9D1D9"}}},{content:"import",props:{style:{color:"#FF7B72"}}},{content:" DropdownInput, StrInput",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"class ",props:{style:{color:"#FF7B72"}}},{content:"RegexRouter",props:{style:{color:"#FFA657"}}},{content:"(",props:{style:{color:"#C9D1D9"}}},{content:"Component",props:{style:{color:"#79C0FF"}}},{content:"):",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"Regex Router"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" description ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"Demonstrates dynamic fields for regex input."',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" inputs ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" [",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" DropdownInput(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"operator"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Operator"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" options",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"[",props:{style:{color:"#C9D1D9"}}},{content:'"equals"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"contains"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"regex"',props:{style:{color:"#A5D6FF"}}},{content:"],",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" value",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"equals"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" real_time_refresh",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"True",props:{style:{color:"#79C0FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" StrInput(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"regex_pattern"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Regex Pattern"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" info",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"\"Used if operator='regex'\"",props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" dynamic",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"True",props:{style:{color:"#79C0FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" show",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"False",props:{style:{color:"#79C0FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ]",props:{style:{color:"#C9D1D9"}}}]}],lang:"python"},annotations:[]}]}),"\n",(0,s.jsxs)(e.h3,{id:"implement-update_build_config",children:["Implement ",(0,s.jsx)(e.code,{children:"update_build_config"})]}),"\n",(0,s.jsxs)(e.p,{children:["When a field with ",(0,s.jsx)(e.code,{children:"real_time_refresh=True"})," is modified, Langflow calls the ",(0,s.jsx)(e.code,{children:"update_build_config"})," method, passing the updated field name, value, and the component's configuration to dynamically adjust the visibility or properties of other fields based on user input."]}),"\n",(0,s.jsxs)(e.p,{children:["This example will show or hide the ",(0,s.jsx)(e.code,{children:"regex_pattern"})," field when the user selects a different operator."]}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"def ",props:{style:{color:"#FF7B72"}}},{content:"update_build_config",props:{style:{color:"#D2A8FF"}}},{content:"(self, build_config: ",props:{style:{color:"#C9D1D9"}}},{content:"dict",props:{style:{color:"#79C0FF"}}},{content:", field_value: ",props:{style:{color:"#C9D1D9"}}},{content:"str",props:{style:{color:"#79C0FF"}}},{content:", field_name: ",props:{style:{color:"#C9D1D9"}}},{content:"str ",props:{style:{color:"#79C0FF"}}},{content:"| ",props:{style:{color:"#FF7B72"}}},{content:"None ",props:{style:{color:"#79C0FF"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:"None",props:{style:{color:"#79C0FF"}}},{content:") -> ",props:{style:{color:"#C9D1D9"}}},{content:"dict",props:{style:{color:"#79C0FF"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" if",props:{style:{color:"#FF7B72"}}},{content:" field_name ",props:{style:{color:"#C9D1D9"}}},{content:"== ",props:{style:{color:"#FF7B72"}}},{content:'"operator"',props:{style:{color:"#A5D6FF"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" if",props:{style:{color:"#FF7B72"}}},{content:" field_value ",props:{style:{color:"#C9D1D9"}}},{content:"== ",props:{style:{color:"#FF7B72"}}},{content:'"regex"',props:{style:{color:"#A5D6FF"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" build_config[",props:{style:{color:"#C9D1D9"}}},{content:'"regex_pattern"',props:{style:{color:"#A5D6FF"}}},{content:"][",props:{style:{color:"#C9D1D9"}}},{content:'"show"',props:{style:{color:"#A5D6FF"}}},{content:"] ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:"True",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" else",props:{style:{color:"#FF7B72"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" build_config[",props:{style:{color:"#C9D1D9"}}},{content:'"regex_pattern"',props:{style:{color:"#A5D6FF"}}},{content:"][",props:{style:{color:"#C9D1D9"}}},{content:'"show"',props:{style:{color:"#A5D6FF"}}},{content:"] ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:"False",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" return",props:{style:{color:"#FF7B72"}}},{content:" build_config",props:{style:{color:"#C9D1D9"}}}]}],lang:"python"},annotations:[]}]}),"\n",(0,s.jsx)(e.h3,{id:"additional-dynamic-field-controls",children:"Additional Dynamic Field Controls"}),"\n",(0,s.jsxs)(e.p,{children:["You can also modify other properties within ",(0,s.jsx)(e.code,{children:"update_build_config"}),", such as:"]}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.code,{children:"required"}),": Set ",(0,s.jsx)(e.code,{children:'build_config["some_field"]["required"] = True/False'})]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.code,{children:"advanced"}),": Set ",(0,s.jsx)(e.code,{children:'build_config["some_field"]["advanced"] = True'})]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.code,{children:"options"}),": Modify dynamic dropdown options."]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(e.h3,{id:"tips-for-managing-dynamic-fields",children:"Tips for Managing Dynamic Fields"}),"\n",(0,s.jsx)(e.p,{children:"When working with dynamic fields, consider the following best practices to ensure a smooth user experience:"}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Minimize field changes"}),": Hide only fields that are truly irrelevant to avoid confusing users."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Test behavior"}),": Ensure that adding or removing fields doesn't accidentally erase user input."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Preserve data"}),": Use ",(0,s.jsx)(e.code,{children:'build_config["some_field"]["show"] = False'})," to hide fields without losing their values."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Clarify logic"}),": Add ",(0,s.jsx)(e.code,{children:"info"})," notes to explain why fields appear or disappear based on conditions."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Keep it manageable"}),": If the dynamic logic becomes too complex, consider breaking it into smaller components, unless it serves a clear purpose in a single node."]}),"\n"]}),"\n",(0,s.jsx)(e.h2,{id:"error-handling-and-logging",children:"Error handling and logging"}),"\n",(0,s.jsx)(e.p,{children:"In Langflow, robust error handling ensures that your components behave predictably, even when unexpected situations occur, such as invalid inputs, external API failures, or internal logic errors."}),"\n",(0,s.jsx)(e.h3,{id:"error-handling-techniques",children:"Error handling techniques"}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.strong,{children:"Raise Exceptions"}),": If a critical error occurs, you can raise standard Python exceptions such as ",(0,s.jsx)(e.code,{children:"ValueError"}),", or specialized exceptions like ",(0,s.jsx)(e.code,{children:"ToolException"}),". Langflow will automatically catch these and display appropriate error messages in the visual editor, helping users quickly identify what went wrong."]}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"def ",props:{style:{color:"#FF7B72"}}},{content:"compute_result",props:{style:{color:"#D2A8FF"}}},{content:"(self) -> ",props:{style:{color:"#C9D1D9"}}},{content:"str",props:{style:{color:"#79C0FF"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" if not ",props:{style:{color:"#FF7B72"}}},{content:"self",props:{style:{color:"#79C0FF"}}},{content:".user_input:",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" raise ",props:{style:{color:"#FF7B72"}}},{content:"ValueError",props:{style:{color:"#79C0FF"}}},{content:"(",props:{style:{color:"#C9D1D9"}}},{content:'"No input provided."',props:{style:{color:"#A5D6FF"}}},{content:")",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" # ...",props:{style:{color:"#8B949E"}}}]}],lang:"python"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.strong,{children:"Return Structured Error Data"}),': Instead of stopping a flow abruptly, you can return a Data object containing an "error" field. This approach allows the flow to continue operating and enables downstream components to detect and handle the error gracefully.']}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"def ",props:{style:{color:"#FF7B72"}}},{content:"run_model",props:{style:{color:"#D2A8FF"}}},{content:"(self) -> Data:",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" try",props:{style:{color:"#FF7B72"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" # ...",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:" except ",props:{style:{color:"#FF7B72"}}},{content:"Exception ",props:{style:{color:"#79C0FF"}}},{content:"as",props:{style:{color:"#FF7B72"}}},{content:" e:",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" return",props:{style:{color:"#FF7B72"}}},{content:" Data(",props:{style:{color:"#C9D1D9"}}},{content:"data",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"{",props:{style:{color:"#C9D1D9"}}},{content:'"error"',props:{style:{color:"#A5D6FF"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"str",props:{style:{color:"#79C0FF"}}},{content:"(e)})",props:{style:{color:"#C9D1D9"}}}]}],lang:"python"},annotations:[]}]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(e.h3,{id:"improve-debugging-and-flow-management",children:"Improve debugging and flow management"}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:[(0,s.jsxs)(e.strong,{children:["Use ",(0,s.jsx)(e.code,{children:"self.status"})]}),": Each component has a status field where you can store short messages about the execution result\u2014such as success summaries, partial progress, or error notifications. These appear directly in the visual editor, making troubleshooting easier for users."]}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"def ",props:{style:{color:"#FF7B72"}}},{content:"parse_data",props:{style:{color:"#D2A8FF"}}},{content:"(self) -> Data:",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"# ...",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:"self",props:{style:{color:"#79C0FF"}}},{content:".status ",props:{style:{color:"#C9D1D9"}}},{content:"= f",props:{style:{color:"#FF7B72"}}},{content:'"Parsed ',props:{style:{color:"#A5D6FF"}}},{content:"{len",props:{style:{color:"#79C0FF"}}},{content:"(rows)",props:{style:{color:"#C9D1D9"}}},{content:"}",props:{style:{color:"#79C0FF"}}},{content:' rows successfully."',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"return",props:{style:{color:"#FF7B72"}}},{content:" Data(",props:{style:{color:"#C9D1D9"}}},{content:"data",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"{",props:{style:{color:"#C9D1D9"}}},{content:'"rows"',props:{style:{color:"#A5D6FF"}}},{content:": rows})",props:{style:{color:"#C9D1D9"}}}]}],lang:"python"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:[(0,s.jsxs)(e.strong,{children:["Stop specific outputs with ",(0,s.jsx)(e.code,{children:"self.stop(...)"})]}),": You can halt individual output paths when certain conditions fail, without affecting the entire component. This is especially useful when working with components that have multiple output branches."]}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"def ",props:{style:{color:"#FF7B72"}}},{content:"some_output",props:{style:{color:"#D2A8FF"}}},{content:"(self) -> Data:",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"if <",props:{style:{color:"#FF7B72"}}},{content:"some condition",props:{style:{color:"#C9D1D9"}}},{content:">",props:{style:{color:"#FF7B72"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" self",props:{style:{color:"#79C0FF"}}},{content:".stop(",props:{style:{color:"#C9D1D9"}}},{content:'"some_output"',props:{style:{color:"#A5D6FF"}}},{content:") ",props:{style:{color:"#C9D1D9"}}},{content:"# Tells Langflow no data flows",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:" return",props:{style:{color:"#FF7B72"}}},{content:" Data(",props:{style:{color:"#C9D1D9"}}},{content:"data",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"{",props:{style:{color:"#C9D1D9"}}},{content:'"error"',props:{style:{color:"#A5D6FF"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"Condition not met"',props:{style:{color:"#A5D6FF"}}},{content:"})",props:{style:{color:"#C9D1D9"}}}]}],lang:"python"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.strong,{children:"Log events"}),': You can log key execution details inside components. Logs are displayed in the "Logs" or "Events" section of the component\'s detail view and can be accessed later through the flow\'s debug panel or exported files, providing a clear trace of the component\'s behavior for easier debugging.']}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"def ",props:{style:{color:"#FF7B72"}}},{content:"process_file",props:{style:{color:"#D2A8FF"}}},{content:"(self, file_path: ",props:{style:{color:"#C9D1D9"}}},{content:"str",props:{style:{color:"#79C0FF"}}},{content:"):",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"self",props:{style:{color:"#79C0FF"}}},{content:".log(",props:{style:{color:"#C9D1D9"}}},{content:"f",props:{style:{color:"#FF7B72"}}},{content:'"Processing file ',props:{style:{color:"#A5D6FF"}}},{content:"{",props:{style:{color:"#79C0FF"}}},{content:"file_path",props:{style:{color:"#C9D1D9"}}},{content:"}",props:{style:{color:"#79C0FF"}}},{content:'"',props:{style:{color:"#A5D6FF"}}},{content:")",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"# ...",props:{style:{color:"#8B949E"}}}]}],lang:"python"},annotations:[]}]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(e.h3,{id:"tips-for-error-handling-and-logging",children:"Tips for error handling and logging"}),"\n",(0,s.jsx)(e.p,{children:"To build more reliable components, consider the following best practices:"}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Validate inputs early"}),": Catch missing or invalid inputs at the start to prevent broken logic."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsxs)(e.strong,{children:["Summarize with ",(0,s.jsx)(e.code,{children:"self.status"})]}),": Use short success or error summaries to help users understand results quickly."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Keep logs concise"}),": Focus on meaningful messages to avoid cluttering the visual editor."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Return structured errors"}),": When appropriate, return ",(0,s.jsx)(e.code,{children:'Data(data={"error": ...})'})," instead of raising exceptions to allow downstream handling."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Stop outputs selectively"}),": Only halt specific outputs with ",(0,s.jsx)(e.code,{children:"self.stop(...)"})," if necessary, to preserve correct flow behavior elsewhere."]}),"\n"]}),"\n",(0,s.jsx)(e.h2,{id:"contribute-custom-components-to-langflow",children:"Contribute custom components to Langflow"}),"\n",(0,s.jsxs)(e.p,{children:["See ",(0,s.jsx)(e.a,{href:"/contributing-components",children:"How to Contribute"})," to contribute your custom component to Langflow."]})]})}function m(o={}){const{wrapper:e}={...(0,r.R)(),...o.components};return e?(0,s.jsx)(e,{...o,children:(0,s.jsx)(D,{...o})}):D(o)}function x(o,e){throw new Error("Expected "+(e?"component":"object")+" `"+o+"` to be defined: you likely forgot to import, pass, or provide it.")}}}]); \ No newline at end of file diff --git a/assets/js/20177945.99afdbc3.js b/assets/js/20177945.99afdbc3.js deleted file mode 100644 index 7614ca073a..0000000000 --- a/assets/js/20177945.99afdbc3.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[8392],{11470:(o,e,t)=>{t.d(e,{A:()=>C});var n=t(96540),s=t(18215),r=t(23104),l=t(56347),c=t(205),p=t(57485),i=t(31682),a=t(70679);function d(o){return n.Children.toArray(o).filter(o=>"\n"!==o).map(o=>{if(!o||(0,n.isValidElement)(o)&&function(o){const{props:e}=o;return!!e&&"object"==typeof e&&"value"in e}(o))return o;throw new Error(`Docusaurus error: Bad child <${"string"==typeof o.type?o.type:o.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function u(o){const{values:e,children:t}=o;return(0,n.useMemo)(()=>{const o=e??function(o){return d(o).map(({props:{value:o,label:e,attributes:t,default:n}})=>({value:o,label:e,attributes:t,default:n}))}(t);return function(o){const e=(0,i.XI)(o,(o,e)=>o.value===e.value);if(e.length>0)throw new Error(`Docusaurus error: Duplicate values "${e.map(o=>o.value).join(", ")}" found in . Every value needs to be unique.`)}(o),o},[e,t])}function h({value:o,tabValues:e}){return e.some(e=>e.value===o)}function y({queryString:o=!1,groupId:e}){const t=(0,l.W6)(),s=function({queryString:o=!1,groupId:e}){if("string"==typeof o)return o;if(!1===o)return null;if(!0===o&&!e)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return e??null}({queryString:o,groupId:e});return[(0,p.aZ)(s),(0,n.useCallback)(o=>{if(!s)return;const e=new URLSearchParams(t.location.search);e.set(s,o),t.replace({...t.location,search:e.toString()})},[s,t])]}function F(o){const{defaultValue:e,queryString:t=!1,groupId:s}=o,r=u(o),[l,p]=(0,n.useState)(()=>function({defaultValue:o,tabValues:e}){if(0===e.length)throw new Error("Docusaurus error: the component requires at least one children component");if(o){if(!h({value:o,tabValues:e}))throw new Error(`Docusaurus error: The has a defaultValue "${o}" but none of its children has the corresponding value. Available values are: ${e.map(o=>o.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return o}const t=e.find(o=>o.default)??e[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:e,tabValues:r})),[i,d]=y({queryString:t,groupId:s}),[F,D]=function({groupId:o}){const e=function(o){return o?`docusaurus.tab.${o}`:null}(o),[t,s]=(0,a.Dv)(e);return[t,(0,n.useCallback)(o=>{e&&s.set(o)},[e,s])]}({groupId:s}),m=(()=>{const o=i??F;return h({value:o,tabValues:r})?o:null})();(0,c.A)(()=>{m&&p(m)},[m]);return{selectedValue:l,selectValue:(0,n.useCallback)(o=>{if(!h({value:o,tabValues:r}))throw new Error(`Can't select invalid tab value=${o}`);p(o),d(o),D(o)},[d,D,r]),tabValues:r}}var D=t(92303);const m={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var x=t(74848);function f({className:o,block:e,selectedValue:t,selectValue:n,tabValues:l}){const c=[],{blockElementScrollPositionUntilNextRender:p}=(0,r.a_)(),i=o=>{const e=o.currentTarget,s=c.indexOf(e),r=l[s].value;r!==t&&(p(e),n(r))},a=o=>{let e=null;switch(o.key){case"Enter":i(o);break;case"ArrowRight":{const t=c.indexOf(o.currentTarget)+1;e=c[t]??c[0];break}case"ArrowLeft":{const t=c.indexOf(o.currentTarget)-1;e=c[t]??c[c.length-1];break}}e?.focus()};return(0,x.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.A)("tabs",{"tabs--block":e},o),children:l.map(({value:o,label:e,attributes:n})=>(0,x.jsx)("li",{role:"tab",tabIndex:t===o?0:-1,"aria-selected":t===o,ref:o=>{c.push(o)},onKeyDown:a,onClick:i,...n,className:(0,s.A)("tabs__item",m.tabItem,n?.className,{"tabs__item--active":t===o}),children:e??o},o))})}function g({lazy:o,children:e,selectedValue:t}){const r=(Array.isArray(e)?e:[e]).filter(Boolean);if(o){const o=r.find(o=>o.props.value===t);return o?(0,n.cloneElement)(o,{className:(0,s.A)("margin-top--md",o.props.className)}):null}return(0,x.jsx)("div",{className:"margin-top--md",children:r.map((o,e)=>(0,n.cloneElement)(o,{key:e,hidden:o.props.value!==t}))})}function j(o){const e=F(o);return(0,x.jsxs)("div",{className:(0,s.A)("tabs-container",m.tabList),children:[(0,x.jsx)(f,{...e,...o}),(0,x.jsx)(g,{...e,...o})]})}function C(o){const e=(0,D.A)();return(0,x.jsx)(j,{...o,children:d(o.children)},String(e))}},17886:(o,e,t)=>{t.d(e,{A:()=>r});t(96540);var n=t(64058),s=t(74848);function r({name:o,...e}){const t=n[o];return t?(0,s.jsx)(t,{...e}):null}},19365:(o,e,t)=>{t.d(e,{A:()=>l});t(96540);var n=t(18215);const s={tabItem:"tabItem_Ymn6"};var r=t(74848);function l({children:o,hidden:e,className:t}){return(0,r.jsx)("div",{role:"tabpanel",className:(0,n.A)(s.tabItem,t),hidden:e,children:o})}},58950:(o,e,t)=>{t.r(e),t.d(e,{CH:()=>h,assets:()=>u,chCodeConfig:()=>y,contentTitle:()=>d,default:()=>m,frontMatter:()=>a,metadata:()=>n,toc:()=>F});const n=JSON.parse('{"id":"Components/components-custom-components","title":"Create custom Python components","description":"Custom components extend Langflow\'s functionality through Python classes that inherit from Component. This enables integration of new features, data manipulation, external services, and specialized tools.","source":"@site/docs/Components/components-custom-components.mdx","sourceDirName":"Components","slug":"/components-custom-components","permalink":"/components-custom-components","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Create custom Python components","slug":"/components-custom-components"},"sidebar":"docs","previous":{"title":"xAI","permalink":"/bundles-xai"},"next":{"title":"Get started with the Langflow API","permalink":"/api-reference-api-examples"}}');var s=t(74848),r=t(28453),l=t(24754),c=t(17886),p=t(11470),i=t(19365);const a={title:"Create custom Python components",slug:"/components-custom-components"},d=void 0,u={},h={annotations:l.hk,Code:l.Cy},y={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},F=[{value:"Class-level attributes",id:"class-level-attributes",level:2},{value:"Structure of a custom component",id:"structure-of-a-custom-component",level:3},{value:"Internal Lifecycle and Execution Flow",id:"internal-lifecycle-and-execution-flow",level:3},{value:"Inputs and outputs",id:"inputs-and-outputs",level:3},{value:"Associated Methods",id:"associated-methods",level:3},{value:"Components with multiple outputs",id:"components-with-multiple-outputs",level:3},{value:"Output Grouping Behavior with group_outputs",id:"output-grouping-behavior-with-group_outputs",level:4},{value:"Common internal patterns",id:"common-internal-patterns",level:3},{value:"_pre_run_setup()",id:"_pre_run_setup",level:4},{value:"Override run or _run",id:"override-run-or-_run",level:4},{value:"Store data in self.ctx",id:"store-data-in-selfctx",level:4},{value:"Directory structure requirements",id:"directory-structure-requirements",level:2},{value:"Custom component inputs and outputs",id:"custom-component-inputs-and-outputs",level:2},{value:"Inputs",id:"inputs",level:3},{value:"Outputs",id:"outputs",level:3},{value:"Tool Mode",id:"tool-mode",level:3},{value:"Typed annotations",id:"typed-annotations",level:2},{value:"Common Return Types",id:"common-return-types",level:3},{value:"Tips for typed annotations",id:"tips-for-typed-annotations",level:3},{value:"Enable dynamic fields",id:"enable-dynamic-fields",level:2},{value:"Implement update_build_config",id:"implement-update_build_config",level:3},{value:"Additional Dynamic Field Controls",id:"additional-dynamic-field-controls",level:3},{value:"Tips for Managing Dynamic Fields",id:"tips-for-managing-dynamic-fields",level:3},{value:"Error handling and logging",id:"error-handling-and-logging",level:2},{value:"Error handling techniques",id:"error-handling-techniques",level:3},{value:"Improve debugging and flow management",id:"improve-debugging-and-flow-management",level:3},{value:"Tips for error handling and logging",id:"tips-for-error-handling-and-logging",level:3},{value:"Contribute custom components to Langflow",id:"contribute-custom-components-to-langflow",level:2}];function D(o){const e={a:"a",code:"code",em:"em",h2:"h2",h3:"h3",h4:"h4",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,r.R)(),...o.components};return h||x("CH",!1),h.Code||x("CH.Code",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n","\n",(0,s.jsxs)(e.p,{children:["Custom components extend Langflow's functionality through Python classes that inherit from ",(0,s.jsx)(e.code,{children:"Component"}),". This enables integration of new features, data manipulation, external services, and specialized tools."]}),"\n",(0,s.jsx)(e.p,{children:'In Langflow\'s node-based environment, each node is a "component" that performs discrete functions. Custom components are Python classes which define:'}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Inputs"})," \u2014 Data or parameters your component requires."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Outputs"})," \u2014 Data your component provides to downstream nodes."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Logic"})," \u2014 How you process inputs to produce outputs."]}),"\n"]}),"\n",(0,s.jsx)(e.p,{children:"The benefits of creating custom components include unlimited extensibility, reusability, automatic field generation in the visual editor based on inputs, and type-safe connections between nodes."}),"\n",(0,s.jsx)(e.p,{children:"Create custom components for performing specialized tasks, calling APIs, or adding advanced logic."}),"\n",(0,s.jsx)(e.p,{children:"Custom components in Langflow are built upon:"}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:["The Python class that inherits from ",(0,s.jsx)(e.code,{children:"Component"}),"."]}),"\n",(0,s.jsx)(e.li,{children:"Class-level attributes that identify and describe the component."}),"\n",(0,s.jsx)(e.li,{children:"Input and output lists that determine data flow."}),"\n",(0,s.jsx)(e.li,{children:"Internal variables for logging and advanced logic."}),"\n"]}),"\n",(0,s.jsx)(e.h2,{id:"class-level-attributes",children:"Class-level attributes"}),"\n",(0,s.jsx)(e.p,{children:"Define these attributes to control a custom component's appearance and behavior:"}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"class ",props:{style:{color:"#FF7B72"}}},{content:"MyCsvReader",props:{style:{color:"#FFA657"}}},{content:"(",props:{style:{color:"#C9D1D9"}}},{content:"Component",props:{style:{color:"#79C0FF"}}},{content:"):",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"CSV Reader"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" description ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"Reads CSV files"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" icon ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"file-text"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" name ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"CSVReader"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" documentation ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"http://docs.example.com/csv_reader"',props:{style:{color:"#A5D6FF"}}}]}],lang:"python"},annotations:[]}]}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.code,{children:"display_name"}),": A user-friendly label shown in the visual editor."]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.code,{children:"description"}),": A brief summary shown in tooltips and printed below the component name when added to a flow."]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.code,{children:"icon"}),": A decorative icon from Langflow's icon library, printed next to the name."]}),"\n",(0,s.jsxs)(e.p,{children:["Langflow uses ",(0,s.jsx)(e.a,{href:"https://lucide.dev/icons",children:"Lucide"})," for icons. To assign an icon to your component, set the icon attribute to the name of a Lucide icon as a string, such as ",(0,s.jsx)(e.code,{children:'icon = "file-text"'}),". Langflow renders icons from the Lucide library automatically."]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.code,{children:"name"}),": A unique internal identifier, typically the same name as the folder containing your component code."]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.code,{children:"documentation"}),": An optional link to external documentation, such as API or product documentation."]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(e.h3,{id:"structure-of-a-custom-component",children:"Structure of a custom component"}),"\n",(0,s.jsx)(e.p,{children:"A Langflow custom component is more than a class with inputs and outputs. It includes an internal structure with optional lifecycle steps, output generation, front-end interaction, and logic organization."}),"\n",(0,s.jsx)(e.p,{children:"A basic component:"}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:["Inherits from ",(0,s.jsx)(e.code,{children:"langflow.custom.Component"}),"."]}),"\n",(0,s.jsxs)(e.li,{children:["Declares metadata like ",(0,s.jsx)(e.code,{children:"display_name"}),", ",(0,s.jsx)(e.code,{children:"description"}),", ",(0,s.jsx)(e.code,{children:"icon"}),", and more."]}),"\n",(0,s.jsxs)(e.li,{children:["Defines ",(0,s.jsx)(e.code,{children:"inputs"})," and ",(0,s.jsx)(e.code,{children:"outputs"})," lists."]}),"\n",(0,s.jsx)(e.li,{children:"Implements methods matching output specifications."}),"\n"]}),"\n",(0,s.jsx)(e.p,{children:"A minimal custom component skeleton contains the following:"}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"from",props:{style:{color:"#FF7B72"}}},{content:" langflow.custom ",props:{style:{color:"#C9D1D9"}}},{content:"import",props:{style:{color:"#FF7B72"}}},{content:" Component",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"from",props:{style:{color:"#FF7B72"}}},{content:" langflow.template ",props:{style:{color:"#C9D1D9"}}},{content:"import",props:{style:{color:"#FF7B72"}}},{content:" Output",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"class ",props:{style:{color:"#FF7B72"}}},{content:"MyComponent",props:{style:{color:"#FFA657"}}},{content:"(",props:{style:{color:"#C9D1D9"}}},{content:"Component",props:{style:{color:"#79C0FF"}}},{content:"):",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"My Component"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" description ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"A short summary."',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" icon ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"sparkles"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" name ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"MyComponent"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" inputs ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" []",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" outputs ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" []",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" def ",props:{style:{color:"#FF7B72"}}},{content:"some_output_method",props:{style:{color:"#D2A8FF"}}},{content:"(self):",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" return ",props:{style:{color:"#FF7B72"}}},{content:"...",props:{style:{color:"#79C0FF"}}}]}],lang:"python"},annotations:[]}]}),"\n",(0,s.jsx)(e.h3,{id:"internal-lifecycle-and-execution-flow",children:"Internal Lifecycle and Execution Flow"}),"\n",(0,s.jsx)(e.p,{children:"Langflow's engine manages:"}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Instantiation"}),": A component is created and internal structures are initialized."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Assigning Inputs"}),": Values from the visual editor or connections are assigned to component fields."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Validation and Setup"}),": Optional hooks like ",(0,s.jsx)(e.code,{children:"_pre_run_setup"}),"."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Outputs Generation"}),": ",(0,s.jsx)(e.code,{children:"run()"})," or ",(0,s.jsx)(e.code,{children:"build_results()"})," triggers output methods."]}),"\n"]}),"\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.strong,{children:"Optional Hooks"}),":"]}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.code,{children:"initialize_data"})," or ",(0,s.jsx)(e.code,{children:"_pre_run_setup"})," can run setup logic before the component's main execution."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.code,{children:"__call__"}),", ",(0,s.jsx)(e.code,{children:"run()"}),", or ",(0,s.jsx)(e.code,{children:"_run()"})," can be overridden to customize how the component is called or to define custom execution logic."]}),"\n"]}),"\n",(0,s.jsx)(e.h3,{id:"inputs-and-outputs",children:"Inputs and outputs"}),"\n",(0,s.jsx)(e.p,{children:"Custom component inputs are defined with properties like:"}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.code,{children:"name"}),", ",(0,s.jsx)(e.code,{children:"display_name"})]}),"\n",(0,s.jsxs)(e.li,{children:["Optional: ",(0,s.jsx)(e.code,{children:"info"}),", ",(0,s.jsx)(e.code,{children:"value"}),", ",(0,s.jsx)(e.code,{children:"advanced"}),", ",(0,s.jsx)(e.code,{children:"is_list"}),", ",(0,s.jsx)(e.code,{children:"tool_mode"}),", ",(0,s.jsx)(e.code,{children:"real_time_refresh"})]}),"\n"]}),"\n",(0,s.jsx)(e.p,{children:"For example:"}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.code,{children:"StrInput"}),": simple text input."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.code,{children:"DropdownInput"}),": selectable options."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.code,{children:"HandleInput"}),": specialized connections."]}),"\n"]}),"\n",(0,s.jsxs)(e.p,{children:["Custom component ",(0,s.jsx)(e.code,{children:"Output"})," properties define:"]}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.code,{children:"name"}),", ",(0,s.jsx)(e.code,{children:"display_name"}),", ",(0,s.jsx)(e.code,{children:"method"})]}),"\n",(0,s.jsxs)(e.li,{children:["Optional: ",(0,s.jsx)(e.code,{children:"info"})]}),"\n"]}),"\n",(0,s.jsxs)(e.p,{children:["For more information, see ",(0,s.jsx)(e.a,{href:"/components-custom-components#custom-component-inputs-and-outputs",children:"Custom component inputs and outputs"}),"."]}),"\n",(0,s.jsx)(e.h3,{id:"associated-methods",children:"Associated Methods"}),"\n",(0,s.jsx)(e.p,{children:"Each output is linked to a method:"}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsx)(e.li,{children:"The output method name must match the method name."}),"\n",(0,s.jsx)(e.li,{children:"The method typically returns objects like Message, Data, or DataFrame."}),"\n",(0,s.jsxs)(e.li,{children:["The method can use inputs with ",(0,s.jsx)(e.code,{children:"self."}),"."]}),"\n"]}),"\n",(0,s.jsx)(e.p,{children:"For example:"}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"Output(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"File Contents"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"file_contents"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" method",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"read_file"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:")",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"#...",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:"def ",props:{style:{color:"#FF7B72"}}},{content:"read_file",props:{style:{color:"#D2A8FF"}}},{content:"(self) -> Data:",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" path ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:"self",props:{style:{color:"#79C0FF"}}},{content:".filename",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" with ",props:{style:{color:"#FF7B72"}}},{content:"open",props:{style:{color:"#79C0FF"}}},{content:"(path, ",props:{style:{color:"#C9D1D9"}}},{content:'"r"',props:{style:{color:"#A5D6FF"}}},{content:") ",props:{style:{color:"#C9D1D9"}}},{content:"as",props:{style:{color:"#FF7B72"}}},{content:" f:",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" content ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" f.read()",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" self",props:{style:{color:"#79C0FF"}}},{content:".status ",props:{style:{color:"#C9D1D9"}}},{content:"= f",props:{style:{color:"#FF7B72"}}},{content:'"Read ',props:{style:{color:"#A5D6FF"}}},{content:"{len",props:{style:{color:"#79C0FF"}}},{content:"(content)",props:{style:{color:"#C9D1D9"}}},{content:"}",props:{style:{color:"#79C0FF"}}},{content:" chars from ",props:{style:{color:"#A5D6FF"}}},{content:"{",props:{style:{color:"#79C0FF"}}},{content:"path",props:{style:{color:"#C9D1D9"}}},{content:"}",props:{style:{color:"#79C0FF"}}},{content:'"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" return",props:{style:{color:"#FF7B72"}}},{content:" Data(",props:{style:{color:"#C9D1D9"}}},{content:"data",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"{",props:{style:{color:"#C9D1D9"}}},{content:'"content"',props:{style:{color:"#A5D6FF"}}},{content:": content})",props:{style:{color:"#C9D1D9"}}}]}],lang:"python"},annotations:[]}]}),"\n",(0,s.jsx)(e.h3,{id:"components-with-multiple-outputs",children:"Components with multiple outputs"}),"\n",(0,s.jsx)(e.p,{children:"A component can define multiple outputs.\nEach output can have a different corresponding method.\nFor example:"}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"outputs ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" [",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" Output(",props:{style:{color:"#C9D1D9"}}},{content:"display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Processed Data"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"processed_data"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"method",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"process_data"',props:{style:{color:"#A5D6FF"}}},{content:"),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" Output(",props:{style:{color:"#C9D1D9"}}},{content:"display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Debug Info"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"debug_info"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"method",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"provide_debug_info"',props:{style:{color:"#A5D6FF"}}},{content:"),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"]",props:{style:{color:"#C9D1D9"}}}]}],lang:"python"},annotations:[]}]}),"\n",(0,s.jsxs)(e.h4,{id:"output-grouping-behavior-with-group_outputs",children:["Output Grouping Behavior with ",(0,s.jsx)(e.code,{children:"group_outputs"})]}),"\n",(0,s.jsx)(e.p,{children:"By default, components in Langflow that produce multiple outputs only allow one output selection in the visual editor.\nThe component will have only one output port where the user can select the preferred output type."}),"\n",(0,s.jsxs)(e.p,{children:["This behavior is controlled by the ",(0,s.jsx)(e.code,{children:"group_outputs"})," parameter:"]}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:[(0,s.jsxs)(e.strong,{children:[(0,s.jsx)(e.code,{children:"group_outputs=False"})," (default)"]}),": When a component has more than one output and ",(0,s.jsx)(e.code,{children:"group_outputs"})," is false or not set, the outputs are grouped in the visual editor, and the user must select one."]}),"\n",(0,s.jsx)(e.p,{children:"Use this option when the component is expected to return only one type of output when used in a flow."}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"group_outputs=True"})}),": All outputs are available simultaneously in the visual editor. The component has one output port for each output, and the user can connect zero or more outputs to other components."]}),"\n",(0,s.jsx)(e.p,{children:"Use this option when the component is expected to return multiple values that are used in parallel by downstream components or processes."}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(p.A,{children:[(0,s.jsxs)(i.A,{value:"false",label:"False or not set",default:!0,children:[(0,s.jsxs)(e.p,{children:["In this example, the visual editor provides a single output port, and the user can select one of the outputs.\nSince ",(0,s.jsx)(e.code,{children:"group_outputs=False"})," is the default behavior, it doesn't need to be explicitly set in the component, as shown in this example:"]}),(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"outputs ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" [",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" Output(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"structured_output"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Structured Output"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" method",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"build_structured_output"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" Output(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"dataframe_output"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"DataFrame Output"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" method",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"build_structured_dataframe"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"]",props:{style:{color:"#C9D1D9"}}}]}],lang:"python"},annotations:[]}]})]}),(0,s.jsxs)(i.A,{value:"true",label:"True",children:[(0,s.jsx)(e.p,{children:"In this example, all outputs are available simultaneously in the visual editor:"}),(0,s.jsxs)(e.ol,{start:"2",children:["\n",(0,s.jsx)(e.li,{children:(0,s.jsx)(e.code,{children:"group_outputs=True"})}),"\n"]}),(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"outputs ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" [",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" Output(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"true_result"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"True"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" method",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"true_response"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" group_outputs",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"True",props:{style:{color:"#79C0FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" Output(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"false_result"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"False"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" method",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"false_response"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" group_outputs",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"True",props:{style:{color:"#79C0FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"]",props:{style:{color:"#C9D1D9"}}}]}],lang:"python"},annotations:[]}]})]})]}),"\n",(0,s.jsx)(e.h3,{id:"common-internal-patterns",children:"Common internal patterns"}),"\n",(0,s.jsx)(e.h4,{id:"_pre_run_setup",children:(0,s.jsx)(e.code,{children:"_pre_run_setup()"})}),"\n",(0,s.jsx)(e.p,{children:"To initialize a custom component with counters set:"}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"def ",props:{style:{color:"#FF7B72"}}},{content:"_pre_run_setup",props:{style:{color:"#D2A8FF"}}},{content:"(self):",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" if not ",props:{style:{color:"#FF7B72"}}},{content:"hasattr",props:{style:{color:"#79C0FF"}}},{content:"(",props:{style:{color:"#C9D1D9"}}},{content:"self",props:{style:{color:"#79C0FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"_initialized"',props:{style:{color:"#A5D6FF"}}},{content:"):",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" self",props:{style:{color:"#79C0FF"}}},{content:"._initialized ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:"True",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" self",props:{style:{color:"#79C0FF"}}},{content:".iteration ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:"0",props:{style:{color:"#79C0FF"}}}]}],lang:"python"},annotations:[]}]}),"\n",(0,s.jsxs)(e.h4,{id:"override-run-or-_run",children:["Override ",(0,s.jsx)(e.code,{children:"run"})," or ",(0,s.jsx)(e.code,{children:"_run"})]}),"\n",(0,s.jsxs)(e.p,{children:["You can override ",(0,s.jsx)(e.code,{children:"async def _run(self): ..."})," to define custom execution logic, although the default behavior from the base class usually covers most cases."]}),"\n",(0,s.jsxs)(e.h4,{id:"store-data-in-selfctx",children:["Store data in ",(0,s.jsx)(e.code,{children:"self.ctx"})]}),"\n",(0,s.jsxs)(e.p,{children:["Use ",(0,s.jsx)(e.code,{children:"self.ctx"})," as a shared storage for data or counters across the component's execution flow:"]}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"def ",props:{style:{color:"#FF7B72"}}},{content:"some_method",props:{style:{color:"#D2A8FF"}}},{content:"(self):",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" count ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:"self",props:{style:{color:"#79C0FF"}}},{content:".ctx.get(",props:{style:{color:"#C9D1D9"}}},{content:'"my_count"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"0",props:{style:{color:"#79C0FF"}}},{content:")",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" self",props:{style:{color:"#79C0FF"}}},{content:".ctx[",props:{style:{color:"#C9D1D9"}}},{content:'"my_count"',props:{style:{color:"#A5D6FF"}}},{content:"] ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" count ",props:{style:{color:"#C9D1D9"}}},{content:"+ ",props:{style:{color:"#FF7B72"}}},{content:"1",props:{style:{color:"#79C0FF"}}}]}],lang:"python"},annotations:[]}]}),"\n",(0,s.jsx)(e.h2,{id:"directory-structure-requirements",children:"Directory structure requirements"}),"\n",(0,s.jsxs)(e.p,{children:["By default, Langflow looks for custom components in the ",(0,s.jsx)(e.code,{children:"/components"})," directory."]}),"\n",(0,s.jsxs)(e.p,{children:["If you're creating custom components in a different location using the ",(0,s.jsx)(e.code,{children:"LANGFLOW_COMPONENTS_PATH"})," ",(0,s.jsx)(e.a,{href:"/environment-variables",children:"environment variable"}),", components must be organized in a specific directory structure to be properly loaded and displayed in the visual editor:"]}),"\n",(0,s.jsxs)(e.p,{children:["Each category directory ",(0,s.jsx)(e.strong,{children:"must"})," contain an ",(0,s.jsx)(e.code,{children:"__init__.py"})," file for Langflow to properly recognize and load the components.\nThis is a Python package requirement that ensures the directory is treated as a module."]}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"/your/custom/components/path/ # Base directory set by LANGFLOW_COMPONENTS_PATH",props:{}}]},{tokens:[{content:" \u2514\u2500\u2500 category_name/ # Required category subfolder that determines menu name",props:{}}]},{tokens:[{content:" \u251c\u2500\u2500 __init__.py # Required",props:{}}]},{tokens:[{content:" \u2514\u2500\u2500 custom_component.py # Component file",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,s.jsx)(e.p,{children:"Components must be placed inside category folders, not directly in the base directory."}),"\n",(0,s.jsxs)(e.p,{children:["The category folder name determines where the component appears in the Langflow ",(0,s.jsx)(c.A,{name:"Component","aria-hidden":"true"})," ",(0,s.jsx)(e.strong,{children:"Core components"})," menu.\nFor example, to add a component to the ",(0,s.jsx)(e.strong,{children:"Helpers"})," category, place it in the ",(0,s.jsx)(e.code,{children:"helpers"})," subfolder:"]}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"/app/custom_components/ # LANGFLOW_COMPONENTS_PATH",props:{}}]},{tokens:[{content:' \u2514\u2500\u2500 helpers/ # Displayed within the "Helpers" category',props:{}}]},{tokens:[{content:" \u251c\u2500\u2500 __init__.py # Required",props:{}}]},{tokens:[{content:" \u2514\u2500\u2500 custom_component.py # Your component",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,s.jsx)(e.p,{children:"You can have multiple category folders to organize components into different categories:"}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"/app/custom_components/",props:{}}]},{tokens:[{content:" \u251c\u2500\u2500 helpers/",props:{}}]},{tokens:[{content:" \u2502 \u251c\u2500\u2500 __init__.py",props:{}}]},{tokens:[{content:" \u2502 \u2514\u2500\u2500 helper_component.py",props:{}}]},{tokens:[{content:" \u2514\u2500\u2500 tools/",props:{}}]},{tokens:[{content:" \u251c\u2500\u2500 __init__.py",props:{}}]},{tokens:[{content:" \u2514\u2500\u2500 tool_component.py",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,s.jsx)(e.p,{children:"This folder structure is required for Langflow to properly discover and load your custom components. Components placed directly in the base directory aren't loaded."}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"/app/custom_components/ # LANGFLOW_COMPONENTS_PATH",props:{}}]},{tokens:[{content:" \u2514\u2500\u2500 custom_component.py # Won't be loaded - missing category folder!",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,s.jsx)(e.h2,{id:"custom-component-inputs-and-outputs",children:"Custom component inputs and outputs"}),"\n",(0,s.jsx)(e.p,{children:"Inputs and outputs define how data flows through the component, how it appears in the visual editor, and how connections to other components are validated."}),"\n",(0,s.jsx)(e.h3,{id:"inputs",children:"Inputs"}),"\n",(0,s.jsxs)(e.p,{children:["Inputs are defined in a class-level ",(0,s.jsx)(e.code,{children:"inputs"})," list. When Langflow loads the component, it uses this list to render component fields and ",(0,s.jsx)(e.a,{href:"/concepts-components#component-ports",children:"ports"})," in the visual editor. Users or other components provide values or connections to fill these inputs."]}),"\n",(0,s.jsxs)(e.p,{children:["An input is usually an instance of a class from ",(0,s.jsx)(e.code,{children:"langflow.io"})," (such as ",(0,s.jsx)(e.code,{children:"StrInput"}),", ",(0,s.jsx)(e.code,{children:"DataInput"}),", or ",(0,s.jsx)(e.code,{children:"MessageTextInput"}),"). The most common constructor parameters are:"]}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"name"})}),": The internal variable name, accessed with ",(0,s.jsx)(e.code,{children:"self."}),"."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"display_name"})}),": The label shown to users in the visual editor."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"info"})})," ",(0,s.jsx)(e.em,{children:"(optional)"}),": A tooltip or short description."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"value"})})," ",(0,s.jsx)(e.em,{children:"(optional)"}),": The default value."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"advanced"})})," ",(0,s.jsx)(e.em,{children:"(optional)"}),': If true, moves the field into the "Advanced" section.']}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"required"})})," ",(0,s.jsx)(e.em,{children:"(optional)"}),": If true, forces the user to provide a value."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"is_list"})})," ",(0,s.jsx)(e.em,{children:"(optional)"}),": If true, allows multiple values."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"input_types"})})," ",(0,s.jsx)(e.em,{children:"(optional)"}),": Restricts allowed connection types (e.g., ",(0,s.jsx)(e.code,{children:'["Data"]'}),", ",(0,s.jsx)(e.code,{children:'["LanguageModel"]'}),")."]}),"\n"]}),"\n",(0,s.jsx)(e.p,{children:"Here are the most commonly used input classes and their typical usage."}),"\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.strong,{children:"Text Inputs"}),": For simple text entries."]}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"StrInput"})})," creates a single-line text field."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"MultilineInput"})})," creates a multi-line text area."]}),"\n"]}),"\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.strong,{children:"Numeric and Boolean Inputs"}),": Ensures users can only enter valid numeric or Boolean data."]}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"BoolInput"})}),", ",(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"IntInput"})}),", and ",(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"FloatInput"})})," provide fields for Boolean, integer, and float values, ensuring type consistency."]}),"\n"]}),"\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.strong,{children:"Dropdowns"}),": For selecting from predefined options, useful for modes or levels."]}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsx)(e.li,{children:(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"DropdownInput"})})}),"\n"]}),"\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.strong,{children:"Secrets"}),": A specialized input for sensitive data, ensuring input is hidden in the visual editor."]}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"SecretStrInput"})})," for API keys and passwords."]}),"\n"]}),"\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.strong,{children:"Specialized Data Inputs"}),": Ensures type-checking and color-coded connections in the visual editor."]}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"DataInput"})})," expects a ",(0,s.jsx)(e.code,{children:"Data"})," object (typically with ",(0,s.jsx)(e.code,{children:".data"})," and optional ",(0,s.jsx)(e.code,{children:".text"}),")."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"MessageInput"})})," expects a ",(0,s.jsx)(e.code,{children:"Message"})," object, used in chat or agent flows."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"MessageTextInput"})})," simplifies access to the ",(0,s.jsx)(e.code,{children:".text"})," field of a ",(0,s.jsx)(e.code,{children:"Message"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.strong,{children:"Handle-Based Inputs"}),": Used to connect outputs of specific types, ensuring correct pipeline connections."]}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsx)(e.li,{children:(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"HandleInput"})})}),"\n"]}),"\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.strong,{children:"File Uploads"}),": Allows users to upload files directly through the visual editor or receive file paths from other components."]}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsx)(e.li,{children:(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"FileInput"})})}),"\n"]}),"\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.strong,{children:"Lists"}),": Set ",(0,s.jsx)(e.code,{children:"is_list=True"})," to accept multiple values, ideal for batch or grouped operations."]}),"\n",(0,s.jsxs)(e.p,{children:["This example defines three inputs: a text field (",(0,s.jsx)(e.code,{children:"StrInput"}),"), a Boolean toggle (",(0,s.jsx)(e.code,{children:"BoolInput"}),"), and a dropdown selection (",(0,s.jsx)(e.code,{children:"DropdownInput"}),")."]}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"from",props:{style:{color:"#FF7B72"}}},{content:" langflow.io ",props:{style:{color:"#C9D1D9"}}},{content:"import",props:{style:{color:"#FF7B72"}}},{content:" StrInput, BoolInput, DropdownInput",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"inputs ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" [",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" StrInput(",props:{style:{color:"#C9D1D9"}}},{content:"name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"title"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Title"',props:{style:{color:"#A5D6FF"}}},{content:"),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" BoolInput(",props:{style:{color:"#C9D1D9"}}},{content:"name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"enabled"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Enabled"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"value",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"True",props:{style:{color:"#79C0FF"}}},{content:"),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" DropdownInput(",props:{style:{color:"#C9D1D9"}}},{content:"name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"mode"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Mode"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"options",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"[",props:{style:{color:"#C9D1D9"}}},{content:'"Fast"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"Safe"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"Experimental"',props:{style:{color:"#A5D6FF"}}},{content:"], ",props:{style:{color:"#C9D1D9"}}},{content:"value",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Safe"',props:{style:{color:"#A5D6FF"}}},{content:")",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"]",props:{style:{color:"#C9D1D9"}}}]}],lang:"python"},annotations:[]}]}),"\n",(0,s.jsx)(e.h3,{id:"outputs",children:"Outputs"}),"\n",(0,s.jsxs)(e.p,{children:["Outputs are defined in a class-level ",(0,s.jsx)(e.code,{children:"outputs"})," list. When Langflow renders a component, each output becomes a connector point in the visual editor. When you connect something to an output, Langflow automatically calls the corresponding method and passes the returned object to the next component."]}),"\n",(0,s.jsxs)(e.p,{children:["An output is usually an instance of ",(0,s.jsx)(e.code,{children:"Output"})," from ",(0,s.jsx)(e.code,{children:"langflow.io"}),", with common parameters:"]}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"name"})}),": The internal variable name."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"display_name"})}),": The label shown in the visual editor."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"method"})}),": The name of the method called to produce the output."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"info"})})," ",(0,s.jsx)(e.em,{children:"(optional)"}),": Help text shown on hover."]}),"\n"]}),"\n",(0,s.jsxs)(e.p,{children:["The method must exist in the class, and it is recommended to annotate its return type for better type checking.\nYou can also set a ",(0,s.jsx)(e.code,{children:"self.status"})," message inside the method to show progress or logs."]}),"\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.strong,{children:"Common Return Types"}),":"]}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"Message"})}),": Structured chat messages."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"Data"})}),": Flexible object with ",(0,s.jsx)(e.code,{children:".data"})," and optional ",(0,s.jsx)(e.code,{children:".text"}),"."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:(0,s.jsx)(e.code,{children:"DataFrame"})}),": Pandas-based tables (",(0,s.jsx)(e.code,{children:"langflow.schema.DataFrame"}),")."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Primitive types"}),": ",(0,s.jsx)(e.code,{children:"str"}),", ",(0,s.jsx)(e.code,{children:"int"}),", ",(0,s.jsx)(e.code,{children:"bool"})," (not recommended if you need type/color consistency)."]}),"\n"]}),"\n",(0,s.jsxs)(e.p,{children:["In this example, the ",(0,s.jsx)(e.code,{children:"DataToDataFrame"})," component defines its output using the outputs list. The ",(0,s.jsx)(e.code,{children:"df_out"})," output is linked to the ",(0,s.jsx)(e.code,{children:"build_df"})," method, so when connected to another component (node), Langflow calls this method and passes its returned ",(0,s.jsx)(e.code,{children:"DataFrame"})," to the next node. This demonstrates how each output maps to a method that generates the actual output data."]}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"from",props:{style:{color:"#FF7B72"}}},{content:" langflow.custom ",props:{style:{color:"#C9D1D9"}}},{content:"import",props:{style:{color:"#FF7B72"}}},{content:" Component",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"from",props:{style:{color:"#FF7B72"}}},{content:" langflow.io ",props:{style:{color:"#C9D1D9"}}},{content:"import",props:{style:{color:"#FF7B72"}}},{content:" DataInput, Output",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"from",props:{style:{color:"#FF7B72"}}},{content:" langflow.schema ",props:{style:{color:"#C9D1D9"}}},{content:"import",props:{style:{color:"#FF7B72"}}},{content:" Data, DataFrame",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"class ",props:{style:{color:"#FF7B72"}}},{content:"DataToDataFrame",props:{style:{color:"#FFA657"}}},{content:"(",props:{style:{color:"#C9D1D9"}}},{content:"Component",props:{style:{color:"#79C0FF"}}},{content:"):",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"Data to DataFrame"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" description ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"Convert multiple Data objects into a DataFrame"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" icon ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"table"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" name ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"DataToDataFrame"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" inputs ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" [",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" DataInput(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"items"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Data Items"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" info",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"List of Data objects to convert"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" is_list",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"True",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" )",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ]",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" outputs ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" [",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" Output(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"df_out"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"DataFrame Output"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" method",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"build_df"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" )",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ]",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" def ",props:{style:{color:"#FF7B72"}}},{content:"build_df",props:{style:{color:"#D2A8FF"}}},{content:"(self) -> DataFrame:",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" rows ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" []",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" for",props:{style:{color:"#FF7B72"}}},{content:" item ",props:{style:{color:"#C9D1D9"}}},{content:"in ",props:{style:{color:"#FF7B72"}}},{content:"self",props:{style:{color:"#79C0FF"}}},{content:".items:",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" row_dict ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" item.data.copy() ",props:{style:{color:"#C9D1D9"}}},{content:"if",props:{style:{color:"#FF7B72"}}},{content:" item.data ",props:{style:{color:"#C9D1D9"}}},{content:"else",props:{style:{color:"#FF7B72"}}},{content:" {}",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" row_dict[",props:{style:{color:"#C9D1D9"}}},{content:'"text"',props:{style:{color:"#A5D6FF"}}},{content:"] ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" item.get_text() ",props:{style:{color:"#C9D1D9"}}},{content:"or ",props:{style:{color:"#FF7B72"}}},{content:'""',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" rows.append(row_dict)",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" df ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" DataFrame(rows)",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" self",props:{style:{color:"#79C0FF"}}},{content:".status ",props:{style:{color:"#C9D1D9"}}},{content:"= f",props:{style:{color:"#FF7B72"}}},{content:'"Built DataFrame with ',props:{style:{color:"#A5D6FF"}}},{content:"{len",props:{style:{color:"#79C0FF"}}},{content:"(rows)",props:{style:{color:"#C9D1D9"}}},{content:"}",props:{style:{color:"#79C0FF"}}},{content:' rows."',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" return",props:{style:{color:"#FF7B72"}}},{content:" df",props:{style:{color:"#C9D1D9"}}}]}],lang:"python"},annotations:[]}]}),"\n",(0,s.jsx)(e.h3,{id:"tool-mode",children:"Tool Mode"}),"\n",(0,s.jsxs)(e.p,{children:["Components that support ",(0,s.jsx)(e.strong,{children:"Tool Mode"})," can be used as standalone components (when ",(0,s.jsx)(e.em,{children:"not"})," in ",(0,s.jsx)(e.strong,{children:"Tool Mode"}),") or as tools for other components with a ",(0,s.jsx)(e.strong,{children:"Tools"})," input, such as ",(0,s.jsx)(e.strong,{children:"Agent"})," components."]}),"\n",(0,s.jsxs)(e.p,{children:["You can allow a custom component to support ",(0,s.jsx)(e.strong,{children:"Tool Mode"})," by setting ",(0,s.jsx)(e.code,{children:"tool_mode=True"}),":"]}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"inputs ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" [",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" MessageTextInput(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"message"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Mensage"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" info",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Enter the message that will be processed directly by the tool"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" tool_mode",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"True",props:{style:{color:"#79C0FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"]",props:{style:{color:"#C9D1D9"}}}]}],lang:"python"},annotations:[]}]}),"\n",(0,s.jsxs)(e.p,{children:["Langflow currently supports the following input types for ",(0,s.jsx)(e.strong,{children:"Tool Mode"}),":"]}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsx)(e.li,{children:(0,s.jsx)(e.code,{children:"DataInput"})}),"\n",(0,s.jsx)(e.li,{children:(0,s.jsx)(e.code,{children:"DataFrameInput"})}),"\n",(0,s.jsx)(e.li,{children:(0,s.jsx)(e.code,{children:"PromptInput"})}),"\n",(0,s.jsx)(e.li,{children:(0,s.jsx)(e.code,{children:"MessageTextInput"})}),"\n",(0,s.jsx)(e.li,{children:(0,s.jsx)(e.code,{children:"MultilineInput"})}),"\n",(0,s.jsx)(e.li,{children:(0,s.jsx)(e.code,{children:"DropdownInput"})}),"\n"]}),"\n",(0,s.jsx)(e.h2,{id:"typed-annotations",children:"Typed annotations"}),"\n",(0,s.jsxs)(e.p,{children:["In Langflow, ",(0,s.jsx)(e.strong,{children:"typed annotations"})," allow Langflow to visually guide users and maintain flow consistency."]}),"\n",(0,s.jsx)(e.p,{children:"Typed annotations provide:"}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Color-coding"}),": Outputs like ",(0,s.jsx)(e.code,{children:"-> Data"})," or ",(0,s.jsx)(e.code,{children:"-> Message"})," get distinct colors."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Validation"}),": Langflow blocks incompatible connections automatically."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Readability"}),": Developers can quickly understand data flow."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Development tools"}),": Better code suggestions and error checking in your code editor."]}),"\n"]}),"\n",(0,s.jsx)(e.h3,{id:"common-return-types",children:"Common Return Types"}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.code,{children:"Message"}),": For chat-style outputs. Connects to any of several ",(0,s.jsx)(e.code,{children:"Message"}),"-compatible inputs."]}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"def ",props:{style:{color:"#FF7B72"}}},{content:"produce_message",props:{style:{color:"#D2A8FF"}}},{content:"(self) -> Message:",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" return",props:{style:{color:"#FF7B72"}}},{content:" Message(",props:{style:{color:"#C9D1D9"}}},{content:"text",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Hello! from typed method!"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"sender",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"System"',props:{style:{color:"#A5D6FF"}}},{content:")",props:{style:{color:"#C9D1D9"}}}]}],lang:"python"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.code,{children:"Data"}),": For structured data like dicts or partial texts. Connects only to ",(0,s.jsx)(e.code,{children:"DataInput"})," (ports that accept ",(0,s.jsx)(e.code,{children:"Data"}),")."]}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"def ",props:{style:{color:"#FF7B72"}}},{content:"get_processed_data",props:{style:{color:"#D2A8FF"}}},{content:"(self) -> Data:",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" processed ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" {",props:{style:{color:"#C9D1D9"}}},{content:'"key1"',props:{style:{color:"#A5D6FF"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"value1"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"key2"',props:{style:{color:"#A5D6FF"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"123",props:{style:{color:"#79C0FF"}}},{content:"}",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" return",props:{style:{color:"#FF7B72"}}},{content:" Data(",props:{style:{color:"#C9D1D9"}}},{content:"data",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"processed)",props:{style:{color:"#C9D1D9"}}}]}],lang:"python"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.code,{children:"DataFrame"}),": For tabular data. Connects only to ",(0,s.jsx)(e.code,{children:"DataFrameInput"})," (ports that accept ",(0,s.jsx)(e.code,{children:"DataFrame"}),")."]}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"def ",props:{style:{color:"#FF7B72"}}},{content:"build_df",props:{style:{color:"#D2A8FF"}}},{content:"(self) -> DataFrame:",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" pdf ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" pd.DataFrame({",props:{style:{color:"#C9D1D9"}}},{content:'"A"',props:{style:{color:"#A5D6FF"}}},{content:": [",props:{style:{color:"#C9D1D9"}}},{content:"1",props:{style:{color:"#79C0FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"2",props:{style:{color:"#79C0FF"}}},{content:"], ",props:{style:{color:"#C9D1D9"}}},{content:'"B"',props:{style:{color:"#A5D6FF"}}},{content:": [",props:{style:{color:"#C9D1D9"}}},{content:"3",props:{style:{color:"#79C0FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"4",props:{style:{color:"#79C0FF"}}},{content:"]})",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" return",props:{style:{color:"#FF7B72"}}},{content:" DataFrame(pdf)",props:{style:{color:"#C9D1D9"}}}]}],lang:"python"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:["Primitive Types (",(0,s.jsx)(e.code,{children:"str"}),", ",(0,s.jsx)(e.code,{children:"int"}),", ",(0,s.jsx)(e.code,{children:"bool"}),"): Returning primitives is allowed but wrapping in ",(0,s.jsx)(e.code,{children:"Data"})," or ",(0,s.jsx)(e.code,{children:"Message"})," is recommended for better consistency in the visual editor."]}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"def ",props:{style:{color:"#FF7B72"}}},{content:"compute_sum",props:{style:{color:"#D2A8FF"}}},{content:"(self) -> ",props:{style:{color:"#C9D1D9"}}},{content:"int",props:{style:{color:"#79C0FF"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" return ",props:{style:{color:"#FF7B72"}}},{content:"sum",props:{style:{color:"#79C0FF"}}},{content:"(",props:{style:{color:"#C9D1D9"}}},{content:"self",props:{style:{color:"#79C0FF"}}},{content:".numbers)",props:{style:{color:"#C9D1D9"}}}]}],lang:"python"},annotations:[]}]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(e.h3,{id:"tips-for-typed-annotations",children:"Tips for typed annotations"}),"\n",(0,s.jsx)(e.p,{children:"When using typed annotations, consider the following best practices:"}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Always Annotate Outputs"}),": Specify return types like ",(0,s.jsx)(e.code,{children:"-> Data"}),", ",(0,s.jsx)(e.code,{children:"-> Message"}),", or ",(0,s.jsx)(e.code,{children:"-> DataFrame"})," to enable proper visual editor color-coding and validation."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Wrap Raw Data"}),": Use ",(0,s.jsx)(e.code,{children:"Data"}),", ",(0,s.jsx)(e.code,{children:"Message"}),", or ",(0,s.jsx)(e.code,{children:"DataFrame"})," wrappers instead of returning plain structures."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Use Primitives Carefully"}),": Direct ",(0,s.jsx)(e.code,{children:"str"})," or ",(0,s.jsx)(e.code,{children:"int"})," returns are fine for simple flows, but wrapping improves flexibility."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Annotate Helpers Too"}),": Even if internal, typing improves maintainability and clarity."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Handle Edge Cases"}),": Prefer returning structured ",(0,s.jsx)(e.code,{children:"Data"})," with error fields when needed."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Stay Consistent"}),": Use the same types across your components to make flows predictable and easier to build."]}),"\n"]}),"\n",(0,s.jsx)(e.h2,{id:"enable-dynamic-fields",children:"Enable dynamic fields"}),"\n",(0,s.jsxs)(e.p,{children:["In ",(0,s.jsx)(e.strong,{children:"Langflow"}),", dynamic fields allow inputs to change or appear based on user interactions. You can make an input dynamic by setting ",(0,s.jsx)(e.code,{children:"dynamic=True"}),".\nOptionally, setting ",(0,s.jsx)(e.code,{children:"real_time_refresh=True"})," triggers the ",(0,s.jsx)(e.code,{children:"update_build_config"})," method to adjust the input's visibility or properties in real time, creating a contextual visual editor experience that only exposes relevant fields based on the user's choices."]}),"\n",(0,s.jsxs)(e.p,{children:["In this example, the operator field triggers updates with ",(0,s.jsx)(e.code,{children:"real_time_refresh=True"}),".\nThe ",(0,s.jsx)(e.code,{children:"regex_pattern"})," field is initially hidden and controlled with ",(0,s.jsx)(e.code,{children:"dynamic=True"}),"."]}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"from",props:{style:{color:"#FF7B72"}}},{content:" langflow.io ",props:{style:{color:"#C9D1D9"}}},{content:"import",props:{style:{color:"#FF7B72"}}},{content:" DropdownInput, StrInput",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"class ",props:{style:{color:"#FF7B72"}}},{content:"RegexRouter",props:{style:{color:"#FFA657"}}},{content:"(",props:{style:{color:"#C9D1D9"}}},{content:"Component",props:{style:{color:"#79C0FF"}}},{content:"):",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"Regex Router"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" description ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"Demonstrates dynamic fields for regex input."',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" inputs ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" [",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" DropdownInput(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"operator"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Operator"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" options",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"[",props:{style:{color:"#C9D1D9"}}},{content:'"equals"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"contains"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"regex"',props:{style:{color:"#A5D6FF"}}},{content:"],",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" value",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"equals"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" real_time_refresh",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"True",props:{style:{color:"#79C0FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" StrInput(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"regex_pattern"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Regex Pattern"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" info",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"\"Used if operator='regex'\"",props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" dynamic",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"True",props:{style:{color:"#79C0FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" show",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"False",props:{style:{color:"#79C0FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ]",props:{style:{color:"#C9D1D9"}}}]}],lang:"python"},annotations:[]}]}),"\n",(0,s.jsxs)(e.h3,{id:"implement-update_build_config",children:["Implement ",(0,s.jsx)(e.code,{children:"update_build_config"})]}),"\n",(0,s.jsxs)(e.p,{children:["When a field with ",(0,s.jsx)(e.code,{children:"real_time_refresh=True"})," is modified, Langflow calls the ",(0,s.jsx)(e.code,{children:"update_build_config"})," method, passing the updated field name, value, and the component's configuration to dynamically adjust the visibility or properties of other fields based on user input."]}),"\n",(0,s.jsxs)(e.p,{children:["This example will show or hide the ",(0,s.jsx)(e.code,{children:"regex_pattern"})," field when the user selects a different operator."]}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"def ",props:{style:{color:"#FF7B72"}}},{content:"update_build_config",props:{style:{color:"#D2A8FF"}}},{content:"(self, build_config: ",props:{style:{color:"#C9D1D9"}}},{content:"dict",props:{style:{color:"#79C0FF"}}},{content:", field_value: ",props:{style:{color:"#C9D1D9"}}},{content:"str",props:{style:{color:"#79C0FF"}}},{content:", field_name: ",props:{style:{color:"#C9D1D9"}}},{content:"str ",props:{style:{color:"#79C0FF"}}},{content:"| ",props:{style:{color:"#FF7B72"}}},{content:"None ",props:{style:{color:"#79C0FF"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:"None",props:{style:{color:"#79C0FF"}}},{content:") -> ",props:{style:{color:"#C9D1D9"}}},{content:"dict",props:{style:{color:"#79C0FF"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" if",props:{style:{color:"#FF7B72"}}},{content:" field_name ",props:{style:{color:"#C9D1D9"}}},{content:"== ",props:{style:{color:"#FF7B72"}}},{content:'"operator"',props:{style:{color:"#A5D6FF"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" if",props:{style:{color:"#FF7B72"}}},{content:" field_value ",props:{style:{color:"#C9D1D9"}}},{content:"== ",props:{style:{color:"#FF7B72"}}},{content:'"regex"',props:{style:{color:"#A5D6FF"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" build_config[",props:{style:{color:"#C9D1D9"}}},{content:'"regex_pattern"',props:{style:{color:"#A5D6FF"}}},{content:"][",props:{style:{color:"#C9D1D9"}}},{content:'"show"',props:{style:{color:"#A5D6FF"}}},{content:"] ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:"True",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" else",props:{style:{color:"#FF7B72"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" build_config[",props:{style:{color:"#C9D1D9"}}},{content:'"regex_pattern"',props:{style:{color:"#A5D6FF"}}},{content:"][",props:{style:{color:"#C9D1D9"}}},{content:'"show"',props:{style:{color:"#A5D6FF"}}},{content:"] ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:"False",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" return",props:{style:{color:"#FF7B72"}}},{content:" build_config",props:{style:{color:"#C9D1D9"}}}]}],lang:"python"},annotations:[]}]}),"\n",(0,s.jsx)(e.h3,{id:"additional-dynamic-field-controls",children:"Additional Dynamic Field Controls"}),"\n",(0,s.jsxs)(e.p,{children:["You can also modify other properties within ",(0,s.jsx)(e.code,{children:"update_build_config"}),", such as:"]}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.code,{children:"required"}),": Set ",(0,s.jsx)(e.code,{children:'build_config["some_field"]["required"] = True/False'})]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.code,{children:"advanced"}),": Set ",(0,s.jsx)(e.code,{children:'build_config["some_field"]["advanced"] = True'})]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.code,{children:"options"}),": Modify dynamic dropdown options."]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(e.h3,{id:"tips-for-managing-dynamic-fields",children:"Tips for Managing Dynamic Fields"}),"\n",(0,s.jsx)(e.p,{children:"When working with dynamic fields, consider the following best practices to ensure a smooth user experience:"}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Minimize field changes"}),": Hide only fields that are truly irrelevant to avoid confusing users."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Test behavior"}),": Ensure that adding or removing fields doesn't accidentally erase user input."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Preserve data"}),": Use ",(0,s.jsx)(e.code,{children:'build_config["some_field"]["show"] = False'})," to hide fields without losing their values."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Clarify logic"}),": Add ",(0,s.jsx)(e.code,{children:"info"})," notes to explain why fields appear or disappear based on conditions."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Keep it manageable"}),": If the dynamic logic becomes too complex, consider breaking it into smaller components, unless it serves a clear purpose in a single node."]}),"\n"]}),"\n",(0,s.jsx)(e.h2,{id:"error-handling-and-logging",children:"Error handling and logging"}),"\n",(0,s.jsx)(e.p,{children:"In Langflow, robust error handling ensures that your components behave predictably, even when unexpected situations occur, such as invalid inputs, external API failures, or internal logic errors."}),"\n",(0,s.jsx)(e.h3,{id:"error-handling-techniques",children:"Error handling techniques"}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.strong,{children:"Raise Exceptions"}),": If a critical error occurs, you can raise standard Python exceptions such as ",(0,s.jsx)(e.code,{children:"ValueError"}),", or specialized exceptions like ",(0,s.jsx)(e.code,{children:"ToolException"}),". Langflow will automatically catch these and display appropriate error messages in the visual editor, helping users quickly identify what went wrong."]}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"def ",props:{style:{color:"#FF7B72"}}},{content:"compute_result",props:{style:{color:"#D2A8FF"}}},{content:"(self) -> ",props:{style:{color:"#C9D1D9"}}},{content:"str",props:{style:{color:"#79C0FF"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" if not ",props:{style:{color:"#FF7B72"}}},{content:"self",props:{style:{color:"#79C0FF"}}},{content:".user_input:",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" raise ",props:{style:{color:"#FF7B72"}}},{content:"ValueError",props:{style:{color:"#79C0FF"}}},{content:"(",props:{style:{color:"#C9D1D9"}}},{content:'"No input provided."',props:{style:{color:"#A5D6FF"}}},{content:")",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" # ...",props:{style:{color:"#8B949E"}}}]}],lang:"python"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.strong,{children:"Return Structured Error Data"}),': Instead of stopping a flow abruptly, you can return a Data object containing an "error" field. This approach allows the flow to continue operating and enables downstream components to detect and handle the error gracefully.']}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"def ",props:{style:{color:"#FF7B72"}}},{content:"run_model",props:{style:{color:"#D2A8FF"}}},{content:"(self) -> Data:",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" try",props:{style:{color:"#FF7B72"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" # ...",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:" except ",props:{style:{color:"#FF7B72"}}},{content:"Exception ",props:{style:{color:"#79C0FF"}}},{content:"as",props:{style:{color:"#FF7B72"}}},{content:" e:",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" return",props:{style:{color:"#FF7B72"}}},{content:" Data(",props:{style:{color:"#C9D1D9"}}},{content:"data",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"{",props:{style:{color:"#C9D1D9"}}},{content:'"error"',props:{style:{color:"#A5D6FF"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"str",props:{style:{color:"#79C0FF"}}},{content:"(e)})",props:{style:{color:"#C9D1D9"}}}]}],lang:"python"},annotations:[]}]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(e.h3,{id:"improve-debugging-and-flow-management",children:"Improve debugging and flow management"}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:[(0,s.jsxs)(e.strong,{children:["Use ",(0,s.jsx)(e.code,{children:"self.status"})]}),": Each component has a status field where you can store short messages about the execution result\u2014such as success summaries, partial progress, or error notifications. These appear directly in the visual editor, making troubleshooting easier for users."]}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"def ",props:{style:{color:"#FF7B72"}}},{content:"parse_data",props:{style:{color:"#D2A8FF"}}},{content:"(self) -> Data:",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"# ...",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:"self",props:{style:{color:"#79C0FF"}}},{content:".status ",props:{style:{color:"#C9D1D9"}}},{content:"= f",props:{style:{color:"#FF7B72"}}},{content:'"Parsed ',props:{style:{color:"#A5D6FF"}}},{content:"{len",props:{style:{color:"#79C0FF"}}},{content:"(rows)",props:{style:{color:"#C9D1D9"}}},{content:"}",props:{style:{color:"#79C0FF"}}},{content:' rows successfully."',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"return",props:{style:{color:"#FF7B72"}}},{content:" Data(",props:{style:{color:"#C9D1D9"}}},{content:"data",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"{",props:{style:{color:"#C9D1D9"}}},{content:'"rows"',props:{style:{color:"#A5D6FF"}}},{content:": rows})",props:{style:{color:"#C9D1D9"}}}]}],lang:"python"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:[(0,s.jsxs)(e.strong,{children:["Stop specific outputs with ",(0,s.jsx)(e.code,{children:"self.stop(...)"})]}),": You can halt individual output paths when certain conditions fail, without affecting the entire component. This is especially useful when working with components that have multiple output branches."]}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"def ",props:{style:{color:"#FF7B72"}}},{content:"some_output",props:{style:{color:"#D2A8FF"}}},{content:"(self) -> Data:",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"if <",props:{style:{color:"#FF7B72"}}},{content:"some condition",props:{style:{color:"#C9D1D9"}}},{content:">",props:{style:{color:"#FF7B72"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" self",props:{style:{color:"#79C0FF"}}},{content:".stop(",props:{style:{color:"#C9D1D9"}}},{content:'"some_output"',props:{style:{color:"#A5D6FF"}}},{content:") ",props:{style:{color:"#C9D1D9"}}},{content:"# Tells Langflow no data flows",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:" return",props:{style:{color:"#FF7B72"}}},{content:" Data(",props:{style:{color:"#C9D1D9"}}},{content:"data",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"{",props:{style:{color:"#C9D1D9"}}},{content:'"error"',props:{style:{color:"#A5D6FF"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"Condition not met"',props:{style:{color:"#A5D6FF"}}},{content:"})",props:{style:{color:"#C9D1D9"}}}]}],lang:"python"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.strong,{children:"Log events"}),': You can log key execution details inside components. Logs are displayed in the "Logs" or "Events" section of the component\'s detail view and can be accessed later through the flow\'s debug panel or exported files, providing a clear trace of the component\'s behavior for easier debugging.']}),"\n",(0,s.jsx)(h.Code,{codeConfig:y,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"def ",props:{style:{color:"#FF7B72"}}},{content:"process_file",props:{style:{color:"#D2A8FF"}}},{content:"(self, file_path: ",props:{style:{color:"#C9D1D9"}}},{content:"str",props:{style:{color:"#79C0FF"}}},{content:"):",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"self",props:{style:{color:"#79C0FF"}}},{content:".log(",props:{style:{color:"#C9D1D9"}}},{content:"f",props:{style:{color:"#FF7B72"}}},{content:'"Processing file ',props:{style:{color:"#A5D6FF"}}},{content:"{",props:{style:{color:"#79C0FF"}}},{content:"file_path",props:{style:{color:"#C9D1D9"}}},{content:"}",props:{style:{color:"#79C0FF"}}},{content:'"',props:{style:{color:"#A5D6FF"}}},{content:")",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"# ...",props:{style:{color:"#8B949E"}}}]}],lang:"python"},annotations:[]}]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(e.h3,{id:"tips-for-error-handling-and-logging",children:"Tips for error handling and logging"}),"\n",(0,s.jsx)(e.p,{children:"To build more reliable components, consider the following best practices:"}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Validate inputs early"}),": Catch missing or invalid inputs at the start to prevent broken logic."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsxs)(e.strong,{children:["Summarize with ",(0,s.jsx)(e.code,{children:"self.status"})]}),": Use short success or error summaries to help users understand results quickly."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Keep logs concise"}),": Focus on meaningful messages to avoid cluttering the visual editor."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Return structured errors"}),": When appropriate, return ",(0,s.jsx)(e.code,{children:'Data(data={"error": ...})'})," instead of raising exceptions to allow downstream handling."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.strong,{children:"Stop outputs selectively"}),": Only halt specific outputs with ",(0,s.jsx)(e.code,{children:"self.stop(...)"})," if necessary, to preserve correct flow behavior elsewhere."]}),"\n"]}),"\n",(0,s.jsx)(e.h2,{id:"contribute-custom-components-to-langflow",children:"Contribute custom components to Langflow"}),"\n",(0,s.jsxs)(e.p,{children:["See ",(0,s.jsx)(e.a,{href:"/contributing-components",children:"How to Contribute"})," to contribute your custom component to Langflow."]})]})}function m(o={}){const{wrapper:e}={...(0,r.R)(),...o.components};return e?(0,s.jsx)(e,{...o,children:(0,s.jsx)(D,{...o})}):D(o)}function x(o,e){throw new Error("Expected "+(e?"component":"object")+" `"+o+"` to be defined: you likely forgot to import, pass, or provide it.")}}}]); \ No newline at end of file diff --git a/assets/js/22dd74f7.3445fcf8.js b/assets/js/22dd74f7.3445fcf8.js deleted file mode 100644 index a4bc5a89d7..0000000000 --- a/assets/js/22dd74f7.3445fcf8.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[1567],{55226:e=>{e.exports=JSON.parse('{"version":{"pluginId":"default","version":"current","label":"Next","banner":null,"badge":false,"noIndex":false,"className":"docs-version-current","isLast":true,"docsSidebars":{"docs":[{"type":"category","label":"Get started","items":[{"type":"link","label":"About Langflow","href":"/","docId":"Get-Started/about-langflow","unlisted":false},{"type":"link","label":"Install Langflow","href":"/get-started-installation","docId":"Get-Started/get-started-installation","unlisted":false},{"type":"link","label":"Quickstart","href":"/get-started-quickstart","docId":"Get-Started/get-started-quickstart","unlisted":false},{"type":"category","label":"Tutorials","items":[{"type":"link","label":"Create a vector RAG chatbot","href":"/chat-with-rag","docId":"Tutorials/chat-with-rag","unlisted":false},{"type":"link","label":"Create a chatbot that can ingest files","href":"/chat-with-files","docId":"Tutorials/chat-with-files","unlisted":false},{"type":"link","label":"Connect applications to agents","href":"/agent-tutorial","docId":"Tutorials/agent","unlisted":false},{"type":"link","label":"Connect to MCP servers from your application","href":"/mcp-tutorial","docId":"Tutorials/mcp-tutorial","unlisted":false}],"collapsed":true,"collapsible":true}],"collapsed":true,"collapsible":true},{"type":"category","label":"Flows","items":[{"type":"link","label":"Use the visual editor","href":"/concepts-overview","docId":"Concepts/concepts-overview","unlisted":false},{"type":"link","label":"Build flows","href":"/concepts-flows","docId":"Concepts/concepts-flows","unlisted":false},{"type":"category","label":"Run flows","items":[{"type":"link","label":"Trigger flows with the Langflow API","href":"/concepts-publish","docId":"Concepts/concepts-publish","unlisted":false},{"type":"link","label":"Trigger flows with webhooks","href":"/webhook","docId":"Develop/webhook","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"link","label":"Test flows","href":"/concepts-playground","docId":"Concepts/concepts-playground","unlisted":false},{"type":"link","label":"Import and export flows","href":"/concepts-flows-import","docId":"Concepts/concepts-flows-import","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Agents","items":[{"type":"link","label":"Use Langflow agents","href":"/agents","docId":"Agents/agents","unlisted":false},{"type":"link","label":"Configure tools for agents","href":"/agents-tools","docId":"Agents/agents-tools","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Model Context Protocol (MCP)","items":[{"type":"link","label":"Use Langflow as an MCP client","href":"/mcp-client","docId":"Components/mcp-client","unlisted":false},{"type":"link","label":"Use Langflow as an MCP server","href":"/mcp-server","docId":"Concepts/mcp-server","unlisted":false},{"type":"link","label":"Connect an Astra DB MCP server to Langflow","href":"/mcp-component-astra","docId":"Integrations/mcp-component-astra","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Develop","items":[{"type":"link","label":"API keys and authentication","href":"/api-keys-and-authentication","docId":"Configuration/api-keys-and-authentication","unlisted":false},{"type":"link","label":"Install custom dependencies","href":"/install-custom-dependencies","docId":"Develop/install-custom-dependencies","unlisted":false},{"type":"link","label":"Global variables","href":"/configuration-global-variables","docId":"Configuration/configuration-global-variables","unlisted":false},{"type":"link","label":"Environment variables","href":"/environment-variables","docId":"Configuration/environment-variables","unlisted":false},{"type":"category","label":"Storage and memory","items":[{"type":"link","label":"Manage files","href":"/concepts-file-management","docId":"Concepts/concepts-file-management","unlisted":false},{"type":"link","label":"Manage memory","href":"/memory","docId":"Develop/memory","unlisted":false},{"type":"link","label":"Use Session IDs","href":"/session-id","docId":"Develop/session-id","unlisted":false},{"type":"link","label":"Configure an external PostgreSQL database","href":"/configuration-custom-database","docId":"Configuration/configuration-custom-database","unlisted":false},{"type":"link","label":"Database guide for enterprise administrators","href":"/enterprise-database-guide","docId":"Develop/enterprise-database-guide","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Observability","items":[{"type":"link","label":"Logs","href":"/logging","docId":"Develop/logging","unlisted":false},{"type":"category","label":"Monitoring","items":[{"type":"link","label":"Arize","href":"/integrations-arize","docId":"Integrations/Arize/integrations-arize","unlisted":false},{"type":"link","label":"Langfuse","href":"/integrations-langfuse","docId":"Integrations/integrations-langfuse","unlisted":false},{"type":"link","label":"LangSmith","href":"/integrations-langsmith","docId":"Integrations/integrations-langsmith","unlisted":false},{"type":"link","label":"LangWatch","href":"/integrations-langwatch","docId":"Integrations/integrations-langwatch","unlisted":false},{"type":"link","label":"Opik","href":"/integrations-opik","docId":"Integrations/integrations-opik","unlisted":false},{"type":"link","label":"Traceloop","href":"/integrations-instana-traceloop","docId":"Integrations/integrations-instana-traceloop","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"link","label":"Telemetry","href":"/contributing-telemetry","docId":"Contributing/contributing-telemetry","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"link","label":"Use Langflow data types","href":"/data-types","docId":"Concepts/data-types","unlisted":false},{"type":"link","label":"Use voice mode","href":"/concepts-voice-mode","docId":"Concepts/concepts-voice-mode","unlisted":false},{"type":"link","label":"Use the Langflow CLI","href":"/configuration-cli","docId":"Configuration/configuration-cli","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Deploy","items":[{"type":"link","label":"Langflow deployment overview","href":"/deployment-overview","docId":"Deployment/deployment-overview","unlisted":false},{"type":"link","label":"Deploy a public Langflow server","href":"/deployment-public-server","docId":"Deployment/deployment-public-server","unlisted":false},{"type":"category","label":"Containerized deployments","items":[{"type":"link","label":"Containerize a Langflow application","href":"/develop-application","docId":"Develop/develop-application","unlisted":false},{"type":"link","label":"Langflow Docker images","href":"/deployment-docker","docId":"Deployment/deployment-docker","unlisted":false},{"type":"link","label":"Deploy Langflow on a remote server","href":"/deployment-caddyfile","docId":"Deployment/deployment-caddyfile","unlisted":false},{"type":"category","label":"Kubernetes","items":[{"type":"link","label":"Deployment architecture","href":"/deployment-architecture","docId":"Deployment/deployment-architecture","unlisted":false},{"type":"link","label":"Best practices","href":"/deployment-prod-best-practices","docId":"Deployment/deployment-prod-best-practices","unlisted":false},{"type":"link","label":"Deploy in development","href":"/deployment-kubernetes-dev","docId":"Deployment/deployment-kubernetes-dev","unlisted":false},{"type":"link","label":"Deploy in production","href":"/deployment-kubernetes-prod","docId":"Deployment/deployment-kubernetes-prod","unlisted":false}],"collapsed":true,"collapsible":true}],"collapsed":true,"collapsible":true},{"type":"category","label":"Cloud platforms","items":[{"type":"link","label":"Google Cloud Platform","href":"/deployment-gcp","docId":"Deployment/deployment-gcp","unlisted":false},{"type":"link","label":"Hugging Face Spaces","href":"/deployment-hugging-face-spaces","docId":"Deployment/deployment-hugging-face-spaces","unlisted":false},{"type":"link","label":"Railway","href":"/deployment-railway","docId":"Deployment/deployment-railway","unlisted":false},{"type":"link","label":"Render","href":"/deployment-render","docId":"Deployment/deployment-render","unlisted":false}],"collapsed":true,"collapsible":true}],"collapsed":true,"collapsible":true},{"type":"category","label":"Components reference","items":[{"type":"link","label":"Components overview","href":"/concepts-components","docId":"Concepts/concepts-components","unlisted":false},{"type":"category","label":"Core components","items":[{"type":"link","label":"Input / Output","href":"/components-io","docId":"Components/components-io","unlisted":false},{"type":"link","label":"Agents","href":"/components-agents","docId":"Components/components-agents","unlisted":false},{"type":"category","label":"Models","items":[{"type":"link","label":"Language Model","href":"/components-models","docId":"Components/components-models","unlisted":false},{"type":"link","label":"Embedding Model","href":"/components-embedding-models","docId":"Components/components-embedding-models","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"link","label":"Data","href":"/components-data","docId":"Components/components-data","unlisted":false},{"type":"category","label":"Processing","items":[{"type":"link","label":"Processing components","href":"/components-processing","docId":"Components/components-processing","unlisted":false},{"type":"link","label":"Prompt Template","href":"/components-prompts","docId":"Components/components-prompts","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"link","label":"Logic","href":"/components-logic","docId":"Components/components-logic","unlisted":false},{"type":"link","label":"Helpers","href":"/components-helpers","docId":"Components/components-helpers","unlisted":false},{"type":"link","label":"Tools","href":"/components-tools","docId":"Components/components-tools","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Bundles","items":[{"type":"link","label":"About bundles","href":"/components-bundle-components","docId":"Components/components-bundles","unlisted":false},{"type":"link","label":"AI/ML API","href":"/bundles-aiml","docId":"Components/bundles-aiml","unlisted":false},{"type":"link","label":"Amazon","href":"/bundles-amazon","docId":"Components/bundles-amazon","unlisted":false},{"type":"link","label":"Anthropic","href":"/bundles-anthropic","docId":"Components/bundles-anthropic","unlisted":false},{"type":"link","label":"Apify","href":"/integrations-apify","docId":"Integrations/Apify/integrations-apify","unlisted":false},{"type":"link","label":"arXiv","href":"/bundles-arxiv","docId":"Components/bundles-arxiv","unlisted":false},{"type":"link","label":"AssemblyAI","href":"/integrations-assemblyai","docId":"Integrations/integrations-assemblyai","unlisted":false},{"type":"link","label":"Azure","href":"/bundles-azure","docId":"Components/bundles-azure","unlisted":false},{"type":"link","label":"Baidu","href":"/bundles-baidu","docId":"Components/bundles-baidu","unlisted":false},{"type":"link","label":"Bing","href":"/bundles-bing","docId":"Components/bundles-bing","unlisted":false},{"type":"link","label":"Cassandra","href":"/bundles-cassandra","docId":"Components/bundles-cassandra","unlisted":false},{"type":"link","label":"Chroma","href":"/bundles-chroma","docId":"Components/bundles-chroma","unlisted":false},{"type":"link","label":"Cleanlab","href":"/integrations-cleanlab","docId":"Integrations/Cleanlab/integrations-cleanlab","unlisted":false},{"type":"link","label":"ClickHouse","href":"/bundles-clickhouse","docId":"Components/bundles-clickhouse","unlisted":false},{"type":"link","label":"Cloudflare","href":"/bundles-cloudflare","docId":"Components/bundles-cloudflare","unlisted":false},{"type":"link","label":"Cohere","href":"/bundles-cohere","docId":"Components/bundles-cohere","unlisted":false},{"type":"link","label":"Composio","href":"/integrations-composio","docId":"Integrations/Composio/integrations-composio","unlisted":false},{"type":"link","label":"Couchbase","href":"/bundles-couchbase","docId":"Components/bundles-couchbase","unlisted":false},{"type":"link","label":"DataStax","href":"/bundles-datastax","docId":"Components/bundles-datastax","unlisted":false},{"type":"link","label":"DeepSeek","href":"/bundles-deepseek","docId":"Components/bundles-deepseek","unlisted":false},{"type":"link","label":"Docling","href":"/integrations-docling","docId":"Integrations/Docling/integrations-docling","unlisted":false},{"type":"link","label":"DuckDuckGo","href":"/bundles-duckduckgo","docId":"Components/bundles-duckduckgo","unlisted":false},{"type":"link","label":"Elastic","href":"/bundles-elastic","docId":"Components/bundles-elastic","unlisted":false},{"type":"link","label":"Exa","href":"/bundles-exa","docId":"Components/bundles-exa","unlisted":false},{"type":"link","label":"FAISS","href":"/bundles-faiss","docId":"Components/bundles-faiss","unlisted":false},{"type":"link","label":"Glean","href":"/bundles-glean","docId":"Components/bundles-glean","unlisted":false},{"type":"category","label":"Google","items":[{"type":"link","label":"Google components","href":"/bundles-google","docId":"Components/bundles-google","unlisted":false},{"type":"link","label":"Google BigQuery","href":"/integrations-google-big-query","docId":"Integrations/Google/integrations-google-big-query","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"link","label":"Groq","href":"/bundles-groq","docId":"Components/bundles-groq","unlisted":false},{"type":"link","label":"Hugging Face","href":"/bundles-huggingface","docId":"Components/bundles-huggingface","unlisted":false},{"type":"link","label":"IBM","href":"/bundles-ibm","docId":"Components/bundles-ibm","unlisted":false},{"type":"link","label":"Icosa Computing","href":"/bundles-icosacomputing","docId":"Components/bundles-icosacomputing","unlisted":false},{"type":"link","label":"LangChain","href":"/bundles-langchain","docId":"Components/bundles-langchain","unlisted":false},{"type":"link","label":"LM Studio","href":"/bundles-lmstudio","docId":"Components/bundles-lmstudio","unlisted":false},{"type":"link","label":"MariTalk","href":"/bundles-maritalk","docId":"Components/bundles-maritalk","unlisted":false},{"type":"link","label":"Mem0","href":"/bundles-mem0","docId":"Components/bundles-mem0","unlisted":false},{"type":"link","label":"Milvus","href":"/bundles-milvus","docId":"Components/bundles-milvus","unlisted":false},{"type":"link","label":"MistralAI","href":"/bundles-mistralai","docId":"Components/bundles-mistralai","unlisted":false},{"type":"link","label":"MongoDB","href":"/bundles-mongodb","docId":"Components/bundles-mongodb","unlisted":false},{"type":"category","label":"Notion","items":[{"type":"link","label":"Set up a Notion App","href":"/integrations/notion/setup","docId":"Integrations/Notion/integrations-notion","unlisted":false},{"type":"link","label":"Notion Conversational Agent","href":"/integrations/notion/notion-agent-conversational","docId":"Integrations/Notion/notion-agent-conversational","unlisted":false},{"type":"link","label":"Notion Meeting Notes Agent","href":"/integrations/notion/notion-agent-meeting-notes","docId":"Integrations/Notion/notion-agent-meeting-notes","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"link","label":"Novita","href":"/bundles-novita","docId":"Components/bundles-novita","unlisted":false},{"type":"category","label":"NVIDIA","items":[{"type":"link","label":"NVIDIA components","href":"/bundles-nvidia","docId":"Components/bundles-nvidia","unlisted":false},{"type":"link","label":"NVIDIA Ingest","href":"/integrations-nvidia-ingest","docId":"Integrations/Nvidia/integrations-nvidia-ingest","unlisted":false},{"type":"link","label":"NVIDIA NIM on WSL2","href":"/integrations-nvidia-ingest-wsl2","docId":"Integrations/Nvidia/integrations-nvidia-nim-wsl2","unlisted":false},{"type":"link","label":"NVIDIA G-Assist","href":"/integrations-nvidia-g-assist","docId":"Integrations/Nvidia/integrations-nvidia-g-assist","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"link","label":"Ollama","href":"/bundles-ollama","docId":"Components/bundles-ollama","unlisted":false},{"type":"link","label":"OpenAI","href":"/bundles-openai","docId":"Components/bundles-openai","unlisted":false},{"type":"link","label":"OpenRouter","href":"/bundles-openrouter","docId":"Components/bundles-openrouter","unlisted":false},{"type":"link","label":"Perplexity","href":"/bundles-perplexity","docId":"Components/bundles-perplexity","unlisted":false},{"type":"link","label":"pgvector","href":"/bundles-pgvector","docId":"Components/bundles-pgvector","unlisted":false},{"type":"link","label":"Pinecone","href":"/bundles-pinecone","docId":"Components/bundles-pinecone","unlisted":false},{"type":"link","label":"Qdrant","href":"/bundles-qdrant","docId":"Components/bundles-qdrant","unlisted":false},{"type":"link","label":"Redis","href":"/bundles-redis","docId":"Components/bundles-redis","unlisted":false},{"type":"link","label":"SambaNova","href":"/bundles-sambanova","docId":"Components/bundles-sambanova","unlisted":false},{"type":"link","label":"SearchApi","href":"/bundles-searchapi","docId":"Components/bundles-searchapi","unlisted":false},{"type":"link","label":"Serper","href":"/bundles-serper","docId":"Components/bundles-serper","unlisted":false},{"type":"link","label":"Supabase","href":"/bundles-supabase","docId":"Components/bundles-supabase","unlisted":false},{"type":"link","label":"Upstash","href":"/bundles-upstash","docId":"Components/bundles-upstash","unlisted":false},{"type":"link","label":"Vectara","href":"/bundles-vectara","docId":"Components/bundles-vectara","unlisted":false},{"type":"link","label":"Vertex AI","href":"/bundles-vertexai","docId":"Components/bundles-vertexai","unlisted":false},{"type":"link","label":"Weaviate","href":"/bundles-weaviate","docId":"Components/bundles-weaviate","unlisted":false},{"type":"link","label":"Wikipedia","href":"/bundles-wikipedia","docId":"Components/bundles-wikipedia","unlisted":false},{"type":"link","label":"xAI","href":"/bundles-xai","docId":"Components/bundles-xai","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"link","label":"Create custom Python components","href":"/components-custom-components","docId":"Components/components-custom-components","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"API reference","items":[{"type":"link","label":"Get started with the Langflow API","href":"/api-reference-api-examples","docId":"API-Reference/api-reference-api-examples","unlisted":false},{"type":"link","label":"Use the TypeScript client","href":"/typescript-client","docId":"Develop/Clients/typescript-client","unlisted":false},{"type":"link","label":"Flow trigger endpoints","href":"/api-flows-run","docId":"API-Reference/api-flows-run","unlisted":false},{"type":"link","label":"OpenAI Responses endpoints","href":"/api-openai-responses","docId":"API-Reference/api-openai-responses","unlisted":false},{"type":"link","label":"Flow management endpoints","href":"/api-flows","docId":"API-Reference/api-flows","unlisted":false},{"type":"link","label":"Files endpoints","href":"/api-files","docId":"API-Reference/api-files","unlisted":false},{"type":"link","label":"Projects endpoints","href":"/api-projects","docId":"API-Reference/api-projects","unlisted":false},{"type":"link","label":"Logs endpoints","href":"/api-logs","docId":"API-Reference/api-logs","unlisted":false},{"type":"link","label":"Monitor endpoints","href":"/api-monitor","docId":"API-Reference/api-monitor","unlisted":false},{"type":"link","label":"Build endpoints","href":"/api-build","docId":"API-Reference/api-build","unlisted":false},{"type":"link","label":"Users endpoints","href":"/api-users","docId":"API-Reference/api-users","unlisted":false},{"type":"link","label":"Langflow API specification","href":"/api"}],"collapsed":true,"collapsible":true},{"type":"category","label":"Contribute","items":[{"type":"link","label":"Join the Langflow community","href":"/contributing-community","docId":"Contributing/contributing-community","unlisted":false},{"type":"link","label":"Contribute to Langflow","href":"/contributing-how-to-contribute","docId":"Contributing/contributing-how-to-contribute","unlisted":false},{"type":"link","label":"Contribute components","href":"/contributing-components","docId":"Contributing/contributing-components","unlisted":false},{"type":"link","label":"Contribute component tests","href":"/contributing-component-tests","docId":"Contributing/contributing-component-tests","unlisted":false},{"type":"link","label":"Contribute templates","href":"/contributing-templates","docId":"Contributing/contributing-templates","unlisted":false},{"type":"link","label":"Contribute bundles","href":"/contributing-bundles","docId":"Contributing/contributing-bundles","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Release notes","items":[{"type":"link","label":"Release notes","href":"/release-notes","docId":"Support/release-notes","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Support","items":[{"type":"link","label":"Troubleshoot","href":"/troubleshoot","docId":"Support/troubleshooting","unlisted":false},{"type":"link","label":"Get help and request enhancements","href":"/contributing-github-issues","docId":"Contributing/contributing-github-issues","unlisted":false},{"type":"link","label":"IBM Elite Support for Langflow","href":"/luna-for-langflow","docId":"Support/luna-for-langflow","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"html","className":"sidebar-ad","value":"\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n
      \\n Get started in minutes\\n Download Langflow Desktop\\n
      \\n
      \\n "}]},"docs":{"Agents/agents":{"id":"Agents/agents","title":"Use Langflow agents","description":"Langflow\'s Agent component is critical for building agent flows.","sidebar":"docs"},"Agents/agents-tools":{"id":"Agents/agents-tools","title":"Configure tools for agents","description":"By default, Langflow agents only include the functionality built-in to their base LLM.","sidebar":"docs"},"API-Reference/api-build":{"id":"API-Reference/api-build","title":"Build endpoints","description":"The /build endpoints are used by Langflow\'s frontend visual editor code.","sidebar":"docs"},"API-Reference/api-files":{"id":"API-Reference/api-files","title":"Files endpoints","description":"Use the /files endpoints to move files between your local machine and Langflow.","sidebar":"docs"},"API-Reference/api-flows":{"id":"API-Reference/api-flows","title":"Flow management endpoints","description":"Use the /flows endpoint to create, read, update, and delete flows.","sidebar":"docs"},"API-Reference/api-flows-run":{"id":"API-Reference/api-flows-run","title":"Flow trigger endpoints","description":"Use the /run and /webhook endpoints to run flows.","sidebar":"docs"},"API-Reference/api-logs":{"id":"API-Reference/api-logs","title":"Logs endpoints","description":"Retrieve logs for your Langflow flows and server.","sidebar":"docs"},"API-Reference/api-monitor":{"id":"API-Reference/api-monitor","title":"Monitor endpoints","description":"The /monitor endpoints are for internal Langflow functionality, primarily related to running flows in the Playground, storing chat history, and generating flow logs.","sidebar":"docs"},"API-Reference/api-openai-responses":{"id":"API-Reference/api-openai-responses","title":"OpenAI Responses API","description":"Langflow includes an endpoint that is compatible with the OpenAI Responses API.","sidebar":"docs"},"API-Reference/api-projects":{"id":"API-Reference/api-projects","title":"Projects endpoints","description":"Use the /projects endpoint to create, read, update, and delete Langflow projects.","sidebar":"docs"},"API-Reference/api-reference-api-examples":{"id":"API-Reference/api-reference-api-examples","title":"Get started with the Langflow API","description":"You can use the Langflow API for programmatic interactions with Langflow, such as the following:","sidebar":"docs"},"API-Reference/api-users":{"id":"API-Reference/api-users","title":"Users endpoints","description":"Use the /users endpoint to manage user accounts in Langflow.","sidebar":"docs"},"Components/bundles-aiml":{"id":"Components/bundles-aiml","title":"AI/ML API","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-amazon":{"id":"Components/bundles-amazon","title":"Amazon","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-anthropic":{"id":"Components/bundles-anthropic","title":"Anthropic","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-arxiv":{"id":"Components/bundles-arxiv","title":"arXiv","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-azure":{"id":"Components/bundles-azure","title":"Azure","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-baidu":{"id":"Components/bundles-baidu","title":"Baidu","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-bing":{"id":"Components/bundles-bing","title":"Bing","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-cassandra":{"id":"Components/bundles-cassandra","title":"Cassandra","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-chroma":{"id":"Components/bundles-chroma","title":"Chroma","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-clickhouse":{"id":"Components/bundles-clickhouse","title":"ClickHouse","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-cloudflare":{"id":"Components/bundles-cloudflare","title":"Cloudflare","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-cohere":{"id":"Components/bundles-cohere","title":"Cohere","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-couchbase":{"id":"Components/bundles-couchbase","title":"Couchbase","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-datastax":{"id":"Components/bundles-datastax","title":"DataStax","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-deepseek":{"id":"Components/bundles-deepseek","title":"DeepSeek","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-duckduckgo":{"id":"Components/bundles-duckduckgo","title":"DuckDuckGo","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-elastic":{"id":"Components/bundles-elastic","title":"Elastic","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-exa":{"id":"Components/bundles-exa","title":"Exa","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-faiss":{"id":"Components/bundles-faiss","title":"FAISS","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-glean":{"id":"Components/bundles-glean","title":"Glean","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-google":{"id":"Components/bundles-google","title":"Google components","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-groq":{"id":"Components/bundles-groq","title":"Groq","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-huggingface":{"id":"Components/bundles-huggingface","title":"Hugging Face","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-ibm":{"id":"Components/bundles-ibm","title":"IBM","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-icosacomputing":{"id":"Components/bundles-icosacomputing","title":"Icosa Computing","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-langchain":{"id":"Components/bundles-langchain","title":"LangChain","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-lmstudio":{"id":"Components/bundles-lmstudio","title":"LM Studio","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-maritalk":{"id":"Components/bundles-maritalk","title":"MariTalk","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-mem0":{"id":"Components/bundles-mem0","title":"Mem0","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-milvus":{"id":"Components/bundles-milvus","title":"Milvus","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-mistralai":{"id":"Components/bundles-mistralai","title":"MistralAI","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-mongodb":{"id":"Components/bundles-mongodb","title":"MongoDB","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-novita":{"id":"Components/bundles-novita","title":"Novita","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-nvidia":{"id":"Components/bundles-nvidia","title":"NVIDIA components","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-ollama":{"id":"Components/bundles-ollama","title":"Ollama","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-openai":{"id":"Components/bundles-openai","title":"OpenAI","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-openrouter":{"id":"Components/bundles-openrouter","title":"OpenRouter","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-perplexity":{"id":"Components/bundles-perplexity","title":"Perplexity","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-pgvector":{"id":"Components/bundles-pgvector","title":"pgvector","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-pinecone":{"id":"Components/bundles-pinecone","title":"Pinecone","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-qdrant":{"id":"Components/bundles-qdrant","title":"Qdrant","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-redis":{"id":"Components/bundles-redis","title":"Redis","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-sambanova":{"id":"Components/bundles-sambanova","title":"SambaNova","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-searchapi":{"id":"Components/bundles-searchapi","title":"SearchApi","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-serper":{"id":"Components/bundles-serper","title":"Serper","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-supabase":{"id":"Components/bundles-supabase","title":"Supabase","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-upstash":{"id":"Components/bundles-upstash","title":"Upstash","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-vectara":{"id":"Components/bundles-vectara","title":"Vectara","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-vertexai":{"id":"Components/bundles-vertexai","title":"Vertex AI","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-weaviate":{"id":"Components/bundles-weaviate","title":"Weaviate","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-wikipedia":{"id":"Components/bundles-wikipedia","title":"Wikipedia","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-xai":{"id":"Components/bundles-xai","title":"xAI","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/components-agents":{"id":"Components/components-agents","title":"Agents","description":"Langflow\'s Agent and MCP Tools components are critical for building agent flows.","sidebar":"docs"},"Components/components-bundles":{"id":"Components/components-bundles","title":"About bundles","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/components-custom-components":{"id":"Components/components-custom-components","title":"Create custom Python components","description":"Custom components extend Langflow\'s functionality through Python classes that inherit from Component. This enables integration of new features, data manipulation, external services, and specialized tools.","sidebar":"docs"},"Components/components-data":{"id":"Components/components-data","title":"Data","description":"Data components bring data into your flows from various sources like files, API endpoints, and URLs.","sidebar":"docs"},"Components/components-embedding-models":{"id":"Components/components-embedding-models","title":"Embedding Model","description":"Embedding model components in Langflow generate text embeddings using a specified Large Language Model (LLM).","sidebar":"docs"},"Components/components-helpers":{"id":"Components/components-helpers","title":"Helpers","description":"Helper components provide utility functions to help manage data and perform simple tasks in your flow.","sidebar":"docs"},"Components/components-io":{"id":"Components/components-io","title":"Input / Output","description":"Input and output components define where data enters and exits your flow, but they don\'t have identical functionality.","sidebar":"docs"},"Components/components-logic":{"id":"Components/components-logic","title":"Logic","description":"Logic components provide functionalities for routing, conditional processing, and flow management.","sidebar":"docs"},"Components/components-models":{"id":"Components/components-models","title":"Language Model","description":"Language model components in Langflow generate text using a specified Large Language Model (LLM).","sidebar":"docs"},"Components/components-processing":{"id":"Components/components-processing","title":"Processing components","description":"Processing components process and transform data within a flow.","sidebar":"docs"},"Components/components-prompts":{"id":"Components/components-prompts","title":"Prompt Template","description":"Use the Prompt Template core component to create a prompt that supplies instructions and context to an LLM or agent, separate from other input like chat messages and file uploads.","sidebar":"docs"},"Components/components-tools":{"id":"Components/components-tools","title":"Tools","description":"In Langflow version 1.5, the Tools category was deprecated.","sidebar":"docs"},"Components/mcp-client":{"id":"Components/mcp-client","title":"Use Langflow as an MCP client","description":"Langflow integrates with the Model Context Protocol (MCP) as both an MCP server and an MCP client.","sidebar":"docs"},"Concepts/concepts-components":{"id":"Concepts/concepts-components","title":"Components overview","description":"Components are the building blocks of your flows.","sidebar":"docs"},"Concepts/concepts-file-management":{"id":"Concepts/concepts-file-management","title":"Manage files","description":"Each Langflow server has a file management system where you can store files that you want to use in your flows.","sidebar":"docs"},"Concepts/concepts-flows":{"id":"Concepts/concepts-flows","title":"Build flows","description":"A flow is a functional representation of an application workflow.","sidebar":"docs"},"Concepts/concepts-flows-import":{"id":"Concepts/concepts-flows-import","title":"Import and export flows","description":"You can export flows to transfer them between Langflow instances, share them with others, or create backups.","sidebar":"docs"},"Concepts/concepts-overview":{"id":"Concepts/concepts-overview","title":"Use the visual editor","description":"You use Langflow\'s visual editor to create, test, and share flows, which are functional representations of application workflows.","sidebar":"docs"},"Concepts/concepts-playground":{"id":"Concepts/concepts-playground","title":"Test flows in the Playground","description":"Langflow\'s Playground is a dynamic interface you can use to test your LLM-based flows in real-time.","sidebar":"docs"},"Concepts/concepts-publish":{"id":"Concepts/concepts-publish","title":"Trigger flows with the Langflow API","description":"After you build a flow, you probably want to run it within an application, such as a chatbot within a mobile app or website.","sidebar":"docs"},"Concepts/concepts-voice-mode":{"id":"Concepts/concepts-voice-mode","title":"Use voice mode","description":"You can use Langflow\'s voice mode to interact with your flows verbally through a microphone and speakers.","sidebar":"docs"},"Concepts/data-types":{"id":"Concepts/data-types","title":"Langflow data types","description":"Langflow components are designed to accept and produce specific types of inputs and outputs.","sidebar":"docs"},"Concepts/mcp-server":{"id":"Concepts/mcp-server","title":"Use Langflow as an MCP server","description":"Langflow integrates with the Model Context Protocol (MCP) as both an MCP server and an MCP client.","sidebar":"docs"},"Configuration/api-keys-and-authentication":{"id":"Configuration/api-keys-and-authentication","title":"API keys and authentication","description":"Never expose Langflow ports directly to the internet without proper security measures.","sidebar":"docs"},"Configuration/configuration-cli":{"id":"Configuration/configuration-cli","title":"Langflow CLI","description":"The Langflow command line interface is the main interface for managing and running the Langflow server.","sidebar":"docs"},"Configuration/configuration-custom-database":{"id":"Configuration/configuration-custom-database","title":"Configure an external PostgreSQL database","description":"Langflow\'s default database is SQLite, but you can configure Langflow to use PostgreSQL instead.","sidebar":"docs"},"Configuration/configuration-global-variables":{"id":"Configuration/configuration-global-variables","title":"Global variables","description":"Use global variables to store and reuse credentials and generic values across all of your flows.","sidebar":"docs"},"Configuration/environment-variables":{"id":"Configuration/environment-variables","title":"Environment variables","description":"In general, environment variables, like LANGFLOWPORT or LANGFLOWLOG_LEVEL, configure how Langflow runs.","sidebar":"docs"},"Contributing/contributing-bundles":{"id":"Contributing/contributing-bundles","title":"Contribute bundles","description":"Bundles are groups of components that are related to a specific service provider.","sidebar":"docs"},"Contributing/contributing-community":{"id":"Contributing/contributing-community","title":"Join the Langflow community","description":"There are several ways you can interact with the Langflow community and learn more about the Langflow codebase.","sidebar":"docs"},"Contributing/contributing-component-tests":{"id":"Contributing/contributing-component-tests","title":"Contribute component tests","description":"This guide outlines how to structure and implement tests for application components to ensure consistency and adequate coverage.","sidebar":"docs"},"Contributing/contributing-components":{"id":"Contributing/contributing-components","title":"Contribute components","description":"New components are added as objects of the Component class.","sidebar":"docs"},"Contributing/contributing-github-issues":{"id":"Contributing/contributing-github-issues","title":"Get help and request enhancements","description":"The Langflow GitHub repository is an integral part of the Langflow community.","sidebar":"docs"},"Contributing/contributing-how-to-contribute":{"id":"Contributing/contributing-how-to-contribute","title":"Contribute to Langflow","description":"This guide is intended to help you start contributing to Langflow.","sidebar":"docs"},"Contributing/contributing-telemetry":{"id":"Contributing/contributing-telemetry","title":"Telemetry","description":"Langflow uses anonymous telemetry to collect statistics about feature usage and performance.","sidebar":"docs"},"Contributing/contributing-templates":{"id":"Contributing/contributing-templates","title":"Contribute templates","description":"Follow these best practices when submitting a template to Langflow.","sidebar":"docs"},"Deployment/deployment-architecture":{"id":"Deployment/deployment-architecture","title":"Langflow architecture on Kubernetes","description":"There are two broad types of Langflow deployments:","sidebar":"docs"},"Deployment/deployment-caddyfile":{"id":"Deployment/deployment-caddyfile","title":"Deploy Langflow on a remote server","description":"Learn how to deploy Langflow on your own remote server with secure web access.","sidebar":"docs"},"Deployment/deployment-docker":{"id":"Deployment/deployment-docker","title":"Deploy Langflow on Docker","description":"Running applications in Docker containers ensures consistent behavior across different systems and eliminates dependency conflicts.","sidebar":"docs"},"Deployment/deployment-gcp":{"id":"Deployment/deployment-gcp","title":"Deploy Langflow on Google Cloud Platform","description":"This guide demonstrates how to deploy Langflow on Google Cloud Platform with a Cloud Shell script that walks through the process of setting up a Debian-based VM with the Langflow package, Nginx, and the necessary configurations to run the Langflow development environment in GCP.","sidebar":"docs"},"Deployment/deployment-hugging-face-spaces":{"id":"Deployment/deployment-hugging-face-spaces","title":"Deploy Langflow on Hugging Face Spaces","description":"This guide explains how to deploy Langflow on Hugging Face Spaces.","sidebar":"docs"},"Deployment/deployment-kubernetes-dev":{"id":"Deployment/deployment-kubernetes-dev","title":"Deploy the Langflow development environment on Kubernetes","description":"The Langflow integrated development environment (IDE) Helm chart is designed to provide a complete environment for developers to create, test, and debug their flows. It includes both the Langflow API and visual editor.","sidebar":"docs"},"Deployment/deployment-kubernetes-prod":{"id":"Deployment/deployment-kubernetes-prod","title":"Deploy the Langflow production environment on Kubernetes","description":"The Langflow runtime Helm chart is tailored for deploying applications in a production environment. It is focused on stability, performance, isolation, and security to ensure that applications run reliably and efficiently.","sidebar":"docs"},"Deployment/deployment-overview":{"id":"Deployment/deployment-overview","title":"Langflow deployment overview","description":"This section includes the different ways to bring your locally-built flows to the world.","sidebar":"docs"},"Deployment/deployment-prod-best-practices":{"id":"Deployment/deployment-prod-best-practices","title":"Best practices for Langflow on Kubernetes","description":"This guide provides best practices for deploying Langflow in production environments on Kubernetes.","sidebar":"docs"},"Deployment/deployment-public-server":{"id":"Deployment/deployment-public-server","title":"Deploy a public Langflow server","description":"By default, your Langflow server at http7860 isn\'t exposed to the public internet.","sidebar":"docs"},"Deployment/deployment-railway":{"id":"Deployment/deployment-railway","title":"Deploy Langflow on Railway","description":"Deploy Langflow to Railway using a one-click template","sidebar":"docs"},"Deployment/deployment-render":{"id":"Deployment/deployment-render","title":"Deploy Langflow on Render","description":"This guide explains how to deploy Langflow on Render, a cloud platform for deploying web applications and APIs.","sidebar":"docs"},"Develop/Clients/typescript-client":{"id":"Develop/Clients/typescript-client","title":"Langflow TypeScript client","description":"The Langflow TypeScript client allows your TypeScript applications to programmatically interact with the Langflow API.","sidebar":"docs"},"Develop/develop-application":{"id":"Develop/develop-application","title":"Containerize a Langflow application","description":"Designing flows in the visual editor is only the first step in building an application that uses Langflow.","sidebar":"docs"},"Develop/enterprise-database-guide":{"id":"Develop/enterprise-database-guide","title":"Langflow database guide for enterprise DBAs","description":"The Langflow database stores data that is essential for more Langflow operations, including startup, flow execution, user interactions, and administrative tasks.","sidebar":"docs"},"Develop/install-custom-dependencies":{"id":"Develop/install-custom-dependencies","title":"Install custom dependencies","description":"Langflow provides optional dependency groups and support for custom dependencies to extend Langflow functionality. This guide covers how to add dependencies for different Langflow installations, including Langflow Desktop and Langflow OSS.","sidebar":"docs"},"Develop/logging":{"id":"Develop/logging","title":"Logs","description":"Langflow produces logs for individual flows and the Langflow application itself using the structlog library for logging.","sidebar":"docs"},"Develop/memory":{"id":"Develop/memory","title":"Memory management options","description":"Langflow provides flexible memory management options for storage and retrieval of data relevant to your flows and your Langflow server.","sidebar":"docs"},"Develop/session-id":{"id":"Develop/session-id","title":"Use session ID to manage communication between components","description":"Session ID is a unique identifier for client/server connections. A single session equals the duration of a client\'s connection to a server.","sidebar":"docs"},"Develop/webhook":{"id":"Develop/webhook","title":"Trigger flows with webhooks","description":"You can use the Webhook component to start a flow run in response to an external event.","sidebar":"docs"},"Get-Started/about-langflow":{"id":"Get-Started/about-langflow","title":"What is Langflow?","description":"Langflow is an open-source, Python-based, customizable framework for building AI applications.","sidebar":"docs"},"Get-Started/get-started-installation":{"id":"Get-Started/get-started-installation","title":"Install Langflow","description":"Langflow can be installed in multiple ways:","sidebar":"docs"},"Get-Started/get-started-quickstart":{"id":"Get-Started/get-started-quickstart","title":"Quickstart","description":"Get started with Langflow by loading a template flow, running it, and then serving it at the /run API endpoint.","sidebar":"docs"},"Integrations/Apify/integrations-apify":{"id":"Integrations/Apify/integrations-apify","title":"Apify","description":"Apify is a web scraping and data extraction platform with more than 3,000 ready-made cloud tools called Actors.","sidebar":"docs"},"Integrations/Arize/integrations-arize":{"id":"Integrations/Arize/integrations-arize","title":"Arize","description":"Arize is a tool built on OpenTelemetry and OpenInference for monitoring and optimizing LLM applications.","sidebar":"docs"},"Integrations/Cleanlab/integrations-cleanlab":{"id":"Integrations/Cleanlab/integrations-cleanlab","title":"Cleanlab","description":"Cleanlab adds automation and trust to every data point going in and every prediction coming out of AI and RAG solutions.","sidebar":"docs"},"Integrations/Composio/integrations-composio":{"id":"Integrations/Composio/integrations-composio","title":"Composio","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Integrations/Docling/integrations-docling":{"id":"Integrations/Docling/integrations-docling","title":"Docling","description":"Langflow integrates with Docling through a bundle of components for parsing documents.","sidebar":"docs"},"Integrations/Google/integrations-google-big-query":{"id":"Integrations/Google/integrations-google-big-query","title":"Google BigQuery","description":"Langflow integrates with Google BigQuery through the BigQuery component in the Google bundle, allowing you to execute SQL queries and retrieve data from your BigQuery datasets.","sidebar":"docs"},"Integrations/integrations-assemblyai":{"id":"Integrations/integrations-assemblyai","title":"AssemblyAI","description":"The AssemblyAI components allow you to apply powerful Speech AI models to your app for tasks like:","sidebar":"docs"},"Integrations/integrations-instana-traceloop":{"id":"Integrations/integrations-instana-traceloop","title":"Traceloop","description":"Instrument Langflow with the Traceloop SDK, and export traces and metrics to Instana using OpenTelemetry.","sidebar":"docs"},"Integrations/integrations-langfuse":{"id":"Integrations/integrations-langfuse","title":"Langfuse","description":"Langfuse is an open-source platform for LLM observability. It provides tracing and monitoring capabilities for AI applications, helping developers debug, analyze, and optimize their AI systems. Langfuse integrates with various tools and frameworks, including workflow builders and runtimes like Langflow.","sidebar":"docs"},"Integrations/integrations-langsmith":{"id":"Integrations/integrations-langsmith","title":"LangSmith","description":"LangSmith is a full-lifecycle DevOps service from LangChain that provides monitoring and observability. To integrate with Langflow, add your LangChain API key and configuration as Langflow environment variables, and then start Langflow.","sidebar":"docs"},"Integrations/integrations-langwatch":{"id":"Integrations/integrations-langwatch","title":"LangWatch","description":"LangWatch is an all-in-one LLMOps platform for monitoring, observability, analytics, evaluations and alerting for getting user insights and improve your LLM workflows.","sidebar":"docs"},"Integrations/integrations-opik":{"id":"Integrations/integrations-opik","title":"Opik","description":"Opik is an open-source platform designed for evaluating, testing, and monitoring large language model (LLM) applications. Developed by Comet, it aims to facilitate more intuitive collaboration, testing, and monitoring of LLM-based applications.","sidebar":"docs"},"Integrations/mcp-component-astra":{"id":"Integrations/mcp-component-astra","title":"Connect an Astra DB MCP server to Langflow","description":"This guide demonstrates how to use Langflow as an MCP client by using the MCP Tools component to run a DataStax Astra DB MCP server in an agent flow.","sidebar":"docs"},"Integrations/Notion/integrations-notion":{"id":"Integrations/Notion/integrations-notion","title":"Set up a Notion App","description":"To use Notion components in Langflow, you first need to create a Notion integration and configure it with the necessary capabilities. This guide will walk you through the process of setting up a Notion integration and granting it access to your Notion databases.","sidebar":"docs"},"Integrations/Notion/notion-agent-conversational":{"id":"Integrations/Notion/notion-agent-conversational","title":"Notion Conversational Agent","description":"The Notion Conversational Agent is an AI-powered assistant that interacts with your Notion workspace through natural language conversations. This flow performs Notion-related tasks like creating pages, searching for information, and managing content, all through a chat interface.","sidebar":"docs"},"Integrations/Notion/notion-agent-meeting-notes":{"id":"Integrations/Notion/notion-agent-meeting-notes","title":"Notion Meeting Notes Agent","description":"The Notion Agent for Meeting Notes is an AI-powered tool that automatically processes meeting transcripts and updates your Notion workspace. It identifies tasks, action items, and key points from your meetings, then creates new tasks or updates existing ones in Notion without manual input.","sidebar":"docs"},"Integrations/Nvidia/integrations-nvidia-g-assist":{"id":"Integrations/Nvidia/integrations-nvidia-g-assist","title":"Integrate NVIDIA G-Assist with Langflow","description":"The NVIDIA System-Assist component integrates your flows with NVIDIA G-Assist, enabling interaction with NVIDIA GPU drivers through natural language prompts.","sidebar":"docs"},"Integrations/Nvidia/integrations-nvidia-ingest":{"id":"Integrations/Nvidia/integrations-nvidia-ingest","title":"Integrate NVIDIA Retriever Extraction with Langflow","description":"The NVIDIA Retriever Extraction component integrates with the NVIDIA nv-ingest microservice for data ingestion, processing, and extraction of text files.","sidebar":"docs"},"Integrations/Nvidia/integrations-nvidia-nim-wsl2":{"id":"Integrations/Nvidia/integrations-nvidia-nim-wsl2","title":"Integrate NVIDIA NIMs with Langflow","description":"Connect Langflow with NVIDIA NIM on an RTX Windows system with Windows Subsystem for Linux 2 (WSL2) installed.","sidebar":"docs"},"Support/luna-for-langflow":{"id":"Support/luna-for-langflow","title":"IBM Elite Support for Langflow","description":"IBM Elite Support offers enterprise support for Langflow to help you develop and deploy Langflow applications with confidence.","sidebar":"docs"},"Support/release-notes":{"id":"Support/release-notes","title":"Langflow release notes","description":"This page summarizes significant changes to Langflow in each release.","sidebar":"docs"},"Support/troubleshooting":{"id":"Support/troubleshooting","title":"Troubleshoot Langflow","description":"This page provides troubleshooting advice for issues you might encounter when using Langflow or contributing to Langflow.","sidebar":"docs"},"Tutorials/agent":{"id":"Tutorials/agent","title":"Connect applications to agents","description":"This tutorial shows you how to connect a JavaScript application to a Langflow agent.","sidebar":"docs"},"Tutorials/chat-with-files":{"id":"Tutorials/chat-with-files","title":"Create a chatbot that can ingest files","description":"This tutorial shows you how to build a chatbot that can read and answer questions about files you upload, such as meeting notes or job applications.","sidebar":"docs"},"Tutorials/chat-with-rag":{"id":"Tutorials/chat-with-rag","title":"Create a vector RAG chatbot","description":"This tutorial demonstrates how you can use Langflow to create a chatbot application that uses Retrieval Augmented Generation (RAG) to embed your data as vectors in a vector database, and then chat with the data.","sidebar":"docs"},"Tutorials/mcp-tutorial":{"id":"Tutorials/mcp-tutorial","title":"Connect to MCP servers from your application","description":"This tutorial shows you how to connect MCP servers to your applications using Langflow\'s MCP Tools component.","sidebar":"docs"}}}}')}}]); \ No newline at end of file diff --git a/assets/js/22dd74f7.9ac934a6.js b/assets/js/22dd74f7.9ac934a6.js new file mode 100644 index 0000000000..aa130592d3 --- /dev/null +++ b/assets/js/22dd74f7.9ac934a6.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[1567],{55226:e=>{e.exports=JSON.parse('{"version":{"pluginId":"default","version":"current","label":"Next","banner":null,"badge":false,"noIndex":false,"className":"docs-version-current","isLast":true,"docsSidebars":{"docs":[{"type":"category","label":"Get started","items":[{"type":"link","label":"About Langflow","href":"/","docId":"Get-Started/about-langflow","unlisted":false},{"type":"link","label":"Install Langflow","href":"/get-started-installation","docId":"Get-Started/get-started-installation","unlisted":false},{"type":"link","label":"Quickstart","href":"/get-started-quickstart","docId":"Get-Started/get-started-quickstart","unlisted":false},{"type":"category","label":"Tutorials","items":[{"type":"link","label":"Create a vector RAG chatbot","href":"/chat-with-rag","docId":"Tutorials/chat-with-rag","unlisted":false},{"type":"link","label":"Create a chatbot that can ingest files","href":"/chat-with-files","docId":"Tutorials/chat-with-files","unlisted":false},{"type":"link","label":"Connect applications to agents","href":"/agent-tutorial","docId":"Tutorials/agent","unlisted":false},{"type":"link","label":"Connect to MCP servers from your application","href":"/mcp-tutorial","docId":"Tutorials/mcp-tutorial","unlisted":false}],"collapsed":true,"collapsible":true}],"collapsed":true,"collapsible":true},{"type":"category","label":"Flows","items":[{"type":"link","label":"Use the visual editor","href":"/concepts-overview","docId":"Concepts/concepts-overview","unlisted":false},{"type":"link","label":"Build flows","href":"/concepts-flows","docId":"Concepts/concepts-flows","unlisted":false},{"type":"category","label":"Run flows","items":[{"type":"link","label":"Trigger flows with the Langflow API","href":"/concepts-publish","docId":"Concepts/concepts-publish","unlisted":false},{"type":"link","label":"Trigger flows with webhooks","href":"/webhook","docId":"Develop/webhook","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"link","label":"Test flows","href":"/concepts-playground","docId":"Concepts/concepts-playground","unlisted":false},{"type":"link","label":"Import and export flows","href":"/concepts-flows-import","docId":"Concepts/concepts-flows-import","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Agents","items":[{"type":"link","label":"Use Langflow agents","href":"/agents","docId":"Agents/agents","unlisted":false},{"type":"link","label":"Configure tools for agents","href":"/agents-tools","docId":"Agents/agents-tools","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Model Context Protocol (MCP)","items":[{"type":"link","label":"Use Langflow as an MCP client","href":"/mcp-client","docId":"Components/mcp-client","unlisted":false},{"type":"link","label":"Use Langflow as an MCP server","href":"/mcp-server","docId":"Concepts/mcp-server","unlisted":false},{"type":"link","label":"Connect an Astra DB MCP server to Langflow","href":"/mcp-component-astra","docId":"Integrations/mcp-component-astra","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Develop","items":[{"type":"link","label":"API keys and authentication","href":"/api-keys-and-authentication","docId":"Configuration/api-keys-and-authentication","unlisted":false},{"type":"link","label":"Install custom dependencies","href":"/install-custom-dependencies","docId":"Develop/install-custom-dependencies","unlisted":false},{"type":"link","label":"Global variables","href":"/configuration-global-variables","docId":"Configuration/configuration-global-variables","unlisted":false},{"type":"link","label":"Environment variables","href":"/environment-variables","docId":"Configuration/environment-variables","unlisted":false},{"type":"category","label":"Storage and memory","items":[{"type":"link","label":"Manage files","href":"/concepts-file-management","docId":"Concepts/concepts-file-management","unlisted":false},{"type":"link","label":"Manage memory","href":"/memory","docId":"Develop/memory","unlisted":false},{"type":"link","label":"Use Session IDs","href":"/session-id","docId":"Develop/session-id","unlisted":false},{"type":"link","label":"Configure an external PostgreSQL database","href":"/configuration-custom-database","docId":"Configuration/configuration-custom-database","unlisted":false},{"type":"link","label":"Database guide for enterprise administrators","href":"/enterprise-database-guide","docId":"Develop/enterprise-database-guide","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Observability","items":[{"type":"link","label":"Logs","href":"/logging","docId":"Develop/logging","unlisted":false},{"type":"category","label":"Monitoring","items":[{"type":"link","label":"Arize","href":"/integrations-arize","docId":"Integrations/Arize/integrations-arize","unlisted":false},{"type":"link","label":"Langfuse","href":"/integrations-langfuse","docId":"Integrations/integrations-langfuse","unlisted":false},{"type":"link","label":"LangSmith","href":"/integrations-langsmith","docId":"Integrations/integrations-langsmith","unlisted":false},{"type":"link","label":"LangWatch","href":"/integrations-langwatch","docId":"Integrations/integrations-langwatch","unlisted":false},{"type":"link","label":"Opik","href":"/integrations-opik","docId":"Integrations/integrations-opik","unlisted":false},{"type":"link","label":"Traceloop","href":"/integrations-instana-traceloop","docId":"Integrations/integrations-instana-traceloop","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"link","label":"Telemetry","href":"/contributing-telemetry","docId":"Contributing/contributing-telemetry","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"link","label":"Use Langflow data types","href":"/data-types","docId":"Concepts/data-types","unlisted":false},{"type":"link","label":"Use voice mode","href":"/concepts-voice-mode","docId":"Concepts/concepts-voice-mode","unlisted":false},{"type":"link","label":"Use the Langflow CLI","href":"/configuration-cli","docId":"Configuration/configuration-cli","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Deploy","items":[{"type":"link","label":"Langflow deployment overview","href":"/deployment-overview","docId":"Deployment/deployment-overview","unlisted":false},{"type":"link","label":"Deploy a public Langflow server","href":"/deployment-public-server","docId":"Deployment/deployment-public-server","unlisted":false},{"type":"category","label":"Containerized deployments","items":[{"type":"link","label":"Containerize a Langflow application","href":"/develop-application","docId":"Develop/develop-application","unlisted":false},{"type":"link","label":"Langflow Docker images","href":"/deployment-docker","docId":"Deployment/deployment-docker","unlisted":false},{"type":"link","label":"Deploy Langflow on a remote server","href":"/deployment-caddyfile","docId":"Deployment/deployment-caddyfile","unlisted":false},{"type":"category","label":"Kubernetes","items":[{"type":"link","label":"Deployment architecture","href":"/deployment-architecture","docId":"Deployment/deployment-architecture","unlisted":false},{"type":"link","label":"Best practices","href":"/deployment-prod-best-practices","docId":"Deployment/deployment-prod-best-practices","unlisted":false},{"type":"link","label":"Deploy in development","href":"/deployment-kubernetes-dev","docId":"Deployment/deployment-kubernetes-dev","unlisted":false},{"type":"link","label":"Deploy in production","href":"/deployment-kubernetes-prod","docId":"Deployment/deployment-kubernetes-prod","unlisted":false}],"collapsed":true,"collapsible":true}],"collapsed":true,"collapsible":true},{"type":"category","label":"Cloud platforms","items":[{"type":"link","label":"Google Cloud Platform","href":"/deployment-gcp","docId":"Deployment/deployment-gcp","unlisted":false},{"type":"link","label":"Hugging Face Spaces","href":"/deployment-hugging-face-spaces","docId":"Deployment/deployment-hugging-face-spaces","unlisted":false},{"type":"link","label":"Railway","href":"/deployment-railway","docId":"Deployment/deployment-railway","unlisted":false},{"type":"link","label":"Render","href":"/deployment-render","docId":"Deployment/deployment-render","unlisted":false}],"collapsed":true,"collapsible":true}],"collapsed":true,"collapsible":true},{"type":"category","label":"Components reference","items":[{"type":"link","label":"Components overview","href":"/concepts-components","docId":"Concepts/concepts-components","unlisted":false},{"type":"category","label":"Core components","items":[{"type":"link","label":"Input / Output","href":"/components-io","docId":"Components/components-io","unlisted":false},{"type":"link","label":"Agents","href":"/components-agents","docId":"Components/components-agents","unlisted":false},{"type":"category","label":"Models","items":[{"type":"link","label":"Language Model","href":"/components-models","docId":"Components/components-models","unlisted":false},{"type":"link","label":"Embedding Model","href":"/components-embedding-models","docId":"Components/components-embedding-models","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"link","label":"Data","href":"/components-data","docId":"Components/components-data","unlisted":false},{"type":"category","label":"Processing","items":[{"type":"link","label":"Processing components","href":"/components-processing","docId":"Components/components-processing","unlisted":false},{"type":"link","label":"Prompt Template","href":"/components-prompts","docId":"Components/components-prompts","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"link","label":"Logic","href":"/components-logic","docId":"Components/components-logic","unlisted":false},{"type":"link","label":"Helpers","href":"/components-helpers","docId":"Components/components-helpers","unlisted":false},{"type":"link","label":"Tools","href":"/components-tools","docId":"Components/components-tools","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Bundles","items":[{"type":"link","label":"About bundles","href":"/components-bundle-components","docId":"Components/components-bundles","unlisted":false},{"type":"link","label":"AI/ML API","href":"/bundles-aiml","docId":"Components/bundles-aiml","unlisted":false},{"type":"link","label":"Amazon","href":"/bundles-amazon","docId":"Components/bundles-amazon","unlisted":false},{"type":"link","label":"Anthropic","href":"/bundles-anthropic","docId":"Components/bundles-anthropic","unlisted":false},{"type":"link","label":"Apify","href":"/integrations-apify","docId":"Integrations/Apify/integrations-apify","unlisted":false},{"type":"link","label":"arXiv","href":"/bundles-arxiv","docId":"Components/bundles-arxiv","unlisted":false},{"type":"link","label":"AssemblyAI","href":"/integrations-assemblyai","docId":"Integrations/integrations-assemblyai","unlisted":false},{"type":"link","label":"Azure","href":"/bundles-azure","docId":"Components/bundles-azure","unlisted":false},{"type":"link","label":"Baidu","href":"/bundles-baidu","docId":"Components/bundles-baidu","unlisted":false},{"type":"link","label":"Bing","href":"/bundles-bing","docId":"Components/bundles-bing","unlisted":false},{"type":"link","label":"Cassandra","href":"/bundles-cassandra","docId":"Components/bundles-cassandra","unlisted":false},{"type":"link","label":"Chroma","href":"/bundles-chroma","docId":"Components/bundles-chroma","unlisted":false},{"type":"link","label":"Cleanlab","href":"/integrations-cleanlab","docId":"Integrations/Cleanlab/integrations-cleanlab","unlisted":false},{"type":"link","label":"ClickHouse","href":"/bundles-clickhouse","docId":"Components/bundles-clickhouse","unlisted":false},{"type":"link","label":"Cloudflare","href":"/bundles-cloudflare","docId":"Components/bundles-cloudflare","unlisted":false},{"type":"link","label":"Cohere","href":"/bundles-cohere","docId":"Components/bundles-cohere","unlisted":false},{"type":"link","label":"Composio","href":"/integrations-composio","docId":"Integrations/Composio/integrations-composio","unlisted":false},{"type":"link","label":"Couchbase","href":"/bundles-couchbase","docId":"Components/bundles-couchbase","unlisted":false},{"type":"link","label":"DataStax","href":"/bundles-datastax","docId":"Components/bundles-datastax","unlisted":false},{"type":"link","label":"DeepSeek","href":"/bundles-deepseek","docId":"Components/bundles-deepseek","unlisted":false},{"type":"link","label":"Docling","href":"/integrations-docling","docId":"Integrations/Docling/integrations-docling","unlisted":false},{"type":"link","label":"DuckDuckGo","href":"/bundles-duckduckgo","docId":"Components/bundles-duckduckgo","unlisted":false},{"type":"link","label":"Elastic","href":"/bundles-elastic","docId":"Components/bundles-elastic","unlisted":false},{"type":"link","label":"Exa","href":"/bundles-exa","docId":"Components/bundles-exa","unlisted":false},{"type":"link","label":"FAISS","href":"/bundles-faiss","docId":"Components/bundles-faiss","unlisted":false},{"type":"link","label":"Glean","href":"/bundles-glean","docId":"Components/bundles-glean","unlisted":false},{"type":"category","label":"Google","items":[{"type":"link","label":"Google components","href":"/bundles-google","docId":"Components/bundles-google","unlisted":false},{"type":"link","label":"Google BigQuery","href":"/integrations-google-big-query","docId":"Integrations/Google/integrations-google-big-query","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"link","label":"Groq","href":"/bundles-groq","docId":"Components/bundles-groq","unlisted":false},{"type":"link","label":"Hugging Face","href":"/bundles-huggingface","docId":"Components/bundles-huggingface","unlisted":false},{"type":"link","label":"IBM","href":"/bundles-ibm","docId":"Components/bundles-ibm","unlisted":false},{"type":"link","label":"Icosa Computing","href":"/bundles-icosacomputing","docId":"Components/bundles-icosacomputing","unlisted":false},{"type":"link","label":"LangChain","href":"/bundles-langchain","docId":"Components/bundles-langchain","unlisted":false},{"type":"link","label":"LM Studio","href":"/bundles-lmstudio","docId":"Components/bundles-lmstudio","unlisted":false},{"type":"link","label":"MariTalk","href":"/bundles-maritalk","docId":"Components/bundles-maritalk","unlisted":false},{"type":"link","label":"Mem0","href":"/bundles-mem0","docId":"Components/bundles-mem0","unlisted":false},{"type":"link","label":"Milvus","href":"/bundles-milvus","docId":"Components/bundles-milvus","unlisted":false},{"type":"link","label":"MistralAI","href":"/bundles-mistralai","docId":"Components/bundles-mistralai","unlisted":false},{"type":"link","label":"MongoDB","href":"/bundles-mongodb","docId":"Components/bundles-mongodb","unlisted":false},{"type":"category","label":"Notion","items":[{"type":"link","label":"Set up a Notion App","href":"/integrations/notion/setup","docId":"Integrations/Notion/integrations-notion","unlisted":false},{"type":"link","label":"Notion Conversational Agent","href":"/integrations/notion/notion-agent-conversational","docId":"Integrations/Notion/notion-agent-conversational","unlisted":false},{"type":"link","label":"Notion Meeting Notes Agent","href":"/integrations/notion/notion-agent-meeting-notes","docId":"Integrations/Notion/notion-agent-meeting-notes","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"link","label":"Novita","href":"/bundles-novita","docId":"Components/bundles-novita","unlisted":false},{"type":"category","label":"NVIDIA","items":[{"type":"link","label":"NVIDIA components","href":"/bundles-nvidia","docId":"Components/bundles-nvidia","unlisted":false},{"type":"link","label":"NVIDIA Ingest","href":"/integrations-nvidia-ingest","docId":"Integrations/Nvidia/integrations-nvidia-ingest","unlisted":false},{"type":"link","label":"NVIDIA NIM on WSL2","href":"/integrations-nvidia-ingest-wsl2","docId":"Integrations/Nvidia/integrations-nvidia-nim-wsl2","unlisted":false},{"type":"link","label":"NVIDIA System-Assist","href":"/integrations-nvidia-g-assist","docId":"Integrations/Nvidia/integrations-nvidia-g-assist","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"link","label":"Ollama","href":"/bundles-ollama","docId":"Components/bundles-ollama","unlisted":false},{"type":"link","label":"OpenAI","href":"/bundles-openai","docId":"Components/bundles-openai","unlisted":false},{"type":"link","label":"OpenRouter","href":"/bundles-openrouter","docId":"Components/bundles-openrouter","unlisted":false},{"type":"link","label":"Perplexity","href":"/bundles-perplexity","docId":"Components/bundles-perplexity","unlisted":false},{"type":"link","label":"pgvector","href":"/bundles-pgvector","docId":"Components/bundles-pgvector","unlisted":false},{"type":"link","label":"Pinecone","href":"/bundles-pinecone","docId":"Components/bundles-pinecone","unlisted":false},{"type":"link","label":"Qdrant","href":"/bundles-qdrant","docId":"Components/bundles-qdrant","unlisted":false},{"type":"link","label":"Redis","href":"/bundles-redis","docId":"Components/bundles-redis","unlisted":false},{"type":"link","label":"SambaNova","href":"/bundles-sambanova","docId":"Components/bundles-sambanova","unlisted":false},{"type":"link","label":"SearchApi","href":"/bundles-searchapi","docId":"Components/bundles-searchapi","unlisted":false},{"type":"link","label":"Serper","href":"/bundles-serper","docId":"Components/bundles-serper","unlisted":false},{"type":"link","label":"Supabase","href":"/bundles-supabase","docId":"Components/bundles-supabase","unlisted":false},{"type":"link","label":"Upstash","href":"/bundles-upstash","docId":"Components/bundles-upstash","unlisted":false},{"type":"link","label":"Vectara","href":"/bundles-vectara","docId":"Components/bundles-vectara","unlisted":false},{"type":"link","label":"Vertex AI","href":"/bundles-vertexai","docId":"Components/bundles-vertexai","unlisted":false},{"type":"link","label":"Weaviate","href":"/bundles-weaviate","docId":"Components/bundles-weaviate","unlisted":false},{"type":"link","label":"Wikipedia","href":"/bundles-wikipedia","docId":"Components/bundles-wikipedia","unlisted":false},{"type":"link","label":"xAI","href":"/bundles-xai","docId":"Components/bundles-xai","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"link","label":"Create custom Python components","href":"/components-custom-components","docId":"Components/components-custom-components","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"API reference","items":[{"type":"link","label":"Get started with the Langflow API","href":"/api-reference-api-examples","docId":"API-Reference/api-reference-api-examples","unlisted":false},{"type":"link","label":"Use the TypeScript client","href":"/typescript-client","docId":"Develop/Clients/typescript-client","unlisted":false},{"type":"link","label":"Flow trigger endpoints","href":"/api-flows-run","docId":"API-Reference/api-flows-run","unlisted":false},{"type":"link","label":"OpenAI Responses endpoints","href":"/api-openai-responses","docId":"API-Reference/api-openai-responses","unlisted":false},{"type":"link","label":"Flow management endpoints","href":"/api-flows","docId":"API-Reference/api-flows","unlisted":false},{"type":"link","label":"Files endpoints","href":"/api-files","docId":"API-Reference/api-files","unlisted":false},{"type":"link","label":"Projects endpoints","href":"/api-projects","docId":"API-Reference/api-projects","unlisted":false},{"type":"link","label":"Logs endpoints","href":"/api-logs","docId":"API-Reference/api-logs","unlisted":false},{"type":"link","label":"Monitor endpoints","href":"/api-monitor","docId":"API-Reference/api-monitor","unlisted":false},{"type":"link","label":"Build endpoints","href":"/api-build","docId":"API-Reference/api-build","unlisted":false},{"type":"link","label":"Users endpoints","href":"/api-users","docId":"API-Reference/api-users","unlisted":false},{"type":"link","label":"Langflow API specification","href":"/api"}],"collapsed":true,"collapsible":true},{"type":"category","label":"Contribute","items":[{"type":"link","label":"Join the Langflow community","href":"/contributing-community","docId":"Contributing/contributing-community","unlisted":false},{"type":"link","label":"Contribute to Langflow","href":"/contributing-how-to-contribute","docId":"Contributing/contributing-how-to-contribute","unlisted":false},{"type":"link","label":"Contribute components","href":"/contributing-components","docId":"Contributing/contributing-components","unlisted":false},{"type":"link","label":"Contribute component tests","href":"/contributing-component-tests","docId":"Contributing/contributing-component-tests","unlisted":false},{"type":"link","label":"Contribute templates","href":"/contributing-templates","docId":"Contributing/contributing-templates","unlisted":false},{"type":"link","label":"Contribute bundles","href":"/contributing-bundles","docId":"Contributing/contributing-bundles","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Release notes","items":[{"type":"link","label":"Release notes","href":"/release-notes","docId":"Support/release-notes","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Support","items":[{"type":"link","label":"Troubleshoot","href":"/troubleshoot","docId":"Support/troubleshooting","unlisted":false},{"type":"link","label":"Get help and request enhancements","href":"/contributing-github-issues","docId":"Contributing/contributing-github-issues","unlisted":false},{"type":"link","label":"IBM Elite Support for Langflow","href":"/luna-for-langflow","docId":"Support/luna-for-langflow","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"html","className":"sidebar-ad","value":"\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n
      \\n Get started in minutes\\n Download Langflow Desktop\\n
      \\n
      \\n "}]},"docs":{"Agents/agents":{"id":"Agents/agents","title":"Use Langflow agents","description":"Langflow\'s Agent component is critical for building agent flows.","sidebar":"docs"},"Agents/agents-tools":{"id":"Agents/agents-tools","title":"Configure tools for agents","description":"By default, Langflow agents only include the functionality built-in to their base LLM.","sidebar":"docs"},"API-Reference/api-build":{"id":"API-Reference/api-build","title":"Build endpoints","description":"The /build endpoints are used by Langflow\'s frontend visual editor code.","sidebar":"docs"},"API-Reference/api-files":{"id":"API-Reference/api-files","title":"Files endpoints","description":"Use the /files endpoints to move files between your local machine and Langflow.","sidebar":"docs"},"API-Reference/api-flows":{"id":"API-Reference/api-flows","title":"Flow management endpoints","description":"Use the /flows endpoint to create, read, update, and delete flows.","sidebar":"docs"},"API-Reference/api-flows-run":{"id":"API-Reference/api-flows-run","title":"Flow trigger endpoints","description":"Use the /run and /webhook endpoints to run flows.","sidebar":"docs"},"API-Reference/api-logs":{"id":"API-Reference/api-logs","title":"Logs endpoints","description":"Retrieve logs for your Langflow flows and server.","sidebar":"docs"},"API-Reference/api-monitor":{"id":"API-Reference/api-monitor","title":"Monitor endpoints","description":"The /monitor endpoints are for internal Langflow functionality, primarily related to running flows in the Playground, storing chat history, and generating flow logs.","sidebar":"docs"},"API-Reference/api-openai-responses":{"id":"API-Reference/api-openai-responses","title":"OpenAI Responses API","description":"Langflow includes an endpoint that is compatible with the OpenAI Responses API.","sidebar":"docs"},"API-Reference/api-projects":{"id":"API-Reference/api-projects","title":"Projects endpoints","description":"Use the /projects endpoint to create, read, update, and delete Langflow projects.","sidebar":"docs"},"API-Reference/api-reference-api-examples":{"id":"API-Reference/api-reference-api-examples","title":"Get started with the Langflow API","description":"You can use the Langflow API for programmatic interactions with Langflow, such as the following:","sidebar":"docs"},"API-Reference/api-users":{"id":"API-Reference/api-users","title":"Users endpoints","description":"Use the /users endpoint to manage user accounts in Langflow.","sidebar":"docs"},"Components/bundles-aiml":{"id":"Components/bundles-aiml","title":"AI/ML API","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-amazon":{"id":"Components/bundles-amazon","title":"Amazon","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-anthropic":{"id":"Components/bundles-anthropic","title":"Anthropic","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-arxiv":{"id":"Components/bundles-arxiv","title":"arXiv","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-azure":{"id":"Components/bundles-azure","title":"Azure","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-baidu":{"id":"Components/bundles-baidu","title":"Baidu","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-bing":{"id":"Components/bundles-bing","title":"Bing","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-cassandra":{"id":"Components/bundles-cassandra","title":"Cassandra","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-chroma":{"id":"Components/bundles-chroma","title":"Chroma","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-clickhouse":{"id":"Components/bundles-clickhouse","title":"ClickHouse","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-cloudflare":{"id":"Components/bundles-cloudflare","title":"Cloudflare","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-cohere":{"id":"Components/bundles-cohere","title":"Cohere","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-couchbase":{"id":"Components/bundles-couchbase","title":"Couchbase","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-datastax":{"id":"Components/bundles-datastax","title":"DataStax","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-deepseek":{"id":"Components/bundles-deepseek","title":"DeepSeek","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-duckduckgo":{"id":"Components/bundles-duckduckgo","title":"DuckDuckGo","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-elastic":{"id":"Components/bundles-elastic","title":"Elastic","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-exa":{"id":"Components/bundles-exa","title":"Exa","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-faiss":{"id":"Components/bundles-faiss","title":"FAISS","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-glean":{"id":"Components/bundles-glean","title":"Glean","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-google":{"id":"Components/bundles-google","title":"Google components","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-groq":{"id":"Components/bundles-groq","title":"Groq","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-huggingface":{"id":"Components/bundles-huggingface","title":"Hugging Face","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-ibm":{"id":"Components/bundles-ibm","title":"IBM","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-icosacomputing":{"id":"Components/bundles-icosacomputing","title":"Icosa Computing","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-langchain":{"id":"Components/bundles-langchain","title":"LangChain","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-lmstudio":{"id":"Components/bundles-lmstudio","title":"LM Studio","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-maritalk":{"id":"Components/bundles-maritalk","title":"MariTalk","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-mem0":{"id":"Components/bundles-mem0","title":"Mem0","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-milvus":{"id":"Components/bundles-milvus","title":"Milvus","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-mistralai":{"id":"Components/bundles-mistralai","title":"MistralAI","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-mongodb":{"id":"Components/bundles-mongodb","title":"MongoDB","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-novita":{"id":"Components/bundles-novita","title":"Novita","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-nvidia":{"id":"Components/bundles-nvidia","title":"NVIDIA components","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-ollama":{"id":"Components/bundles-ollama","title":"Ollama","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-openai":{"id":"Components/bundles-openai","title":"OpenAI","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-openrouter":{"id":"Components/bundles-openrouter","title":"OpenRouter","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-perplexity":{"id":"Components/bundles-perplexity","title":"Perplexity","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-pgvector":{"id":"Components/bundles-pgvector","title":"pgvector","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-pinecone":{"id":"Components/bundles-pinecone","title":"Pinecone","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-qdrant":{"id":"Components/bundles-qdrant","title":"Qdrant","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-redis":{"id":"Components/bundles-redis","title":"Redis","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-sambanova":{"id":"Components/bundles-sambanova","title":"SambaNova","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-searchapi":{"id":"Components/bundles-searchapi","title":"SearchApi","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-serper":{"id":"Components/bundles-serper","title":"Serper","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-supabase":{"id":"Components/bundles-supabase","title":"Supabase","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-upstash":{"id":"Components/bundles-upstash","title":"Upstash","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-vectara":{"id":"Components/bundles-vectara","title":"Vectara","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-vertexai":{"id":"Components/bundles-vertexai","title":"Vertex AI","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-weaviate":{"id":"Components/bundles-weaviate","title":"Weaviate","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-wikipedia":{"id":"Components/bundles-wikipedia","title":"Wikipedia","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/bundles-xai":{"id":"Components/bundles-xai","title":"xAI","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/components-agents":{"id":"Components/components-agents","title":"Agents","description":"Langflow\'s Agent and MCP Tools components are critical for building agent flows.","sidebar":"docs"},"Components/components-bundles":{"id":"Components/components-bundles","title":"About bundles","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Components/components-custom-components":{"id":"Components/components-custom-components","title":"Create custom Python components","description":"Custom components extend Langflow\'s functionality through Python classes that inherit from Component. This enables integration of new features, data manipulation, external services, and specialized tools.","sidebar":"docs"},"Components/components-data":{"id":"Components/components-data","title":"Data","description":"Data components bring data into your flows from various sources like files, API endpoints, and URLs.","sidebar":"docs"},"Components/components-embedding-models":{"id":"Components/components-embedding-models","title":"Embedding Model","description":"Embedding model components in Langflow generate text embeddings using a specified Large Language Model (LLM).","sidebar":"docs"},"Components/components-helpers":{"id":"Components/components-helpers","title":"Helpers","description":"Helper components provide utility functions to help manage data and perform simple tasks in your flow.","sidebar":"docs"},"Components/components-io":{"id":"Components/components-io","title":"Input / Output","description":"Input and output components define where data enters and exits your flow, but they don\'t have identical functionality.","sidebar":"docs"},"Components/components-logic":{"id":"Components/components-logic","title":"Logic","description":"Logic components provide functionalities for routing, conditional processing, and flow management.","sidebar":"docs"},"Components/components-models":{"id":"Components/components-models","title":"Language Model","description":"Language model components in Langflow generate text using a specified Large Language Model (LLM).","sidebar":"docs"},"Components/components-processing":{"id":"Components/components-processing","title":"Processing components","description":"Processing components process and transform data within a flow.","sidebar":"docs"},"Components/components-prompts":{"id":"Components/components-prompts","title":"Prompt Template","description":"Use the Prompt Template core component to create a prompt that supplies instructions and context to an LLM or agent, separate from other input like chat messages and file uploads.","sidebar":"docs"},"Components/components-tools":{"id":"Components/components-tools","title":"Tools","description":"In Langflow version 1.5, the Tools category was deprecated.","sidebar":"docs"},"Components/mcp-client":{"id":"Components/mcp-client","title":"Use Langflow as an MCP client","description":"Langflow integrates with the Model Context Protocol (MCP) as both an MCP server and an MCP client.","sidebar":"docs"},"Concepts/concepts-components":{"id":"Concepts/concepts-components","title":"Components overview","description":"Components are the building blocks of your flows.","sidebar":"docs"},"Concepts/concepts-file-management":{"id":"Concepts/concepts-file-management","title":"Manage files","description":"Each Langflow server has a file management system where you can store files that you want to use in your flows.","sidebar":"docs"},"Concepts/concepts-flows":{"id":"Concepts/concepts-flows","title":"Build flows","description":"A flow is a functional representation of an application workflow.","sidebar":"docs"},"Concepts/concepts-flows-import":{"id":"Concepts/concepts-flows-import","title":"Import and export flows","description":"You can export flows to transfer them between Langflow instances, share them with others, or create backups.","sidebar":"docs"},"Concepts/concepts-overview":{"id":"Concepts/concepts-overview","title":"Use the visual editor","description":"You use Langflow\'s visual editor to create, test, and share flows, which are functional representations of application workflows.","sidebar":"docs"},"Concepts/concepts-playground":{"id":"Concepts/concepts-playground","title":"Test flows in the Playground","description":"Langflow\'s Playground is a dynamic interface you can use to test your LLM-based flows in real-time.","sidebar":"docs"},"Concepts/concepts-publish":{"id":"Concepts/concepts-publish","title":"Trigger flows with the Langflow API","description":"After you build a flow, you probably want to run it within an application, such as a chatbot within a mobile app or website.","sidebar":"docs"},"Concepts/concepts-voice-mode":{"id":"Concepts/concepts-voice-mode","title":"Use voice mode","description":"You can use Langflow\'s voice mode to interact with your flows verbally through a microphone and speakers.","sidebar":"docs"},"Concepts/data-types":{"id":"Concepts/data-types","title":"Langflow data types","description":"Langflow components are designed to accept and produce specific types of inputs and outputs.","sidebar":"docs"},"Concepts/mcp-server":{"id":"Concepts/mcp-server","title":"Use Langflow as an MCP server","description":"Langflow integrates with the Model Context Protocol (MCP) as both an MCP server and an MCP client.","sidebar":"docs"},"Configuration/api-keys-and-authentication":{"id":"Configuration/api-keys-and-authentication","title":"API keys and authentication","description":"Never expose Langflow ports directly to the internet without proper security measures.","sidebar":"docs"},"Configuration/configuration-cli":{"id":"Configuration/configuration-cli","title":"Langflow CLI","description":"The Langflow command line interface is the main interface for managing and running the Langflow server.","sidebar":"docs"},"Configuration/configuration-custom-database":{"id":"Configuration/configuration-custom-database","title":"Configure an external PostgreSQL database","description":"Langflow\'s default database is SQLite, but you can configure Langflow to use PostgreSQL instead.","sidebar":"docs"},"Configuration/configuration-global-variables":{"id":"Configuration/configuration-global-variables","title":"Global variables","description":"Use global variables to store and reuse credentials and generic values across all of your flows.","sidebar":"docs"},"Configuration/environment-variables":{"id":"Configuration/environment-variables","title":"Environment variables","description":"In general, environment variables, like LANGFLOWPORT or LANGFLOWLOG_LEVEL, configure how Langflow runs.","sidebar":"docs"},"Contributing/contributing-bundles":{"id":"Contributing/contributing-bundles","title":"Contribute bundles","description":"Bundles are groups of components that are related to a specific service provider.","sidebar":"docs"},"Contributing/contributing-community":{"id":"Contributing/contributing-community","title":"Join the Langflow community","description":"There are several ways you can interact with the Langflow community and learn more about the Langflow codebase.","sidebar":"docs"},"Contributing/contributing-component-tests":{"id":"Contributing/contributing-component-tests","title":"Contribute component tests","description":"This guide outlines how to structure and implement tests for application components to ensure consistency and adequate coverage.","sidebar":"docs"},"Contributing/contributing-components":{"id":"Contributing/contributing-components","title":"Contribute components","description":"New components are added as objects of the Component class.","sidebar":"docs"},"Contributing/contributing-github-issues":{"id":"Contributing/contributing-github-issues","title":"Get help and request enhancements","description":"The Langflow GitHub repository is an integral part of the Langflow community.","sidebar":"docs"},"Contributing/contributing-how-to-contribute":{"id":"Contributing/contributing-how-to-contribute","title":"Contribute to Langflow","description":"This guide is intended to help you start contributing to Langflow.","sidebar":"docs"},"Contributing/contributing-telemetry":{"id":"Contributing/contributing-telemetry","title":"Telemetry","description":"Langflow uses anonymous telemetry to collect statistics about feature usage and performance.","sidebar":"docs"},"Contributing/contributing-templates":{"id":"Contributing/contributing-templates","title":"Contribute templates","description":"Follow these best practices when submitting a template to Langflow.","sidebar":"docs"},"Deployment/deployment-architecture":{"id":"Deployment/deployment-architecture","title":"Langflow architecture on Kubernetes","description":"There are two broad types of Langflow deployments:","sidebar":"docs"},"Deployment/deployment-caddyfile":{"id":"Deployment/deployment-caddyfile","title":"Deploy Langflow on a remote server","description":"Learn how to deploy Langflow on your own remote server with secure web access.","sidebar":"docs"},"Deployment/deployment-docker":{"id":"Deployment/deployment-docker","title":"Deploy Langflow on Docker","description":"Running applications in Docker containers ensures consistent behavior across different systems and eliminates dependency conflicts.","sidebar":"docs"},"Deployment/deployment-gcp":{"id":"Deployment/deployment-gcp","title":"Deploy Langflow on Google Cloud Platform","description":"This guide demonstrates how to deploy Langflow on Google Cloud Platform with a Cloud Shell script that walks through the process of setting up a Debian-based VM with the Langflow package, Nginx, and the necessary configurations to run the Langflow development environment in GCP.","sidebar":"docs"},"Deployment/deployment-hugging-face-spaces":{"id":"Deployment/deployment-hugging-face-spaces","title":"Deploy Langflow on Hugging Face Spaces","description":"This guide explains how to deploy Langflow on Hugging Face Spaces.","sidebar":"docs"},"Deployment/deployment-kubernetes-dev":{"id":"Deployment/deployment-kubernetes-dev","title":"Deploy the Langflow development environment on Kubernetes","description":"The Langflow integrated development environment (IDE) Helm chart is designed to provide a complete environment for developers to create, test, and debug their flows. It includes both the Langflow API and visual editor.","sidebar":"docs"},"Deployment/deployment-kubernetes-prod":{"id":"Deployment/deployment-kubernetes-prod","title":"Deploy the Langflow production environment on Kubernetes","description":"The Langflow runtime Helm chart is tailored for deploying applications in a production environment. It is focused on stability, performance, isolation, and security to ensure that applications run reliably and efficiently.","sidebar":"docs"},"Deployment/deployment-overview":{"id":"Deployment/deployment-overview","title":"Langflow deployment overview","description":"This section includes the different ways to bring your locally-built flows to the world.","sidebar":"docs"},"Deployment/deployment-prod-best-practices":{"id":"Deployment/deployment-prod-best-practices","title":"Best practices for Langflow on Kubernetes","description":"This guide provides best practices for deploying Langflow in production environments on Kubernetes.","sidebar":"docs"},"Deployment/deployment-public-server":{"id":"Deployment/deployment-public-server","title":"Deploy a public Langflow server","description":"By default, your Langflow server at http7860 isn\'t exposed to the public internet.","sidebar":"docs"},"Deployment/deployment-railway":{"id":"Deployment/deployment-railway","title":"Deploy Langflow on Railway","description":"Deploy Langflow to Railway using a one-click template","sidebar":"docs"},"Deployment/deployment-render":{"id":"Deployment/deployment-render","title":"Deploy Langflow on Render","description":"This guide explains how to deploy Langflow on Render, a cloud platform for deploying web applications and APIs.","sidebar":"docs"},"Develop/Clients/typescript-client":{"id":"Develop/Clients/typescript-client","title":"Langflow TypeScript client","description":"The Langflow TypeScript client allows your TypeScript applications to programmatically interact with the Langflow API.","sidebar":"docs"},"Develop/develop-application":{"id":"Develop/develop-application","title":"Containerize a Langflow application","description":"Designing flows in the visual editor is only the first step in building an application that uses Langflow.","sidebar":"docs"},"Develop/enterprise-database-guide":{"id":"Develop/enterprise-database-guide","title":"Langflow database guide for enterprise DBAs","description":"The Langflow database stores data that is essential for more Langflow operations, including startup, flow execution, user interactions, and administrative tasks.","sidebar":"docs"},"Develop/install-custom-dependencies":{"id":"Develop/install-custom-dependencies","title":"Install custom dependencies","description":"Langflow provides optional dependency groups and support for custom dependencies to extend Langflow functionality. This guide covers how to add dependencies for different Langflow installations, including Langflow Desktop and Langflow OSS.","sidebar":"docs"},"Develop/logging":{"id":"Develop/logging","title":"Logs","description":"Langflow produces logs for individual flows and the Langflow application itself using the structlog library for logging.","sidebar":"docs"},"Develop/memory":{"id":"Develop/memory","title":"Memory management options","description":"Langflow provides flexible memory management options for storage and retrieval of data relevant to your flows and your Langflow server.","sidebar":"docs"},"Develop/session-id":{"id":"Develop/session-id","title":"Use session ID to manage communication between components","description":"Session ID is a unique identifier for client/server connections. A single session equals the duration of a client\'s connection to a server.","sidebar":"docs"},"Develop/webhook":{"id":"Develop/webhook","title":"Trigger flows with webhooks","description":"You can use the Webhook component to start a flow run in response to an external event.","sidebar":"docs"},"Get-Started/about-langflow":{"id":"Get-Started/about-langflow","title":"What is Langflow?","description":"Langflow is an open-source, Python-based, customizable framework for building AI applications.","sidebar":"docs"},"Get-Started/get-started-installation":{"id":"Get-Started/get-started-installation","title":"Install Langflow","description":"Langflow can be installed in multiple ways:","sidebar":"docs"},"Get-Started/get-started-quickstart":{"id":"Get-Started/get-started-quickstart","title":"Quickstart","description":"Get started with Langflow by loading a template flow, running it, and then serving it at the /run API endpoint.","sidebar":"docs"},"Integrations/Apify/integrations-apify":{"id":"Integrations/Apify/integrations-apify","title":"Apify","description":"Apify is a web scraping and data extraction platform with more than 3,000 ready-made cloud tools called Actors.","sidebar":"docs"},"Integrations/Arize/integrations-arize":{"id":"Integrations/Arize/integrations-arize","title":"Arize","description":"Arize is a tool built on OpenTelemetry and OpenInference for monitoring and optimizing LLM applications.","sidebar":"docs"},"Integrations/Cleanlab/integrations-cleanlab":{"id":"Integrations/Cleanlab/integrations-cleanlab","title":"Cleanlab","description":"Cleanlab adds automation and trust to every data point going in and every prediction coming out of AI and RAG solutions.","sidebar":"docs"},"Integrations/Composio/integrations-composio":{"id":"Integrations/Composio/integrations-composio","title":"Composio","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","sidebar":"docs"},"Integrations/Docling/integrations-docling":{"id":"Integrations/Docling/integrations-docling","title":"Docling","description":"Langflow integrates with Docling through a bundle of components for parsing documents.","sidebar":"docs"},"Integrations/Google/integrations-google-big-query":{"id":"Integrations/Google/integrations-google-big-query","title":"Google BigQuery","description":"Langflow integrates with Google BigQuery through the BigQuery component in the Google bundle, allowing you to execute SQL queries and retrieve data from your BigQuery datasets.","sidebar":"docs"},"Integrations/integrations-assemblyai":{"id":"Integrations/integrations-assemblyai","title":"AssemblyAI","description":"The AssemblyAI components allow you to apply powerful Speech AI models to your app for tasks like:","sidebar":"docs"},"Integrations/integrations-instana-traceloop":{"id":"Integrations/integrations-instana-traceloop","title":"Traceloop","description":"Instrument Langflow with the Traceloop SDK, and export traces and metrics to Instana using OpenTelemetry.","sidebar":"docs"},"Integrations/integrations-langfuse":{"id":"Integrations/integrations-langfuse","title":"Langfuse","description":"Langfuse is an open-source platform for LLM observability. It provides tracing and monitoring capabilities for AI applications, helping developers debug, analyze, and optimize their AI systems. Langfuse integrates with various tools and frameworks, including workflow builders and runtimes like Langflow.","sidebar":"docs"},"Integrations/integrations-langsmith":{"id":"Integrations/integrations-langsmith","title":"LangSmith","description":"LangSmith is a full-lifecycle DevOps service from LangChain that provides monitoring and observability. To integrate with Langflow, add your LangChain API key and configuration as Langflow environment variables, and then start Langflow.","sidebar":"docs"},"Integrations/integrations-langwatch":{"id":"Integrations/integrations-langwatch","title":"LangWatch","description":"LangWatch is an all-in-one LLMOps platform for monitoring, observability, analytics, evaluations and alerting for getting user insights and improve your LLM workflows.","sidebar":"docs"},"Integrations/integrations-opik":{"id":"Integrations/integrations-opik","title":"Opik","description":"Opik is an open-source platform designed for evaluating, testing, and monitoring large language model (LLM) applications. Developed by Comet, it aims to facilitate more intuitive collaboration, testing, and monitoring of LLM-based applications.","sidebar":"docs"},"Integrations/mcp-component-astra":{"id":"Integrations/mcp-component-astra","title":"Connect an Astra DB MCP server to Langflow","description":"This guide demonstrates how to use Langflow as an MCP client by using the MCP Tools component to run a DataStax Astra DB MCP server in an agent flow.","sidebar":"docs"},"Integrations/Notion/integrations-notion":{"id":"Integrations/Notion/integrations-notion","title":"Set up a Notion App","description":"To use Notion components in Langflow, you first need to create a Notion integration and configure it with the necessary capabilities. This guide will walk you through the process of setting up a Notion integration and granting it access to your Notion databases.","sidebar":"docs"},"Integrations/Notion/notion-agent-conversational":{"id":"Integrations/Notion/notion-agent-conversational","title":"Notion Conversational Agent","description":"The Notion Conversational Agent is an AI-powered assistant that interacts with your Notion workspace through natural language conversations. This flow performs Notion-related tasks like creating pages, searching for information, and managing content, all through a chat interface.","sidebar":"docs"},"Integrations/Notion/notion-agent-meeting-notes":{"id":"Integrations/Notion/notion-agent-meeting-notes","title":"Notion Meeting Notes Agent","description":"The Notion Agent for Meeting Notes is an AI-powered tool that automatically processes meeting transcripts and updates your Notion workspace. It identifies tasks, action items, and key points from your meetings, then creates new tasks or updates existing ones in Notion without manual input.","sidebar":"docs"},"Integrations/Nvidia/integrations-nvidia-g-assist":{"id":"Integrations/Nvidia/integrations-nvidia-g-assist","title":"Integrate NVIDIA G-Assist with Langflow","description":"The NVIDIA System-Assist component integrates your flows with NVIDIA G-Assist, enabling interaction with NVIDIA GPU drivers through natural language prompts.","sidebar":"docs"},"Integrations/Nvidia/integrations-nvidia-ingest":{"id":"Integrations/Nvidia/integrations-nvidia-ingest","title":"Integrate NVIDIA Retriever Extraction with Langflow","description":"The NVIDIA Retriever Extraction component integrates with the NVIDIA nv-ingest microservice for data ingestion, processing, and extraction of text files.","sidebar":"docs"},"Integrations/Nvidia/integrations-nvidia-nim-wsl2":{"id":"Integrations/Nvidia/integrations-nvidia-nim-wsl2","title":"Integrate NVIDIA NIMs with Langflow","description":"Connect Langflow with NVIDIA NIM on an RTX Windows system with Windows Subsystem for Linux 2 (WSL2) installed.","sidebar":"docs"},"Support/luna-for-langflow":{"id":"Support/luna-for-langflow","title":"IBM Elite Support for Langflow","description":"IBM Elite Support offers enterprise support for Langflow to help you develop and deploy Langflow applications with confidence.","sidebar":"docs"},"Support/release-notes":{"id":"Support/release-notes","title":"Langflow release notes","description":"This page summarizes significant changes to Langflow in each release.","sidebar":"docs"},"Support/troubleshooting":{"id":"Support/troubleshooting","title":"Troubleshoot Langflow","description":"This page provides troubleshooting advice for issues you might encounter when using Langflow or contributing to Langflow.","sidebar":"docs"},"Tutorials/agent":{"id":"Tutorials/agent","title":"Connect applications to agents","description":"This tutorial shows you how to connect a JavaScript application to a Langflow agent.","sidebar":"docs"},"Tutorials/chat-with-files":{"id":"Tutorials/chat-with-files","title":"Create a chatbot that can ingest files","description":"This tutorial shows you how to build a chatbot that can read and answer questions about files you upload, such as meeting notes or job applications.","sidebar":"docs"},"Tutorials/chat-with-rag":{"id":"Tutorials/chat-with-rag","title":"Create a vector RAG chatbot","description":"This tutorial demonstrates how you can use Langflow to create a chatbot application that uses Retrieval Augmented Generation (RAG) to embed your data as vectors in a vector database, and then chat with the data.","sidebar":"docs"},"Tutorials/mcp-tutorial":{"id":"Tutorials/mcp-tutorial","title":"Connect to MCP servers from your application","description":"This tutorial shows you how to connect MCP servers to your applications using Langflow\'s MCP Tools component.","sidebar":"docs"}}}}')}}]); \ No newline at end of file diff --git a/assets/js/230d5fdc.68af4621.js b/assets/js/230d5fdc.68af4621.js new file mode 100644 index 0000000000..9cbf1a54b0 --- /dev/null +++ b/assets/js/230d5fdc.68af4621.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[9976],{17886:(e,t,n)=>{n.d(t,{A:()=>o});n(96540);var r=n(64058),s=n(74848);function o({name:e,...t}){const n=r[e];return n?(0,s.jsx)(n,{...t}):null}},25791:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>d,default:()=>u,frontMatter:()=>a,metadata:()=>r,toc:()=>h});const r=JSON.parse('{"id":"Components/bundles-vertexai","title":"Vertex AI","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/bundles-vertexai.mdx","sourceDirName":"Components","slug":"/bundles-vertexai","permalink":"/bundles-vertexai","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Vertex AI","slug":"/bundles-vertexai"},"sidebar":"docs","previous":{"title":"Vectara","permalink":"/bundles-vectara"},"next":{"title":"Weaviate","permalink":"/bundles-weaviate"}}');var s=n(74848),o=n(28453),i=n(17886),l=n(31929);const a={title:"Vertex AI",slug:"/bundles-vertexai"},d=void 0,c={},h=[{value:"Vertex AI text generation",id:"vertex-ai-text-generation",level:2},{value:"Vertex AI text generation parameters",id:"vertex-ai-text-generation-parameters",level:3},...l.RM,{value:"Vertex AI Embeddings",id:"vertex-ai-embeddings",level:2},{value:"Vertex AI Embeddings parameters",id:"vertex-ai-embeddings-parameters",level:3},...l.RM,{value:"Create a service account for Vertex AI authentication",id:"vertexai-credentials",level:2}];function x(e){const t={a:"a",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,o.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(t.p,{children:[(0,s.jsx)(i.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(t.a,{href:"/components-bundle-components",children:(0,s.jsx)(t.strong,{children:"Bundles"})})," contain custom components that support specific third-party integrations with Langflow."]}),"\n",(0,s.jsxs)(t.p,{children:["This page describes the components that are available in the ",(0,s.jsx)(t.strong,{children:"Vertex AI"})," bundle."]}),"\n",(0,s.jsxs)(t.p,{children:["For more information about Vertex AI features and functionality used by Vertex AI components, see the ",(0,s.jsx)(t.a,{href:"https://cloud.google.com/vertex-ai",children:"Vertex AI documentation"}),"."]}),"\n",(0,s.jsxs)(t.p,{children:["For other Google components, see the ",(0,s.jsxs)(t.a,{href:"/bundles-google",children:[(0,s.jsx)(t.strong,{children:"Google"})," bundle"]}),"."]}),"\n",(0,s.jsx)(t.h2,{id:"vertex-ai-text-generation",children:"Vertex AI text generation"}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.strong,{children:"Vertex AI"})," component generates text using Google Vertex AI models."]}),"\n",(0,s.jsxs)(t.p,{children:["It can output either a ",(0,s.jsx)(t.strong,{children:"Model Response"})," (",(0,s.jsx)(t.a,{href:"/data-types#message",children:(0,s.jsx)(t.code,{children:"Message"})}),") or a ",(0,s.jsx)(t.strong,{children:"Language Model"})," (",(0,s.jsx)(t.a,{href:"/data-types#languagemodel",children:(0,s.jsx)(t.code,{children:"LanguageModel"})}),")."]}),"\n",(0,s.jsxs)(t.p,{children:["Use the ",(0,s.jsx)(t.strong,{children:"Language Model"})," output when you want to use a Vertex AI model as the LLM for another LLM-driven component, such as an ",(0,s.jsx)(t.strong,{children:"Agent"})," or ",(0,s.jsx)(t.strong,{children:"Smart Function"})," component."]}),"\n",(0,s.jsxs)(t.p,{children:["For more information, see ",(0,s.jsx)(t.a,{href:"/components-models",children:"Language model components"}),"."]}),"\n",(0,s.jsx)(t.h3,{id:"vertex-ai-text-generation-parameters",children:"Vertex AI text generation parameters"}),"\n",(0,s.jsx)(l.Ay,{}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Name"}),(0,s.jsx)(t.th,{children:"Type"}),(0,s.jsx)(t.th,{children:"Description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"credentials"}),(0,s.jsx)(t.td,{children:"File"}),(0,s.jsxs)(t.td,{children:["Input parameter. JSON credentials file. Leave empty to fall back to environment variables. File type: JSON. For more information, see ",(0,s.jsx)(t.a,{href:"#vertexai-credentials",children:"Create a service account for Vertex AI authentication"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"model_name"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:'Input parameter. The name of the Vertex AI model to use. Default: "gemini-1.5-pro".'})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"project"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. The project ID."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"location"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:'Input parameter. The location for the Vertex AI API. Default: "us-central1".'})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"max_output_tokens"}),(0,s.jsx)(t.td,{children:"Integer"}),(0,s.jsx)(t.td,{children:"Input parameter. The maximum number of tokens to generate."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"max_retries"}),(0,s.jsx)(t.td,{children:"Integer"}),(0,s.jsx)(t.td,{children:"Input parameter. Maximum number of retries for API calls. Default: 1."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"temperature"}),(0,s.jsx)(t.td,{children:"Float"}),(0,s.jsx)(t.td,{children:"Input parameter. Controls randomness in the output. Default: 0.0."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"top_k"}),(0,s.jsx)(t.td,{children:"Integer"}),(0,s.jsx)(t.td,{children:"Input parameter. The number of highest-probability vocabulary tokens to keep for top-k-filtering."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"top_p"}),(0,s.jsx)(t.td,{children:"Float"}),(0,s.jsx)(t.td,{children:"Input parameter. The cumulative probability of all highest-probability vocabulary tokens that are kept for nucleus sampling. Default: 0.95."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"verbose"}),(0,s.jsx)(t.td,{children:"Boolean"}),(0,s.jsxs)(t.td,{children:["Input parameter. Whether to print verbose output. Default: ",(0,s.jsx)(t.code,{children:"false"}),"."]})]})]})]}),"\n",(0,s.jsxs)(t.p,{children:["For more information about Vertex AI text generation parameters, see the ",(0,s.jsx)(t.a,{href:"https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/content-generation-parameters#token-sampling-parameters",children:"Vertex AI content generation parameters documentation"}),"."]}),"\n",(0,s.jsx)(t.h2,{id:"vertex-ai-embeddings",children:"Vertex AI Embeddings"}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.strong,{children:"Vertex AI Embeddings"})," component is a wrapper around the ",(0,s.jsx)(t.a,{href:"https://cloud.google.com/vertex-ai/docs/generative-ai/embeddings/get-text-embeddings",children:"Google Vertex AI Embeddings API"})," for embedding generation."]}),"\n",(0,s.jsxs)(t.p,{children:["For more information about using embedding model components in flows, see ",(0,s.jsx)(t.a,{href:"/components-embedding-models",children:"Embedding model components"}),"."]}),"\n",(0,s.jsx)(t.h3,{id:"vertex-ai-embeddings-parameters",children:"Vertex AI Embeddings parameters"}),"\n",(0,s.jsx)(l.Ay,{}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Name"}),(0,s.jsx)(t.th,{children:"Type"}),(0,s.jsx)(t.th,{children:"Description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"credentials"}),(0,s.jsx)(t.td,{children:"Credentials"}),(0,s.jsxs)(t.td,{children:["Input parameter. JSON credentials file. Leave empty to fall back to environment variables. File type: JSON. For more information, see ",(0,s.jsx)(t.a,{href:"#vertexai-credentials",children:"Create a service account for Vertex AI authentication"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"location"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsxs)(t.td,{children:["Input parameter. The default location to use when making API calls. Default: ",(0,s.jsx)(t.code,{children:"us-central1"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"max_output_tokens"}),(0,s.jsx)(t.td,{children:"Integer"}),(0,s.jsxs)(t.td,{children:["Input parameter. The token limit determines the maximum amount of text output from one prompt. Default: ",(0,s.jsx)(t.code,{children:"128"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"model_name"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsxs)(t.td,{children:["Input parameter. The name of the Vertex AI large language model. Default: ",(0,s.jsx)(t.code,{children:"text-bison"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"project"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. The default GCP project to use when making Vertex API calls."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"request_parallelism"}),(0,s.jsx)(t.td,{children:"Integer"}),(0,s.jsxs)(t.td,{children:["Input parameter. The amount of parallelism allowed for requests issued to Vertex AI models. Default: ",(0,s.jsx)(t.code,{children:"5"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"temperature"}),(0,s.jsx)(t.td,{children:"Float"}),(0,s.jsxs)(t.td,{children:["Input parameter. Tunes the degree of randomness in text generations. Should be a non-negative value. Default: ",(0,s.jsx)(t.code,{children:"0"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"top_k"}),(0,s.jsx)(t.td,{children:"Integer"}),(0,s.jsxs)(t.td,{children:["Input parameter. How the model selects tokens for output. The next token is selected from the top ",(0,s.jsx)(t.code,{children:"k"})," tokens. Default: ",(0,s.jsx)(t.code,{children:"40"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"top_p"}),(0,s.jsx)(t.td,{children:"Float"}),(0,s.jsxs)(t.td,{children:["Input parameter. Tokens are selected from the most probable to least until the sum of their probabilities exceeds the top ",(0,s.jsx)(t.code,{children:"p"})," value. Default: ",(0,s.jsx)(t.code,{children:"0.95"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"tuned_model_name"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsxs)(t.td,{children:["Input parameter. The name of a tuned model. If provided, ",(0,s.jsx)(t.code,{children:"model_name"})," is ignored."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"verbose"}),(0,s.jsx)(t.td,{children:"Boolean"}),(0,s.jsxs)(t.td,{children:["Input parameter. This parameter controls the level of detail in the output. When set to ",(0,s.jsx)(t.code,{children:"true"}),", it prints internal states of the chain to help debug. Default: ",(0,s.jsx)(t.code,{children:"false"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"embeddings"}),(0,s.jsx)(t.td,{children:"Embeddings"}),(0,s.jsx)(t.td,{children:"Output parameter. An instance for generating embeddings using Vertex AI."})]})]})]}),"\n",(0,s.jsx)(t.h2,{id:"vertexai-credentials",children:"Create a service account for Vertex AI authentication"}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.strong,{children:"Vertex AI Embeddings"})," and ",(0,s.jsx)(t.strong,{children:"Vertex AI"})," components authenticate with the ",(0,s.jsx)(t.a,{href:"https://console.cloud.google.com/marketplace/product/google/aiplatform.googleapis.com",children:"Google Vertex AI API"})," using a service account JSON file."]}),"\n",(0,s.jsxs)(t.p,{children:["These components require that you provide a service account JSON file in the ",(0,s.jsx)(t.strong,{children:"Credentials"})," parameter (",(0,s.jsx)(t.code,{children:"credentials"}),").\nYou can either provide the file directly in your component's settings or you can use a ",(0,s.jsxs)(t.a,{href:"https://cloud.google.com/docs/authentication/application-default-credentials",children:[(0,s.jsx)(t.code,{children:"GOOGLE_APPLICATION_CREDENTIALS"})," environment variable"]})," to reference the path to your JSON file."]}),"\n",(0,s.jsx)(t.p,{children:"The following steps explain how to create a service account for Langflow, create a service account JSON key file, and then use the JSON key file in Langflow:"}),"\n",(0,s.jsxs)(t.ol,{children:["\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["If you haven't done so already, ",(0,s.jsx)(t.a,{href:"https://cloud.google.com/vertex-ai/docs/start/cloud-environment",children:"enable the Vertex AI APIs in your Google Cloud project"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["Create a ",(0,s.jsx)(t.a,{href:"https://cloud.google.com/iam/docs/service-account-overview",children:"service account"})," in your Google Cloud project."]}),"\n",(0,s.jsxs)(t.p,{children:["It is recommended that you ",(0,s.jsx)(t.a,{href:"https://cloud.google.com/vertex-ai/docs/general/custom-service-account",children:"create a custom service account for Vertex AI"})," because Langflow uses this account to access the Vertex AI APIs."]}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["Assign the ",(0,s.jsx)(t.strong,{children:"Vertex AI Service Agent"})," role to the service account."]}),"\n",(0,s.jsxs)(t.p,{children:["This role allows Langflow to access Vertex AI resources.\nFor more information, see ",(0,s.jsx)(t.a,{href:"https://cloud.google.com/vertex-ai/docs/general/access-control",children:"Vertex AI access control with IAM"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)(t.a,{href:"https://cloud.google.com/iam/docs/keys-create-delete#console",children:"Create a service account key"})," in JSON format for your Langflow Vertex AI service account."]}),"\n",(0,s.jsxs)(t.p,{children:["When you click ",(0,s.jsx)(t.strong,{children:"Create"}),", the JSON key file is downloaded."]}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["In Langflow, create or open a flow with the ",(0,s.jsx)(t.strong,{children:"Vertex AI"})," or ",(0,s.jsx)(t.strong,{children:"Vertex AI Embeddings"})," component."]}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["In the component's ",(0,s.jsx)(t.strong,{children:"Credentials"})," field, do one of the following:"]}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsx)(t.p,{children:"Select your service account JSON file directly."}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["Leave the ",(0,s.jsx)(t.strong,{children:"Credentials"})," field empty if you want to pull the key file from an environment variable.\nThen, you must provide the path to your JSON file in a ",(0,s.jsx)(t.code,{children:"GOOGLE_APPLICATION_CREDENTIALS"})," environment variable that is set somewhere relative to your Langflow instance.\nFor example, you can set the environment variable in your terminal, your Langflow ",(0,s.jsx)(t.code,{children:".env"})," file, or otherwise in the environment where your Langflow server or application runs."]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.img,{alt:"Select a local JSON key file for the Vertex AI component",src:n(65180).A+"",width:"1913",height:"819"})}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsx)(t.p,{children:"Run your flow to verify that Langflow can use the service account credentials successfully."}),"\n",(0,s.jsxs)(t.p,{children:["For example, in a flow with ",(0,s.jsx)(t.strong,{children:"Chat Input"}),", ",(0,s.jsx)(t.strong,{children:"Chat Output"}),", and ",(0,s.jsx)(t.strong,{children:"Vertex AI"})," components, you can open the ",(0,s.jsx)(t.strong,{children:"Playground"})," and try chatting with the LLM.\nIf the LLM responds, then the credentials are configured correctly."]}),"\n"]}),"\n"]})]})}function u(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(x,{...e})}):x(e)}},31929:(e,t,n)=>{n.d(t,{Ay:()=>a,RM:()=>i});var r=n(74848),s=n(28453),o=n(17886);const i=[];function l(e){const t={a:"a",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,r.jsxs)(t.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,r.jsx)(o.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Controls"})," in the ",(0,r.jsx)(t.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function a(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(l,{...e})}):l(e)}},65180:(e,t,n)=>{n.d(t,{A:()=>r});const r=n.p+"assets/images/configure-vertex-ai-credentials-in-langflow-10c417c45f725fee46d4ef5f740316b3.gif"}}]); \ No newline at end of file diff --git a/assets/js/230d5fdc.a4d2272c.js b/assets/js/230d5fdc.a4d2272c.js deleted file mode 100644 index 1b8b85534c..0000000000 --- a/assets/js/230d5fdc.a4d2272c.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[9976],{17886:(e,t,n)=>{n.d(t,{A:()=>o});n(96540);var r=n(64058),s=n(74848);function o({name:e,...t}){const n=r[e];return n?(0,s.jsx)(n,{...t}):null}},25791:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>d,default:()=>u,frontMatter:()=>l,metadata:()=>r,toc:()=>h});const r=JSON.parse('{"id":"Components/bundles-vertexai","title":"Vertex AI","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/bundles-vertexai.mdx","sourceDirName":"Components","slug":"/bundles-vertexai","permalink":"/bundles-vertexai","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Vertex AI","slug":"/bundles-vertexai"},"sidebar":"docs","previous":{"title":"Vectara","permalink":"/bundles-vectara"},"next":{"title":"Weaviate","permalink":"/bundles-weaviate"}}');var s=n(74848),o=n(28453),i=n(17886),a=n(31929);const l={title:"Vertex AI",slug:"/bundles-vertexai"},d=void 0,c={},h=[{value:"Vertex AI text generation",id:"vertex-ai-text-generation",level:2},{value:"Vertex AI text generation parameters",id:"vertex-ai-text-generation-parameters",level:3},...a.RM,{value:"Vertex AI Embeddings",id:"vertex-ai-embeddings",level:2},{value:"Vertex AI Embeddings parameters",id:"vertex-ai-embeddings-parameters",level:3},...a.RM,{value:"Create a service account for Vertex AI authentication",id:"vertexai-credentials",level:2}];function x(e){const t={a:"a",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,o.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(t.p,{children:[(0,s.jsx)(i.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(t.a,{href:"/components-bundle-components",children:(0,s.jsx)(t.strong,{children:"Bundles"})})," contain custom components that support specific third-party integrations with Langflow."]}),"\n",(0,s.jsxs)(t.p,{children:["This page describes the components that are available in the ",(0,s.jsx)(t.strong,{children:"Vertex AI"})," bundle."]}),"\n",(0,s.jsxs)(t.p,{children:["For more information about Vertex AI features and functionality used by Vertex AI components, see the ",(0,s.jsx)(t.a,{href:"https://cloud.google.com/vertex-ai",children:"Vertex AI documentation"}),"."]}),"\n",(0,s.jsxs)(t.p,{children:["For other Google components, see the ",(0,s.jsxs)(t.a,{href:"/bundles-google",children:[(0,s.jsx)(t.strong,{children:"Google"})," bundle"]}),"."]}),"\n",(0,s.jsx)(t.h2,{id:"vertex-ai-text-generation",children:"Vertex AI text generation"}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.strong,{children:"Vertex AI"})," component generates text using Google Vertex AI models."]}),"\n",(0,s.jsxs)(t.p,{children:["It can output either a ",(0,s.jsx)(t.strong,{children:"Model Response"})," (",(0,s.jsx)(t.a,{href:"/data-types#message",children:(0,s.jsx)(t.code,{children:"Message"})}),") or a ",(0,s.jsx)(t.strong,{children:"Language Model"})," (",(0,s.jsx)(t.a,{href:"/data-types#languagemodel",children:(0,s.jsx)(t.code,{children:"LanguageModel"})}),")."]}),"\n",(0,s.jsxs)(t.p,{children:["Use the ",(0,s.jsx)(t.strong,{children:"Language Model"})," output when you want to use a Vertex AI model as the LLM for another LLM-driven component, such as an ",(0,s.jsx)(t.strong,{children:"Agent"})," or ",(0,s.jsx)(t.strong,{children:"Smart Function"})," component."]}),"\n",(0,s.jsxs)(t.p,{children:["For more information, see ",(0,s.jsx)(t.a,{href:"/components-models",children:"Language model components"}),"."]}),"\n",(0,s.jsx)(t.h3,{id:"vertex-ai-text-generation-parameters",children:"Vertex AI text generation parameters"}),"\n",(0,s.jsx)(a.Ay,{}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Name"}),(0,s.jsx)(t.th,{children:"Type"}),(0,s.jsx)(t.th,{children:"Description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"credentials"}),(0,s.jsx)(t.td,{children:"File"}),(0,s.jsxs)(t.td,{children:["Input parameter. JSON credentials file. Leave empty to fall back to environment variables. File type: JSON. For more information, see ",(0,s.jsx)(t.a,{href:"#vertexai-credentials",children:"Create a service account for Vertex AI authentication"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"model_name"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:'Input parameter. The name of the Vertex AI model to use. Default: "gemini-1.5-pro".'})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"project"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. The project ID (advanced)."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"location"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:'Input parameter. The location for the Vertex AI API. Default: "us-central1" (advanced).'})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"max_output_tokens"}),(0,s.jsx)(t.td,{children:"Integer"}),(0,s.jsx)(t.td,{children:"Input parameter. The maximum number of tokens to generate (advanced)."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"max_retries"}),(0,s.jsx)(t.td,{children:"Integer"}),(0,s.jsx)(t.td,{children:"Input parameter. Maximum number of retries for API calls. Default: 1 (advanced)."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"temperature"}),(0,s.jsx)(t.td,{children:"Float"}),(0,s.jsx)(t.td,{children:"Input parameter. Controls randomness in the output. Default: 0.0."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"top_k"}),(0,s.jsx)(t.td,{children:"Integer"}),(0,s.jsx)(t.td,{children:"Input parameter. The number of highest-probability vocabulary tokens to keep for top-k-filtering (advanced)."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"top_p"}),(0,s.jsx)(t.td,{children:"Float"}),(0,s.jsx)(t.td,{children:"Input parameter. The cumulative probability of all highest-probability vocabulary tokens that are kept for nucleus sampling. Default: 0.95 (advanced)."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"verbose"}),(0,s.jsx)(t.td,{children:"Boolean"}),(0,s.jsx)(t.td,{children:"Input parameter. Whether to print verbose output. Default: False (advanced)."})]})]})]}),"\n",(0,s.jsxs)(t.p,{children:["For more information about Vertex AI text generation parameters, see the ",(0,s.jsx)(t.a,{href:"https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/content-generation-parameters#token-sampling-parameters",children:"Vertex AI content generation parameters documentation"}),"."]}),"\n",(0,s.jsx)(t.h2,{id:"vertex-ai-embeddings",children:"Vertex AI Embeddings"}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.strong,{children:"Vertex AI Embeddings"})," component is a wrapper around the ",(0,s.jsx)(t.a,{href:"https://cloud.google.com/vertex-ai/docs/generative-ai/embeddings/get-text-embeddings",children:"Google Vertex AI Embeddings API"})," for embedding generation."]}),"\n",(0,s.jsxs)(t.p,{children:["For more information about using embedding model components in flows, see ",(0,s.jsx)(t.a,{href:"/components-embedding-models",children:"Embedding model components"}),"."]}),"\n",(0,s.jsx)(t.h3,{id:"vertex-ai-embeddings-parameters",children:"Vertex AI Embeddings parameters"}),"\n",(0,s.jsx)(a.Ay,{}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Name"}),(0,s.jsx)(t.th,{children:"Type"}),(0,s.jsx)(t.th,{children:"Description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"credentials"}),(0,s.jsx)(t.td,{children:"Credentials"}),(0,s.jsxs)(t.td,{children:["Input parameter. JSON credentials file. Leave empty to fall back to environment variables. File type: JSON. For more information, see ",(0,s.jsx)(t.a,{href:"#vertexai-credentials",children:"Create a service account for Vertex AI authentication"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"location"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsxs)(t.td,{children:["Input parameter. The default location to use when making API calls. Default: ",(0,s.jsx)(t.code,{children:"us-central1"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"max_output_tokens"}),(0,s.jsx)(t.td,{children:"Integer"}),(0,s.jsxs)(t.td,{children:["Input parameter. The token limit determines the maximum amount of text output from one prompt. Default: ",(0,s.jsx)(t.code,{children:"128"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"model_name"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsxs)(t.td,{children:["Input parameter. The name of the Vertex AI large language model. Default: ",(0,s.jsx)(t.code,{children:"text-bison"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"project"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. The default GCP project to use when making Vertex API calls."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"request_parallelism"}),(0,s.jsx)(t.td,{children:"Integer"}),(0,s.jsxs)(t.td,{children:["Input parameter. The amount of parallelism allowed for requests issued to Vertex AI models. Default: ",(0,s.jsx)(t.code,{children:"5"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"temperature"}),(0,s.jsx)(t.td,{children:"Float"}),(0,s.jsxs)(t.td,{children:["Input parameter. Tunes the degree of randomness in text generations. Should be a non-negative value. Default: ",(0,s.jsx)(t.code,{children:"0"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"top_k"}),(0,s.jsx)(t.td,{children:"Integer"}),(0,s.jsxs)(t.td,{children:["Input parameter. How the model selects tokens for output. The next token is selected from the top ",(0,s.jsx)(t.code,{children:"k"})," tokens. Default: ",(0,s.jsx)(t.code,{children:"40"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"top_p"}),(0,s.jsx)(t.td,{children:"Float"}),(0,s.jsxs)(t.td,{children:["Input parameter. Tokens are selected from the most probable to least until the sum of their probabilities exceeds the top ",(0,s.jsx)(t.code,{children:"p"})," value. Default: ",(0,s.jsx)(t.code,{children:"0.95"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"tuned_model_name"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsxs)(t.td,{children:["Input parameter. The name of a tuned model. If provided, ",(0,s.jsx)(t.code,{children:"model_name"})," is ignored."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"verbose"}),(0,s.jsx)(t.td,{children:"Boolean"}),(0,s.jsx)(t.td,{children:"Input parameter. This parameter controls the level of detail in the output. When set to true, it prints internal states of the chain to help debug. Default: false."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"embeddings"}),(0,s.jsx)(t.td,{children:"Embeddings"}),(0,s.jsx)(t.td,{children:"Output parameter. An instance for generating embeddings using Vertex AI."})]})]})]}),"\n",(0,s.jsx)(t.h2,{id:"vertexai-credentials",children:"Create a service account for Vertex AI authentication"}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.strong,{children:"Vertex AI Embeddings"})," and ",(0,s.jsx)(t.strong,{children:"Vertex AI"})," components authenticate with the ",(0,s.jsx)(t.a,{href:"https://console.cloud.google.com/marketplace/product/google/aiplatform.googleapis.com",children:"Google Vertex AI API"})," using a service account JSON file."]}),"\n",(0,s.jsxs)(t.p,{children:["These components require that you provide a service account JSON file in the ",(0,s.jsx)(t.strong,{children:"Credentials"})," parameter (",(0,s.jsx)(t.code,{children:"credentials"}),").\nYou can either provide the file directly in your component's settings or you can use a ",(0,s.jsxs)(t.a,{href:"https://cloud.google.com/docs/authentication/application-default-credentials",children:[(0,s.jsx)(t.code,{children:"GOOGLE_APPLICATION_CREDENTIALS"})," environment variable"]})," to reference the path to your JSON file."]}),"\n",(0,s.jsx)(t.p,{children:"The following steps explain how to create a service account for Langflow, create a service account JSON key file, and then use the JSON key file in Langflow:"}),"\n",(0,s.jsxs)(t.ol,{children:["\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["If you haven't done so already, ",(0,s.jsx)(t.a,{href:"https://cloud.google.com/vertex-ai/docs/start/cloud-environment",children:"enable the Vertex AI APIs in your Google Cloud project"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["Create a ",(0,s.jsx)(t.a,{href:"https://cloud.google.com/iam/docs/service-account-overview",children:"service account"})," in your Google Cloud project."]}),"\n",(0,s.jsxs)(t.p,{children:["It is recommended that you ",(0,s.jsx)(t.a,{href:"https://cloud.google.com/vertex-ai/docs/general/custom-service-account",children:"create a custom service account for Vertex AI"})," because Langflow uses this account to access the Vertex AI APIs."]}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["Assign the ",(0,s.jsx)(t.strong,{children:"Vertex AI Service Agent"})," role to the service account."]}),"\n",(0,s.jsxs)(t.p,{children:["This role allows Langflow to access Vertex AI resources.\nFor more information, see ",(0,s.jsx)(t.a,{href:"https://cloud.google.com/vertex-ai/docs/general/access-control",children:"Vertex AI access control with IAM"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)(t.a,{href:"https://cloud.google.com/iam/docs/keys-create-delete#console",children:"Create a service account key"})," in JSON format for your Langflow Vertex AI service account."]}),"\n",(0,s.jsxs)(t.p,{children:["When you click ",(0,s.jsx)(t.strong,{children:"Create"}),", the JSON key file is downloaded."]}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["In Langflow, create or open a flow with the ",(0,s.jsx)(t.strong,{children:"Vertex AI"})," or ",(0,s.jsx)(t.strong,{children:"Vertex AI Embeddings"})," component."]}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["In the component's ",(0,s.jsx)(t.strong,{children:"Credentials"})," field, do one of the following:"]}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsx)(t.p,{children:"Select your service account JSON file directly."}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["Leave the ",(0,s.jsx)(t.strong,{children:"Credentials"})," field empty if you want to pull the key file from an environment variable.\nThen, you must provide the path to your JSON file in a ",(0,s.jsx)(t.code,{children:"GOOGLE_APPLICATION_CREDENTIALS"})," environment variable that is set somewhere relative to your Langflow instance.\nFor example, you can set the environment variable in your terminal, your Langflow ",(0,s.jsx)(t.code,{children:".env"})," file, or otherwise in the environment where your Langflow server or application runs."]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.img,{alt:"Select a local JSON key file for the Vertex AI component",src:n(65180).A+"",width:"1913",height:"819"})}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsx)(t.p,{children:"Run your flow to verify that Langflow can use the service account credentials successfully."}),"\n",(0,s.jsxs)(t.p,{children:["For example, in a flow with ",(0,s.jsx)(t.strong,{children:"Chat Input"}),", ",(0,s.jsx)(t.strong,{children:"Chat Output"}),", and ",(0,s.jsx)(t.strong,{children:"Vertex AI"})," components, you can open the ",(0,s.jsx)(t.strong,{children:"Playground"})," and try chatting with the LLM.\nIf the LLM responds, then the credentials are configured correctly."]}),"\n"]}),"\n"]})]})}function u(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(x,{...e})}):x(e)}},31929:(e,t,n)=>{n.d(t,{Ay:()=>l,RM:()=>i});var r=n(74848),s=n(28453),o=n(17886);const i=[];function a(e){const t={a:"a",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,r.jsxs)(t.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,r.jsx)(o.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Controls"})," in the ",(0,r.jsx)(t.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function l(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}},65180:(e,t,n)=>{n.d(t,{A:()=>r});const r=n.p+"assets/images/configure-vertex-ai-credentials-in-langflow-10c417c45f725fee46d4ef5f740316b3.gif"}}]); \ No newline at end of file diff --git a/assets/js/238e6167.9fd2a7f2.js b/assets/js/238e6167.9fd2a7f2.js new file mode 100644 index 0000000000..54389a809d --- /dev/null +++ b/assets/js/238e6167.9fd2a7f2.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[3953],{17886:(e,n,t)=>{t.d(n,{A:()=>o});t(96540);var i=t(64058),s=t(74848);function o({name:e,...n}){const t=i[e];return t?(0,s.jsx)(t,{...n}):null}},29750:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/notion_meeting_agent_part_2-cbaa61a7a2dc7af1fc8541bfae8491ac.png"},43725:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/notion_meeting_agent_part_1-58b920a4f8129f18bbf4483b3e3255a5.png"},63398:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>a,default:()=>p,frontMatter:()=>l,metadata:()=>i,toc:()=>c});const i=JSON.parse('{"id":"Integrations/Notion/notion-agent-meeting-notes","title":"Notion Meeting Notes Agent","description":"The Notion Agent for Meeting Notes is an AI-powered tool that automatically processes meeting transcripts and updates your Notion workspace. It identifies tasks, action items, and key points from your meetings, then creates new tasks or updates existing ones in Notion without manual input.","source":"@site/docs/Integrations/Notion/notion-agent-meeting-notes.mdx","sourceDirName":"Integrations/Notion","slug":"/integrations/notion/notion-agent-meeting-notes","permalink":"/integrations/notion/notion-agent-meeting-notes","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Notion Meeting Notes Agent","slug":"/integrations/notion/notion-agent-meeting-notes"},"sidebar":"docs","previous":{"title":"Notion Conversational Agent","permalink":"/integrations/notion/notion-agent-conversational"},"next":{"title":"Novita","permalink":"/bundles-novita"}}');var s=t(74848),o=t(28453),r=t(17886);const l={title:"Notion Meeting Notes Agent",slug:"/integrations/notion/notion-agent-meeting-notes"},a=void 0,d={},c=[{value:"Prerequisites",id:"prerequisites",level:2},{value:"Components",id:"components",level:2},{value:"Meeting Transcript (text input)",id:"meeting-transcript-text-input",level:3},{value:"List Users (Notion component)",id:"list-users-notion-component",level:3},{value:"List Databases (Notion component)",id:"list-databases-notion-component",level:3},{value:"Prompt Template",id:"prompt-template",level:3},{value:"Meeting Summarizer (Tool Calling Agent)",id:"meeting-summarizer-tool-calling-agent",level:3},{value:"Notion Agent (Tool Calling Agent)",id:"notion-agent-tool-calling-agent",level:3},{value:"Notion components (tools)",id:"notion-components-tools",level:3},{value:"List Database Properties",id:"list-database-properties",level:4},{value:"Create Page",id:"create-page",level:4},{value:"Update Page Property",id:"update-page-property",level:4},{value:"Add Content to Page",id:"add-content-to-page",level:4},{value:"Chat Output",id:"chat-output",level:3},{value:"Flow Process",id:"flow-process",level:2},{value:"Run the Notion Meeting Notes flow",id:"run-the-notion-meeting-notes-flow",level:2},{value:"Customization",id:"customization",level:2},{value:"Troubleshooting",id:"troubleshooting",level:2}];function h(e){const n={a:"a",admonition:"admonition",h2:"h2",h3:"h3",h4:"h4",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,o.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.p,{children:"The Notion Agent for Meeting Notes is an AI-powered tool that automatically processes meeting transcripts and updates your Notion workspace. It identifies tasks, action items, and key points from your meetings, then creates new tasks or updates existing ones in Notion without manual input."}),"\n",(0,s.jsx)(n.h2,{id:"prerequisites",children:"Prerequisites"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"/integrations/notion/setup",children:"A Notion App"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"https://www.notion.so/my-integrations",children:"A Notion API key"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"https://platform.openai.com/account/api-keys",children:"An OpenAI API key"})}),"\n",(0,s.jsxs)(n.li,{children:["Recommended: ",(0,s.jsx)(n.a,{target:"_blank","data-noBrokenLinkCheck":!0,href:t(86924).A+"",children:"Download the Meeting Agent Flow JSON"}),", and then ",(0,s.jsx)(n.a,{href:"/concepts-flows-import",children:"import the flow"})," into Langflow."]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"warning",children:(0,s.jsx)(n.p,{children:"Treat all keys and other credentials as sensitive information. Use secure references, and don't share them publicly."})}),"\n",(0,s.jsx)(n.h2,{id:"components",children:"Components"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"Notion Meeting Agent Part 1",src:t(43725).A+"",width:"1427",height:"645"})}),"\n",(0,s.jsx)(n.h3,{id:"meeting-transcript-text-input",children:"Meeting Transcript (text input)"}),"\n",(0,s.jsx)(n.p,{children:"This component allows users to input the meeting transcript directly into the flow."}),"\n",(0,s.jsx)(n.h3,{id:"list-users-notion-component",children:"List Users (Notion component)"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Purpose"}),": Retrieves a list of users from the Notion workspace."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Input"}),": Notion Secret (API key)"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Output"}),": List of user data"]}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"list-databases-notion-component",children:"List Databases (Notion component)"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Purpose"}),": Searches and lists all databases in the Notion workspace."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Input"}),":","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Notion Secret (API key)"}),"\n",(0,s.jsx)(n.li,{children:"Query (optional)"}),"\n",(0,s.jsx)(n.li,{children:"Filter Type (default: database)"}),"\n",(0,s.jsx)(n.li,{children:"Sort Direction"}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Output"}),": List of database data"]}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"prompt-template",children:"Prompt Template"}),"\n",(0,s.jsx)(n.p,{children:"This component creates a dynamic prompt template using the following inputs:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Meeting Transcript"}),"\n",(0,s.jsx)(n.li,{children:"List of Users"}),"\n",(0,s.jsx)(n.li,{children:"List of Databases"}),"\n",(0,s.jsx)(n.li,{children:"Current Date"}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"meeting-summarizer-tool-calling-agent",children:"Meeting Summarizer (Tool Calling Agent)"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Purpose"}),": Analyzes the meeting transcript and identifies tasks and action items."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Inputs"}),":","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["System Prompt (from the ",(0,s.jsx)(n.strong,{children:"Prompt Template"})," component)"]}),"\n",(0,s.jsx)(n.li,{children:"Language Model (OpenAI)"}),"\n",(0,s.jsxs)(n.li,{children:["Tools:","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Notion Search"}),"\n",(0,s.jsx)(n.li,{children:"List Database Properties"}),"\n",(0,s.jsx)(n.li,{children:"Create Page"}),"\n",(0,s.jsx)(n.li,{children:"Update Page Property"}),"\n",(0,s.jsx)(n.li,{children:"Add Content to Page"}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"Notion Meeting Agent Part 2",src:t(29750).A+"",width:"1362",height:"819"})}),"\n",(0,s.jsx)(n.h3,{id:"notion-agent-tool-calling-agent",children:"Notion Agent (Tool Calling Agent)"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Purpose"}),": Executes actions in Notion based on the meeting summary."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Inputs"}),":","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["System Prompt (from the second ",(0,s.jsx)(n.strong,{children:"Prompt Template"})," component)"]}),"\n",(0,s.jsx)(n.li,{children:"Language Model (OpenAI)"}),"\n",(0,s.jsxs)(n.li,{children:["Tools:","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"List Database Properties"}),"\n",(0,s.jsx)(n.li,{children:"Create Page"}),"\n",(0,s.jsx)(n.li,{children:"Update Page Property"}),"\n",(0,s.jsx)(n.li,{children:"Add Content to Page"}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"notion-components-tools",children:"Notion components (tools)"}),"\n",(0,s.jsx)(n.h4,{id:"list-database-properties",children:"List Database Properties"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Purpose"}),": Retrieves the properties of a specified Notion database."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Input"}),":","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Database ID"}),"\n",(0,s.jsx)(n.li,{children:"Notion Secret (API key)"}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.h4,{id:"create-page",children:"Create Page"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Purpose"}),": Creates a new page in a Notion database."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Inputs"}),":","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Database ID"}),"\n",(0,s.jsx)(n.li,{children:"Notion Secret (API key)"}),"\n",(0,s.jsx)(n.li,{children:"Properties (JSON)"}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.h4,{id:"update-page-property",children:"Update Page Property"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Purpose"}),": Updates the properties of an existing Notion page."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Inputs"}),":","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Page ID"}),"\n",(0,s.jsx)(n.li,{children:"Notion Secret (API key)"}),"\n",(0,s.jsx)(n.li,{children:"Properties to update"}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.h4,{id:"add-content-to-page",children:"Add Content to Page"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Purpose"}),": Converts markdown text to Notion blocks and appends them to a specified Notion page."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Inputs"}),":","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Page/Block ID"}),"\n",(0,s.jsx)(n.li,{children:"Notion Secret (API key)"}),"\n",(0,s.jsx)(n.li,{children:"Markdown text"}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"chat-output",children:"Chat Output"}),"\n",(0,s.jsx)(n.p,{children:"Displays the final output of the Notion Agent in the Playground."}),"\n",(0,s.jsx)(n.h2,{id:"flow-process",children:"Flow Process"}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsx)(n.li,{children:"The user inputs a meeting transcript."}),"\n",(0,s.jsx)(n.li,{children:"The flow retrieves the list of Notion users and databases."}),"\n",(0,s.jsx)(n.li,{children:"A prompt is generated using the transcript, user list, database list, and current date."}),"\n",(0,s.jsx)(n.li,{children:"The Meeting Summarizer analyzes the transcript and identifies tasks and action items."}),"\n",(0,s.jsxs)(n.li,{children:["The Notion Agent uses the meeting summary to:","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Create new pages for new tasks"}),"\n",(0,s.jsx)(n.li,{children:"Update existing pages for existing tasks"}),"\n",(0,s.jsx)(n.li,{children:"Add content to pages with meeting notes"}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.li,{children:"The Chat Output displays a summary of actions taken in Notion."}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"run-the-notion-meeting-notes-flow",children:"Run the Notion Meeting Notes flow"}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Create a flow manually or import a pre-built flow JSON file:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["Recommended: ",(0,s.jsx)(n.a,{target:"_blank","data-noBrokenLinkCheck":!0,href:t(86924).A+"",children:"Download the Meeting Agent flow JSON"})," and then ",(0,s.jsx)(n.a,{href:"/concepts-flows-import",children:"import the flow"})," into Langflow."]}),"\n",(0,s.jsx)(n.li,{children:"Create a blank flow, and then add the previously described components to your flow, connecting them as shown in the flow diagram."}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Input the Notion and OpenAI API keys in their respective components."}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Paste your meeting transcript into the ",(0,s.jsx)(n.strong,{children:"Meeting Transcript"})," component."]}),"\n",(0,s.jsx)(n.p,{children:"For optimal results, use detailed meeting transcripts. The quality of the output depends on the comprehensiveness of the input provided."}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Run the flow by clicking ",(0,s.jsx)(r.A,{name:"Play","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Run component"})," on the ",(0,s.jsx)(n.strong,{children:"Chat Output"})," component or open the ",(0,s.jsx)(n.strong,{children:"Playground"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Review the output summarizing the actions taken in your Notion workspace."}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"customization",children:"Customization"}),"\n",(0,s.jsx)(n.p,{children:"The flow can be customized to meet your team's specific needs."}),"\n",(0,s.jsx)(n.p,{children:"Customize this flow by:"}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsx)(n.li,{children:"Adjusting the system prompt to change the agent's behavior or context."}),"\n",(0,s.jsx)(n.li,{children:"Adding or removing Notion tools based on your specific needs."}),"\n",(0,s.jsx)(n.li,{children:"Modifying the OpenAI model parameters (e.g., temperature) to adjust the agent's response style."}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"troubleshooting",children:"Troubleshooting"}),"\n",(0,s.jsx)(n.p,{children:"If you encounter issues:"}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsx)(n.li,{children:"Ensure all API keys are correctly set and have the necessary permissions."}),"\n",(0,s.jsx)(n.li,{children:"Check that your Notion integration has access to the relevant pages and databases."}),"\n",(0,s.jsx)(n.li,{children:"Verify that all components are properly connected in the flow."}),"\n",(0,s.jsx)(n.li,{children:"Review the Langflow logs for any error messages."}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["For more advanced usage and integration options, refer to the ",(0,s.jsx)(n.a,{href:"https://developers.notion.com/",children:"Notion API documentation"})," and ",(0,s.jsx)(n.a,{href:"/",children:"Langflow documentation"}),"."]})]})}function p(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(h,{...e})}):h(e)}},86924:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/files/Meeting_Notes_Agent-5b44e7b25cc900331f0467d3e4571151.json"}}]); \ No newline at end of file diff --git a/assets/js/238e6167.b289dca1.js b/assets/js/238e6167.b289dca1.js deleted file mode 100644 index 1fd99fa64d..0000000000 --- a/assets/js/238e6167.b289dca1.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[3953],{17886:(e,n,t)=>{t.d(n,{A:()=>o});t(96540);var i=t(64058),s=t(74848);function o({name:e,...n}){const t=i[e];return t?(0,s.jsx)(t,{...n}):null}},29750:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/notion_meeting_agent_part_2-cbaa61a7a2dc7af1fc8541bfae8491ac.png"},43725:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/notion_meeting_agent_part_1-58b920a4f8129f18bbf4483b3e3255a5.png"},63398:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>a,default:()=>p,frontMatter:()=>l,metadata:()=>i,toc:()=>c});const i=JSON.parse('{"id":"Integrations/Notion/notion-agent-meeting-notes","title":"Notion Meeting Notes Agent","description":"The Notion Agent for Meeting Notes is an AI-powered tool that automatically processes meeting transcripts and updates your Notion workspace. It identifies tasks, action items, and key points from your meetings, then creates new tasks or updates existing ones in Notion without manual input.","source":"@site/docs/Integrations/Notion/notion-agent-meeting-notes.mdx","sourceDirName":"Integrations/Notion","slug":"/integrations/notion/notion-agent-meeting-notes","permalink":"/integrations/notion/notion-agent-meeting-notes","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Notion Meeting Notes Agent","slug":"/integrations/notion/notion-agent-meeting-notes"},"sidebar":"docs","previous":{"title":"Notion Conversational Agent","permalink":"/integrations/notion/notion-agent-conversational"},"next":{"title":"Novita","permalink":"/bundles-novita"}}');var s=t(74848),o=t(28453),r=t(17886);const l={title:"Notion Meeting Notes Agent",slug:"/integrations/notion/notion-agent-meeting-notes"},a=void 0,d={},c=[{value:"Prerequisites",id:"prerequisites",level:2},{value:"Components",id:"components",level:2},{value:"Meeting Transcript (text input)",id:"meeting-transcript-text-input",level:3},{value:"List Users (Notion component)",id:"list-users-notion-component",level:3},{value:"List Databases (Notion component)",id:"list-databases-notion-component",level:3},{value:"Prompt Template",id:"prompt-template",level:3},{value:"Meeting Summarizer (Tool Calling Agent)",id:"meeting-summarizer-tool-calling-agent",level:3},{value:"Notion Agent (Tool Calling Agent)",id:"notion-agent-tool-calling-agent",level:3},{value:"Notion components (tools)",id:"notion-components-tools",level:3},{value:"List Database Properties",id:"list-database-properties",level:4},{value:"Create Page",id:"create-page",level:4},{value:"Update Page Property",id:"update-page-property",level:4},{value:"Add Content to Page",id:"add-content-to-page",level:4},{value:"Chat Output",id:"chat-output",level:3},{value:"Flow Process",id:"flow-process",level:2},{value:"Run the Notion Meeting Notes flow",id:"run-the-notion-meeting-notes-flow",level:2},{value:"Customization",id:"customization",level:2},{value:"Troubleshooting",id:"troubleshooting",level:2}];function h(e){const n={a:"a",admonition:"admonition",h2:"h2",h3:"h3",h4:"h4",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,o.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.p,{children:"The Notion Agent for Meeting Notes is an AI-powered tool that automatically processes meeting transcripts and updates your Notion workspace. It identifies tasks, action items, and key points from your meetings, then creates new tasks or updates existing ones in Notion without manual input."}),"\n",(0,s.jsx)(n.h2,{id:"prerequisites",children:"Prerequisites"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"/integrations/notion/setup",children:"A Notion App"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"https://www.notion.so/my-integrations",children:"A Notion API key"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"https://platform.openai.com/account/api-keys",children:"An OpenAI API key"})}),"\n",(0,s.jsxs)(n.li,{children:["Recommended: ",(0,s.jsx)(n.a,{target:"_blank","data-noBrokenLinkCheck":!0,href:t(86924).A+"",children:"Download the Meeting Agent Flow JSON"}),", and then ",(0,s.jsx)(n.a,{href:"/concepts-flows-import",children:"import the flow"})," into Langflow."]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"important",children:(0,s.jsx)(n.p,{children:"Treat all keys and other credentials as sensitive information. Use secure references, and don't share them publicly."})}),"\n",(0,s.jsx)(n.h2,{id:"components",children:"Components"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"Notion Meeting Agent Part 1",src:t(43725).A+"",width:"1427",height:"645"})}),"\n",(0,s.jsx)(n.h3,{id:"meeting-transcript-text-input",children:"Meeting Transcript (text input)"}),"\n",(0,s.jsx)(n.p,{children:"This component allows users to input the meeting transcript directly into the flow."}),"\n",(0,s.jsx)(n.h3,{id:"list-users-notion-component",children:"List Users (Notion component)"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Purpose"}),": Retrieves a list of users from the Notion workspace."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Input"}),": Notion Secret (API key)"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Output"}),": List of user data"]}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"list-databases-notion-component",children:"List Databases (Notion component)"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Purpose"}),": Searches and lists all databases in the Notion workspace."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Input"}),":","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Notion Secret (API key)"}),"\n",(0,s.jsx)(n.li,{children:"Query (optional)"}),"\n",(0,s.jsx)(n.li,{children:"Filter Type (default: database)"}),"\n",(0,s.jsx)(n.li,{children:"Sort Direction"}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Output"}),": List of database data"]}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"prompt-template",children:"Prompt Template"}),"\n",(0,s.jsx)(n.p,{children:"This component creates a dynamic prompt template using the following inputs:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Meeting Transcript"}),"\n",(0,s.jsx)(n.li,{children:"List of Users"}),"\n",(0,s.jsx)(n.li,{children:"List of Databases"}),"\n",(0,s.jsx)(n.li,{children:"Current Date"}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"meeting-summarizer-tool-calling-agent",children:"Meeting Summarizer (Tool Calling Agent)"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Purpose"}),": Analyzes the meeting transcript and identifies tasks and action items."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Inputs"}),":","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["System Prompt (from the ",(0,s.jsx)(n.strong,{children:"Prompt Template"})," component)"]}),"\n",(0,s.jsx)(n.li,{children:"Language Model (OpenAI)"}),"\n",(0,s.jsxs)(n.li,{children:["Tools:","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Notion Search"}),"\n",(0,s.jsx)(n.li,{children:"List Database Properties"}),"\n",(0,s.jsx)(n.li,{children:"Create Page"}),"\n",(0,s.jsx)(n.li,{children:"Update Page Property"}),"\n",(0,s.jsx)(n.li,{children:"Add Content to Page"}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"Notion Meeting Agent Part 2",src:t(29750).A+"",width:"1362",height:"819"})}),"\n",(0,s.jsx)(n.h3,{id:"notion-agent-tool-calling-agent",children:"Notion Agent (Tool Calling Agent)"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Purpose"}),": Executes actions in Notion based on the meeting summary."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Inputs"}),":","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["System Prompt (from the second ",(0,s.jsx)(n.strong,{children:"Prompt Template"})," component)"]}),"\n",(0,s.jsx)(n.li,{children:"Language Model (OpenAI)"}),"\n",(0,s.jsxs)(n.li,{children:["Tools:","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"List Database Properties"}),"\n",(0,s.jsx)(n.li,{children:"Create Page"}),"\n",(0,s.jsx)(n.li,{children:"Update Page Property"}),"\n",(0,s.jsx)(n.li,{children:"Add Content to Page"}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"notion-components-tools",children:"Notion components (tools)"}),"\n",(0,s.jsx)(n.h4,{id:"list-database-properties",children:"List Database Properties"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Purpose"}),": Retrieves the properties of a specified Notion database."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Input"}),":","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Database ID"}),"\n",(0,s.jsx)(n.li,{children:"Notion Secret (API key)"}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.h4,{id:"create-page",children:"Create Page"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Purpose"}),": Creates a new page in a Notion database."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Inputs"}),":","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Database ID"}),"\n",(0,s.jsx)(n.li,{children:"Notion Secret (API key)"}),"\n",(0,s.jsx)(n.li,{children:"Properties (JSON)"}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.h4,{id:"update-page-property",children:"Update Page Property"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Purpose"}),": Updates the properties of an existing Notion page."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Inputs"}),":","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Page ID"}),"\n",(0,s.jsx)(n.li,{children:"Notion Secret (API key)"}),"\n",(0,s.jsx)(n.li,{children:"Properties to update"}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.h4,{id:"add-content-to-page",children:"Add Content to Page"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Purpose"}),": Converts markdown text to Notion blocks and appends them to a specified Notion page."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Inputs"}),":","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Page/Block ID"}),"\n",(0,s.jsx)(n.li,{children:"Notion Secret (API key)"}),"\n",(0,s.jsx)(n.li,{children:"Markdown text"}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"chat-output",children:"Chat Output"}),"\n",(0,s.jsx)(n.p,{children:"Displays the final output of the Notion Agent in the Playground."}),"\n",(0,s.jsx)(n.h2,{id:"flow-process",children:"Flow Process"}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsx)(n.li,{children:"The user inputs a meeting transcript."}),"\n",(0,s.jsx)(n.li,{children:"The flow retrieves the list of Notion users and databases."}),"\n",(0,s.jsx)(n.li,{children:"A prompt is generated using the transcript, user list, database list, and current date."}),"\n",(0,s.jsx)(n.li,{children:"The Meeting Summarizer analyzes the transcript and identifies tasks and action items."}),"\n",(0,s.jsxs)(n.li,{children:["The Notion Agent uses the meeting summary to:","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Create new pages for new tasks"}),"\n",(0,s.jsx)(n.li,{children:"Update existing pages for existing tasks"}),"\n",(0,s.jsx)(n.li,{children:"Add content to pages with meeting notes"}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.li,{children:"The Chat Output displays a summary of actions taken in Notion."}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"run-the-notion-meeting-notes-flow",children:"Run the Notion Meeting Notes flow"}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Create a flow manually or import a pre-built flow JSON file:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["Recommended: ",(0,s.jsx)(n.a,{target:"_blank","data-noBrokenLinkCheck":!0,href:t(86924).A+"",children:"Download the Meeting Agent flow JSON"})," and then ",(0,s.jsx)(n.a,{href:"/concepts-flows-import",children:"import the flow"})," into Langflow."]}),"\n",(0,s.jsx)(n.li,{children:"Create a blank flow, and then add the previously described components to your flow, connecting them as shown in the flow diagram."}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Input the Notion and OpenAI API keys in their respective components."}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Paste your meeting transcript into the ",(0,s.jsx)(n.strong,{children:"Meeting Transcript"})," component."]}),"\n",(0,s.jsx)(n.p,{children:"For optimal results, use detailed meeting transcripts. The quality of the output depends on the comprehensiveness of the input provided."}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Run the flow by clicking ",(0,s.jsx)(r.A,{name:"Play","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Run component"})," on the ",(0,s.jsx)(n.strong,{children:"Chat Output"})," component or open the ",(0,s.jsx)(n.strong,{children:"Playground"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Review the output summarizing the actions taken in your Notion workspace."}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"customization",children:"Customization"}),"\n",(0,s.jsx)(n.p,{children:"The flow can be customized to meet your team's specific needs."}),"\n",(0,s.jsx)(n.p,{children:"Customize this flow by:"}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsx)(n.li,{children:"Adjusting the system prompt to change the agent's behavior or context."}),"\n",(0,s.jsx)(n.li,{children:"Adding or removing Notion tools based on your specific needs."}),"\n",(0,s.jsx)(n.li,{children:"Modifying the OpenAI model parameters (e.g., temperature) to adjust the agent's response style."}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"troubleshooting",children:"Troubleshooting"}),"\n",(0,s.jsx)(n.p,{children:"If you encounter issues:"}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsx)(n.li,{children:"Ensure all API keys are correctly set and have the necessary permissions."}),"\n",(0,s.jsx)(n.li,{children:"Check that your Notion integration has access to the relevant pages and databases."}),"\n",(0,s.jsx)(n.li,{children:"Verify that all components are properly connected in the flow."}),"\n",(0,s.jsx)(n.li,{children:"Review the Langflow logs for any error messages."}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["For more advanced usage and integration options, refer to the ",(0,s.jsx)(n.a,{href:"https://developers.notion.com/",children:"Notion API documentation"})," and ",(0,s.jsx)(n.a,{href:"/",children:"Langflow documentation"}),"."]})]})}function p(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(h,{...e})}):h(e)}},86924:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/files/Meeting_Notes_Agent-5b44e7b25cc900331f0467d3e4571151.json"}}]); \ No newline at end of file diff --git a/assets/js/2ab0d4f5.e81e9d22.js b/assets/js/2ab0d4f5.5628838f.js similarity index 50% rename from assets/js/2ab0d4f5.e81e9d22.js rename to assets/js/2ab0d4f5.5628838f.js index fa39da9d3b..e0cc45563a 100644 --- a/assets/js/2ab0d4f5.e81e9d22.js +++ b/assets/js/2ab0d4f5.5628838f.js @@ -1 +1 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[1845],{28453:(e,n,t)=>{t.d(n,{R:()=>a,x:()=>o});var i=t(96540);const s={},r=i.createContext(s);function a(e){const n=i.useContext(r);return i.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:a(e.components),i.createElement(r.Provider,{value:n},e.children)}},83640:(e,n,t)=>{t.r(n),t.d(n,{contentTitle:()=>o,default:()=>c,frontMatter:()=>a,metadata:()=>i,toc:()=>l});const i=JSON.parse('{"type":"api","id":"simplified-run-flow","title":"Simplified Run Flow","description":"","slug":"/simplified-run-flow","frontMatter":{},"api":{"tags":["Base"],"description":"Executes a specified flow by ID with support for streaming and telemetry.\\n\\nThis endpoint executes a flow identified by ID or name, with options for streaming the response\\nand tracking execution metrics. It handles both streaming and non-streaming execution modes.\\n\\nArgs:\\n background_tasks (BackgroundTasks): FastAPI background task manager\\n flow (FlowRead | None): The flow to execute, loaded via dependency\\n input_request (SimplifiedAPIRequest | None): Input parameters for the flow\\n stream (bool): Whether to stream the response\\n api_key_user (UserRead): Authenticated user from API key\\n request (Request): The incoming HTTP request\\n\\nReturns:\\n Union[StreamingResponse, RunResponse]: Either a streaming response for real-time results\\n or a RunResponse with the complete execution results\\n\\nRaises:\\n HTTPException: For flow not found (404) or invalid input (400)\\n APIException: For internal execution errors (500)\\n\\nNotes:\\n - Supports both streaming and non-streaming execution modes\\n - Tracks execution time and success/failure via telemetry\\n - Handles graceful client disconnection in streaming mode\\n - Provides detailed error handling with appropriate HTTP status codes\\n - In streaming mode, uses EventManager to handle events:\\n - \\"add_message\\": New messages during execution\\n - \\"token\\": Individual tokens during streaming\\n - \\"end\\": Final execution result","operationId":"simplified_run_flow_api_v1_run__flow_id_or_name__post","security":[{"API key query":[]},{"API key header":[]}],"parameters":[{"name":"flow_id_or_name","in":"path","required":true,"schema":{"type":"string","title":"Flow Id Or Name"}},{"name":"stream","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Stream"}},{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"string","format":"uuid"},{"type":"null"}],"title":"User Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"properties":{"input_value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Input Value","description":"The input value"},"input_type":{"anyOf":[{"type":"string","enum":["chat","text","any"]},{"type":"null"}],"title":"Input Type","description":"The input type","default":"chat"},"output_type":{"anyOf":[{"type":"string","enum":["chat","text","any","debug"]},{"type":"null"}],"title":"Output Type","description":"The output type","default":"chat"},"output_component":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Output Component","description":"If there are multiple output components, you can specify the component to get the output from.","default":""},"tweaks":{"anyOf":[{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"object"}]},"type":"object","title":"Tweaks","description":"A dictionary of tweaks to adjust the flow\'s execution. Allows customizing flow behavior dynamically. All tweaks are overridden by the input values.","examples":[{"Component Name":{"parameter_name":"value"},"component_id":{"parameter_name":"value"},"parameter_name":"value"}]},{"type":"null"}],"description":"The tweaks"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id","description":"The session id"}},"type":"object","title":"SimplifiedAPIRequest"},{"type":"null"}],"title":"Input Request"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"properties":{"detail":{"items":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"}}}}},"method":"post","path":"/api/v1/run/{flow_id_or_name}","securitySchemes":{"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"api/v1/login"}}},"API key query":{"type":"apiKey","in":"query","name":"x-api-key"},"API key header":{"type":"apiKey","in":"header","name":"x-api-key"}},"info":{"title":"Langflow","version":"1.5.1"},"postman":{"name":"Simplified Run Flow","description":{"content":"Executes a specified flow by ID with support for streaming and telemetry.\\n\\nThis endpoint executes a flow identified by ID or name, with options for streaming the response\\nand tracking execution metrics. It handles both streaming and non-streaming execution modes.\\n\\nArgs:\\n background_tasks (BackgroundTasks): FastAPI background task manager\\n flow (FlowRead | None): The flow to execute, loaded via dependency\\n input_request (SimplifiedAPIRequest | None): Input parameters for the flow\\n stream (bool): Whether to stream the response\\n api_key_user (UserRead): Authenticated user from API key\\n request (Request): The incoming HTTP request\\n\\nReturns:\\n Union[StreamingResponse, RunResponse]: Either a streaming response for real-time results\\n or a RunResponse with the complete execution results\\n\\nRaises:\\n HTTPException: For flow not found (404) or invalid input (400)\\n APIException: For internal execution errors (500)\\n\\nNotes:\\n - Supports both streaming and non-streaming execution modes\\n - Tracks execution time and success/failure via telemetry\\n - Handles graceful client disconnection in streaming mode\\n - Provides detailed error handling with appropriate HTTP status codes\\n - In streaming mode, uses EventManager to handle events:\\n - \\"add_message\\": New messages during execution\\n - \\"token\\": Individual tokens during streaming\\n - \\"end\\": Final execution result","type":"text/plain"},"url":{"path":["api","v1","run",":flow_id_or_name"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"key":"stream","value":"false"},{"disabled":false,"key":"user_id","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) ","type":"text/plain"},"type":"any","value":"","key":"flow_id_or_name"}]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"{\\n \\"input_value\\": \\"\\",\\n \\"input_type\\": \\"\\",\\n \\"output_type\\": \\"\\",\\n \\"output_component\\": \\"\\",\\n \\"tweaks\\": {\\n \\"ipsum7\\": \\"\\",\\n \\"officia_e45\\": \\"\\"\\n },\\n \\"session_id\\": \\"\\"\\n}","options":{"raw":{"language":"json"}}},"auth":{"type":"apikey","apikey":[{"type":"any","value":"x-api-key","key":"key"},{"type":"any","value":"{{apiKey}}","key":"value"},{"type":"any","value":"query","key":"in"}]}}},"source":"@site/openapi.json","sourceDirName":".","permalink":"/api/simplified-run-flow","previous":{"title":"Get All","permalink":"/api/get-all"},"next":{"title":"Webhook Run Flow","permalink":"/api/webhook-run-flow"}}');var s=t(74848),r=t(28453);const a={},o="Simplified Run Flow",l=[];function d(e){const n={h1:"h1",header:"header",li:"li",p:"p",ul:"ul",...(0,r.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.header,{children:(0,s.jsx)(n.h1,{id:"simplified-run-flow",children:"Simplified Run Flow"})}),"\n",(0,s.jsx)(n.p,{children:"Executes a specified flow by ID with support for streaming and telemetry."}),"\n",(0,s.jsx)(n.p,{children:"This endpoint executes a flow identified by ID or name, with options for streaming the response\nand tracking execution metrics. It handles both streaming and non-streaming execution modes."}),"\n",(0,s.jsx)(n.p,{children:"Args:\nbackground_tasks (BackgroundTasks): FastAPI background task manager\nflow (FlowRead | None): The flow to execute, loaded via dependency\ninput_request (SimplifiedAPIRequest | None): Input parameters for the flow\nstream (bool): Whether to stream the response\napi_key_user (UserRead): Authenticated user from API key\nrequest (Request): The incoming HTTP request"}),"\n",(0,s.jsx)(n.p,{children:"Returns:\nUnion[StreamingResponse, RunResponse]: Either a streaming response for real-time results\nor a RunResponse with the complete execution results"}),"\n",(0,s.jsx)(n.p,{children:"Raises:\nHTTPException: For flow not found (404) or invalid input (400)\nAPIException: For internal execution errors (500)"}),"\n",(0,s.jsx)(n.p,{children:"Notes:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Supports both streaming and non-streaming execution modes"}),"\n",(0,s.jsx)(n.li,{children:"Tracks execution time and success/failure via telemetry"}),"\n",(0,s.jsx)(n.li,{children:"Handles graceful client disconnection in streaming mode"}),"\n",(0,s.jsx)(n.li,{children:"Provides detailed error handling with appropriate HTTP status codes"}),"\n",(0,s.jsxs)(n.li,{children:["In streaming mode, uses EventManager to handle events:","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:'"add_message": New messages during execution'}),"\n",(0,s.jsx)(n.li,{children:'"token": Individual tokens during streaming'}),"\n",(0,s.jsx)(n.li,{children:'"end": Final execution result'}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)("table",{style:{display:"table",width:"100%"},children:[(0,s.jsx)("thead",{children:(0,s.jsx)("tr",{children:(0,s.jsx)("th",{style:{textAlign:"left"},children:"Path Parameters"})})}),(0,s.jsx)("tbody",{children:(0,s.jsx)("tr",{children:(0,s.jsxs)("td",{children:[(0,s.jsx)("code",{children:"flow_id_or_name"}),(0,s.jsx)("span",{style:{opacity:"0.6"},children:" Flow Id Or Name"}),(0,s.jsx)("span",{style:{opacity:"0.6"},children:" \u2014 "}),(0,s.jsx)("strong",{style:{fontSize:"var(--ifm-code-font-size)",color:"var(--openapi-required)"},children:" REQUIRED"})]})})})]}),"\n",(0,s.jsxs)("table",{style:{display:"table",width:"100%"},children:[(0,s.jsx)("thead",{children:(0,s.jsx)("tr",{children:(0,s.jsx)("th",{style:{textAlign:"left"},children:"Query Parameters"})})}),(0,s.jsxs)("tbody",{children:[(0,s.jsx)("tr",{children:(0,s.jsxs)("td",{children:[(0,s.jsx)("code",{children:"stream"}),(0,s.jsx)("span",{style:{opacity:"0.6"},children:" Stream"})]})}),(0,s.jsx)("tr",{children:(0,s.jsxs)("td",{children:[(0,s.jsx)("code",{children:"user_id"}),(0,s.jsx)("span",{style:{opacity:"0.6"},children:" User Id"})]})})]})]}),"\n",(0,s.jsxs)("table",{style:{display:"table",width:"100%"},children:[(0,s.jsx)("thead",{children:(0,s.jsx)("tr",{children:(0,s.jsxs)("th",{style:{textAlign:"left"},children:[(0,s.jsx)("span",{children:"Request Body "}),(0,s.jsx)("div",{})]})})}),(0,s.jsx)("tbody",{children:(0,s.jsx)("tr",{children:(0,s.jsx)("td",{children:(0,s.jsx)("span",{style:{opacity:"0.6"},children:" undefined"})})})})]}),"\n",(0,s.jsxs)("table",{style:{display:"table",width:"100%"},children:[(0,s.jsx)("thead",{children:(0,s.jsx)("tr",{children:(0,s.jsx)("th",{style:{textAlign:"left"},children:"Responses"})})}),(0,s.jsxs)("tbody",{children:[(0,s.jsx)("tr",{children:(0,s.jsxs)("td",{children:[(0,s.jsxs)("div",{style:{display:"flex"},children:[(0,s.jsx)("div",{style:{marginRight:"var(--ifm-table-cell-padding)"},children:(0,s.jsx)("code",{children:"200"})}),(0,s.jsx)("div",{children:(0,s.jsx)(n.p,{children:"Successful Response"})})]}),(0,s.jsx)("div",{children:(0,s.jsxs)("table",{style:{display:"table",width:"100%",marginTop:"var(--ifm-table-cell-padding)",marginBottom:"0px"},children:[(0,s.jsx)("thead",{children:(0,s.jsx)("tr",{children:(0,s.jsxs)("th",{style:{textAlign:"left"},children:[(0,s.jsx)("span",{children:"Schema "}),(0,s.jsx)("span",{style:{opacity:"0.6"},children:" \u2014 "}),(0,s.jsx)("strong",{style:{fontSize:"var(--ifm-code-font-size)",color:"var(--openapi-optional)"},children:" OPTIONAL"}),(0,s.jsx)("div",{})]})})}),(0,s.jsx)("tbody",{children:(0,s.jsx)("tr",{children:(0,s.jsx)("td",{children:(0,s.jsx)("span",{style:{opacity:"0.6"},children:" undefined"})})})})]})})]})}),(0,s.jsx)("tr",{children:(0,s.jsxs)("td",{children:[(0,s.jsxs)("div",{style:{display:"flex"},children:[(0,s.jsx)("div",{style:{marginRight:"var(--ifm-table-cell-padding)"},children:(0,s.jsx)("code",{children:"422"})}),(0,s.jsx)("div",{children:(0,s.jsx)(n.p,{children:"Validation Error"})})]}),(0,s.jsx)("div",{children:(0,s.jsxs)("table",{style:{display:"table",width:"100%",marginTop:"var(--ifm-table-cell-padding)",marginBottom:"0px"},children:[(0,s.jsx)("thead",{children:(0,s.jsx)("tr",{children:(0,s.jsxs)("th",{style:{textAlign:"left"},children:[(0,s.jsx)("span",{children:"Schema "}),(0,s.jsx)("span",{style:{opacity:"0.6"},children:" \u2014 "}),(0,s.jsx)("strong",{style:{fontSize:"var(--ifm-code-font-size)",color:"var(--openapi-optional)"},children:" OPTIONAL"}),(0,s.jsx)("div",{})]})})}),(0,s.jsx)("tbody",{children:(0,s.jsx)("tr",{children:(0,s.jsxs)("td",{children:[(0,s.jsx)("code",{children:"detail"}),(0,s.jsx)("span",{style:{opacity:"0.6"},children:" object[]"}),(0,s.jsx)("span",{style:{opacity:"0.6"},children:" \u2014 "}),(0,s.jsx)("strong",{style:{fontSize:"var(--ifm-code-font-size)",color:"var(--openapi-optional)"},children:" OPTIONAL"}),(0,s.jsx)("table",{style:{display:"table",width:"100%",marginTop:"var(--ifm-table-cell-padding)",marginBottom:"0px"},children:(0,s.jsxs)("tbody",{children:[(0,s.jsx)("tr",{children:(0,s.jsxs)("td",{children:[(0,s.jsx)("code",{children:"loc"}),(0,s.jsx)("span",{style:{opacity:"0.6"},children:" undefined[]"})]})}),(0,s.jsx)("tr",{children:(0,s.jsxs)("td",{children:[(0,s.jsx)("code",{children:"msg"}),(0,s.jsx)("span",{style:{opacity:"0.6"},children:" Message"})]})}),(0,s.jsx)("tr",{children:(0,s.jsxs)("td",{children:[(0,s.jsx)("code",{children:"type"}),(0,s.jsx)("span",{style:{opacity:"0.6"},children:" Error Type"})]})})]})})]})})})]})})]})})]})]})]})}function c(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}}}]); \ No newline at end of file +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[1845],{28453:(e,n,t)=>{t.d(n,{R:()=>a,x:()=>o});var i=t(96540);const s={},r=i.createContext(s);function a(e){const n=i.useContext(r);return i.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:a(e.components),i.createElement(r.Provider,{value:n},e.children)}},83640:(e,n,t)=>{t.r(n),t.d(n,{contentTitle:()=>o,default:()=>c,frontMatter:()=>a,metadata:()=>i,toc:()=>l});const i=JSON.parse('{"type":"api","id":"simplified-run-flow","title":"Simplified Run Flow","description":"","slug":"/simplified-run-flow","frontMatter":{},"api":{"tags":["Base"],"description":"Executes a specified flow by ID with support for streaming and telemetry.\\n\\nThis endpoint executes a flow identified by ID or name, with options for streaming the response\\nand tracking execution metrics. It handles both streaming and non-streaming execution modes.\\n\\nArgs:\\n background_tasks (BackgroundTasks): FastAPI background task manager\\n flow (FlowRead | None): The flow to execute, loaded via dependency\\n input_request (SimplifiedAPIRequest | None): Input parameters for the flow\\n stream (bool): Whether to stream the response\\n api_key_user (UserRead): Authenticated user from API key\\n request (Request): The incoming HTTP request\\n\\nReturns:\\n Union[StreamingResponse, RunResponse]: Either a streaming response for real-time results\\n or a RunResponse with the complete execution results\\n\\nRaises:\\n HTTPException: For flow not found (404) or invalid input (400)\\n APIException: For internal execution errors (500)\\n\\nNotes:\\n - Supports both streaming and non-streaming execution modes\\n - Tracks execution time and success/failure via telemetry\\n - Handles graceful client disconnection in streaming mode\\n - Provides detailed error handling with appropriate HTTP status codes\\n - In streaming mode, uses EventManager to handle events:\\n - \\"add_message\\": New messages during execution\\n - \\"token\\": Individual tokens during streaming\\n - \\"end\\": Final execution result","operationId":"simplified_run_flow_api_v1_run__flow_id_or_name__post","security":[{"API key query":[]},{"API key header":[]}],"parameters":[{"name":"flow_id_or_name","in":"path","required":true,"schema":{"type":"string","title":"Flow Id Or Name"}},{"name":"stream","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Stream"}},{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"string","format":"uuid"},{"type":"null"}],"title":"User Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"properties":{"input_value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Input Value","description":"The input value"},"input_type":{"anyOf":[{"type":"string","enum":["chat","text","any"]},{"type":"null"}],"title":"Input Type","description":"The input type","default":"chat"},"output_type":{"anyOf":[{"type":"string","enum":["chat","text","any","debug"]},{"type":"null"}],"title":"Output Type","description":"The output type","default":"chat"},"output_component":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Output Component","description":"If there are multiple output components, you can specify the component to get the output from.","default":""},"tweaks":{"anyOf":[{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"object"}]},"type":"object","title":"Tweaks","description":"A dictionary of tweaks to adjust the flow\'s execution. Allows customizing flow behavior dynamically. All tweaks are overridden by the input values.","examples":[{"Component Name":{"parameter_name":"value"},"component_id":{"parameter_name":"value"},"parameter_name":"value"}]},{"type":"null"}],"description":"The tweaks"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id","description":"The session id"}},"type":"object","title":"SimplifiedAPIRequest"},{"type":"null"}],"title":"Input Request"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"properties":{"detail":{"items":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"}}}}},"method":"post","path":"/api/v1/run/{flow_id_or_name}","securitySchemes":{"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"api/v1/login"}}},"API key query":{"type":"apiKey","in":"query","name":"x-api-key"},"API key header":{"type":"apiKey","in":"header","name":"x-api-key"}},"info":{"title":"Langflow","version":"1.5.1"},"postman":{"name":"Simplified Run Flow","description":{"content":"Executes a specified flow by ID with support for streaming and telemetry.\\n\\nThis endpoint executes a flow identified by ID or name, with options for streaming the response\\nand tracking execution metrics. It handles both streaming and non-streaming execution modes.\\n\\nArgs:\\n background_tasks (BackgroundTasks): FastAPI background task manager\\n flow (FlowRead | None): The flow to execute, loaded via dependency\\n input_request (SimplifiedAPIRequest | None): Input parameters for the flow\\n stream (bool): Whether to stream the response\\n api_key_user (UserRead): Authenticated user from API key\\n request (Request): The incoming HTTP request\\n\\nReturns:\\n Union[StreamingResponse, RunResponse]: Either a streaming response for real-time results\\n or a RunResponse with the complete execution results\\n\\nRaises:\\n HTTPException: For flow not found (404) or invalid input (400)\\n APIException: For internal execution errors (500)\\n\\nNotes:\\n - Supports both streaming and non-streaming execution modes\\n - Tracks execution time and success/failure via telemetry\\n - Handles graceful client disconnection in streaming mode\\n - Provides detailed error handling with appropriate HTTP status codes\\n - In streaming mode, uses EventManager to handle events:\\n - \\"add_message\\": New messages during execution\\n - \\"token\\": Individual tokens during streaming\\n - \\"end\\": Final execution result","type":"text/plain"},"url":{"path":["api","v1","run",":flow_id_or_name"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"key":"stream","value":"false"},{"disabled":false,"key":"user_id","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) ","type":"text/plain"},"type":"any","value":"","key":"flow_id_or_name"}]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"{\\n \\"input_value\\": \\"\\",\\n \\"input_type\\": \\"\\",\\n \\"output_type\\": \\"\\",\\n \\"output_component\\": \\"\\",\\n \\"tweaks\\": {\\n \\"commodo_1\\": \\"\\"\\n },\\n \\"session_id\\": \\"\\"\\n}","options":{"raw":{"language":"json"}}},"auth":{"type":"apikey","apikey":[{"type":"any","value":"x-api-key","key":"key"},{"type":"any","value":"{{apiKey}}","key":"value"},{"type":"any","value":"query","key":"in"}]}}},"source":"@site/openapi.json","sourceDirName":".","permalink":"/api/simplified-run-flow","previous":{"title":"Get All","permalink":"/api/get-all"},"next":{"title":"Webhook Run Flow","permalink":"/api/webhook-run-flow"}}');var s=t(74848),r=t(28453);const a={},o="Simplified Run Flow",l=[];function d(e){const n={h1:"h1",header:"header",li:"li",p:"p",ul:"ul",...(0,r.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.header,{children:(0,s.jsx)(n.h1,{id:"simplified-run-flow",children:"Simplified Run Flow"})}),"\n",(0,s.jsx)(n.p,{children:"Executes a specified flow by ID with support for streaming and telemetry."}),"\n",(0,s.jsx)(n.p,{children:"This endpoint executes a flow identified by ID or name, with options for streaming the response\nand tracking execution metrics. It handles both streaming and non-streaming execution modes."}),"\n",(0,s.jsx)(n.p,{children:"Args:\nbackground_tasks (BackgroundTasks): FastAPI background task manager\nflow (FlowRead | None): The flow to execute, loaded via dependency\ninput_request (SimplifiedAPIRequest | None): Input parameters for the flow\nstream (bool): Whether to stream the response\napi_key_user (UserRead): Authenticated user from API key\nrequest (Request): The incoming HTTP request"}),"\n",(0,s.jsx)(n.p,{children:"Returns:\nUnion[StreamingResponse, RunResponse]: Either a streaming response for real-time results\nor a RunResponse with the complete execution results"}),"\n",(0,s.jsx)(n.p,{children:"Raises:\nHTTPException: For flow not found (404) or invalid input (400)\nAPIException: For internal execution errors (500)"}),"\n",(0,s.jsx)(n.p,{children:"Notes:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Supports both streaming and non-streaming execution modes"}),"\n",(0,s.jsx)(n.li,{children:"Tracks execution time and success/failure via telemetry"}),"\n",(0,s.jsx)(n.li,{children:"Handles graceful client disconnection in streaming mode"}),"\n",(0,s.jsx)(n.li,{children:"Provides detailed error handling with appropriate HTTP status codes"}),"\n",(0,s.jsxs)(n.li,{children:["In streaming mode, uses EventManager to handle events:","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:'"add_message": New messages during execution'}),"\n",(0,s.jsx)(n.li,{children:'"token": Individual tokens during streaming'}),"\n",(0,s.jsx)(n.li,{children:'"end": Final execution result'}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)("table",{style:{display:"table",width:"100%"},children:[(0,s.jsx)("thead",{children:(0,s.jsx)("tr",{children:(0,s.jsx)("th",{style:{textAlign:"left"},children:"Path Parameters"})})}),(0,s.jsx)("tbody",{children:(0,s.jsx)("tr",{children:(0,s.jsxs)("td",{children:[(0,s.jsx)("code",{children:"flow_id_or_name"}),(0,s.jsx)("span",{style:{opacity:"0.6"},children:" Flow Id Or Name"}),(0,s.jsx)("span",{style:{opacity:"0.6"},children:" \u2014 "}),(0,s.jsx)("strong",{style:{fontSize:"var(--ifm-code-font-size)",color:"var(--openapi-required)"},children:" REQUIRED"})]})})})]}),"\n",(0,s.jsxs)("table",{style:{display:"table",width:"100%"},children:[(0,s.jsx)("thead",{children:(0,s.jsx)("tr",{children:(0,s.jsx)("th",{style:{textAlign:"left"},children:"Query Parameters"})})}),(0,s.jsxs)("tbody",{children:[(0,s.jsx)("tr",{children:(0,s.jsxs)("td",{children:[(0,s.jsx)("code",{children:"stream"}),(0,s.jsx)("span",{style:{opacity:"0.6"},children:" Stream"})]})}),(0,s.jsx)("tr",{children:(0,s.jsxs)("td",{children:[(0,s.jsx)("code",{children:"user_id"}),(0,s.jsx)("span",{style:{opacity:"0.6"},children:" User Id"})]})})]})]}),"\n",(0,s.jsxs)("table",{style:{display:"table",width:"100%"},children:[(0,s.jsx)("thead",{children:(0,s.jsx)("tr",{children:(0,s.jsxs)("th",{style:{textAlign:"left"},children:[(0,s.jsx)("span",{children:"Request Body "}),(0,s.jsx)("div",{})]})})}),(0,s.jsx)("tbody",{children:(0,s.jsx)("tr",{children:(0,s.jsx)("td",{children:(0,s.jsx)("span",{style:{opacity:"0.6"},children:" undefined"})})})})]}),"\n",(0,s.jsxs)("table",{style:{display:"table",width:"100%"},children:[(0,s.jsx)("thead",{children:(0,s.jsx)("tr",{children:(0,s.jsx)("th",{style:{textAlign:"left"},children:"Responses"})})}),(0,s.jsxs)("tbody",{children:[(0,s.jsx)("tr",{children:(0,s.jsxs)("td",{children:[(0,s.jsxs)("div",{style:{display:"flex"},children:[(0,s.jsx)("div",{style:{marginRight:"var(--ifm-table-cell-padding)"},children:(0,s.jsx)("code",{children:"200"})}),(0,s.jsx)("div",{children:(0,s.jsx)(n.p,{children:"Successful Response"})})]}),(0,s.jsx)("div",{children:(0,s.jsxs)("table",{style:{display:"table",width:"100%",marginTop:"var(--ifm-table-cell-padding)",marginBottom:"0px"},children:[(0,s.jsx)("thead",{children:(0,s.jsx)("tr",{children:(0,s.jsxs)("th",{style:{textAlign:"left"},children:[(0,s.jsx)("span",{children:"Schema "}),(0,s.jsx)("span",{style:{opacity:"0.6"},children:" \u2014 "}),(0,s.jsx)("strong",{style:{fontSize:"var(--ifm-code-font-size)",color:"var(--openapi-optional)"},children:" OPTIONAL"}),(0,s.jsx)("div",{})]})})}),(0,s.jsx)("tbody",{children:(0,s.jsx)("tr",{children:(0,s.jsx)("td",{children:(0,s.jsx)("span",{style:{opacity:"0.6"},children:" undefined"})})})})]})})]})}),(0,s.jsx)("tr",{children:(0,s.jsxs)("td",{children:[(0,s.jsxs)("div",{style:{display:"flex"},children:[(0,s.jsx)("div",{style:{marginRight:"var(--ifm-table-cell-padding)"},children:(0,s.jsx)("code",{children:"422"})}),(0,s.jsx)("div",{children:(0,s.jsx)(n.p,{children:"Validation Error"})})]}),(0,s.jsx)("div",{children:(0,s.jsxs)("table",{style:{display:"table",width:"100%",marginTop:"var(--ifm-table-cell-padding)",marginBottom:"0px"},children:[(0,s.jsx)("thead",{children:(0,s.jsx)("tr",{children:(0,s.jsxs)("th",{style:{textAlign:"left"},children:[(0,s.jsx)("span",{children:"Schema "}),(0,s.jsx)("span",{style:{opacity:"0.6"},children:" \u2014 "}),(0,s.jsx)("strong",{style:{fontSize:"var(--ifm-code-font-size)",color:"var(--openapi-optional)"},children:" OPTIONAL"}),(0,s.jsx)("div",{})]})})}),(0,s.jsx)("tbody",{children:(0,s.jsx)("tr",{children:(0,s.jsxs)("td",{children:[(0,s.jsx)("code",{children:"detail"}),(0,s.jsx)("span",{style:{opacity:"0.6"},children:" object[]"}),(0,s.jsx)("span",{style:{opacity:"0.6"},children:" \u2014 "}),(0,s.jsx)("strong",{style:{fontSize:"var(--ifm-code-font-size)",color:"var(--openapi-optional)"},children:" OPTIONAL"}),(0,s.jsx)("table",{style:{display:"table",width:"100%",marginTop:"var(--ifm-table-cell-padding)",marginBottom:"0px"},children:(0,s.jsxs)("tbody",{children:[(0,s.jsx)("tr",{children:(0,s.jsxs)("td",{children:[(0,s.jsx)("code",{children:"loc"}),(0,s.jsx)("span",{style:{opacity:"0.6"},children:" undefined[]"})]})}),(0,s.jsx)("tr",{children:(0,s.jsxs)("td",{children:[(0,s.jsx)("code",{children:"msg"}),(0,s.jsx)("span",{style:{opacity:"0.6"},children:" Message"})]})}),(0,s.jsx)("tr",{children:(0,s.jsxs)("td",{children:[(0,s.jsx)("code",{children:"type"}),(0,s.jsx)("span",{style:{opacity:"0.6"},children:" Error Type"})]})})]})})]})})})]})})]})})]})]})]})}function c(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}}}]); \ No newline at end of file diff --git a/assets/js/2ea623f2.44ba2c5c.js b/assets/js/2ea623f2.44ba2c5c.js deleted file mode 100644 index 2cfaecd73f..0000000000 --- a/assets/js/2ea623f2.44ba2c5c.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[7356],{17886:(e,t,n)=>{n.d(t,{A:()=>d});n(96540);var r=n(64058),s=n(74848);function d({name:e,...t}){const n=r[e];return n?(0,s.jsx)(n,{...t}):null}},31929:(e,t,n)=>{n.d(t,{Ay:()=>a,RM:()=>i});var r=n(74848),s=n(28453),d=n(17886);const i=[];function o(e){const t={a:"a",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,r.jsxs)(t.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,r.jsx)(d.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Controls"})," in the ",(0,r.jsx)(t.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function a(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(o,{...e})}):o(e)}},93792:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>c,default:()=>x,frontMatter:()=>a,metadata:()=>r,toc:()=>h});const r=JSON.parse('{"id":"Components/bundles-amazon","title":"Amazon","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/bundles-amazon.mdx","sourceDirName":"Components","slug":"/bundles-amazon","permalink":"/bundles-amazon","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Amazon","slug":"/bundles-amazon"},"sidebar":"docs","previous":{"title":"AI/ML API","permalink":"/bundles-aiml"},"next":{"title":"Anthropic","permalink":"/bundles-anthropic"}}');var s=n(74848),d=n(28453),i=n(17886),o=n(31929);const a={title:"Amazon",slug:"/bundles-amazon"},c=void 0,l={},h=[{value:"Amazon Bedrock",id:"amazon-bedrock",level:2},{value:"Amazon Bedrock parameters",id:"amazon-bedrock-parameters",level:3},...o.RM,{value:"Amazon Bedrock Embeddings",id:"amazon-bedrock-embeddings",level:2},{value:"Amazon Bedrock Embeddings parameters",id:"amazon-bedrock-embeddings-parameters",level:3},...o.RM,{value:"S3 Bucket Uploader",id:"s3-bucket-uploader",level:2},{value:"S3 Bucket Uploader parameters",id:"s3-bucket-uploader-parameters",level:3},...o.RM];function p(e){const t={a:"a",code:"code",h2:"h2",h3:"h3",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,d.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(t.p,{children:[(0,s.jsx)(i.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(t.a,{href:"/components-bundle-components",children:(0,s.jsx)(t.strong,{children:"Bundles"})})," contain custom components that support specific third-party integrations with Langflow."]}),"\n",(0,s.jsxs)(t.p,{children:["This page describes the components that are available in the ",(0,s.jsx)(t.strong,{children:"Amazon"})," bundle."]}),"\n",(0,s.jsx)(t.h2,{id:"amazon-bedrock",children:"Amazon Bedrock"}),"\n",(0,s.jsxs)(t.p,{children:["This component generates text using ",(0,s.jsx)(t.a,{href:"https://docs.aws.amazon.com/bedrock",children:"Amazon Bedrock LLMs"}),"."]}),"\n",(0,s.jsxs)(t.p,{children:["It can output either a ",(0,s.jsx)(t.strong,{children:"Model Response"})," (",(0,s.jsx)(t.a,{href:"/data-types#message",children:(0,s.jsx)(t.code,{children:"Message"})}),") or a ",(0,s.jsx)(t.strong,{children:"Language Model"})," (",(0,s.jsx)(t.a,{href:"/data-types#languagemodel",children:(0,s.jsx)(t.code,{children:"LanguageModel"})}),").\nSpecifically, the ",(0,s.jsx)(t.strong,{children:"Language Model"})," output is an instance of ",(0,s.jsx)(t.a,{href:"https://python.langchain.com/docs/integrations/chat/bedrock/",children:(0,s.jsx)(t.code,{children:"ChatBedrock"})})," configured according to the component's parameters."]}),"\n",(0,s.jsxs)(t.p,{children:["Use the ",(0,s.jsx)(t.strong,{children:"Language Model"})," output when you want to use an Amazon Bedrock model as the LLM for another LLM-driven component, such as an ",(0,s.jsx)(t.strong,{children:"Agent"})," or ",(0,s.jsx)(t.strong,{children:"Smart Function"})," component."]}),"\n",(0,s.jsxs)(t.p,{children:["For more information, see ",(0,s.jsx)(t.a,{href:"/components-models",children:"Language model components"}),"."]}),"\n",(0,s.jsx)(t.h3,{id:"amazon-bedrock-parameters",children:"Amazon Bedrock parameters"}),"\n",(0,s.jsx)(o.Ay,{}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Name"}),(0,s.jsx)(t.th,{children:"Type"}),(0,s.jsx)(t.th,{children:"Description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"input"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. The input string for text generation."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"system_message"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. A system message to pass to the model."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"stream"}),(0,s.jsx)(t.td,{children:"Boolean"}),(0,s.jsx)(t.td,{children:"Input parameter. Whether to stream the response. Only works in chat. Default: false."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"model_id"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. The Amazon Bedrock model to use."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"aws_access_key_id"}),(0,s.jsx)(t.td,{children:"SecretString"}),(0,s.jsx)(t.td,{children:"Input parameter. AWS Access Key for authentication."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"aws_secret_access_key"}),(0,s.jsx)(t.td,{children:"SecretString"}),(0,s.jsx)(t.td,{children:"Input parameter. AWS Secret Key for authentication."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"aws_session_token"}),(0,s.jsx)(t.td,{children:"SecretString"}),(0,s.jsx)(t.td,{children:"Input parameter. The session key for your AWS account."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"credentials_profile_name"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. Name of the AWS credentials profile to use."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"region_name"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsxs)(t.td,{children:["Input parameter. AWS region where your Bedrock resources are located. Default: ",(0,s.jsx)(t.code,{children:"us-east-1"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"model_kwargs"}),(0,s.jsx)(t.td,{children:"Dictionary"}),(0,s.jsx)(t.td,{children:"Input parameter. Additional keyword arguments to pass to the model."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"endpoint_url"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. Custom endpoint URL for a Bedrock service."})]})]})]}),"\n",(0,s.jsx)(t.h2,{id:"amazon-bedrock-embeddings",children:"Amazon Bedrock Embeddings"}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.strong,{children:"Amazon Bedrock Embeddings"})," component is used to load embedding models from ",(0,s.jsx)(t.a,{href:"https://aws.amazon.com/bedrock/",children:"Amazon Bedrock"}),"."]}),"\n",(0,s.jsxs)(t.p,{children:["For more information about using embedding model components in flows, see ",(0,s.jsx)(t.a,{href:"/components-embedding-models",children:"Embedding model components"}),"."]}),"\n",(0,s.jsx)(t.h3,{id:"amazon-bedrock-embeddings-parameters",children:"Amazon Bedrock Embeddings parameters"}),"\n",(0,s.jsx)(o.Ay,{}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Name"}),(0,s.jsx)(t.th,{children:"Type"}),(0,s.jsx)(t.th,{children:"Description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"model_id"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsxs)(t.td,{children:["Input parameter. The ID of the model to call, such as ",(0,s.jsx)(t.code,{children:"amazon.titan-embed-text-v1"}),". This is equivalent to the ",(0,s.jsx)(t.code,{children:"modelId"})," property in the ",(0,s.jsx)(t.code,{children:"list-foundation-models"})," API."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"aws_access_key_id"}),(0,s.jsx)(t.td,{children:"SecretString"}),(0,s.jsx)(t.td,{children:"Input parameter. AWS Access Key for authentication."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"aws_secret_access_key"}),(0,s.jsx)(t.td,{children:"SecretString"}),(0,s.jsx)(t.td,{children:"Input parameter. AWS Secret Key for authentication."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"aws_session_token"}),(0,s.jsx)(t.td,{children:"SecretString"}),(0,s.jsx)(t.td,{children:"Input parameter. The session key for your AWS account."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"credentials_profile_name"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsxs)(t.td,{children:["Input parameter. The name of the AWS credentials profile in ",(0,s.jsx)(t.code,{children:"~/.aws/credentials"})," or ",(0,s.jsx)(t.code,{children:"~/.aws/config"}),", which has access keys or role information."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"region_name"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsxs)(t.td,{children:["Input parameter. The AWS region to use, such as ",(0,s.jsx)(t.code,{children:"us-west-2"}),". Falls back to the ",(0,s.jsx)(t.code,{children:"AWS_DEFAULT_REGION"})," environment variable or region specified in ",(0,s.jsx)(t.code,{children:"~/.aws/config"})," if not provided."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"endpoint_url"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. The URL to set a specific service endpoint other than the default AWS endpoint."})]})]})]}),"\n",(0,s.jsx)(t.h2,{id:"s3-bucket-uploader",children:"S3 Bucket Uploader"}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.strong,{children:"S3 Bucket Uploader"})," component uploads files to an Amazon S3 bucket.\nIt is designed to process ",(0,s.jsx)(t.code,{children:"Data"})," input from a ",(0,s.jsx)(t.strong,{children:"File"})," or ",(0,s.jsx)(t.strong,{children:"Directory"})," component.\nIf you upload ",(0,s.jsx)(t.code,{children:"Data"})," from other components, test the results before running the flow in production."]}),"\n",(0,s.jsxs)(t.p,{children:["Requires the ",(0,s.jsx)(t.code,{children:"boto3"})," package, which is included in your Langflow installation."]}),"\n",(0,s.jsx)(t.p,{children:"The component produces logs but it doesn't emit output to the flow."}),"\n",(0,s.jsx)(t.h3,{id:"s3-bucket-uploader-parameters",children:"S3 Bucket Uploader parameters"}),"\n",(0,s.jsx)(o.Ay,{}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Name"}),(0,s.jsx)(t.th,{children:"Type"}),(0,s.jsx)(t.th,{children:"Description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.strong,{children:"AWS Access Key ID"})}),(0,s.jsx)(t.td,{children:"SecretString"}),(0,s.jsx)(t.td,{children:"Input parameter. AWS Access Key ID for authentication."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.strong,{children:"AWS Secret Key"})}),(0,s.jsx)(t.td,{children:"SecretString"}),(0,s.jsx)(t.td,{children:"Input parameter. AWS Secret Key for authentication."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.strong,{children:"Bucket Name"})}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. The name of the S3 bucket to upload files to."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.strong,{children:"Strategy for file upload"})}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsxs)(t.td,{children:["Input parameter. The file upload strategy. ",(0,s.jsx)(t.strong,{children:"Store Data"})," (default) iterates over ",(0,s.jsx)(t.code,{children:"Data"})," inputs, logs the file path and text content, and uploads each file to the specified S3 bucket if both file path and text content are available. ",(0,s.jsx)(t.strong,{children:"Store Original File"})," iterates through the list of data inputs, retrieves the file path from each data item, uploads the file to the specified S3 bucket if the file path is available, and logs the file path being uploaded."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.strong,{children:"Data Inputs"})}),(0,s.jsx)(t.td,{children:"Data"}),(0,s.jsxs)(t.td,{children:["Input parameter. The ",(0,s.jsx)(t.code,{children:"Data"})," input to iterate over and upload as files in the specified S3 bucket."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.strong,{children:"S3 Prefix"})}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. Optional prefix (folder path) within the S3 bucket where files will be uploaded."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.strong,{children:"Strip Path"})}),(0,s.jsx)(t.td,{children:"Boolean"}),(0,s.jsx)(t.td,{children:"Input parameter. Whether to strip the file path when uploading. Default: false."})]})]})]})]})}function x(e={}){const{wrapper:t}={...(0,d.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(p,{...e})}):p(e)}}}]); \ No newline at end of file diff --git a/assets/js/2ea623f2.7a2d7aa3.js b/assets/js/2ea623f2.7a2d7aa3.js new file mode 100644 index 0000000000..971cf9d5d2 --- /dev/null +++ b/assets/js/2ea623f2.7a2d7aa3.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[7356],{17886:(e,n,t)=>{t.d(n,{A:()=>d});t(96540);var r=t(64058),s=t(74848);function d({name:e,...n}){const t=r[e];return t?(0,s.jsx)(t,{...n}):null}},31929:(e,n,t)=>{t.d(n,{Ay:()=>a,RM:()=>i});var r=t(74848),s=t(28453),d=t(17886);const i=[];function o(e){const n={a:"a",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,r.jsxs)(n.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,r.jsx)(d.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Controls"})," in the ",(0,r.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function a(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(o,{...e})}):o(e)}},93792:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>c,default:()=>x,frontMatter:()=>a,metadata:()=>r,toc:()=>h});const r=JSON.parse('{"id":"Components/bundles-amazon","title":"Amazon","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/bundles-amazon.mdx","sourceDirName":"Components","slug":"/bundles-amazon","permalink":"/bundles-amazon","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Amazon","slug":"/bundles-amazon"},"sidebar":"docs","previous":{"title":"AI/ML API","permalink":"/bundles-aiml"},"next":{"title":"Anthropic","permalink":"/bundles-anthropic"}}');var s=t(74848),d=t(28453),i=t(17886),o=t(31929);const a={title:"Amazon",slug:"/bundles-amazon"},c=void 0,l={},h=[{value:"Amazon Bedrock",id:"amazon-bedrock",level:2},{value:"Amazon Bedrock parameters",id:"amazon-bedrock-parameters",level:3},...o.RM,{value:"Amazon Bedrock Embeddings",id:"amazon-bedrock-embeddings",level:2},{value:"Amazon Bedrock Embeddings parameters",id:"amazon-bedrock-embeddings-parameters",level:3},...o.RM,{value:"S3 Bucket Uploader",id:"s3-bucket-uploader",level:2},{value:"S3 Bucket Uploader parameters",id:"s3-bucket-uploader-parameters",level:3},...o.RM];function p(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,d.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:[(0,s.jsx)(i.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(n.a,{href:"/components-bundle-components",children:(0,s.jsx)(n.strong,{children:"Bundles"})})," contain custom components that support specific third-party integrations with Langflow."]}),"\n",(0,s.jsxs)(n.p,{children:["This page describes the components that are available in the ",(0,s.jsx)(n.strong,{children:"Amazon"})," bundle."]}),"\n",(0,s.jsx)(n.h2,{id:"amazon-bedrock",children:"Amazon Bedrock"}),"\n",(0,s.jsxs)(n.p,{children:["This component generates text using ",(0,s.jsx)(n.a,{href:"https://docs.aws.amazon.com/bedrock",children:"Amazon Bedrock LLMs"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["It can output either a ",(0,s.jsx)(n.strong,{children:"Model Response"})," (",(0,s.jsx)(n.a,{href:"/data-types#message",children:(0,s.jsx)(n.code,{children:"Message"})}),") or a ",(0,s.jsx)(n.strong,{children:"Language Model"})," (",(0,s.jsx)(n.a,{href:"/data-types#languagemodel",children:(0,s.jsx)(n.code,{children:"LanguageModel"})}),").\nSpecifically, the ",(0,s.jsx)(n.strong,{children:"Language Model"})," output is an instance of ",(0,s.jsx)(n.a,{href:"https://python.langchain.com/docs/integrations/chat/bedrock/",children:(0,s.jsx)(n.code,{children:"ChatBedrock"})})," configured according to the component's parameters."]}),"\n",(0,s.jsxs)(n.p,{children:["Use the ",(0,s.jsx)(n.strong,{children:"Language Model"})," output when you want to use an Amazon Bedrock model as the LLM for another LLM-driven component, such as an ",(0,s.jsx)(n.strong,{children:"Agent"})," or ",(0,s.jsx)(n.strong,{children:"Smart Function"})," component."]}),"\n",(0,s.jsxs)(n.p,{children:["For more information, see ",(0,s.jsx)(n.a,{href:"/components-models",children:"Language model components"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"amazon-bedrock-parameters",children:"Amazon Bedrock parameters"}),"\n",(0,s.jsx)(o.Ay,{}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"input"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. The input string for text generation."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"system_message"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. A system message to pass to the model."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"stream"}),(0,s.jsx)(n.td,{children:"Boolean"}),(0,s.jsxs)(n.td,{children:["Input parameter. Whether to stream the response. Only works in chat. Default: ",(0,s.jsx)(n.code,{children:"false"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"model_id"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. The Amazon Bedrock model to use."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"aws_access_key_id"}),(0,s.jsx)(n.td,{children:"SecretString"}),(0,s.jsx)(n.td,{children:"Input parameter. AWS Access Key for authentication."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"aws_secret_access_key"}),(0,s.jsx)(n.td,{children:"SecretString"}),(0,s.jsx)(n.td,{children:"Input parameter. AWS Secret Key for authentication."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"aws_session_token"}),(0,s.jsx)(n.td,{children:"SecretString"}),(0,s.jsx)(n.td,{children:"Input parameter. The session key for your AWS account."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"credentials_profile_name"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. Name of the AWS credentials profile to use."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"region_name"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsxs)(n.td,{children:["Input parameter. AWS region where your Bedrock resources are located. Default: ",(0,s.jsx)(n.code,{children:"us-east-1"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"model_kwargs"}),(0,s.jsx)(n.td,{children:"Dictionary"}),(0,s.jsx)(n.td,{children:"Input parameter. Additional keyword arguments to pass to the model."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"endpoint_url"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. Custom endpoint URL for a Bedrock service."})]})]})]}),"\n",(0,s.jsx)(n.h2,{id:"amazon-bedrock-embeddings",children:"Amazon Bedrock Embeddings"}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"Amazon Bedrock Embeddings"})," component is used to load embedding models from ",(0,s.jsx)(n.a,{href:"https://aws.amazon.com/bedrock/",children:"Amazon Bedrock"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["For more information about using embedding model components in flows, see ",(0,s.jsx)(n.a,{href:"/components-embedding-models",children:"Embedding model components"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"amazon-bedrock-embeddings-parameters",children:"Amazon Bedrock Embeddings parameters"}),"\n",(0,s.jsx)(o.Ay,{}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"model_id"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsxs)(n.td,{children:["Input parameter. The ID of the model to call, such as ",(0,s.jsx)(n.code,{children:"amazon.titan-embed-text-v1"}),". This is equivalent to the ",(0,s.jsx)(n.code,{children:"modelId"})," property in the ",(0,s.jsx)(n.code,{children:"list-foundation-models"})," API."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"aws_access_key_id"}),(0,s.jsx)(n.td,{children:"SecretString"}),(0,s.jsx)(n.td,{children:"Input parameter. AWS Access Key for authentication."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"aws_secret_access_key"}),(0,s.jsx)(n.td,{children:"SecretString"}),(0,s.jsx)(n.td,{children:"Input parameter. AWS Secret Key for authentication."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"aws_session_token"}),(0,s.jsx)(n.td,{children:"SecretString"}),(0,s.jsx)(n.td,{children:"Input parameter. The session key for your AWS account."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"credentials_profile_name"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsxs)(n.td,{children:["Input parameter. The name of the AWS credentials profile in ",(0,s.jsx)(n.code,{children:"~/.aws/credentials"})," or ",(0,s.jsx)(n.code,{children:"~/.aws/config"}),", which has access keys or role information."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"region_name"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsxs)(n.td,{children:["Input parameter. The AWS region to use, such as ",(0,s.jsx)(n.code,{children:"us-west-2"}),". Falls back to the ",(0,s.jsx)(n.code,{children:"AWS_DEFAULT_REGION"})," environment variable or region specified in ",(0,s.jsx)(n.code,{children:"~/.aws/config"})," if not provided."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"endpoint_url"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. The URL to set a specific service endpoint other than the default AWS endpoint."})]})]})]}),"\n",(0,s.jsx)(n.h2,{id:"s3-bucket-uploader",children:"S3 Bucket Uploader"}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"S3 Bucket Uploader"})," component uploads files to an Amazon S3 bucket.\nIt is designed to process ",(0,s.jsx)(n.code,{children:"Data"})," input from a ",(0,s.jsx)(n.strong,{children:"File"})," or ",(0,s.jsx)(n.strong,{children:"Directory"})," component.\nIf you upload ",(0,s.jsx)(n.code,{children:"Data"})," from other components, test the results before running the flow in production."]}),"\n",(0,s.jsxs)(n.p,{children:["Requires the ",(0,s.jsx)(n.code,{children:"boto3"})," package, which is included in your Langflow installation."]}),"\n",(0,s.jsx)(n.p,{children:"The component produces logs but it doesn't emit output to the flow."}),"\n",(0,s.jsx)(n.h3,{id:"s3-bucket-uploader-parameters",children:"S3 Bucket Uploader parameters"}),"\n",(0,s.jsx)(o.Ay,{}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.strong,{children:"AWS Access Key ID"})}),(0,s.jsx)(n.td,{children:"SecretString"}),(0,s.jsx)(n.td,{children:"Input parameter. AWS Access Key ID for authentication."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.strong,{children:"AWS Secret Key"})}),(0,s.jsx)(n.td,{children:"SecretString"}),(0,s.jsx)(n.td,{children:"Input parameter. AWS Secret Key for authentication."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.strong,{children:"Bucket Name"})}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. The name of the S3 bucket to upload files to."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.strong,{children:"Strategy for file upload"})}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsxs)(n.td,{children:["Input parameter. The file upload strategy. ",(0,s.jsx)(n.strong,{children:"Store Data"})," (default) iterates over ",(0,s.jsx)(n.code,{children:"Data"})," inputs, logs the file path and text content, and uploads each file to the specified S3 bucket if both file path and text content are available. ",(0,s.jsx)(n.strong,{children:"Store Original File"})," iterates through the list of data inputs, retrieves the file path from each data item, uploads the file to the specified S3 bucket if the file path is available, and logs the file path being uploaded."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.strong,{children:"Data Inputs"})}),(0,s.jsx)(n.td,{children:"Data"}),(0,s.jsxs)(n.td,{children:["Input parameter. The ",(0,s.jsx)(n.code,{children:"Data"})," input to iterate over and upload as files in the specified S3 bucket."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.strong,{children:"S3 Prefix"})}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. Optional prefix (folder path) within the S3 bucket where files will be uploaded."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.strong,{children:"Strip Path"})}),(0,s.jsx)(n.td,{children:"Boolean"}),(0,s.jsxs)(n.td,{children:["Input parameter. Whether to strip the file path when uploading. Default: ",(0,s.jsx)(n.code,{children:"false"}),"."]})]})]})]})]})}function x(e={}){const{wrapper:n}={...(0,d.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(p,{...e})}):p(e)}}}]); \ No newline at end of file diff --git a/assets/js/2fed9fb3.84d034bd.js b/assets/js/2fed9fb3.84298e7b.js similarity index 76% rename from assets/js/2fed9fb3.84d034bd.js rename to assets/js/2fed9fb3.84298e7b.js index 0704e5c17f..b1aa1c863a 100644 --- a/assets/js/2fed9fb3.84d034bd.js +++ b/assets/js/2fed9fb3.84298e7b.js @@ -1 +1 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[6108],{9080:(e,n,t)=>{t.r(n),t.d(n,{CH:()=>d,assets:()=>c,chCodeConfig:()=>p,contentTitle:()=>l,default:()=>g,frontMatter:()=>a,metadata:()=>o,toc:()=>u});const o=JSON.parse('{"id":"Deployment/deployment-prod-best-practices","title":"Best practices for Langflow on Kubernetes","description":"This guide provides best practices for deploying Langflow in production environments on Kubernetes.","source":"@site/docs/Deployment/deployment-prod-best-practices.mdx","sourceDirName":"Deployment","slug":"/deployment-prod-best-practices","permalink":"/deployment-prod-best-practices","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Best practices for Langflow on Kubernetes","slug":"/deployment-prod-best-practices"},"sidebar":"docs","previous":{"title":"Deployment architecture","permalink":"/deployment-architecture"},"next":{"title":"Deploy in development","permalink":"/deployment-kubernetes-dev"}}');var s=t(74848),r=t(28453),i=t(24754);const a={title:"Best practices for Langflow on Kubernetes",slug:"/deployment-prod-best-practices"},l=void 0,c={},d={annotations:i.hk,Code:i.Cy},p={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},u=[{value:"Resources and scaling",id:"resources-and-scaling",level:2},{value:"Estimate, test, and adjust",id:"estimate-test-and-adjust",level:3},{value:"Use an external PostgreSQL database",id:"use-an-external-postgresql-database",level:3},{value:"Use HPA for dynamic scaling",id:"use-hpa-for-dynamic-scaling",level:3},{value:"Failure points",id:"failure-points",level:2},{value:"Monitoring",id:"monitoring",level:2},{value:"Security",id:"security",level:2},{value:"See also",id:"see-also",level:2}];function h(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",li:"li",p:"p",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return d||m("CH",!1),d.Code||m("CH.Code",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n",(0,s.jsx)(n.p,{children:"This guide provides best practices for deploying Langflow in production environments on Kubernetes."}),"\n",(0,s.jsx)(n.h2,{id:"resources-and-scaling",children:"Resources and scaling"}),"\n",(0,s.jsx)(n.p,{children:"Langflow's minimum resource requirements vary by deployment type:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"IDE (development)"}),": Deploy both the Langflow visual editor (frontend) and API (backend). Typically, this is used for development environments where developers use the visual editor to create and manage flows before packaging and serving them through a production runtime deployment."]}),"\n",(0,s.jsx)(n.p,{children:"The frontend service requires a minimum of 512Mi RAM and 0.3 CPU per instance with 1 replica."}),"\n",(0,s.jsx)(n.p,{children:"The backend service requires a minimum of 1Gi RAM and 0.5 CPU per instance with 1 replica."}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Runtime (production)"}),": Deploy the Langflow runtime for production flows, which is headless (backend only) service focused on serving the Langflow API. This is used for production environments where flows are executed programmatically without the need for the visual editor."]}),"\n",(0,s.jsx)(n.p,{children:"Minimum requirements include 2Gi RAM and 1000m (1 CPU) per instance with 3 replicas."}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["For more information about Langflow deployment types, see ",(0,s.jsx)(n.a,{href:"/deployment-architecture",children:"Langflow architecture on Kubernetes"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"estimate-test-and-adjust",children:"Estimate, test, and adjust"}),"\n",(0,s.jsx)(n.p,{children:"Start with the minimum recommended resources and replicas, then monitor and scale as needed based on your deployment's requirements and performance testing.\nConsider the following factors in your resource estimation and performance testing:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Flow complexity."}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Volume of concurrent users and requests."}),"\n",(0,s.jsx)(n.p,{children:"For IDE (development) deployments, consider that frontend activity also pings the backend service, so you typically need to scale both the frontend and backend together."}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Request payload content and size, particularly for file uploads in production deployments."}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Storage requirements for cache, file management, and the Langflow database."}),"\n",(0,s.jsxs)(n.p,{children:["An ",(0,s.jsx)(n.a,{href:"#use-an-external-postgresql-database",children:"external PostgreSQL database"})," is recommended for production deployments."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Infrastructure options that might require more resources, such as multi-core CPUs."}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"use-an-external-postgresql-database",children:"Use an external PostgreSQL database"}),"\n",(0,s.jsx)(n.p,{children:"An external PostgreSQL database is recommended for production deployments to improve scalability and reliability as compared to the default SQLite database."}),"\n",(0,s.jsxs)(n.p,{children:["Your resource allocation and replication strategy must be able to support the PostgreSQL service and storage.\nFor example, for a runtime (production) deployment, you might allocate 4Gi RAM, 2 CPU, and multiple replicas for high availability.\nTune PostgreSQL parameters, such as ",(0,s.jsx)(n.code,{children:"work_mem"})," and ",(0,s.jsx)(n.code,{children:"shared_buffers"}),", as needed based on resource requirements and usage metrics."]}),"\n",(0,s.jsx)(n.p,{children:"Recommended configurations include:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Persistent storage to prevent data loss on container shutdown"}),"\n",(0,s.jsx)(n.li,{children:"High Availability (HA) or Active-Active for automatic failover, scaling, and load balancing"}),"\n",(0,s.jsx)(n.li,{children:"Shared databases for multi-instance deployments"}),"\n",(0,s.jsxs)(n.li,{children:["Shared storage, such as NFS or cloud storage, for multi-instance deployments to access large files stored on disk, such as in ",(0,s.jsx)(n.code,{children:"/opt/langflow/data/"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["For more information, see ",(0,s.jsx)(n.a,{href:"/configuration-custom-database",children:"Configure an external PostgreSQL database"})," and ",(0,s.jsx)(n.a,{href:"/enterprise-database-guide",children:"Langflow database guide for enterprise DBAs"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"use-hpa-for-dynamic-scaling",children:"Use HPA for dynamic scaling"}),"\n",(0,s.jsx)(n.p,{children:"Load balancing and dynamic scaling are recommended for runtime (production) deployments."}),"\n",(0,s.jsx)(n.p,{children:"For example, consider using Horizontal Pod Autoscaler (HPA) in Kubernetes to dynamically scale based on CPU or memory usage.\nThe following example shows a Langflow HPA configuration with CPU-based scaling:"}),"\n",(0,s.jsx)(d.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"apiVersion",props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"autoscaling/v2",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"kind",props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"HorizontalPodAutoscaler",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"metadata",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"langflow-runtime-hpa",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"spec",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" scaleTargetRef",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" apiVersion",props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"apps/v1",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" kind",props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"Deployment",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" name",props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"langflow-runtime",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" minReplicas",props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"1",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" maxReplicas",props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"10",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" metrics",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" - ",props:{style:{color:"#C9D1D9"}}},{content:"type",props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"Resource",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" resource",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"cpu",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" target",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" type",props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"Utilization",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" averageUtilization",props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"80",props:{style:{color:"#79C0FF"}}}]}],lang:"yaml"},annotations:[]}]}),"\n",(0,s.jsx)(n.h2,{id:"failure-points",children:"Failure points"}),"\n",(0,s.jsx)(n.p,{children:"Langflow's reliability in production depends on mitigating key failure points, particularly around the database, file system, and instance availability:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Database failures"}),": See ",(0,s.jsx)(n.a,{href:"/enterprise-database-guide",children:"Langflow database guide for enterprise DBAs"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"File system failures"}),": Concurrency issues in file caching, such as ",(0,s.jsx)(n.code,{children:"/app/data/.cache"}),", can cause IO errors in multi-instance setups.\nTo avoid this, use a shared, POSIX-compliant file system or cloud storage.\nUse persistent volumes instead of ramdisk solutions that result in data loss on container shutdown."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Instance failures"}),": Deploy multiple replicas to avoid service disruptions when a single instance fails. Use health checks to detect and replace failed pods."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Network and dependency failures"}),": External APIs or services used in flows may fail, causing flow errors. Implement retry logic and error handling in flows or application code. Monitor network latency and dependency health."]}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"monitoring",children:"Monitoring"}),"\n",(0,s.jsx)(n.p,{children:"Effective monitoring ensures Langflow operates reliably and performs well under varying loads:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Database monitoring"}),": See ",(0,s.jsx)(n.a,{href:"/enterprise-database-guide",children:"Langflow database guide for enterprise DBAs"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Application logs"}),": Collect and analyze logs for errors, warnings, and flow execution issues. Centralize logs using tools like ELK Stack or Fluentd. You can also inspect ",(0,s.jsx)(n.a,{href:"/logging",children:"Langflow logs"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Resource usage"}),": Track CPU, memory, and disk usage of Langflow instances. Use Prometheus and Grafana for real-time metrics collection and monitoring in Kubernetes."]}),"\n",(0,s.jsxs)(n.p,{children:["To expose your Langflow server's Prometheus metrics, set ",(0,s.jsx)(n.code,{children:"LANGFLOW_PROMETHEUS_ENABLED=True"})," (the default is false).\nThe default port for the Prometheus metrics is 9090.\nTo change the port, set ",(0,s.jsx)(n.code,{children:"LANGFLOW_PROMETHEUS_PORT"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"API performance"}),": Monitor response times, error rates, and request throughput. Set alerts for high latency or error spikes."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Observability tools"}),": Integrate with ",(0,s.jsx)(n.a,{href:"/integrations-langwatch",children:"LangWatch"})," or ",(0,s.jsx)(n.a,{href:"/integrations-opik",children:"Opik"})," for detailed flow tracing and metrics. Use these tools to debug flow performance and optimize execution."]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"security",children:"Security"}),"\n",(0,s.jsx)(n.p,{children:"Running Langflow in production requires robust security measures to protect the application, data, and users.\nFollow industry best practices and use secure Langflow configurations, such as the following:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Container security"}),": Apply security best practices for containerized applications. For example, set ",(0,s.jsx)(n.code,{children:"readOnlyRootFilesystem: true"})," in runtime (production) containers to prevent unauthorized modifications. Restrict access to files and codebases containing sensitive data and configuration files that shouldn't be exposed to unauthorized users."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Secrets management"}),": Store sensitive data like API keys and PostgreSQL credentials in Kubernetes secrets or external secrets managers like HashiCorp Vault."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Authentication, authorization, and access control"}),": Start your Langflow server with authentication enabled, as explained in ",(0,s.jsx)(n.a,{href:"/api-keys-and-authentication",children:"API keys and authentication"}),". Restrict network and resource access with firewalls, network policies, network security groups, or VPCs. For example, restrict PostgreSQL database access to Langflow instances."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Encryption and privacy"}),": Follow industry best practices and legal requirements for data privacy and encryption of data in transit and at rest, including GDPR requirements, HTTPS, TLS, and SSL. For example, configure PostgreSQL with valid SSL certificates and append ",(0,s.jsx)(n.code,{children:"?sslmode=require"})," or ",(0,s.jsx)(n.code,{children:"?sslmode=verify-full"})," to the connection string to enable SSL for database connections."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Security posture maintenance"}),": Conduct regular security audits, keep current with software updates, and monitor for suspicious activity using intrusion detection systems."]}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"see-also",children:"See also"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"/deployment-kubernetes-prod",children:"Deploy the Langflow production environment on Kubernetes"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"https://github.com/langflow-ai/langflow-helm-charts",children:"Langflow Helm Charts repository"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"/environment-variables",children:"Langflow environment variables"})}),"\n"]})]})}function g(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(h,{...e})}):h(e)}function m(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}},28453:(e,n,t)=>{t.d(n,{R:()=>i,x:()=>a});var o=t(96540);const s={},r=o.createContext(s);function i(e){const n=o.useContext(r);return o.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:i(e.components),o.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[6108],{9080:(e,n,t)=>{t.r(n),t.d(n,{CH:()=>d,assets:()=>c,chCodeConfig:()=>p,contentTitle:()=>l,default:()=>g,frontMatter:()=>a,metadata:()=>o,toc:()=>u});const o=JSON.parse('{"id":"Deployment/deployment-prod-best-practices","title":"Best practices for Langflow on Kubernetes","description":"This guide provides best practices for deploying Langflow in production environments on Kubernetes.","source":"@site/docs/Deployment/deployment-prod-best-practices.mdx","sourceDirName":"Deployment","slug":"/deployment-prod-best-practices","permalink":"/deployment-prod-best-practices","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Best practices for Langflow on Kubernetes","slug":"/deployment-prod-best-practices"},"sidebar":"docs","previous":{"title":"Deployment architecture","permalink":"/deployment-architecture"},"next":{"title":"Deploy in development","permalink":"/deployment-kubernetes-dev"}}');var s=t(74848),r=t(28453),i=t(24754);const a={title:"Best practices for Langflow on Kubernetes",slug:"/deployment-prod-best-practices"},l=void 0,c={},d={annotations:i.hk,Code:i.Cy},p={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},u=[{value:"Resources and scaling",id:"resources-and-scaling",level:2},{value:"Estimate, test, and adjust",id:"estimate-test-and-adjust",level:3},{value:"Use an external PostgreSQL database",id:"use-an-external-postgresql-database",level:3},{value:"Use HPA for dynamic scaling",id:"use-hpa-for-dynamic-scaling",level:3},{value:"Failure points",id:"failure-points",level:2},{value:"Monitoring",id:"monitoring",level:2},{value:"Security",id:"security",level:2},{value:"See also",id:"see-also",level:2}];function h(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",li:"li",p:"p",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return d||m("CH",!1),d.Code||m("CH.Code",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n",(0,s.jsx)(n.p,{children:"This guide provides best practices for deploying Langflow in production environments on Kubernetes."}),"\n",(0,s.jsx)(n.h2,{id:"resources-and-scaling",children:"Resources and scaling"}),"\n",(0,s.jsx)(n.p,{children:"Langflow's minimum resource requirements vary by deployment type:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"IDE (development)"}),": Deploy both the Langflow visual editor (frontend) and API (backend). Typically, this is used for development environments where developers use the visual editor to create and manage flows before packaging and serving them through a production runtime deployment."]}),"\n",(0,s.jsx)(n.p,{children:"The frontend service requires a minimum of 512Mi RAM and 0.3 CPU per instance with 1 replica."}),"\n",(0,s.jsx)(n.p,{children:"The backend service requires a minimum of 1Gi RAM and 0.5 CPU per instance with 1 replica."}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Runtime (production)"}),": Deploy the Langflow runtime for production flows, which is headless (backend only) service focused on serving the Langflow API. This is used for production environments where flows are executed programmatically without the need for the visual editor."]}),"\n",(0,s.jsx)(n.p,{children:"Minimum requirements include 2Gi RAM and 1000m (1 CPU) per instance with 3 replicas."}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["For more information about Langflow deployment types, see ",(0,s.jsx)(n.a,{href:"/deployment-architecture",children:"Langflow architecture on Kubernetes"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"estimate-test-and-adjust",children:"Estimate, test, and adjust"}),"\n",(0,s.jsx)(n.p,{children:"Start with the minimum recommended resources and replicas, then monitor and scale as needed based on your deployment's requirements and performance testing.\nConsider the following factors in your resource estimation and performance testing:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Flow complexity."}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Volume of concurrent users and requests."}),"\n",(0,s.jsx)(n.p,{children:"For IDE (development) deployments, consider that frontend activity also pings the backend service, so you typically need to scale both the frontend and backend together."}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Request payload content and size, particularly for file uploads in production deployments."}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Storage requirements for cache, file management, and the Langflow database."}),"\n",(0,s.jsxs)(n.p,{children:["An ",(0,s.jsx)(n.a,{href:"#use-an-external-postgresql-database",children:"external PostgreSQL database"})," is recommended for production deployments."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Infrastructure options that might require more resources, such as multi-core CPUs."}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"use-an-external-postgresql-database",children:"Use an external PostgreSQL database"}),"\n",(0,s.jsx)(n.p,{children:"An external PostgreSQL database is recommended for production deployments to improve scalability and reliability as compared to the default SQLite database."}),"\n",(0,s.jsxs)(n.p,{children:["Your resource allocation and replication strategy must be able to support the PostgreSQL service and storage.\nFor example, for a runtime (production) deployment, you might allocate 4Gi RAM, 2 CPU, and multiple replicas for high availability.\nTune PostgreSQL parameters, such as ",(0,s.jsx)(n.code,{children:"work_mem"})," and ",(0,s.jsx)(n.code,{children:"shared_buffers"}),", as needed based on resource requirements and usage metrics."]}),"\n",(0,s.jsx)(n.p,{children:"Recommended configurations include:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Persistent storage to prevent data loss on container shutdown"}),"\n",(0,s.jsx)(n.li,{children:"High Availability (HA) or Active-Active for automatic failover, scaling, and load balancing"}),"\n",(0,s.jsx)(n.li,{children:"Shared databases for multi-instance deployments"}),"\n",(0,s.jsxs)(n.li,{children:["Shared storage, such as NFS or cloud storage, for multi-instance deployments to access large files stored on disk, such as in ",(0,s.jsx)(n.code,{children:"/opt/langflow/data/"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["For more information, see ",(0,s.jsx)(n.a,{href:"/configuration-custom-database",children:"Configure an external PostgreSQL database"})," and ",(0,s.jsx)(n.a,{href:"/enterprise-database-guide",children:"Langflow database guide for enterprise DBAs"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"use-hpa-for-dynamic-scaling",children:"Use HPA for dynamic scaling"}),"\n",(0,s.jsx)(n.p,{children:"Load balancing and dynamic scaling are recommended for runtime (production) deployments."}),"\n",(0,s.jsx)(n.p,{children:"For example, consider using Horizontal Pod Autoscaler (HPA) in Kubernetes to dynamically scale based on CPU or memory usage.\nThe following example shows a Langflow HPA configuration with CPU-based scaling:"}),"\n",(0,s.jsx)(d.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"apiVersion",props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"autoscaling/v2",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"kind",props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"HorizontalPodAutoscaler",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"metadata",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"langflow-runtime-hpa",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"spec",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" scaleTargetRef",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" apiVersion",props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"apps/v1",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" kind",props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"Deployment",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" name",props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"langflow-runtime",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" minReplicas",props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"1",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" maxReplicas",props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"10",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" metrics",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" - ",props:{style:{color:"#C9D1D9"}}},{content:"type",props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"Resource",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" resource",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"cpu",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" target",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" type",props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"Utilization",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" averageUtilization",props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"80",props:{style:{color:"#79C0FF"}}}]}],lang:"yaml"},annotations:[]}]}),"\n",(0,s.jsx)(n.h2,{id:"failure-points",children:"Failure points"}),"\n",(0,s.jsx)(n.p,{children:"Langflow's reliability in production depends on mitigating key failure points, particularly around the database, file system, and instance availability:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Database failures"}),": See ",(0,s.jsx)(n.a,{href:"/enterprise-database-guide",children:"Langflow database guide for enterprise DBAs"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"File system failures"}),": Concurrency issues in file caching, such as ",(0,s.jsx)(n.code,{children:"/app/data/.cache"}),", can cause IO errors in multi-instance setups.\nTo avoid this, use a shared, POSIX-compliant file system or cloud storage.\nUse persistent volumes instead of ramdisk solutions that result in data loss on container shutdown."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Instance failures"}),": Deploy multiple replicas to avoid service disruptions when a single instance fails. Use health checks to detect and replace failed pods."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Network and dependency failures"}),": External APIs or services used in flows may fail, causing flow errors. Implement retry logic and error handling in flows or application code. Monitor network latency and dependency health."]}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"monitoring",children:"Monitoring"}),"\n",(0,s.jsx)(n.p,{children:"Effective monitoring ensures Langflow operates reliably and performs well under varying loads:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Database monitoring"}),": See ",(0,s.jsx)(n.a,{href:"/enterprise-database-guide",children:"Langflow database guide for enterprise DBAs"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Application logs"}),": Collect and analyze logs for errors, warnings, and flow execution issues. Centralize logs using tools like ELK Stack or Fluentd. You can also inspect ",(0,s.jsx)(n.a,{href:"/logging",children:"Langflow logs"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Resource usage"}),": Track CPU, memory, and disk usage of Langflow instances. Use Prometheus and Grafana for real-time metrics collection and monitoring in Kubernetes."]}),"\n",(0,s.jsxs)(n.p,{children:["To expose your Langflow server's Prometheus metrics, set ",(0,s.jsx)(n.code,{children:"LANGFLOW_PROMETHEUS_ENABLED=True"})," (the default is ",(0,s.jsx)(n.code,{children:"false"}),").\nThe default port for the Prometheus metrics is 9090.\nTo change the port, set ",(0,s.jsx)(n.code,{children:"LANGFLOW_PROMETHEUS_PORT"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"API performance"}),": Monitor response times, error rates, and request throughput. Set alerts for high latency or error spikes."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Observability tools"}),": Integrate with ",(0,s.jsx)(n.a,{href:"/integrations-langwatch",children:"LangWatch"})," or ",(0,s.jsx)(n.a,{href:"/integrations-opik",children:"Opik"})," for detailed flow tracing and metrics. Use these tools to debug flow performance and optimize execution."]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"security",children:"Security"}),"\n",(0,s.jsx)(n.p,{children:"Running Langflow in production requires robust security measures to protect the application, data, and users.\nFollow industry best practices and use secure Langflow configurations, such as the following:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Container security"}),": Apply security best practices for containerized applications. For example, set ",(0,s.jsx)(n.code,{children:"readOnlyRootFilesystem: true"})," in runtime (production) containers to prevent unauthorized modifications. Restrict access to files and codebases containing sensitive data and configuration files that shouldn't be exposed to unauthorized users."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Secrets management"}),": Store sensitive data like API keys and PostgreSQL credentials in Kubernetes secrets or external secrets managers like HashiCorp Vault."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Authentication, authorization, and access control"}),": Start your Langflow server with authentication enabled, as explained in ",(0,s.jsx)(n.a,{href:"/api-keys-and-authentication",children:"API keys and authentication"}),". Restrict network and resource access with firewalls, network policies, network security groups, or VPCs. For example, restrict PostgreSQL database access to Langflow instances."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Encryption and privacy"}),": Follow industry best practices and legal requirements for data privacy and encryption of data in transit and at rest, including GDPR requirements, HTTPS, TLS, and SSL. For example, configure PostgreSQL with valid SSL certificates and append ",(0,s.jsx)(n.code,{children:"?sslmode=require"})," or ",(0,s.jsx)(n.code,{children:"?sslmode=verify-full"})," to the connection string to enable SSL for database connections."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Security posture maintenance"}),": Conduct regular security audits, keep current with software updates, and monitor for suspicious activity using intrusion detection systems."]}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"see-also",children:"See also"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"/deployment-kubernetes-prod",children:"Deploy the Langflow production environment on Kubernetes"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"https://github.com/langflow-ai/langflow-helm-charts",children:"Langflow Helm Charts repository"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"/environment-variables",children:"Langflow environment variables"})}),"\n"]})]})}function g(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(h,{...e})}):h(e)}function m(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}},28453:(e,n,t)=>{t.d(n,{R:()=>i,x:()=>a});var o=t(96540);const s={},r=o.createContext(s);function i(e){const n=o.useContext(r);return o.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:i(e.components),o.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/33b5ee95.f31be200.js b/assets/js/33b5ee95.a4d14cb3.js similarity index 89% rename from assets/js/33b5ee95.f31be200.js rename to assets/js/33b5ee95.a4d14cb3.js index 5e0f5247d0..51f1a551cd 100644 --- a/assets/js/33b5ee95.f31be200.js +++ b/assets/js/33b5ee95.a4d14cb3.js @@ -1 +1 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[750],{7685:(e,n,t)=>{t.d(n,{A:()=>o});const o=t.p+"assets/images/vector-store-document-ingestion-6157311fb4d16e7f944d55254f0cc0e2.png"},11470:(e,n,t)=>{t.d(n,{A:()=>w});var o=t(96540),s=t(18215),r=t(23104),a=t(56347),i=t(205),l=t(57485),d=t(31682),c=t(70679);function h(e){return o.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,o.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function u(e){const{values:n,children:t}=e;return(0,o.useMemo)(()=>{const e=n??function(e){return h(e).map(({props:{value:e,label:n,attributes:t,default:o}})=>({value:e,label:n,attributes:t,default:o}))}(t);return function(e){const n=(0,d.XI)(e,(e,n)=>e.value===n.value);if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map(e=>e.value).join(", ")}" found in . Every value needs to be unique.`)}(e),e},[n,t])}function p({value:e,tabValues:n}){return n.some(n=>n.value===e)}function m({queryString:e=!1,groupId:n}){const t=(0,a.W6)(),s=function({queryString:e=!1,groupId:n}){if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:e,groupId:n});return[(0,l.aZ)(s),(0,o.useCallback)(e=>{if(!s)return;const n=new URLSearchParams(t.location.search);n.set(s,e),t.replace({...t.location,search:n.toString()})},[s,t])]}function g(e){const{defaultValue:n,queryString:t=!1,groupId:s}=e,r=u(e),[a,l]=(0,o.useState)(()=>function({defaultValue:e,tabValues:n}){if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(e){if(!p({value:e,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${n.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}const t=n.find(e=>e.default)??n[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:n,tabValues:r})),[d,h]=m({queryString:t,groupId:s}),[g,x]=function({groupId:e}){const n=function(e){return e?`docusaurus.tab.${e}`:null}(e),[t,s]=(0,c.Dv)(n);return[t,(0,o.useCallback)(e=>{n&&s.set(e)},[n,s])]}({groupId:s}),f=(()=>{const e=d??g;return p({value:e,tabValues:r})?e:null})();(0,i.A)(()=>{f&&l(f)},[f]);return{selectedValue:a,selectValue:(0,o.useCallback)(e=>{if(!p({value:e,tabValues:r}))throw new Error(`Can't select invalid tab value=${e}`);l(e),h(e),x(e)},[h,x,r]),tabValues:r}}var x=t(92303);const f={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var j=t(74848);function y({className:e,block:n,selectedValue:t,selectValue:o,tabValues:a}){const i=[],{blockElementScrollPositionUntilNextRender:l}=(0,r.a_)(),d=e=>{const n=e.currentTarget,s=i.indexOf(n),r=a[s].value;r!==t&&(l(n),o(r))},c=e=>{let n=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const t=i.indexOf(e.currentTarget)+1;n=i[t]??i[0];break}case"ArrowLeft":{const t=i.indexOf(e.currentTarget)-1;n=i[t]??i[i.length-1];break}}n?.focus()};return(0,j.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.A)("tabs",{"tabs--block":n},e),children:a.map(({value:e,label:n,attributes:o})=>(0,j.jsx)("li",{role:"tab",tabIndex:t===e?0:-1,"aria-selected":t===e,ref:e=>{i.push(e)},onKeyDown:c,onClick:d,...o,className:(0,s.A)("tabs__item",f.tabItem,o?.className,{"tabs__item--active":t===e}),children:n??e},e))})}function b({lazy:e,children:n,selectedValue:t}){const r=(Array.isArray(n)?n:[n]).filter(Boolean);if(e){const e=r.find(e=>e.props.value===t);return e?(0,o.cloneElement)(e,{className:(0,s.A)("margin-top--md",e.props.className)}):null}return(0,j.jsx)("div",{className:"margin-top--md",children:r.map((e,n)=>(0,o.cloneElement)(e,{key:n,hidden:e.props.value!==t}))})}function v(e){const n=g(e);return(0,j.jsxs)("div",{className:(0,s.A)("tabs-container",f.tabList),children:[(0,j.jsx)(y,{...n,...e}),(0,j.jsx)(b,{...n,...e})]})}function w(e){const n=(0,x.A)();return(0,j.jsx)(v,{...e,children:h(e.children)},String(n))}},17886:(e,n,t)=>{t.d(n,{A:()=>r});t(96540);var o=t(64058),s=t(74848);function r({name:e,...n}){const t=o[e];return t?(0,s.jsx)(t,{...n}):null}},19365:(e,n,t)=>{t.d(n,{A:()=>a});t(96540);var o=t(18215);const s={tabItem:"tabItem_Ymn6"};var r=t(74848);function a({children:e,hidden:n,className:t}){return(0,r.jsx)("div",{role:"tabpanel",className:(0,o.A)(s.tabItem,t),hidden:n,children:e})}},22444:(e,n,t)=>{t.d(n,{Ay:()=>l,RM:()=>a});var o=t(74848),s=t(28453),r=t(17886);const a=[];function i(e){const n={a:"a",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.p,{children:"By design, vector data is essential for LLM applications, such as chatbots and agents."}),"\n",(0,o.jsx)(n.p,{children:"While you can use an LLM alone for generic chat interactions and common tasks, you can take your application to the next level with context sensitivity (such as RAG) and custom datasets (such as internal business data).\nThis often requires integrating vector databases and vector searches that provide the additional context and define meaningful queries."}),"\n",(0,o.jsx)(n.p,{children:"Langflow includes vector store components that can read and write vector data, including embedding storage, similarity search, Graph RAG traversals, and dedicated search instances like OpenSearch.\nBecause of their interdependent functionality, it is common to use vector store, language model, and embedding model components in the same flow or in a series of dependent flows."}),"\n",(0,o.jsxs)(n.p,{children:["To find available vector store components, browse ",(0,o.jsx)(r.A,{name:"Blocks","aria-hidden":"true"})," ",(0,o.jsx)(n.a,{href:"/components-bundle-components",children:(0,o.jsx)(n.strong,{children:"Bundles"})})," or ",(0,o.jsx)(r.A,{name:"Search","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Search"})," for your preferred vector database provider."]})]})}function l(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(i,{...e})}):i(e)}},27027:(e,n,t)=>{t.d(n,{Ay:()=>l,RM:()=>a});var o=t(74848),s=t(28453),r=t(17886);const a=[];function i(e){const n={a:"a",admonition:"admonition",code:"code",em:"em",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,s.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.admonition,{type:"tip",children:(0,o.jsxs)(n.p,{children:["For a tutorial that uses vector data in a flow, see ",(0,o.jsx)(n.a,{href:"/chat-with-rag",children:"Create a vector RAG chatbot"}),"."]})}),"\n",(0,o.jsx)(n.p,{children:"The following example demonstrates how to use vector store components in flows alongside related components like embedding model and language model components.\nThese steps walk through important configuration details, functionality, and best practices for using these components effectively.\nThis is only one example; it isn't a prescriptive guide to all possible use cases or configurations."}),"\n",(0,o.jsxs)(n.ol,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Create a flow with the ",(0,o.jsx)(n.strong,{children:"Vector Store RAG"})," template."]}),"\n",(0,o.jsxs)(n.p,{children:["This template has two subflows.\nThe ",(0,o.jsx)(n.strong,{children:"Load Data"})," subflow loads embeddings and content into a vector database, and the ",(0,o.jsx)(n.strong,{children:"Retriever"})," subflow runs a vector search to retrieve relevant context based on a user's query."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Configure the database connection for both ",(0,o.jsxs)(n.a,{href:"/bundles-datastax#astra-db",children:[(0,o.jsx)(n.strong,{children:"Astra DB"})," components"]}),", or replace them with another pair of vector store components of your choice.\nMake sure the components connect to the same vector store, and that the component in the ",(0,o.jsx)(n.strong,{children:"Retriever"})," subflow is able to run a similarity search."]}),"\n",(0,o.jsxs)(n.p,{children:["The parameters you set in each vector store component depend on the component's role in your flow.\nIn this example, the ",(0,o.jsx)(n.strong,{children:"Load Data"})," subflow ",(0,o.jsx)(n.em,{children:"writes"})," to the vector store, whereas the ",(0,o.jsx)(n.strong,{children:"Retriever"})," subflow ",(0,o.jsx)(n.em,{children:"reads"})," from the vector store.\nTherefore, search-related parameters are only relevant to the ",(0,o.jsx)(n.strong,{children:"Vector Search"})," component in the ",(0,o.jsx)(n.strong,{children:"Retriever"})," subflow."]}),"\n",(0,o.jsx)(n.p,{children:"For information about specific parameters, see the documentation for your chosen vector store component."}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:"To configure the embedding model, do one of the following:"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Use an OpenAI model"}),": In both ",(0,o.jsx)(n.strong,{children:"OpenAI Embeddings"})," components, enter your OpenAI API key.\nYou can use the default model or select a different OpenAI embedding model."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Use another provider"}),": Replace the ",(0,o.jsx)(n.strong,{children:"OpenAI Embeddings"})," components with another pair of ",(0,o.jsx)(n.a,{href:"/components-embedding-models",children:"embedding model components"})," of your choice, and then configure the parameters and credentials accordingly."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Use Astra DB vectorize"}),": If you are using an Astra DB vector store that has a vectorize integration, you can remove both ",(0,o.jsx)(n.strong,{children:"OpenAI Embeddings"})," components.\nIf you do this, the vectorize integration automatically generates embeddings from the ",(0,o.jsx)(n.strong,{children:"Ingest Data"})," (in the ",(0,o.jsx)(n.strong,{children:"Load Data"})," subflow) and ",(0,o.jsx)(n.strong,{children:"Search Query"})," (in the ",(0,o.jsx)(n.strong,{children:"Retriever"})," subflow)."]}),"\n"]}),"\n"]}),"\n",(0,o.jsx)(n.admonition,{type:"tip",children:(0,o.jsx)(n.p,{children:"If your vector store already contains embeddings, make sure your embedding model components use the same model as your previous embeddings.\nMixing embedding models in the same vector store can produce inaccurate search results."})}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Recommended: In the ",(0,o.jsxs)(n.a,{href:"/components-processing#split-text",children:[(0,o.jsx)(n.strong,{children:"Split Text"})," component"]}),", optimize the chunking settings for your embedding model.\nFor example, if your embedding model has a token limit of 512, then the ",(0,o.jsx)(n.strong,{children:"Chunk Size"})," parameter must not exceed that limit."]}),"\n",(0,o.jsxs)(n.p,{children:["Additionally, because the ",(0,o.jsx)(n.strong,{children:"Retriever"})," subflow passes the chat input directly to the vector store component for vector search, make sure that your chat input string doesn't exceed your embedding model's limits.\nFor this example, you can enter a query that is within the limits; however, in a production environment, you might need to implement additional checks or preprocessing steps to ensure compliance.\nFor example, use additional components to prepare the chat input before running the vector search, or enforce chat input limits in your application code."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["In the ",(0,o.jsx)(n.strong,{children:"Language Model"})," component, enter your OpenAI API key, or select a different provider and model to use for the chat portion of the flow."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Run the ",(0,o.jsx)(n.strong,{children:"Load Data"})," subflow to populate your vector store.\nIn the ",(0,o.jsx)(n.strong,{children:"File"})," component, select one or more files, and then click ",(0,o.jsx)(r.A,{name:"Play","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Run component"})," on the vector store component in the ",(0,o.jsx)(n.strong,{children:"Load Data"})," subflow."]}),"\n",(0,o.jsxs)(n.p,{children:["The ",(0,o.jsx)(n.strong,{children:"Load Data"})," subflow loads files from your local machine, chunks them, generates embeddings for the chunks, and then stores the chunks and their embeddings in the vector database."]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.img,{alt:"Embedding data into a vector store",src:t(7685).A+"",width:"4000",height:"2512"})}),"\n",(0,o.jsxs)(n.p,{children:["The ",(0,o.jsx)(n.strong,{children:"Load Data"})," subflow is separate from the ",(0,o.jsx)(n.strong,{children:"Retriever"})," subflow because you probably won't run it every time you use the chat.\nYou can run the ",(0,o.jsx)(n.strong,{children:"Load Data"})," subflow as needed to preload or update the data in your vector store.\nThen, your chat interactions only use the components that are necessary for chat."]}),"\n",(0,o.jsxs)(n.p,{children:["If your vector store already contains data that you want to use for vector search, then you don't need to run the ",(0,o.jsx)(n.strong,{children:"Load Data"})," subflow."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Open the ",(0,o.jsx)(n.strong,{children:"Playground"})," and start chatting to run the ",(0,o.jsx)(n.strong,{children:"Retriever"})," subflow."]}),"\n",(0,o.jsxs)(n.p,{children:["The ",(0,o.jsx)(n.strong,{children:"Retriever"})," subflow generates an embedding from chat input, runs a vector search to retrieve similar content from your vector store, parses the search results into supplemental context for the LLM, and then uses the LLM to generate a natural language response to your query.\nThe LLM uses the vector search results along with its internal training data and tools, such as basic web search and datetime information, to produce the response."]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.img,{alt:"Retrieval from a vector store",src:t(67719).A+"",width:"4000",height:"1324"})}),"\n",(0,o.jsxs)(n.p,{children:["To avoid passing the entire block of raw search results to the LLM, the ",(0,o.jsx)(n.strong,{children:"Parser"})," component extracts ",(0,o.jsx)(n.code,{children:"text"})," strings from the search results ",(0,o.jsx)(n.code,{children:"Data"})," object, and then passes them to the ",(0,o.jsx)(n.strong,{children:"Prompt Template"})," component in ",(0,o.jsx)(n.code,{children:"Message"})," format.\nFrom there, the strings and other template content are compiled into natural language instructions for the LLM."]}),"\n",(0,o.jsxs)(n.p,{children:["You can use other components for this transformation, such as the ",(0,o.jsx)(n.strong,{children:"Data Operations"})," component, depending on how you want to use the search results."]}),"\n",(0,o.jsxs)(n.p,{children:["To view the raw search results, click ",(0,o.jsx)(r.A,{name:"TextSearch","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Inspect output"})," on the vector store component after running the ",(0,o.jsx)(n.strong,{children:"Retriever"})," subflow."]}),"\n"]}),"\n"]})]})}function l(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(i,{...e})}):i(e)}},31929:(e,n,t)=>{t.d(n,{Ay:()=>l,RM:()=>a});var o=t(74848),s=t(28453),r=t(17886);const a=[];function i(e){const n={a:"a",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,o.jsxs)(n.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,o.jsx)(r.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Controls"})," in the ",(0,o.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function l(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(i,{...e})}):i(e)}},45591:(e,n,t)=>{t.r(n),t.d(n,{CH:()=>x,assets:()=>g,chCodeConfig:()=>f,contentTitle:()=>m,default:()=>b,frontMatter:()=>p,metadata:()=>o,toc:()=>j});const o=JSON.parse('{"id":"Components/components-models","title":"Language Model","description":"Language model components in Langflow generate text using a specified Large Language Model (LLM).","source":"@site/docs/Components/components-models.mdx","sourceDirName":"Components","slug":"/components-models","permalink":"/components-models","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Language Model","slug":"/components-models"},"sidebar":"docs","previous":{"title":"Agents","permalink":"/components-agents"},"next":{"title":"Embedding Model","permalink":"/components-embedding-models"}}');var s=t(74848),r=t(28453),a=t(24754),i=t(17886),l=t(11470),d=t(19365),c=t(31929),h=t(22444),u=t(27027);const p={title:"Language Model",slug:"/components-models"},m=void 0,g={},x={annotations:a.hk,Code:a.Cy},f={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},j=[{value:"Use language model components in flows",id:"use-language-model-components-in-flows",level:2},{value:"Language model parameters",id:"language-model-parameters",level:2},...c.RM,{value:"Language model output types",id:"language-model-output-types",level:2},{value:"Additional language models",id:"additional-language-models",level:2},{value:"Pair models with vector stores",id:"pair-models-with-vector-stores",level:2},...h.RM,...u.RM];function y(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,r.R)(),...e.components},{Details:o}=n;return x||v("CH",!1),x.Code||v("CH.Code",!0),o||v("Details",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n","\n",(0,s.jsx)(n.p,{children:"Language model components in Langflow generate text using a specified Large Language Model (LLM).\nThese components accept inputs like chat messages, files, and instructions in order to generate a text response."}),"\n",(0,s.jsxs)(n.p,{children:["Langflow includes a ",(0,s.jsx)(n.strong,{children:"Language Model"})," core component that has built-in support for many LLMs.\nAlternatively, you can use any ",(0,s.jsx)(n.a,{href:"#additional-language-models",children:"additional language model"})," in place of the ",(0,s.jsx)(n.strong,{children:"Language Model"})," core component."]}),"\n",(0,s.jsx)(n.h2,{id:"use-language-model-components-in-flows",children:"Use language model components in flows"}),"\n",(0,s.jsx)(n.p,{children:"Use language model components anywhere you would use an LLM in a flow."}),"\n",(0,s.jsxs)(l.A,{children:[(0,s.jsxs)(d.A,{value:"chat",label:"Chat",default:!0,children:[(0,s.jsx)(n.p,{children:"One of the most common use cases of language model components is to chat with LLMs in your flows."}),(0,s.jsxs)(n.p,{children:["The following example uses a language model component in a chatbot flow similar to the ",(0,s.jsx)(n.strong,{children:"Basic Prompting"})," template."]}),(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Add the ",(0,s.jsx)(n.strong,{children:"Language Model"})," core component to your flow, and then enter your OpenAI API key."]}),"\n",(0,s.jsxs)(n.p,{children:["This example uses the ",(0,s.jsx)(n.strong,{children:"Language Model"})," core component's default OpenAI model.\nIf you want to use a different provider or model, edit the ",(0,s.jsx)(n.strong,{children:"Model Provider"}),", ",(0,s.jsx)(n.strong,{children:"Model Name"}),", and ",(0,s.jsx)(n.strong,{children:"API Key"})," fields accordingly."]}),"\n",(0,s.jsxs)(n.admonition,{title:"My preferred provider or model isn't listed",type:"tip",children:[(0,s.jsxs)(n.p,{children:["If you want to use a provider or model that isn't built-in to the ",(0,s.jsx)(n.strong,{children:"Language Model"})," core component, you can replace this component with any ",(0,s.jsx)(n.a,{href:"#additional-language-models",children:"additional language model"}),"."]}),(0,s.jsxs)(n.p,{children:["Browse ",(0,s.jsx)(i.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(n.a,{href:"/components-bundle-components",children:(0,s.jsx)(n.strong,{children:"Bundles"})})," or ",(0,s.jsx)(i.A,{name:"Search","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Search"})," for your preferred provider to find additional language models."]})]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["In the ",(0,s.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),", click ",(0,s.jsx)(i.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Controls"}),", enable the ",(0,s.jsx)(n.strong,{children:"System Message"})," parameter, and then click ",(0,s.jsx)(n.strong,{children:"Close"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Add a ",(0,s.jsxs)(n.a,{href:"/components-prompts",children:[(0,s.jsx)(n.strong,{children:"Prompt Template"})," component"]})," to your flow."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["In the ",(0,s.jsx)(n.strong,{children:"Template"})," field, enter some instructions for the LLM, such as ",(0,s.jsx)(n.code,{children:"You are an expert in geography who is tutoring high school students"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Connect the ",(0,s.jsx)(n.strong,{children:"Prompt Template"})," component's output to the ",(0,s.jsx)(n.strong,{children:"Language Model"})," component's ",(0,s.jsx)(n.strong,{children:"System Message"})," input."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Add ",(0,s.jsxs)(n.a,{href:"/components-io#chat-io",children:[(0,s.jsx)(n.strong,{children:"Chat Input"})," and ",(0,s.jsx)(n.strong,{children:"Chat Output"})," components"]})," to your flow.\nThese components are required for direct chat interaction with an LLM."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Connect the ",(0,s.jsx)(n.strong,{children:"Chat Input"})," component to the ",(0,s.jsx)(n.strong,{children:"Language Model"})," component's ",(0,s.jsx)(n.strong,{children:"Input"}),", and then connect the ",(0,s.jsx)(n.strong,{children:"Language Model"})," component's ",(0,s.jsx)(n.strong,{children:"Message"})," output to the ",(0,s.jsx)(n.strong,{children:"Chat Output"})," component."]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"A basic prompting flow with Language Model, Prompt Template, Chat Input, and Chat Output components",src:t(80625).A+"",width:"2000",height:"1060"})}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Open the ",(0,s.jsx)(n.strong,{children:"Playground"}),", and ask a question to chat with the LLM and test the flow, such as ",(0,s.jsx)(n.code,{children:"What is the capital of Utah?"}),"."]}),"\n",(0,s.jsxs)(o,{children:[(0,s.jsx)("summary",{children:"Result"}),(0,s.jsx)(n.p,{children:"The following response is an example of an OpenAI model's response.\nYour actual response may vary based on the model version at the time of your request, your template, and input."}),(0,s.jsx)(x.Code,{codeConfig:f,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"The capital of Utah is Salt Lake City. It is not only the largest city in the state but also serves as the cultural and economic center of Utah. Salt Lake City was founded in 1847 by Mormon pioneers and is known for its proximity to the Great Salt Lake and its role in the history of the Church of Jesus Christ of Latter-day Saints. For more information, you can refer to sources such as the U.S. Geological Survey or the official state website of Utah.",props:{}}]}],lang:"text"},annotations:[]}]})]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Optional: Try a different model or provider to see how the response changes.\nFor example, if you are using the ",(0,s.jsx)(n.strong,{children:"Language Model"})," core component, you could try an Anthropic model."]}),"\n",(0,s.jsxs)(n.p,{children:["Then, open the ",(0,s.jsx)(n.strong,{children:"Playground"}),", ask the same question as you did before, and then compare the content and format of the responses."]}),"\n",(0,s.jsx)(n.p,{children:"This helps you understand how different models handle the same request so you can choose the best model for your use case.\nYou can also learn more about different models in each model provider's documentation."}),"\n",(0,s.jsxs)(o,{children:[(0,s.jsx)("summary",{children:"Result"}),(0,s.jsx)(n.p,{children:"The following response is an example of an Anthropic model's response.\nYour actual response may vary based on the model version at the time of your request, your template, and input."}),(0,s.jsx)(n.p,{children:"Note that this response is shorter and includes sources, whereas the previous OpenAI response was more encyclopedic and didn't cite sources."}),(0,s.jsx)(x.Code,{codeConfig:f,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"The capital of Utah is Salt Lake City. It is also the most populous city in the state. Salt Lake City has been the capital of Utah since 1896, when Utah became a state.",props:{}}]},{tokens:[{content:"Sources:",props:{}}]},{tokens:[{content:"Utah State Government Official Website (utah.gov)",props:{}}]},{tokens:[{content:"U.S. Census Bureau",props:{}}]},{tokens:[{content:"Encyclopedia Britannica",props:{}}]}],lang:"text"},annotations:[]}]})]}),"\n"]}),"\n"]})]}),(0,s.jsxs)(d.A,{value:"drivers",label:"Drivers",children:[(0,s.jsxs)(n.p,{children:["Some components use a language model component to perform LLM-driven actions.\nTypically, these components prepare data for further processing by downstream components, rather than emitting direct chat output.\nFor an example, see the ",(0,s.jsxs)(n.a,{href:"/components-processing#smart-function",children:[(0,s.jsx)(n.strong,{children:"Smart Function"})," component"]}),"."]}),(0,s.jsxs)(n.p,{children:["A component must accept a ",(0,s.jsx)(n.code,{children:"LanguageModel"})," input to use a language model component as a driver, and you must set the language model component's output type to ",(0,s.jsx)(n.code,{children:"LanguageModel"}),".\nFor more information, see ",(0,s.jsx)(n.a,{href:"#language-model-output-types",children:"Language Model output types"}),"."]})]}),(0,s.jsxs)(d.A,{value:"agents",label:"Agents",children:[(0,s.jsxs)(n.p,{children:["If you don't want to use the ",(0,s.jsx)(n.strong,{children:"Agent"})," component's built-in LLMs, you can use a language model component to connect your preferred model:"]}),(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Add a language model component to your flow."}),"\n",(0,s.jsxs)(n.p,{children:["You can use the ",(0,s.jsx)(n.strong,{children:"Language Model"})," core component or browse ",(0,s.jsx)(i.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(n.a,{href:"/components-bundle-components",children:(0,s.jsx)(n.strong,{children:"Bundles"})})," to find additional language models.\nComponents in bundles may not have ",(0,s.jsx)(n.code,{children:"language model"})," in the name.\nFor example, Azure OpenAI LLMs are provided through the ",(0,s.jsxs)(n.a,{href:"/bundles-azure#azure-openai",children:[(0,s.jsx)(n.strong,{children:"Azure OpenAI"})," component"]}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Configure the language model component as needed to connect to your preferred model."}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Change the language model component's output type from ",(0,s.jsx)(n.strong,{children:"Model Response"})," to ",(0,s.jsx)(n.strong,{children:"Language Model"}),".\nThe output port changes to a ",(0,s.jsx)(n.code,{children:"LanguageModel"})," port.\nThis is required to connect the language model component to the ",(0,s.jsx)(n.strong,{children:"Agent"})," component.\nFor more information, see ",(0,s.jsx)(n.a,{href:"#language-model-output-types",children:"Language Model output types"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Add an ",(0,s.jsx)(n.strong,{children:"Agent"})," component to the flow, and then set ",(0,s.jsx)(n.strong,{children:"Model Provider"})," to ",(0,s.jsx)(n.strong,{children:"Connect other models"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"Model Provider"})," field changes to a ",(0,s.jsx)(n.strong,{children:"Language Model"})," (",(0,s.jsx)(n.code,{children:"LanguageModel"}),") input."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Connect the language model component's output to the ",(0,s.jsx)(n.strong,{children:"Agent"})," component's ",(0,s.jsx)(n.strong,{children:"Language Model"})," input.\nThe ",(0,s.jsx)(n.strong,{children:"Agent"})," component now inherits the language model settings from the connected language model component instead of using any of the built-in models."]}),"\n"]}),"\n"]})]})]}),"\n",(0,s.jsx)(n.h2,{id:"language-model-parameters",children:"Language model parameters"}),"\n",(0,s.jsxs)(n.p,{children:["The following parameters are for the ",(0,s.jsx)(n.strong,{children:"Language Model"})," core component.\nOther language model components can have additional or different parameters."]}),"\n","\n",(0,s.jsx)(c.Ay,{}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"provider"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. The model provider to use."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"model_name"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. The name of the model to use. Options depend on the selected provider."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"api_key"}),(0,s.jsx)(n.td,{children:"SecretString"}),(0,s.jsx)(n.td,{children:"Input parameter. The API Key for authentication with the selected provider."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"input_value"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. The input text to send to the model."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"system_message"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. A system message that helps set the behavior of the assistant."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"stream"}),(0,s.jsx)(n.td,{children:"Boolean"}),(0,s.jsx)(n.td,{children:"Input parameter. Whether to stream the response. Default: false."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"temperature"}),(0,s.jsx)(n.td,{children:"Float"}),(0,s.jsxs)(n.td,{children:["Input parameter. Controls randomness in responses. Range: ",(0,s.jsx)(n.code,{children:"[0.0, 1.0]"}),". Default: ",(0,s.jsx)(n.code,{children:"0.1"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"model"}),(0,s.jsx)(n.td,{children:"LanguageModel"}),(0,s.jsxs)(n.td,{children:["Output parameter. Alternative output type to the default ",(0,s.jsx)(n.code,{children:"Message"})," output. Produces an instance of Chat configured with the specified parameters. See ",(0,s.jsx)(n.a,{href:"#language-model-output-types",children:"Language Model output types"}),"."]})]})]})]}),"\n",(0,s.jsx)(n.h2,{id:"language-model-output-types",children:"Language model output types"}),"\n",(0,s.jsx)(n.p,{children:"Language model components, including the core component and bundled components, can produce two types of output:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Model Response"}),": The default output type emits the model's generated response as ",(0,s.jsxs)(n.a,{href:"/data-types#message",children:[(0,s.jsx)(n.code,{children:"Message"})," data"]}),".\nUse this output type when you want the typical LLM interaction where the LLM produces a text response based on given input."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Language Model"}),": Change the language model component's output type to ",(0,s.jsx)(n.a,{href:"/data-types#languagemodel",children:(0,s.jsx)(n.code,{children:"LanguageModel"})})," when you need to attach an LLM to another component in your flow, such as an ",(0,s.jsx)(n.strong,{children:"Agent"})," or ",(0,s.jsx)(n.strong,{children:"Smart Function"})," component."]}),"\n",(0,s.jsxs)(n.p,{children:["With this configuration, the language model component supports an action completed by another component, rather than a direct chat interaction.\nFor an example, the ",(0,s.jsx)(n.strong,{children:"Smart Function"})," component uses an LLM to create a function from natural language input."]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"additional-language-models",children:"Additional language models"}),"\n",(0,s.jsxs)(n.p,{children:["If your provider or model isn't supported by the ",(0,s.jsx)(n.strong,{children:"Language Model"})," core component, additional language model components are available in ",(0,s.jsx)(i.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(n.a,{href:"/components-bundle-components",children:(0,s.jsx)(n.strong,{children:"Bundles"})}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["You can use these components in the same way that you use the core ",(0,s.jsx)(n.strong,{children:"Language Model"})," component, as explained in ",(0,s.jsx)(n.a,{href:"#use-language-model-components-in-flows",children:"Use language model components in flows"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"pair-models-with-vector-stores",children:"Pair models with vector stores"}),"\n","\n",(0,s.jsx)(h.Ay,{}),"\n",(0,s.jsxs)(o,{children:[(0,s.jsx)("summary",{children:"Example: Vector search flow"}),(0,s.jsx)(u.Ay,{})]})]})}function b(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(y,{...e})}):y(e)}function v(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}},67719:(e,n,t)=>{t.d(n,{A:()=>o});const o=t.p+"assets/images/vector-store-retrieval-af7257d77ff0259ab1a0980641d464ce.png"},80625:(e,n,t)=>{t.d(n,{A:()=>o});const o=t.p+"assets/images/component-language-model-1ddc1bd5726d5ea55ac91f7813a024d7.png"}}]); \ No newline at end of file +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[750],{7685:(e,n,t)=>{t.d(n,{A:()=>o});const o=t.p+"assets/images/vector-store-document-ingestion-6157311fb4d16e7f944d55254f0cc0e2.png"},11470:(e,n,t)=>{t.d(n,{A:()=>w});var o=t(96540),s=t(18215),r=t(23104),a=t(56347),i=t(205),l=t(57485),d=t(31682),c=t(70679);function h(e){return o.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,o.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function u(e){const{values:n,children:t}=e;return(0,o.useMemo)(()=>{const e=n??function(e){return h(e).map(({props:{value:e,label:n,attributes:t,default:o}})=>({value:e,label:n,attributes:t,default:o}))}(t);return function(e){const n=(0,d.XI)(e,(e,n)=>e.value===n.value);if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map(e=>e.value).join(", ")}" found in . Every value needs to be unique.`)}(e),e},[n,t])}function p({value:e,tabValues:n}){return n.some(n=>n.value===e)}function m({queryString:e=!1,groupId:n}){const t=(0,a.W6)(),s=function({queryString:e=!1,groupId:n}){if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:e,groupId:n});return[(0,l.aZ)(s),(0,o.useCallback)(e=>{if(!s)return;const n=new URLSearchParams(t.location.search);n.set(s,e),t.replace({...t.location,search:n.toString()})},[s,t])]}function g(e){const{defaultValue:n,queryString:t=!1,groupId:s}=e,r=u(e),[a,l]=(0,o.useState)(()=>function({defaultValue:e,tabValues:n}){if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(e){if(!p({value:e,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${n.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}const t=n.find(e=>e.default)??n[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:n,tabValues:r})),[d,h]=m({queryString:t,groupId:s}),[g,x]=function({groupId:e}){const n=function(e){return e?`docusaurus.tab.${e}`:null}(e),[t,s]=(0,c.Dv)(n);return[t,(0,o.useCallback)(e=>{n&&s.set(e)},[n,s])]}({groupId:s}),f=(()=>{const e=d??g;return p({value:e,tabValues:r})?e:null})();(0,i.A)(()=>{f&&l(f)},[f]);return{selectedValue:a,selectValue:(0,o.useCallback)(e=>{if(!p({value:e,tabValues:r}))throw new Error(`Can't select invalid tab value=${e}`);l(e),h(e),x(e)},[h,x,r]),tabValues:r}}var x=t(92303);const f={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var j=t(74848);function y({className:e,block:n,selectedValue:t,selectValue:o,tabValues:a}){const i=[],{blockElementScrollPositionUntilNextRender:l}=(0,r.a_)(),d=e=>{const n=e.currentTarget,s=i.indexOf(n),r=a[s].value;r!==t&&(l(n),o(r))},c=e=>{let n=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const t=i.indexOf(e.currentTarget)+1;n=i[t]??i[0];break}case"ArrowLeft":{const t=i.indexOf(e.currentTarget)-1;n=i[t]??i[i.length-1];break}}n?.focus()};return(0,j.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.A)("tabs",{"tabs--block":n},e),children:a.map(({value:e,label:n,attributes:o})=>(0,j.jsx)("li",{role:"tab",tabIndex:t===e?0:-1,"aria-selected":t===e,ref:e=>{i.push(e)},onKeyDown:c,onClick:d,...o,className:(0,s.A)("tabs__item",f.tabItem,o?.className,{"tabs__item--active":t===e}),children:n??e},e))})}function b({lazy:e,children:n,selectedValue:t}){const r=(Array.isArray(n)?n:[n]).filter(Boolean);if(e){const e=r.find(e=>e.props.value===t);return e?(0,o.cloneElement)(e,{className:(0,s.A)("margin-top--md",e.props.className)}):null}return(0,j.jsx)("div",{className:"margin-top--md",children:r.map((e,n)=>(0,o.cloneElement)(e,{key:n,hidden:e.props.value!==t}))})}function v(e){const n=g(e);return(0,j.jsxs)("div",{className:(0,s.A)("tabs-container",f.tabList),children:[(0,j.jsx)(y,{...n,...e}),(0,j.jsx)(b,{...n,...e})]})}function w(e){const n=(0,x.A)();return(0,j.jsx)(v,{...e,children:h(e.children)},String(n))}},17886:(e,n,t)=>{t.d(n,{A:()=>r});t(96540);var o=t(64058),s=t(74848);function r({name:e,...n}){const t=o[e];return t?(0,s.jsx)(t,{...n}):null}},19365:(e,n,t)=>{t.d(n,{A:()=>a});t(96540);var o=t(18215);const s={tabItem:"tabItem_Ymn6"};var r=t(74848);function a({children:e,hidden:n,className:t}){return(0,r.jsx)("div",{role:"tabpanel",className:(0,o.A)(s.tabItem,t),hidden:n,children:e})}},22444:(e,n,t)=>{t.d(n,{Ay:()=>l,RM:()=>a});var o=t(74848),s=t(28453),r=t(17886);const a=[];function i(e){const n={a:"a",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.p,{children:"By design, vector data is essential for LLM applications, such as chatbots and agents."}),"\n",(0,o.jsx)(n.p,{children:"While you can use an LLM alone for generic chat interactions and common tasks, you can take your application to the next level with context sensitivity (such as RAG) and custom datasets (such as internal business data).\nThis often requires integrating vector databases and vector searches that provide the additional context and define meaningful queries."}),"\n",(0,o.jsx)(n.p,{children:"Langflow includes vector store components that can read and write vector data, including embedding storage, similarity search, Graph RAG traversals, and dedicated search instances like OpenSearch.\nBecause of their interdependent functionality, it is common to use vector store, language model, and embedding model components in the same flow or in a series of dependent flows."}),"\n",(0,o.jsxs)(n.p,{children:["To find available vector store components, browse ",(0,o.jsx)(r.A,{name:"Blocks","aria-hidden":"true"})," ",(0,o.jsx)(n.a,{href:"/components-bundle-components",children:(0,o.jsx)(n.strong,{children:"Bundles"})})," or ",(0,o.jsx)(r.A,{name:"Search","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Search"})," for your preferred vector database provider."]})]})}function l(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(i,{...e})}):i(e)}},27027:(e,n,t)=>{t.d(n,{Ay:()=>l,RM:()=>a});var o=t(74848),s=t(28453),r=t(17886);const a=[];function i(e){const n={a:"a",admonition:"admonition",code:"code",em:"em",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,s.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.admonition,{type:"tip",children:(0,o.jsxs)(n.p,{children:["For a tutorial that uses vector data in a flow, see ",(0,o.jsx)(n.a,{href:"/chat-with-rag",children:"Create a vector RAG chatbot"}),"."]})}),"\n",(0,o.jsx)(n.p,{children:"The following example demonstrates how to use vector store components in flows alongside related components like embedding model and language model components.\nThese steps walk through important configuration details, functionality, and best practices for using these components effectively.\nThis is only one example; it isn't a prescriptive guide to all possible use cases or configurations."}),"\n",(0,o.jsxs)(n.ol,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Create a flow with the ",(0,o.jsx)(n.strong,{children:"Vector Store RAG"})," template."]}),"\n",(0,o.jsxs)(n.p,{children:["This template has two subflows.\nThe ",(0,o.jsx)(n.strong,{children:"Load Data"})," subflow loads embeddings and content into a vector database, and the ",(0,o.jsx)(n.strong,{children:"Retriever"})," subflow runs a vector search to retrieve relevant context based on a user's query."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Configure the database connection for both ",(0,o.jsxs)(n.a,{href:"/bundles-datastax#astra-db",children:[(0,o.jsx)(n.strong,{children:"Astra DB"})," components"]}),", or replace them with another pair of vector store components of your choice.\nMake sure the components connect to the same vector store, and that the component in the ",(0,o.jsx)(n.strong,{children:"Retriever"})," subflow is able to run a similarity search."]}),"\n",(0,o.jsxs)(n.p,{children:["The parameters you set in each vector store component depend on the component's role in your flow.\nIn this example, the ",(0,o.jsx)(n.strong,{children:"Load Data"})," subflow ",(0,o.jsx)(n.em,{children:"writes"})," to the vector store, whereas the ",(0,o.jsx)(n.strong,{children:"Retriever"})," subflow ",(0,o.jsx)(n.em,{children:"reads"})," from the vector store.\nTherefore, search-related parameters are only relevant to the ",(0,o.jsx)(n.strong,{children:"Vector Search"})," component in the ",(0,o.jsx)(n.strong,{children:"Retriever"})," subflow."]}),"\n",(0,o.jsx)(n.p,{children:"For information about specific parameters, see the documentation for your chosen vector store component."}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:"To configure the embedding model, do one of the following:"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Use an OpenAI model"}),": In both ",(0,o.jsx)(n.strong,{children:"OpenAI Embeddings"})," components, enter your OpenAI API key.\nYou can use the default model or select a different OpenAI embedding model."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Use another provider"}),": Replace the ",(0,o.jsx)(n.strong,{children:"OpenAI Embeddings"})," components with another pair of ",(0,o.jsx)(n.a,{href:"/components-embedding-models",children:"embedding model components"})," of your choice, and then configure the parameters and credentials accordingly."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Use Astra DB vectorize"}),": If you are using an Astra DB vector store that has a vectorize integration, you can remove both ",(0,o.jsx)(n.strong,{children:"OpenAI Embeddings"})," components.\nIf you do this, the vectorize integration automatically generates embeddings from the ",(0,o.jsx)(n.strong,{children:"Ingest Data"})," (in the ",(0,o.jsx)(n.strong,{children:"Load Data"})," subflow) and ",(0,o.jsx)(n.strong,{children:"Search Query"})," (in the ",(0,o.jsx)(n.strong,{children:"Retriever"})," subflow)."]}),"\n"]}),"\n"]}),"\n",(0,o.jsx)(n.admonition,{type:"tip",children:(0,o.jsx)(n.p,{children:"If your vector store already contains embeddings, make sure your embedding model components use the same model as your previous embeddings.\nMixing embedding models in the same vector store can produce inaccurate search results."})}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Recommended: In the ",(0,o.jsxs)(n.a,{href:"/components-processing#split-text",children:[(0,o.jsx)(n.strong,{children:"Split Text"})," component"]}),", optimize the chunking settings for your embedding model.\nFor example, if your embedding model has a token limit of 512, then the ",(0,o.jsx)(n.strong,{children:"Chunk Size"})," parameter must not exceed that limit."]}),"\n",(0,o.jsxs)(n.p,{children:["Additionally, because the ",(0,o.jsx)(n.strong,{children:"Retriever"})," subflow passes the chat input directly to the vector store component for vector search, make sure that your chat input string doesn't exceed your embedding model's limits.\nFor this example, you can enter a query that is within the limits; however, in a production environment, you might need to implement additional checks or preprocessing steps to ensure compliance.\nFor example, use additional components to prepare the chat input before running the vector search, or enforce chat input limits in your application code."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["In the ",(0,o.jsx)(n.strong,{children:"Language Model"})," component, enter your OpenAI API key, or select a different provider and model to use for the chat portion of the flow."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Run the ",(0,o.jsx)(n.strong,{children:"Load Data"})," subflow to populate your vector store.\nIn the ",(0,o.jsx)(n.strong,{children:"File"})," component, select one or more files, and then click ",(0,o.jsx)(r.A,{name:"Play","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Run component"})," on the vector store component in the ",(0,o.jsx)(n.strong,{children:"Load Data"})," subflow."]}),"\n",(0,o.jsxs)(n.p,{children:["The ",(0,o.jsx)(n.strong,{children:"Load Data"})," subflow loads files from your local machine, chunks them, generates embeddings for the chunks, and then stores the chunks and their embeddings in the vector database."]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.img,{alt:"Embedding data into a vector store",src:t(7685).A+"",width:"4000",height:"2512"})}),"\n",(0,o.jsxs)(n.p,{children:["The ",(0,o.jsx)(n.strong,{children:"Load Data"})," subflow is separate from the ",(0,o.jsx)(n.strong,{children:"Retriever"})," subflow because you probably won't run it every time you use the chat.\nYou can run the ",(0,o.jsx)(n.strong,{children:"Load Data"})," subflow as needed to preload or update the data in your vector store.\nThen, your chat interactions only use the components that are necessary for chat."]}),"\n",(0,o.jsxs)(n.p,{children:["If your vector store already contains data that you want to use for vector search, then you don't need to run the ",(0,o.jsx)(n.strong,{children:"Load Data"})," subflow."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Open the ",(0,o.jsx)(n.strong,{children:"Playground"})," and start chatting to run the ",(0,o.jsx)(n.strong,{children:"Retriever"})," subflow."]}),"\n",(0,o.jsxs)(n.p,{children:["The ",(0,o.jsx)(n.strong,{children:"Retriever"})," subflow generates an embedding from chat input, runs a vector search to retrieve similar content from your vector store, parses the search results into supplemental context for the LLM, and then uses the LLM to generate a natural language response to your query.\nThe LLM uses the vector search results along with its internal training data and tools, such as basic web search and datetime information, to produce the response."]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.img,{alt:"Retrieval from a vector store",src:t(67719).A+"",width:"4000",height:"1324"})}),"\n",(0,o.jsxs)(n.p,{children:["To avoid passing the entire block of raw search results to the LLM, the ",(0,o.jsx)(n.strong,{children:"Parser"})," component extracts ",(0,o.jsx)(n.code,{children:"text"})," strings from the search results ",(0,o.jsx)(n.code,{children:"Data"})," object, and then passes them to the ",(0,o.jsx)(n.strong,{children:"Prompt Template"})," component in ",(0,o.jsx)(n.code,{children:"Message"})," format.\nFrom there, the strings and other template content are compiled into natural language instructions for the LLM."]}),"\n",(0,o.jsxs)(n.p,{children:["You can use other components for this transformation, such as the ",(0,o.jsx)(n.strong,{children:"Data Operations"})," component, depending on how you want to use the search results."]}),"\n",(0,o.jsxs)(n.p,{children:["To view the raw search results, click ",(0,o.jsx)(r.A,{name:"TextSearch","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Inspect output"})," on the vector store component after running the ",(0,o.jsx)(n.strong,{children:"Retriever"})," subflow."]}),"\n"]}),"\n"]})]})}function l(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(i,{...e})}):i(e)}},31929:(e,n,t)=>{t.d(n,{Ay:()=>l,RM:()=>a});var o=t(74848),s=t(28453),r=t(17886);const a=[];function i(e){const n={a:"a",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,o.jsxs)(n.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,o.jsx)(r.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Controls"})," in the ",(0,o.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function l(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(i,{...e})}):i(e)}},45591:(e,n,t)=>{t.r(n),t.d(n,{CH:()=>x,assets:()=>g,chCodeConfig:()=>f,contentTitle:()=>m,default:()=>b,frontMatter:()=>p,metadata:()=>o,toc:()=>j});const o=JSON.parse('{"id":"Components/components-models","title":"Language Model","description":"Language model components in Langflow generate text using a specified Large Language Model (LLM).","source":"@site/docs/Components/components-models.mdx","sourceDirName":"Components","slug":"/components-models","permalink":"/components-models","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Language Model","slug":"/components-models"},"sidebar":"docs","previous":{"title":"Agents","permalink":"/components-agents"},"next":{"title":"Embedding Model","permalink":"/components-embedding-models"}}');var s=t(74848),r=t(28453),a=t(24754),i=t(17886),l=t(11470),d=t(19365),c=t(31929),h=t(22444),u=t(27027);const p={title:"Language Model",slug:"/components-models"},m=void 0,g={},x={annotations:a.hk,Code:a.Cy},f={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},j=[{value:"Use language model components in flows",id:"use-language-model-components-in-flows",level:2},{value:"Language model parameters",id:"language-model-parameters",level:2},...c.RM,{value:"Language model output types",id:"language-model-output-types",level:2},{value:"Additional language models",id:"additional-language-models",level:2},{value:"Pair models with vector stores",id:"pair-models-with-vector-stores",level:2},...h.RM,...u.RM];function y(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,r.R)(),...e.components},{Details:o}=n;return x||v("CH",!1),x.Code||v("CH.Code",!0),o||v("Details",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n","\n",(0,s.jsx)(n.p,{children:"Language model components in Langflow generate text using a specified Large Language Model (LLM).\nThese components accept inputs like chat messages, files, and instructions in order to generate a text response."}),"\n",(0,s.jsxs)(n.p,{children:["Langflow includes a ",(0,s.jsx)(n.strong,{children:"Language Model"})," core component that has built-in support for many LLMs.\nAlternatively, you can use any ",(0,s.jsx)(n.a,{href:"#additional-language-models",children:"additional language model"})," in place of the ",(0,s.jsx)(n.strong,{children:"Language Model"})," core component."]}),"\n",(0,s.jsx)(n.h2,{id:"use-language-model-components-in-flows",children:"Use language model components in flows"}),"\n",(0,s.jsx)(n.p,{children:"Use language model components anywhere you would use an LLM in a flow."}),"\n",(0,s.jsxs)(l.A,{children:[(0,s.jsxs)(d.A,{value:"chat",label:"Chat",default:!0,children:[(0,s.jsx)(n.p,{children:"One of the most common use cases of language model components is to chat with LLMs in your flows."}),(0,s.jsxs)(n.p,{children:["The following example uses a language model component in a chatbot flow similar to the ",(0,s.jsx)(n.strong,{children:"Basic Prompting"})," template."]}),(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Add the ",(0,s.jsx)(n.strong,{children:"Language Model"})," core component to your flow, and then enter your OpenAI API key."]}),"\n",(0,s.jsxs)(n.p,{children:["This example uses the ",(0,s.jsx)(n.strong,{children:"Language Model"})," core component's default OpenAI model.\nIf you want to use a different provider or model, edit the ",(0,s.jsx)(n.strong,{children:"Model Provider"}),", ",(0,s.jsx)(n.strong,{children:"Model Name"}),", and ",(0,s.jsx)(n.strong,{children:"API Key"})," fields accordingly."]}),"\n",(0,s.jsxs)(n.admonition,{title:"My preferred provider or model isn't listed",type:"tip",children:[(0,s.jsxs)(n.p,{children:["If you want to use a provider or model that isn't built-in to the ",(0,s.jsx)(n.strong,{children:"Language Model"})," core component, you can replace this component with any ",(0,s.jsx)(n.a,{href:"#additional-language-models",children:"additional language model"}),"."]}),(0,s.jsxs)(n.p,{children:["Browse ",(0,s.jsx)(i.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(n.a,{href:"/components-bundle-components",children:(0,s.jsx)(n.strong,{children:"Bundles"})})," or ",(0,s.jsx)(i.A,{name:"Search","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Search"})," for your preferred provider to find additional language models."]})]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["In the ",(0,s.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),", click ",(0,s.jsx)(i.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Controls"}),", enable the ",(0,s.jsx)(n.strong,{children:"System Message"})," parameter, and then click ",(0,s.jsx)(n.strong,{children:"Close"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Add a ",(0,s.jsxs)(n.a,{href:"/components-prompts",children:[(0,s.jsx)(n.strong,{children:"Prompt Template"})," component"]})," to your flow."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["In the ",(0,s.jsx)(n.strong,{children:"Template"})," field, enter some instructions for the LLM, such as ",(0,s.jsx)(n.code,{children:"You are an expert in geography who is tutoring high school students"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Connect the ",(0,s.jsx)(n.strong,{children:"Prompt Template"})," component's output to the ",(0,s.jsx)(n.strong,{children:"Language Model"})," component's ",(0,s.jsx)(n.strong,{children:"System Message"})," input."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Add ",(0,s.jsxs)(n.a,{href:"/components-io#chat-io",children:[(0,s.jsx)(n.strong,{children:"Chat Input"})," and ",(0,s.jsx)(n.strong,{children:"Chat Output"})," components"]})," to your flow.\nThese components are required for direct chat interaction with an LLM."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Connect the ",(0,s.jsx)(n.strong,{children:"Chat Input"})," component to the ",(0,s.jsx)(n.strong,{children:"Language Model"})," component's ",(0,s.jsx)(n.strong,{children:"Input"}),", and then connect the ",(0,s.jsx)(n.strong,{children:"Language Model"})," component's ",(0,s.jsx)(n.strong,{children:"Message"})," output to the ",(0,s.jsx)(n.strong,{children:"Chat Output"})," component."]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"A basic prompting flow with Language Model, Prompt Template, Chat Input, and Chat Output components",src:t(80625).A+"",width:"2000",height:"1060"})}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Open the ",(0,s.jsx)(n.strong,{children:"Playground"}),", and ask a question to chat with the LLM and test the flow, such as ",(0,s.jsx)(n.code,{children:"What is the capital of Utah?"}),"."]}),"\n",(0,s.jsxs)(o,{children:[(0,s.jsx)("summary",{children:"Result"}),(0,s.jsx)(n.p,{children:"The following response is an example of an OpenAI model's response.\nYour actual response may vary based on the model version at the time of your request, your template, and input."}),(0,s.jsx)(x.Code,{codeConfig:f,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"The capital of Utah is Salt Lake City. It is not only the largest city in the state but also serves as the cultural and economic center of Utah. Salt Lake City was founded in 1847 by Mormon pioneers and is known for its proximity to the Great Salt Lake and its role in the history of the Church of Jesus Christ of Latter-day Saints. For more information, you can refer to sources such as the U.S. Geological Survey or the official state website of Utah.",props:{}}]}],lang:"text"},annotations:[]}]})]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Optional: Try a different model or provider to see how the response changes.\nFor example, if you are using the ",(0,s.jsx)(n.strong,{children:"Language Model"})," core component, you could try an Anthropic model."]}),"\n",(0,s.jsxs)(n.p,{children:["Then, open the ",(0,s.jsx)(n.strong,{children:"Playground"}),", ask the same question as you did before, and then compare the content and format of the responses."]}),"\n",(0,s.jsx)(n.p,{children:"This helps you understand how different models handle the same request so you can choose the best model for your use case.\nYou can also learn more about different models in each model provider's documentation."}),"\n",(0,s.jsxs)(o,{children:[(0,s.jsx)("summary",{children:"Result"}),(0,s.jsx)(n.p,{children:"The following response is an example of an Anthropic model's response.\nYour actual response may vary based on the model version at the time of your request, your template, and input."}),(0,s.jsx)(n.p,{children:"Note that this response is shorter and includes sources, whereas the previous OpenAI response was more encyclopedic and didn't cite sources."}),(0,s.jsx)(x.Code,{codeConfig:f,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"The capital of Utah is Salt Lake City. It is also the most populous city in the state. Salt Lake City has been the capital of Utah since 1896, when Utah became a state.",props:{}}]},{tokens:[{content:"Sources:",props:{}}]},{tokens:[{content:"Utah State Government Official Website (utah.gov)",props:{}}]},{tokens:[{content:"U.S. Census Bureau",props:{}}]},{tokens:[{content:"Encyclopedia Britannica",props:{}}]}],lang:"text"},annotations:[]}]})]}),"\n"]}),"\n"]})]}),(0,s.jsxs)(d.A,{value:"drivers",label:"Drivers",children:[(0,s.jsxs)(n.p,{children:["Some components use a language model component to perform LLM-driven actions.\nTypically, these components prepare data for further processing by downstream components, rather than emitting direct chat output.\nFor an example, see the ",(0,s.jsxs)(n.a,{href:"/components-processing#smart-function",children:[(0,s.jsx)(n.strong,{children:"Smart Function"})," component"]}),"."]}),(0,s.jsxs)(n.p,{children:["A component must accept a ",(0,s.jsx)(n.code,{children:"LanguageModel"})," input to use a language model component as a driver, and you must set the language model component's output type to ",(0,s.jsx)(n.code,{children:"LanguageModel"}),".\nFor more information, see ",(0,s.jsx)(n.a,{href:"#language-model-output-types",children:"Language Model output types"}),"."]})]}),(0,s.jsxs)(d.A,{value:"agents",label:"Agents",children:[(0,s.jsxs)(n.p,{children:["If you don't want to use the ",(0,s.jsx)(n.strong,{children:"Agent"})," component's built-in LLMs, you can use a language model component to connect your preferred model:"]}),(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Add a language model component to your flow."}),"\n",(0,s.jsxs)(n.p,{children:["You can use the ",(0,s.jsx)(n.strong,{children:"Language Model"})," core component or browse ",(0,s.jsx)(i.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(n.a,{href:"/components-bundle-components",children:(0,s.jsx)(n.strong,{children:"Bundles"})})," to find additional language models.\nComponents in bundles may not have ",(0,s.jsx)(n.code,{children:"language model"})," in the name.\nFor example, Azure OpenAI LLMs are provided through the ",(0,s.jsxs)(n.a,{href:"/bundles-azure#azure-openai",children:[(0,s.jsx)(n.strong,{children:"Azure OpenAI"})," component"]}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Configure the language model component as needed to connect to your preferred model."}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Change the language model component's output type from ",(0,s.jsx)(n.strong,{children:"Model Response"})," to ",(0,s.jsx)(n.strong,{children:"Language Model"}),".\nThe output port changes to a ",(0,s.jsx)(n.code,{children:"LanguageModel"})," port.\nThis is required to connect the language model component to the ",(0,s.jsx)(n.strong,{children:"Agent"})," component.\nFor more information, see ",(0,s.jsx)(n.a,{href:"#language-model-output-types",children:"Language Model output types"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Add an ",(0,s.jsx)(n.strong,{children:"Agent"})," component to the flow, and then set ",(0,s.jsx)(n.strong,{children:"Model Provider"})," to ",(0,s.jsx)(n.strong,{children:"Connect other models"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"Model Provider"})," field changes to a ",(0,s.jsx)(n.strong,{children:"Language Model"})," (",(0,s.jsx)(n.code,{children:"LanguageModel"}),") input."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Connect the language model component's output to the ",(0,s.jsx)(n.strong,{children:"Agent"})," component's ",(0,s.jsx)(n.strong,{children:"Language Model"})," input.\nThe ",(0,s.jsx)(n.strong,{children:"Agent"})," component now inherits the language model settings from the connected language model component instead of using any of the built-in models."]}),"\n"]}),"\n"]})]})]}),"\n",(0,s.jsx)(n.h2,{id:"language-model-parameters",children:"Language model parameters"}),"\n",(0,s.jsxs)(n.p,{children:["The following parameters are for the ",(0,s.jsx)(n.strong,{children:"Language Model"})," core component.\nOther language model components can have additional or different parameters."]}),"\n","\n",(0,s.jsx)(c.Ay,{}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"provider"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. The model provider to use."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"model_name"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. The name of the model to use. Options depend on the selected provider."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"api_key"}),(0,s.jsx)(n.td,{children:"SecretString"}),(0,s.jsx)(n.td,{children:"Input parameter. The API Key for authentication with the selected provider."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"input_value"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. The input text to send to the model."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"system_message"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. A system message that helps set the behavior of the assistant."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"stream"}),(0,s.jsx)(n.td,{children:"Boolean"}),(0,s.jsxs)(n.td,{children:["Input parameter. Whether to stream the response. Default: ",(0,s.jsx)(n.code,{children:"false"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"temperature"}),(0,s.jsx)(n.td,{children:"Float"}),(0,s.jsxs)(n.td,{children:["Input parameter. Controls randomness in responses. Range: ",(0,s.jsx)(n.code,{children:"[0.0, 1.0]"}),". Default: ",(0,s.jsx)(n.code,{children:"0.1"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"model"}),(0,s.jsx)(n.td,{children:"LanguageModel"}),(0,s.jsxs)(n.td,{children:["Output parameter. Alternative output type to the default ",(0,s.jsx)(n.code,{children:"Message"})," output. Produces an instance of Chat configured with the specified parameters. See ",(0,s.jsx)(n.a,{href:"#language-model-output-types",children:"Language Model output types"}),"."]})]})]})]}),"\n",(0,s.jsx)(n.h2,{id:"language-model-output-types",children:"Language model output types"}),"\n",(0,s.jsx)(n.p,{children:"Language model components, including the core component and bundled components, can produce two types of output:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Model Response"}),": The default output type emits the model's generated response as ",(0,s.jsxs)(n.a,{href:"/data-types#message",children:[(0,s.jsx)(n.code,{children:"Message"})," data"]}),".\nUse this output type when you want the typical LLM interaction where the LLM produces a text response based on given input."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Language Model"}),": Change the language model component's output type to ",(0,s.jsx)(n.a,{href:"/data-types#languagemodel",children:(0,s.jsx)(n.code,{children:"LanguageModel"})})," when you need to attach an LLM to another component in your flow, such as an ",(0,s.jsx)(n.strong,{children:"Agent"})," or ",(0,s.jsx)(n.strong,{children:"Smart Function"})," component."]}),"\n",(0,s.jsxs)(n.p,{children:["With this configuration, the language model component supports an action completed by another component, rather than a direct chat interaction.\nFor an example, the ",(0,s.jsx)(n.strong,{children:"Smart Function"})," component uses an LLM to create a function from natural language input."]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"additional-language-models",children:"Additional language models"}),"\n",(0,s.jsxs)(n.p,{children:["If your provider or model isn't supported by the ",(0,s.jsx)(n.strong,{children:"Language Model"})," core component, additional language model components are available in ",(0,s.jsx)(i.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(n.a,{href:"/components-bundle-components",children:(0,s.jsx)(n.strong,{children:"Bundles"})}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["You can use these components in the same way that you use the core ",(0,s.jsx)(n.strong,{children:"Language Model"})," component, as explained in ",(0,s.jsx)(n.a,{href:"#use-language-model-components-in-flows",children:"Use language model components in flows"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"pair-models-with-vector-stores",children:"Pair models with vector stores"}),"\n","\n",(0,s.jsx)(h.Ay,{}),"\n",(0,s.jsxs)(o,{children:[(0,s.jsx)("summary",{children:"Example: Vector search flow"}),(0,s.jsx)(u.Ay,{})]})]})}function b(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(y,{...e})}):y(e)}function v(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}},67719:(e,n,t)=>{t.d(n,{A:()=>o});const o=t.p+"assets/images/vector-store-retrieval-af7257d77ff0259ab1a0980641d464ce.png"},80625:(e,n,t)=>{t.d(n,{A:()=>o});const o=t.p+"assets/images/component-language-model-1ddc1bd5726d5ea55ac91f7813a024d7.png"}}]); \ No newline at end of file diff --git a/assets/js/391afd3f.87240b17.js b/assets/js/391afd3f.87240b17.js new file mode 100644 index 0000000000..8e9219af6a --- /dev/null +++ b/assets/js/391afd3f.87240b17.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[6608],{28453:(n,e,s)=>{s.d(e,{R:()=>r,x:()=>l});var i=s(96540);const t={},o=i.createContext(t);function r(n){const e=i.useContext(o);return i.useMemo(function(){return"function"==typeof n?n(e):{...e,...n}},[e,n])}function l(n){let e;return e=n.disableParentContext?"function"==typeof n.components?n.components(t):n.components||t:r(n.components),i.createElement(o.Provider,{value:e},n.children)}},51768:(n,e,s)=>{s.r(e),s.d(e,{assets:()=>d,contentTitle:()=>l,default:()=>h,frontMatter:()=>r,metadata:()=>i,toc:()=>a});const i=JSON.parse('{"id":"Integrations/Nvidia/integrations-nvidia-nim-wsl2","title":"Integrate NVIDIA NIMs with Langflow","description":"Connect Langflow with NVIDIA NIM on an RTX Windows system with Windows Subsystem for Linux 2 (WSL2) installed.","source":"@site/docs/Integrations/Nvidia/integrations-nvidia-nim-wsl2.mdx","sourceDirName":"Integrations/Nvidia","slug":"/integrations-nvidia-ingest-wsl2","permalink":"/integrations-nvidia-ingest-wsl2","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Integrate NVIDIA NIMs with Langflow","slug":"/integrations-nvidia-ingest-wsl2"},"sidebar":"docs","previous":{"title":"NVIDIA Ingest","permalink":"/integrations-nvidia-ingest"},"next":{"title":"NVIDIA System-Assist","permalink":"/integrations-nvidia-g-assist"}}');var t=s(74848),o=s(28453);const r={title:"Integrate NVIDIA NIMs with Langflow",slug:"/integrations-nvidia-ingest-wsl2"},l=void 0,d={},a=[{value:"Prerequisites",id:"prerequisites",level:2},{value:"Use the NVIDIA NIM in a flow",id:"use-the-nvidia-nim-in-a-flow",level:2}];function c(n){const e={a:"a",code:"code",h2:"h2",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,o.R)(),...n.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(e.p,{children:["Connect Langflow with NVIDIA NIM on an RTX Windows system with ",(0,t.jsx)(e.a,{href:"https://learn.microsoft.com/en-us/windows/wsl/install",children:"Windows Subsystem for Linux 2 (WSL2)"})," installed."]}),"\n",(0,t.jsxs)(e.p,{children:[(0,t.jsx)(e.a,{href:"https://docs.nvidia.com/nim/index.html",children:"NVIDIA NIM (NVIDIA Inference Microservices)"})," provides containers to self-host GPU-accelerated inferencing microservices.\nIn this example, you connect a Language Model component in Langflow to a deployed ",(0,t.jsx)(e.code,{children:"mistral-nemo-12b-instruct"})," NIM on an ",(0,t.jsx)(e.strong,{children:"RTX Windows system"})," with ",(0,t.jsx)(e.strong,{children:"WSL2"}),"."]}),"\n",(0,t.jsxs)(e.p,{children:["For more information on NVIDIA NIM, see the ",(0,t.jsx)(e.a,{href:"https://docs.nvidia.com/nim/index.html",children:"NVIDIA documentation"}),"."]}),"\n",(0,t.jsx)(e.h2,{id:"prerequisites",children:"Prerequisites"}),"\n",(0,t.jsxs)(e.ul,{children:["\n",(0,t.jsxs)(e.li,{children:["\n",(0,t.jsx)(e.p,{children:(0,t.jsx)(e.a,{href:"https://docs.nvidia.com/nim/wsl2/latest/getting-started.html",children:"NVIDIA NIM WSL2 installed"})}),"\n"]}),"\n",(0,t.jsxs)(e.li,{children:["\n",(0,t.jsx)(e.p,{children:"A NIM container deployed according to the model's instructions"}),"\n",(0,t.jsxs)(e.p,{children:["Prerequisites vary between models.\nFor example, to deploy the ",(0,t.jsx)(e.code,{children:"mistral-nemo-12b-instruct"})," NIM, follow the instructions for ",(0,t.jsx)(e.strong,{children:"Windows on RTX AI PCs (Beta)"})," on your ",(0,t.jsx)(e.a,{href:"https://build.nvidia.com/nv-mistralai/mistral-nemo-12b-instruct/deploy?environment=wsl2.md",children:"model's deployment overview"}),"."]}),"\n"]}),"\n",(0,t.jsxs)(e.li,{children:["\n",(0,t.jsx)(e.p,{children:"Windows 11 build 23H2 or later"}),"\n"]}),"\n",(0,t.jsxs)(e.li,{children:["\n",(0,t.jsx)(e.p,{children:"At least 12 GB of RAM"}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(e.h2,{id:"use-the-nvidia-nim-in-a-flow",children:"Use the NVIDIA NIM in a flow"}),"\n",(0,t.jsxs)(e.p,{children:["To connect the deployed NIM to Langflow, add the ",(0,t.jsx)(e.strong,{children:"NVIDIA"})," language model component to a flow:"]}),"\n",(0,t.jsxs)(e.ol,{children:["\n",(0,t.jsxs)(e.li,{children:["Create a flow based on the ",(0,t.jsx)(e.strong,{children:"Basic Prompting"})," template."]}),"\n",(0,t.jsxs)(e.li,{children:["Replace the ",(0,t.jsx)(e.strong,{children:"OpenAI"})," model component with the ",(0,t.jsx)(e.strong,{children:"NVIDIA"})," component."]}),"\n",(0,t.jsxs)(e.li,{children:["In the ",(0,t.jsx)(e.strong,{children:"NVIDIA"})," component's ",(0,t.jsx)(e.strong,{children:"Base URL"})," field, add the URL where your NIM is accessible. If you followed your model's ",(0,t.jsx)(e.a,{href:"https://build.nvidia.com/nv-mistralai/mistral-nemo-12b-instruct/deploy?environment=wsl2.md",children:"deployment instructions"}),", the value is ",(0,t.jsx)(e.code,{children:"http://localhost:8000/v1"}),"."]}),"\n",(0,t.jsxs)(e.li,{children:["In the ",(0,t.jsx)(e.strong,{children:"NVIDIA"})," component's ",(0,t.jsx)(e.strong,{children:"NVIDIA API Key"})," field, add your NVIDIA API Key."]}),"\n",(0,t.jsxs)(e.li,{children:["Select your model from the ",(0,t.jsx)(e.strong,{children:"Model Name"})," field."]}),"\n",(0,t.jsxs)(e.li,{children:["Open the ",(0,t.jsx)(e.strong,{children:"Playground"})," and chat with your ",(0,t.jsx)(e.strong,{children:"NIM"})," model."]}),"\n"]})]})}function h(n={}){const{wrapper:e}={...(0,o.R)(),...n.components};return e?(0,t.jsx)(e,{...n,children:(0,t.jsx)(c,{...n})}):c(n)}}}]); \ No newline at end of file diff --git a/assets/js/391afd3f.963a3f2b.js b/assets/js/391afd3f.963a3f2b.js deleted file mode 100644 index 9cf51d2f06..0000000000 --- a/assets/js/391afd3f.963a3f2b.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[6608],{28453:(n,e,i)=>{i.d(e,{R:()=>r,x:()=>l});var s=i(96540);const t={},o=s.createContext(t);function r(n){const e=s.useContext(o);return s.useMemo(function(){return"function"==typeof n?n(e):{...e,...n}},[e,n])}function l(n){let e;return e=n.disableParentContext?"function"==typeof n.components?n.components(t):n.components||t:r(n.components),s.createElement(o.Provider,{value:e},n.children)}},51768:(n,e,i)=>{i.r(e),i.d(e,{assets:()=>d,contentTitle:()=>l,default:()=>h,frontMatter:()=>r,metadata:()=>s,toc:()=>a});const s=JSON.parse('{"id":"Integrations/Nvidia/integrations-nvidia-nim-wsl2","title":"Integrate NVIDIA NIMs with Langflow","description":"Connect Langflow with NVIDIA NIM on an RTX Windows system with Windows Subsystem for Linux 2 (WSL2) installed.","source":"@site/docs/Integrations/Nvidia/integrations-nvidia-nim-wsl2.mdx","sourceDirName":"Integrations/Nvidia","slug":"/integrations-nvidia-ingest-wsl2","permalink":"/integrations-nvidia-ingest-wsl2","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Integrate NVIDIA NIMs with Langflow","slug":"/integrations-nvidia-ingest-wsl2"},"sidebar":"docs","previous":{"title":"NVIDIA Ingest","permalink":"/integrations-nvidia-ingest"},"next":{"title":"NVIDIA G-Assist","permalink":"/integrations-nvidia-g-assist"}}');var t=i(74848),o=i(28453);const r={title:"Integrate NVIDIA NIMs with Langflow",slug:"/integrations-nvidia-ingest-wsl2"},l=void 0,d={},a=[{value:"Prerequisites",id:"prerequisites",level:2},{value:"Use the NVIDIA NIM in a flow",id:"use-the-nvidia-nim-in-a-flow",level:2}];function c(n){const e={a:"a",code:"code",h2:"h2",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,o.R)(),...n.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(e.p,{children:["Connect Langflow with NVIDIA NIM on an RTX Windows system with ",(0,t.jsx)(e.a,{href:"https://learn.microsoft.com/en-us/windows/wsl/install",children:"Windows Subsystem for Linux 2 (WSL2)"})," installed."]}),"\n",(0,t.jsxs)(e.p,{children:[(0,t.jsx)(e.a,{href:"https://docs.nvidia.com/nim/index.html",children:"NVIDIA NIM (NVIDIA Inference Microservices)"})," provides containers to self-host GPU-accelerated inferencing microservices.\nIn this example, you connect a Language Model component in Langflow to a deployed ",(0,t.jsx)(e.code,{children:"mistral-nemo-12b-instruct"})," NIM on an ",(0,t.jsx)(e.strong,{children:"RTX Windows system"})," with ",(0,t.jsx)(e.strong,{children:"WSL2"}),"."]}),"\n",(0,t.jsxs)(e.p,{children:["For more information on NVIDIA NIM, see the ",(0,t.jsx)(e.a,{href:"https://docs.nvidia.com/nim/index.html",children:"NVIDIA documentation"}),"."]}),"\n",(0,t.jsx)(e.h2,{id:"prerequisites",children:"Prerequisites"}),"\n",(0,t.jsxs)(e.ul,{children:["\n",(0,t.jsxs)(e.li,{children:["\n",(0,t.jsx)(e.p,{children:(0,t.jsx)(e.a,{href:"https://docs.nvidia.com/nim/wsl2/latest/getting-started.html",children:"NVIDIA NIM WSL2 installed"})}),"\n"]}),"\n",(0,t.jsxs)(e.li,{children:["\n",(0,t.jsx)(e.p,{children:"A NIM container deployed according to the model's instructions"}),"\n",(0,t.jsxs)(e.p,{children:["Prerequisites vary between models.\nFor example, to deploy the ",(0,t.jsx)(e.code,{children:"mistral-nemo-12b-instruct"})," NIM, follow the instructions for ",(0,t.jsx)(e.strong,{children:"Windows on RTX AI PCs (Beta)"})," on your ",(0,t.jsx)(e.a,{href:"https://build.nvidia.com/nv-mistralai/mistral-nemo-12b-instruct/deploy?environment=wsl2.md",children:"model's deployment overview"}),"."]}),"\n"]}),"\n",(0,t.jsxs)(e.li,{children:["\n",(0,t.jsx)(e.p,{children:"Windows 11 build 23H2 or later"}),"\n"]}),"\n",(0,t.jsxs)(e.li,{children:["\n",(0,t.jsx)(e.p,{children:"At least 12 GB of RAM"}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(e.h2,{id:"use-the-nvidia-nim-in-a-flow",children:"Use the NVIDIA NIM in a flow"}),"\n",(0,t.jsxs)(e.p,{children:["To connect the deployed NIM to Langflow, add the ",(0,t.jsx)(e.strong,{children:"NVIDIA"})," language model component to a flow:"]}),"\n",(0,t.jsxs)(e.ol,{children:["\n",(0,t.jsxs)(e.li,{children:["Create a flow based on the ",(0,t.jsx)(e.strong,{children:"Basic Prompting"})," template."]}),"\n",(0,t.jsxs)(e.li,{children:["Replace the ",(0,t.jsx)(e.strong,{children:"OpenAI"})," model component with the ",(0,t.jsx)(e.strong,{children:"NVIDIA"})," component."]}),"\n",(0,t.jsxs)(e.li,{children:["In the ",(0,t.jsx)(e.strong,{children:"NVIDIA"})," component's ",(0,t.jsx)(e.strong,{children:"Base URL"})," field, add the URL where your NIM is accessible. If you followed your model's ",(0,t.jsx)(e.a,{href:"https://build.nvidia.com/nv-mistralai/mistral-nemo-12b-instruct/deploy?environment=wsl2.md",children:"deployment instructions"}),", the value is ",(0,t.jsx)(e.code,{children:"http://localhost:8000/v1"}),"."]}),"\n",(0,t.jsxs)(e.li,{children:["In the ",(0,t.jsx)(e.strong,{children:"NVIDIA"})," component's ",(0,t.jsx)(e.strong,{children:"NVIDIA API Key"})," field, add your NVIDIA API Key."]}),"\n",(0,t.jsxs)(e.li,{children:["Select your model from the ",(0,t.jsx)(e.strong,{children:"Model Name"})," field."]}),"\n",(0,t.jsxs)(e.li,{children:["Open the ",(0,t.jsx)(e.strong,{children:"Playground"})," and chat with your ",(0,t.jsx)(e.strong,{children:"NIM"})," model."]}),"\n"]})]})}function h(n={}){const{wrapper:e}={...(0,o.R)(),...n.components};return e?(0,t.jsx)(e,{...n,children:(0,t.jsx)(c,{...n})}):c(n)}}}]); \ No newline at end of file diff --git a/assets/js/393c45a3.32dc7136.js b/assets/js/393c45a3.32dc7136.js new file mode 100644 index 0000000000..a7e033867b --- /dev/null +++ b/assets/js/393c45a3.32dc7136.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[692],{10734:(e,n,t)=>{t.r(n),t.d(n,{CH:()=>p,assets:()=>u,chCodeConfig:()=>f,contentTitle:()=>h,default:()=>y,frontMatter:()=>d,metadata:()=>o,toc:()=>g});const o=JSON.parse('{"id":"Configuration/api-keys-and-authentication","title":"API keys and authentication","description":"Never expose Langflow ports directly to the internet without proper security measures.","source":"@site/docs/Configuration/api-keys-and-authentication.mdx","sourceDirName":"Configuration","slug":"/api-keys-and-authentication","permalink":"/api-keys-and-authentication","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"API keys and authentication","slug":"/api-keys-and-authentication"},"sidebar":"docs","previous":{"title":"Connect an Astra DB MCP server to Langflow","permalink":"/mcp-component-astra"},"next":{"title":"Install custom dependencies","permalink":"/install-custom-dependencies"}}');var s=t(74848),r=t(28453),a=t(24754),i=t(11470),l=t(19365),c=t(17886);const d={title:"API keys and authentication",slug:"/api-keys-and-authentication"},h=void 0,u={},p={annotations:a.hk,Code:a.Cy},f={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},g=[{value:"Langflow API keys",id:"langflow-api-keys",level:2},{value:"Langflow API key permissions",id:"langflow-api-key-permissions",level:3},{value:"Create a Langflow API key",id:"create-a-langflow-api-key",level:3},{value:"Use a Langflow API key",id:"use-a-langflow-api-key",level:3},{value:"Track API key usage",id:"track-api-key-usage",level:3},{value:"Revoke an API key",id:"revoke-an-api-key",level:3},{value:"Component API keys",id:"component-api-keys",level:2},{value:"Authentication environment variables",id:"authentication-environment-variables",level:2},{value:"LANGFLOW_AUTO_LOGIN",id:"langflow-auto-login",level:3},{value:"Default authentication enforcement and LANGFLOW_SKIP_AUTH_AUTO_LOGIN",id:"langflow-skip-auth-auto-login",level:4},{value:"LANGFLOW_ENABLE_SUPERUSER_CLI",id:"langflow-enable-superuser-cli",level:3},{value:"LANGFLOW_SUPERUSER and LANGFLOW_SUPERUSER_PASSWORD",id:"langflow-superuser",level:3},{value:"LANGFLOW_SECRET_KEY",id:"langflow-secret-key",level:3},{value:"LANGFLOW_NEW_USER_IS_ACTIVE",id:"langflow-new-user-is-active",level:3},{value:"LANGFLOW_CORS_*",id:"cors-configuration-for-authentication",level:3},{value:"Start a Langflow server with authentication enabled",id:"start-a-langflow-server-with-authentication-enabled",level:2},{value:"Start the Langflow server",id:"start-the-langflow-server",level:3},{value:"Manage users as an administrator",id:"manage-users-as-an-administrator",level:3},{value:"See also",id:"see-also",level:2}];function x(e){const n={a:"a",admonition:"admonition",code:"code",em:"em",h2:"h2",h3:"h3",h4:"h4",li:"li",ol:"ol",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,r.R)(),...e.components},{Details:t}=n;return p||L("CH",!1),p.Code||L("CH.Code",!0),t||L("Details",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n","\n",(0,s.jsx)(n.admonition,{type:"warning",children:(0,s.jsxs)(n.p,{children:["Never expose Langflow ports directly to the internet without proper security measures.\nSet ",(0,s.jsx)(n.code,{children:"LANGFLOW_AUTO_LOGIN=False"}),", use a non-default ",(0,s.jsx)(n.code,{children:"LANGFLOW_SECRET_KEY"}),", and deploy your Langflow server behind a reverse proxy with authentication enabled.\nFor more information, see ",(0,s.jsx)(n.a,{href:"#start-a-langflow-server-with-authentication-enabled",children:"Start a Langflow server with authentication enabled"}),"."]})}),"\n",(0,s.jsx)(n.p,{children:"Authentication credentials help prevent unauthorized access to your Langflow server, flows, and services connected through components."}),"\n",(0,s.jsx)(n.p,{children:"There are three types of credentials that you use in Langflow:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.a,{href:"#langflow-api-keys",children:"Langflow API keys"}),": For authentication with the Langflow API and authorizing server-side Langflow actions like running flows and uploading files."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.a,{href:"#component-api-keys",children:"Component API keys"}),": For authentication between Langflow and a service connected through a component, such as a model provider or third-party API."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.a,{href:"#authentication-environment-variables",children:"Authentication environment variables"}),": These environment variables configure how Langflow handles user authentication and authorization."]}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"langflow-api-keys",children:"Langflow API keys"}),"\n",(0,s.jsx)(n.p,{children:"You can use Langflow API keys to interact with Langflow programmatically."}),"\n",(0,s.jsxs)(n.p,{children:["By default, most Langflow API endpoints, such as ",(0,s.jsx)(n.code,{children:"/v1/run/$FLOW_ID"}),", require authentication with a Langflow API key.\nTo require API key authentication for flow webhook endpoints, use the ",(0,s.jsx)(n.a,{href:"/webhook#require-authentication-for-webhooks",children:(0,s.jsx)(n.code,{children:"LANGFLOW_WEBHOOK_AUTH_ENABLE"})})," environment variable.\nTo configure authentication for Langflow MCP servers, see ",(0,s.jsx)(n.a,{href:"/mcp-server",children:"Use Langflow as an MCP server"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"langflow-api-key-permissions",children:"Langflow API key permissions"}),"\n",(0,s.jsx)(n.p,{children:"A Langflow API key adopts the privileges of the user who created it.\nThis means that API keys you create have the same permissions and access that you do, including access to your flows, components, and Langflow database.\nA Langflow API key cannot be used to access resources outside of your own Langflow server."}),"\n",(0,s.jsx)(n.p,{children:"In single-user environments, you are always a superuser, and your Langflow API keys always have superuser privileges."}),"\n",(0,s.jsxs)(n.p,{children:["In multi-user environments, users who aren't superusers cannot use their API keys to access other users' resources.\nYou must ",(0,s.jsx)(n.a,{href:"#start-a-langflow-server-with-authentication-enabled",children:"start your Langflow server with authentication enabled"})," to allow user management and creation of non-superuser accounts."]}),"\n",(0,s.jsx)(n.h3,{id:"create-a-langflow-api-key",children:"Create a Langflow API key"}),"\n",(0,s.jsxs)(n.p,{children:["You can generate a Langflow API key in your Langflow ",(0,s.jsx)(n.strong,{children:"Settings"})," or with the Langflow CLI."]}),"\n",(0,s.jsxs)(n.p,{children:["The CLI option is required if your Langflow server is running in ",(0,s.jsx)(n.code,{children:"--backend-only"})," mode."]}),"\n",(0,s.jsxs)(i.A,{children:[(0,s.jsx)(l.A,{value:"settings",label:"Langflow Settings",default:!0,children:(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["In the Langflow header, click your profile icon, and then select ",(0,s.jsx)(n.strong,{children:"Settings"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:["Click ",(0,s.jsx)(n.strong,{children:"Langflow API Keys"}),", and then click ",(0,s.jsx)(n.strong,{children:"Add New"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:["Name your key, and then click ",(0,s.jsx)(n.strong,{children:"Create API Key"}),"."]}),"\n",(0,s.jsx)(n.li,{children:"Copy the API key and store it securely."}),"\n"]})}),(0,s.jsxs)(l.A,{value:"Langflow CLI",label:"Langflow CLI",children:[(0,s.jsxs)(n.p,{children:["If you're serving your flow with ",(0,s.jsx)(n.code,{children:"--backend-only=true"}),", you can't create API keys in your Langflow ",(0,s.jsx)(n.strong,{children:"Settings"})," because the frontend isn't running.\nIn this case, you must create API keys with the Langflow CLI."]}),(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Recommended: ",(0,s.jsx)(n.a,{href:"#start-a-langflow-server-with-authentication-enabled",children:"Start your Langflow server with authentication enabled"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["The Langflow team recommends enabling authentication for security reasons to prevent unauthorized creation of API keys and superusers, especially in production environments.\nIf authentication isn't enabled (",(0,s.jsx)(n.code,{children:"LANGFLOW_AUTO_LOGIN=True"}),"), all users are effectively superusers, and they can create API keys with the Langflow CLI."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Create an API key with ",(0,s.jsx)(n.a,{href:"/configuration-cli#langflow-api-key",children:(0,s.jsx)(n.code,{children:"langflow api-key"})}),":"]}),"\n",(0,s.jsx)(p.Code,{codeConfig:f,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"uv ",props:{style:{color:"#FFA657"}}},{content:"run langflow api-key",props:{style:{color:"#A5D6FF"}}}]}],lang:"shell"},annotations:[]}]}),"\n",(0,s.jsx)(n.p,{children:"All API keys created with the Langflow CLI have superuser privileges because the command requires superuser authentication, and Langflow API keys adopt the privileges of the user who created them."}),"\n"]}),"\n"]})]})]}),"\n",(0,s.jsx)(n.h3,{id:"use-a-langflow-api-key",children:"Use a Langflow API key"}),"\n",(0,s.jsxs)(n.p,{children:["To authenticate Langflow API requests, pass your Langflow API key an ",(0,s.jsx)(n.code,{children:"x-api-key"})," header or query parameter."]}),"\n",(0,s.jsxs)(i.A,{children:[(0,s.jsx)(l.A,{value:"header",label:"HTTP header",default:!0,children:(0,s.jsx)(p.Code,{codeConfig:f,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:"POST ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:' "http://',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_SERVER_ADDRESS",props:{style:{color:"#C9D1D9"}}},{content:"/api/v1/run/",props:{style:{color:"#A5D6FF"}}},{content:"$FLOW_ID",props:{style:{color:"#C9D1D9"}}},{content:'?stream=false" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"Content-Type: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"x-api-key: ',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -d ",props:{style:{color:"#79C0FF"}}},{content:'\'{"inputs": {"text":""}, "tweaks": {}}\'',props:{style:{color:"#A5D6FF"}}}]}],lang:"shell"},annotations:[]}]})}),(0,s.jsx)(l.A,{value:"parameter",label:"Query parameter",children:(0,s.jsx)(p.Code,{codeConfig:f,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:"POST ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:' "http://',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_SERVER_ADDRESS",props:{style:{color:"#C9D1D9"}}},{content:"/api/v1/run/",props:{style:{color:"#A5D6FF"}}},{content:"$FLOW_ID",props:{style:{color:"#C9D1D9"}}},{content:"?x-api-key=",props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"Content-Type: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -d ",props:{style:{color:"#79C0FF"}}},{content:'\'{"inputs": {"text":""}, "tweaks": {}}\'',props:{style:{color:"#A5D6FF"}}}]}],lang:"shell"},annotations:[]}]})})]}),"\n",(0,s.jsxs)(n.p,{children:["For more information about forming Langflow API requests, see ",(0,s.jsx)(n.a,{href:"/api-reference-api-examples",children:"Get started with the Langflow API"})," and ",(0,s.jsx)(n.a,{href:"/concepts-publish",children:"Trigger flows with the Langflow API"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"track-api-key-usage",children:"Track API key usage"}),"\n",(0,s.jsxs)(n.p,{children:["By default, Langflow tracks API key usage through ",(0,s.jsx)(n.code,{children:"total_uses"})," and ",(0,s.jsx)(n.code,{children:"last_used_at"})," records in your ",(0,s.jsx)(n.a,{href:"/memory",children:"Langflow database"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["To disable API key tracking, set ",(0,s.jsx)(n.code,{children:"LANGFLOW_DISABLE_TRACK_APIKEY_USAGE=True"})," in your ",(0,s.jsx)(n.a,{href:"/environment-variables",children:"Langflow environment variables"}),".\nThis can help avoid database contention during periods of high concurrency."]}),"\n",(0,s.jsx)(n.h3,{id:"revoke-an-api-key",children:"Revoke an API key"}),"\n",(0,s.jsx)(n.p,{children:"To revoke and delete an API key, do the following:"}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["In the Langflow header, click your profile icon, and then select ",(0,s.jsx)(n.strong,{children:"Settings"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:["Click ",(0,s.jsx)(n.strong,{children:"Langflow API Keys"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:["Select the keys you want to delete, and then click ",(0,s.jsx)(c.A,{name:"Trash2","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Delete"}),"."]}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:"This action immediately invalidates the key and prevents it from being used again."}),"\n",(0,s.jsx)(n.h2,{id:"component-api-keys",children:"Component API keys"}),"\n",(0,s.jsx)(n.p,{children:"Component API keys authorize access to external services that are called by components in your flows, such as model providers, databases, or third-party APIs.\nThese aren't Langflow API keys or general application credentials."}),"\n",(0,s.jsxs)(n.p,{children:["In Langflow, you can store component API keys in global variables in your ",(0,s.jsx)(n.strong,{children:"Settings"})," or import them from your runtime environment.\nFor more information, see ",(0,s.jsx)(n.a,{href:"/configuration-global-variables",children:"Global variables"}),"."]}),"\n",(0,s.jsx)(n.p,{children:"You create and manage component API keys within the service provider's platform.\nLangflow only stores the encrypted key value or a secure reference to a key stored elsewhere; it doesn't manage the actual credentials at the source.\nThis means that deleting a global variable from Langflow doesn't delete or invalidate the actual API key in the service provider's system.\nYou must delete or rotate component API keys directly using the service provider's interface or API."}),"\n",(0,s.jsxs)(n.p,{children:["For added security, you can set ",(0,s.jsx)(n.code,{children:"LANGFLOW_REMOVE_API_KEYS=True"})," to omit API keys and tokens from flow data in your ",(0,s.jsx)(n.a,{href:"/memory",children:"Langflow database"}),".\nAdditionally, when ",(0,s.jsx)(n.a,{href:"/concepts-flows-import",children:"exporting flows"}),", you can choose to omit API keys from the exported flow JSON."]}),"\n",(0,s.jsx)(n.h2,{id:"authentication-environment-variables",children:"Authentication environment variables"}),"\n",(0,s.jsx)(n.p,{children:"This section describes the available authentication configuration variables."}),"\n",(0,s.jsxs)(n.p,{children:["You can use the ",(0,s.jsx)(n.a,{href:"https://github.com/langflow-ai/langflow/blob/main/.env.example",children:(0,s.jsx)(n.code,{children:".env.example"})})," file in the Langflow repository as a template for your own ",(0,s.jsx)(n.code,{children:".env"})," file."]}),"\n",(0,s.jsx)(n.h3,{id:"langflow-auto-login",children:"LANGFLOW_AUTO_LOGIN"}),"\n",(0,s.jsx)(n.p,{children:"This variable controls whether authentication is required to access your Langflow server, including the visual editor, API, and Langflow CLI:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["If ",(0,s.jsx)(n.code,{children:"LANGFLOW_AUTO_LOGIN=False"}),", automatic login is disabled. Users must sign in to the visual editor, authenticate as a superuser to run certain Langflow CLI commands, and use a Langflow API key for Langflow API requests.\nIf ",(0,s.jsx)(n.code,{children:"false"}),", the Langflow team recommends that you also explicitly set ",(0,s.jsxs)(n.a,{href:"#langflow-superuser",children:[(0,s.jsx)(n.code,{children:"LANGFLOW_SUPERUSER"})," and ",(0,s.jsx)(n.code,{children:"LANGFLOW_SUPERUSER_PASSWORD"})]})," to avoid using the insecure default values."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["If ",(0,s.jsx)(n.code,{children:"LANGFLOW_AUTO_LOGIN=True"})," (default), all API requests require authentication with a Langflow API key, but the visual editor automatically signs in all users as superusers, and Langflow uses ",(0,s.jsx)(n.em,{children:"only"})," the default ",(0,s.jsx)(n.a,{href:"/api-keys-and-authentication#langflow-superuser",children:"superuser credentials"}),".\nAll users access the same visual editor environment without password protection, they can run all Langflow CLI commands as superusers, and Langflow automatically authenticates internal requests between the backend and frontend based on the users' superuser privileges.\nIf you also want to bypass authentication for Langflow API requests in addition to other bypassed authentication, see ",(0,s.jsx)(n.a,{href:"/api-keys-and-authentication#langflow-skip-auth-auto-login",children:(0,s.jsx)(n.code,{children:"LANGFLOW_SKIP_AUTH_AUTO_LOGIN"})}),"."]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["Langflow doesn't allow users to simultaneously edit the same flow in real time.\nIf two users edit the same flow, Langflow saves only the work of the most recent editor based on the state of that user's ",(0,s.jsx)(n.a,{href:"/concepts-overview#workspace",children:"workspace"}),". Any changes made by the other user in the interim are overwritten."]}),"\n",(0,s.jsx)(n.h4,{id:"langflow-skip-auth-auto-login",children:"Default authentication enforcement and LANGFLOW_SKIP_AUTH_AUTO_LOGIN"}),"\n",(0,s.jsxs)(n.p,{children:["In Langflow version 1.6, the default settings are ",(0,s.jsx)(n.code,{children:"LANGFLOW_AUTO_LOGIN=True"})," and ",(0,s.jsx)(n.code,{children:"LANGFLOW_SKIP_AUTH_AUTO_LOGIN=False"}),".\nThis enforces authentication for API requests only, as explained in the preceding section."]}),"\n",(0,s.jsxs)(n.p,{children:["For temporary backwards compatibility, you can revert to the fully unauthenticated behavior from earlier versions by setting both variables to ",(0,s.jsx)(n.code,{children:"true"}),".\nHowever, a future release will set ",(0,s.jsx)(n.code,{children:"LANGFLOW_AUTO_LOGIN=False"})," and remove ",(0,s.jsx)(n.code,{children:"LANGFLOW_SKIP_AUTH_AUTO_LOGIN"}),".\nAt that point, Langflow will strictly enforce API key authentication for API requests, and you can manually disable authentication for some features, like the visual editor, by setting ",(0,s.jsx)(n.code,{children:"LANGFLOW_AUTO_LOGIN=True"}),"."]}),"\n",(0,s.jsxs)(t,{children:[(0,s.jsx)("summary",{children:"Authentication enforcement in earlier versions"}),(0,s.jsxs)(n.p,{children:["Langflow version 1.5 was the first version that could enforce authentication for Langflow API requests, regardless of the value of ",(0,s.jsx)(n.code,{children:"LANGFLOW_AUTO_LOGIN"}),".\nAs a temporary bypass for backwards compatibility, this version added the ",(0,s.jsx)(n.code,{children:"LANGFLOW_SKIP_AUTH_AUTO_LOGIN"})," environment variable and set both variables to ",(0,s.jsx)(n.code,{children:"true"})," by default to preserve the fully unauthenticated behavior from earlier versions.\nThis allowed users to upgrade to version 1.5 with no change in the authentication behavior."]}),(0,s.jsxs)(n.p,{children:["In Langflow versions earlier than 1.5, Langflow API requests didn't require authentication.\nAdditionally, the default setting of ",(0,s.jsx)(n.code,{children:"LANGFLOW_AUTO_LOGIN=True"})," automatically granted all users superuser privileges in the visual editor, and it allowed all users to run all Langflow CLI commands as superusers."]})]}),"\n",(0,s.jsx)(n.h3,{id:"langflow-enable-superuser-cli",children:"LANGFLOW_ENABLE_SUPERUSER_CLI"}),"\n",(0,s.jsxs)(n.p,{children:["Controls the availability of the ",(0,s.jsx)(n.code,{children:"langflow superuser"})," command in the Langflow CLI.\nThe default is ",(0,s.jsx)(n.code,{children:"true"}),", but ",(0,s.jsx)(n.code,{children:"false"})," is recommended to prevent unrestricted superuser creation.\nFor more information, see ",(0,s.jsx)(n.a,{href:"/configuration-cli#langflow-superuser",children:(0,s.jsx)(n.code,{children:"langflow superuser"})}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"langflow-superuser",children:"LANGFLOW_SUPERUSER and LANGFLOW_SUPERUSER_PASSWORD"}),"\n",(0,s.jsx)(n.p,{children:"These variables specify the username and password for the Langflow server's superuser."}),"\n",(0,s.jsx)(p.Code,{codeConfig:f,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"LANGFLOW_SUPERUSER=administrator",props:{}}]},{tokens:[{content:"LANGFLOW_SUPERUSER_PASSWORD=securepassword",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,s.jsxs)(n.p,{children:["They are required if ",(0,s.jsx)(n.code,{children:"LANGFLOW_AUTO_LOGIN=False"}),".\nOtherwise, they aren't relevant."]}),"\n",(0,s.jsxs)(n.p,{children:["When you ",(0,s.jsx)(n.a,{href:"#start-a-langflow-server-with-authentication-enabled",children:"start a Langflow server with authentication enabled"}),", if these variables are required but ",(0,s.jsx)(n.em,{children:"not"})," set, then Langflow uses the default values of ",(0,s.jsx)(n.code,{children:"langflow"})," and ",(0,s.jsx)(n.code,{children:"langflow"}),".\nThese defaults don't apply when using the Langflow CLI command ",(0,s.jsx)(n.a,{href:"/configuration-cli#langflow-superuser",children:(0,s.jsx)(n.code,{children:"langflow superuser"})}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"langflow-secret-key",children:"LANGFLOW_SECRET_KEY"}),"\n",(0,s.jsxs)(n.p,{children:["This environment variable stores a secret key used for encrypting sensitive data like API keys.\nLangflow uses the ",(0,s.jsx)(n.a,{href:"https://pypi.org/project/cryptography/",children:"Fernet"})," library for secret key encryption."]}),"\n",(0,s.jsx)(n.p,{children:"If no secret key is provided, Langflow automatically generates one."}),"\n",(0,s.jsx)(n.p,{children:"However, you should generate and explicitly set your own key in production environments.\nThis is particularly important for multi-instance deployments like Kubernetes to ensure consistent encryption across instances."}),"\n",(0,s.jsxs)(n.p,{children:["To generate a secret encryption key for ",(0,s.jsx)(n.code,{children:"LANGFLOW_SECRET_KEY"}),", do the following:"]}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Run the command to generate and copy a secret to the clipboard."}),"\n",(0,s.jsxs)(i.A,{children:[(0,s.jsx)(l.A,{value:"unix",label:"macOS or Linux",children:(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"macOS"}),": Generate a secret key and copy it to the clipboard:"]}),"\n",(0,s.jsx)(p.Code,{codeConfig:f,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"python3 ",props:{style:{color:"#FFA657"}}},{content:"-c ",props:{style:{color:"#79C0FF"}}},{content:"\"from secrets import token_urlsafe; print(f'LANGFLOW_SECRET_KEY={token_urlsafe(32)}')\" ",props:{style:{color:"#A5D6FF"}}},{content:"| ",props:{style:{color:"#FF7B72"}}},{content:"pbcopy",props:{style:{color:"#FFA657"}}}]}],lang:"bash"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Linux"}),": Generate a secret key and copy it to the clipboard:"]}),"\n",(0,s.jsx)(p.Code,{codeConfig:f,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"python3 ",props:{style:{color:"#FFA657"}}},{content:"-c ",props:{style:{color:"#79C0FF"}}},{content:"\"from secrets import token_urlsafe; print(f'LANGFLOW_SECRET_KEY={token_urlsafe(32)}')\" ",props:{style:{color:"#A5D6FF"}}},{content:"| ",props:{style:{color:"#FF7B72"}}},{content:"xclip ",props:{style:{color:"#FFA657"}}},{content:"-selection ",props:{style:{color:"#79C0FF"}}},{content:"clipboard",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Unix"}),": Generate a secret key and print it to the terminal to manually copy it:"]}),"\n",(0,s.jsx)(p.Code,{codeConfig:f,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"python3 ",props:{style:{color:"#FFA657"}}},{content:"-c ",props:{style:{color:"#79C0FF"}}},{content:"\"from secrets import token_urlsafe; print(f'LANGFLOW_SECRET_KEY={token_urlsafe(32)}')\"",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n"]}),"\n"]})}),(0,s.jsx)(l.A,{value:"windows",label:"Windows",children:(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Generate a secret key and copy it to the clipboard:"}),"\n",(0,s.jsx)(p.Code,{codeConfig:f,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"python ",props:{style:{color:"#FFA657"}}},{content:"-c ",props:{style:{color:"#79C0FF"}}},{content:"\"from secrets import token_urlsafe; print(f'LANGFLOW_SECRET_KEY={token_urlsafe(32)}')\"",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Generate a secret key and print it to the terminal to manually copy it:"}),"\n",(0,s.jsx)(p.Code,{codeConfig:f,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"# Or just print",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:"python ",props:{style:{color:"#FFA657"}}},{content:"-c ",props:{style:{color:"#79C0FF"}}},{content:"\"from secrets import token_urlsafe; print(f'LANGFLOW_SECRET_KEY={token_urlsafe(32)}')\"",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n"]}),"\n"]})})]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Paste the value into your ",(0,s.jsx)(n.code,{children:".env"})," file:"]}),"\n",(0,s.jsx)(p.Code,{codeConfig:f,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"LANGFLOW_SECRET_KEY=dBuu...2kM2_fb",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,s.jsxs)(n.p,{children:["If you're running Langflow on Docker, reference the ",(0,s.jsx)(n.code,{children:"LANGFLOW_SECRET_KEY"})," from your ",(0,s.jsx)(n.code,{children:".env"})," file in the ",(0,s.jsx)(n.code,{children:"docker-compose.yml"})," file like this:"]}),"\n",(0,s.jsx)(p.Code,{codeConfig:f,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"environment",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" - ",props:{style:{color:"#C9D1D9"}}},{content:"LANGFLOW_SECRET_KEY=${LANGFLOW_SECRET_KEY}",props:{style:{color:"#A5D6FF"}}}]}],lang:"yaml"},annotations:[]}]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"langflow-new-user-is-active",children:"LANGFLOW_NEW_USER_IS_ACTIVE"}),"\n",(0,s.jsxs)(n.p,{children:["When ",(0,s.jsx)(n.code,{children:"LANGFLOW_NEW_USER_IS_ACTIVE=False"})," (default), a superuser must explicitly activate a new user's account before they can sign in to the visual editor.\nThe superuser can also deactivate a user's account as needed."]}),"\n",(0,s.jsxs)(n.p,{children:["When ",(0,s.jsx)(n.code,{children:"LANGFLOW_NEW_USER_IS_ACTIVE=True"}),", new user accounts are automatically activated."]}),"\n",(0,s.jsx)(p.Code,{codeConfig:f,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"LANGFLOW_NEW_USER_IS_ACTIVE=False",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,s.jsxs)(n.p,{children:["Only superusers can manage user accounts for a Langflow server, but user management only matters if your server has authentication enabled.\nFor more information, see ",(0,s.jsx)(n.a,{href:"#start-a-langflow-server-with-authentication-enabled",children:"Start a Langflow server with authentication enabled"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"cors-configuration-for-authentication",children:"LANGFLOW_CORS_*"}),"\n",(0,s.jsxs)(n.p,{children:["Cross-Origin Resource Sharing (CORS) configuration controls how authentication credentials are handled when your Langflow frontend and backend are served from different origins.\nThe following ",(0,s.jsx)(n.code,{children:"LANGFLOW_CORS_*"})," environment variables are available:"]}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Variable"}),(0,s.jsx)(n.th,{children:"Format"}),(0,s.jsx)(n.th,{children:"Default"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"LANGFLOW_CORS_ALLOW_CREDENTIALS"})}),(0,s.jsx)(n.td,{children:"Boolean"}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"True"})}),(0,s.jsx)(n.td,{children:"Whether to allow credentials, such as cookies and authorization headers, in CORS requests."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"LANGFLOW_CORS_ALLOW_HEADERS"})}),(0,s.jsx)(n.td,{children:"List[String] or String"}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"*"})}),(0,s.jsxs)(n.td,{children:["The allowed headers for CORS requests. Provide a comma-separated list of headers or use ",(0,s.jsx)(n.code,{children:"*"})," to allow all headers."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"LANGFLOW_CORS_ALLOW_METHODS"})}),(0,s.jsx)(n.td,{children:"List[String] or String"}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"*"})}),(0,s.jsxs)(n.td,{children:["The allowed HTTP methods for CORS requests. Provide a comma-separated list of methods or use ",(0,s.jsx)(n.code,{children:"*"})," to allow all methods."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"LANGFLOW_CORS_ORIGINS"})}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"*"})}),(0,s.jsxs)(n.td,{children:["The allowed CORS origins. Provide a comma-separated list of origins or use ",(0,s.jsx)(n.code,{children:"*"})," for all origins."]})]})]})]}),"\n",(0,s.jsxs)(n.p,{children:["The default configuration enables CORS credentials and uses wildcards (",(0,s.jsx)(n.code,{children:"*"}),") to allow all origins, headers, and methods:"]}),"\n",(0,s.jsx)(p.Code,{codeConfig:f,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"LANGFLOW_CORS_ORIGINS=*",props:{}}]},{tokens:[{content:"LANGFLOW_CORS_ALLOW_CREDENTIALS=True",props:{}}]},{tokens:[{content:"LANGFLOW_CORS_ALLOW_HEADERS=*",props:{}}]},{tokens:[{content:"LANGFLOW_CORS_ALLOW_METHODS=*",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,s.jsxs)(n.admonition,{type:"danger",children:[(0,s.jsx)(n.p,{children:"Langflow's default CORS settings can be a security risk in production environments because any website can make requests to your Langflow API, and any website can include credentials in cross-origin requests, including authentication cookies and authorization headers."}),(0,s.jsxs)(n.p,{children:["In production deployments, specify exact origins in ",(0,s.jsx)(n.code,{children:"LANGFLOW_CORS_ORIGINS"}),".\nYou can also specify allowed headers and methods, if needed.\nFor example:"]}),(0,s.jsx)(p.Code,{codeConfig:f,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"LANGFLOW_CORS_ORIGINS=https://yourdomain.com,https://app.yourdomain.com",props:{}}]},{tokens:[{content:"LANGFLOW_CORS_ALLOW_CREDENTIALS=True",props:{}}]},{tokens:[{content:"LANGFLOW_CORS_ALLOW_HEADERS=Content-Type,Authorization",props:{}}]},{tokens:[{content:"LANGFLOW_CORS_ALLOW_METHODS=GET,POST,PUT",props:{}}]}],lang:"text"},annotations:[]}]})]}),"\n",(0,s.jsx)(n.h2,{id:"start-a-langflow-server-with-authentication-enabled",children:"Start a Langflow server with authentication enabled"}),"\n",(0,s.jsxs)(n.p,{children:["This section shows you how to use the ",(0,s.jsx)(n.a,{href:"/api-keys-and-authentication#authentication-environment-variables",children:"authentication environment variables"})," to deploy a Langflow server with authentication enabled.\nThis involves disabling automatic login, setting superuser credentials, generating a secret encryption key, and enabling user management."]}),"\n",(0,s.jsx)(n.p,{children:"This configuration is recommended for any deployment where Langflow is exposed to a shared or public network, or where multiple users access the same Langflow server."}),"\n",(0,s.jsxs)(n.p,{children:["With authentication enabled, all users must sign in to the visual editor with valid credentials, and API requests require authentication with a Langflow API key.\nAdditionally, you must sign in as a superuser to manage users and ",(0,s.jsx)(n.a,{href:"#create-a-langflow-api-key",children:"create a Langflow API key"})," with superuser privileges."]}),"\n",(0,s.jsx)(n.h3,{id:"start-the-langflow-server",children:"Start the Langflow server"}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Create a ",(0,s.jsx)(n.code,{children:".env"})," file with the following variables:"]}),"\n",(0,s.jsx)(p.Code,{codeConfig:f,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"LANGFLOW_AUTO_LOGIN=False",props:{}}]},{tokens:[{content:"LANGFLOW_SUPERUSER=",props:{}}]},{tokens:[{content:"LANGFLOW_SUPERUSER_PASSWORD=",props:{}}]},{tokens:[{content:"LANGFLOW_SECRET_KEY=",props:{}}]},{tokens:[{content:"LANGFLOW_NEW_USER_IS_ACTIVE=False",props:{}}]},{tokens:[{content:"LANGFLOW_ENABLE_SUPERUSER_CLI=False",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,s.jsxs)(n.p,{children:["Your ",(0,s.jsx)(n.code,{children:".env"})," file can have other environment variables.\nThis example focuses on authentication variables."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Set ",(0,s.jsx)(n.code,{children:"LANGFLOW_SUPERUSER"})," and ",(0,s.jsx)(n.code,{children:"LANGFLOW_SUPERUSER_PASSWORD"})," to your desired superuser credentials."]}),"\n",(0,s.jsxs)(n.p,{children:["For a one-time test, you can use basic credentials like ",(0,s.jsx)(n.code,{children:"administrator"})," and ",(0,s.jsx)(n.code,{children:"password"}),".\nStrong, securely-stored credentials are recommended in genuine development and production environments."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Recommended: Generate and set a ",(0,s.jsx)(n.code,{children:"LANGFLOW_SECRET_KEY"})," for encrypting sensitive data."]}),"\n",(0,s.jsx)(n.p,{children:"If you don't set a secret key, Langflow generates one automatically, but this isn't recommended for production environments."}),"\n",(0,s.jsxs)(n.p,{children:["For instructions on generating at setting a secret key, see ",(0,s.jsx)(n.a,{href:"#langflow-secret-key",children:(0,s.jsx)(n.code,{children:"LANGFLOW_SECRET_KEY"})}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Save your ",(0,s.jsx)(n.code,{children:".env"})," file with the populated variables. For example:"]}),"\n",(0,s.jsx)(p.Code,{codeConfig:f,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"LANGFLOW_AUTO_LOGIN=False",props:{}}]},{tokens:[{content:"LANGFLOW_SUPERUSER=administrator",props:{}}]},{tokens:[{content:"LANGFLOW_SUPERUSER_PASSWORD=securepassword",props:{}}]},{tokens:[{content:"LANGFLOW_SECRET_KEY=dBuu...2kM2_fb",props:{}}]},{tokens:[{content:"LANGFLOW_NEW_USER_IS_ACTIVE=False",props:{}}]},{tokens:[{content:"LANGFLOW_ENABLE_SUPERUSER_CLI=False",props:{}}]}],lang:"text"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Start Langflow with the configuration from your ",(0,s.jsx)(n.code,{children:".env"})," file:"]}),"\n",(0,s.jsx)(p.Code,{codeConfig:f,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"uv run langflow run --env-file .env",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,s.jsxs)(n.p,{children:["Starting Langflow with a ",(0,s.jsx)(n.code,{children:".env"})," file automatically authenticates you as the superuser set in ",(0,s.jsx)(n.code,{children:"LANGFLOW_SUPERUSER"})," and ",(0,s.jsx)(n.code,{children:"LANGFLOW_SUPERUSER_PASSWORD"}),".\nIf you don't explicitly set these variables, the default values are ",(0,s.jsx)(n.code,{children:"langflow"})," and ",(0,s.jsx)(n.code,{children:"langflow"})," for system auto-login."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Verify the server is running. The default location is ",(0,s.jsx)(n.code,{children:"http://localhost:7860"}),"."]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:"Next, you can add users to your Langflow server to collaborate with others on flows."}),"\n",(0,s.jsx)(n.h3,{id:"manage-users-as-an-administrator",children:"Manage users as an administrator"}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["To complete your first-time login as a superuser, go to ",(0,s.jsx)(n.code,{children:"http://localhost:7860/login"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["If you aren't using the default location, replace ",(0,s.jsx)(n.code,{children:"localhost:7860"})," with your server's address."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Log in with the superuser credentials you set in your ",(0,s.jsx)(n.code,{children:".env"})," (",(0,s.jsx)(n.code,{children:"LANGFLOW_SUPERUSER"})," and ",(0,s.jsx)(n.code,{children:"LANGFLOW_SUPERUSER_PASSWORD"}),")."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["To manage users on your server, navigate to ",(0,s.jsx)(n.code,{children:"/admin"}),", such as ",(0,s.jsx)(n.code,{children:"http://localhost:7860/admin"}),", click your profile icon, and then click ",(0,s.jsx)(n.strong,{children:"Admin Page"}),"."]}),"\n",(0,s.jsx)(n.p,{children:"As a superuser, you can add users, set permissions, reset passwords, and delete accounts."}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["To add a user, click ",(0,s.jsx)(n.strong,{children:"New User"}),", and then complete the user account form:"]}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsx)(n.li,{children:"Enter a username and password."}),"\n",(0,s.jsxs)(n.li,{children:["To activate the account immediately, select ",(0,s.jsx)(n.strong,{children:"Active"}),". Inactive users cannot sign in or access flows they created before becoming inactive."]}),"\n",(0,s.jsxs)(n.li,{children:["Deselect ",(0,s.jsx)(n.strong,{children:"Superuser"})," if you don't want the user to have full administrative privileges."]}),"\n",(0,s.jsxs)(n.li,{children:["Click ",(0,s.jsx)(n.strong,{children:"Save"}),". The new user appears in the ",(0,s.jsx)(n.strong,{children:"Admin Page"}),"."]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"To test the new user's access, sign out of Langflow, and then sign in with the new user's credentials."}),"\n",(0,s.jsxs)(n.p,{children:["Try to access the ",(0,s.jsx)(n.code,{children:"/admin"})," page.\nYou are redirected to the ",(0,s.jsx)(n.code,{children:"/flows"})," page if the new user isn't a superuser."]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"see-also",children:"See also"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"/environment-variables",children:"Langflow environment variables"})}),"\n"]})]})}function y(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(x,{...e})}):x(e)}function L(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}},11470:(e,n,t)=>{t.d(n,{A:()=>w});var o=t(96540),s=t(18215),r=t(23104),a=t(56347),i=t(205),l=t(57485),c=t(31682),d=t(70679);function h(e){return o.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,o.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function u(e){const{values:n,children:t}=e;return(0,o.useMemo)(()=>{const e=n??function(e){return h(e).map(({props:{value:e,label:n,attributes:t,default:o}})=>({value:e,label:n,attributes:t,default:o}))}(t);return function(e){const n=(0,c.XI)(e,(e,n)=>e.value===n.value);if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map(e=>e.value).join(", ")}" found in . Every value needs to be unique.`)}(e),e},[n,t])}function p({value:e,tabValues:n}){return n.some(n=>n.value===e)}function f({queryString:e=!1,groupId:n}){const t=(0,a.W6)(),s=function({queryString:e=!1,groupId:n}){if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:e,groupId:n});return[(0,l.aZ)(s),(0,o.useCallback)(e=>{if(!s)return;const n=new URLSearchParams(t.location.search);n.set(s,e),t.replace({...t.location,search:n.toString()})},[s,t])]}function g(e){const{defaultValue:n,queryString:t=!1,groupId:s}=e,r=u(e),[a,l]=(0,o.useState)(()=>function({defaultValue:e,tabValues:n}){if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(e){if(!p({value:e,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${n.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}const t=n.find(e=>e.default)??n[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:n,tabValues:r})),[c,h]=f({queryString:t,groupId:s}),[g,x]=function({groupId:e}){const n=function(e){return e?`docusaurus.tab.${e}`:null}(e),[t,s]=(0,d.Dv)(n);return[t,(0,o.useCallback)(e=>{n&&s.set(e)},[n,s])]}({groupId:s}),y=(()=>{const e=c??g;return p({value:e,tabValues:r})?e:null})();(0,i.A)(()=>{y&&l(y)},[y]);return{selectedValue:a,selectValue:(0,o.useCallback)(e=>{if(!p({value:e,tabValues:r}))throw new Error(`Can't select invalid tab value=${e}`);l(e),h(e),x(e)},[h,x,r]),tabValues:r}}var x=t(92303);const y={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var L=t(74848);function j({className:e,block:n,selectedValue:t,selectValue:o,tabValues:a}){const i=[],{blockElementScrollPositionUntilNextRender:l}=(0,r.a_)(),c=e=>{const n=e.currentTarget,s=i.indexOf(n),r=a[s].value;r!==t&&(l(n),o(r))},d=e=>{let n=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const t=i.indexOf(e.currentTarget)+1;n=i[t]??i[0];break}case"ArrowLeft":{const t=i.indexOf(e.currentTarget)-1;n=i[t]??i[i.length-1];break}}n?.focus()};return(0,L.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.A)("tabs",{"tabs--block":n},e),children:a.map(({value:e,label:n,attributes:o})=>(0,L.jsx)("li",{role:"tab",tabIndex:t===e?0:-1,"aria-selected":t===e,ref:e=>{i.push(e)},onKeyDown:d,onClick:c,...o,className:(0,s.A)("tabs__item",y.tabItem,o?.className,{"tabs__item--active":t===e}),children:n??e},e))})}function m({lazy:e,children:n,selectedValue:t}){const r=(Array.isArray(n)?n:[n]).filter(Boolean);if(e){const e=r.find(e=>e.props.value===t);return e?(0,o.cloneElement)(e,{className:(0,s.A)("margin-top--md",e.props.className)}):null}return(0,L.jsx)("div",{className:"margin-top--md",children:r.map((e,n)=>(0,o.cloneElement)(e,{key:n,hidden:e.props.value!==t}))})}function v(e){const n=g(e);return(0,L.jsxs)("div",{className:(0,s.A)("tabs-container",y.tabList),children:[(0,L.jsx)(j,{...n,...e}),(0,L.jsx)(m,{...n,...e})]})}function w(e){const n=(0,x.A)();return(0,L.jsx)(v,{...e,children:h(e.children)},String(n))}},17886:(e,n,t)=>{t.d(n,{A:()=>r});t(96540);var o=t(64058),s=t(74848);function r({name:e,...n}){const t=o[e];return t?(0,s.jsx)(t,{...n}):null}},19365:(e,n,t)=>{t.d(n,{A:()=>a});t(96540);var o=t(18215);const s={tabItem:"tabItem_Ymn6"};var r=t(74848);function a({children:e,hidden:n,className:t}){return(0,r.jsx)("div",{role:"tabpanel",className:(0,o.A)(s.tabItem,t),hidden:n,children:e})}}}]); \ No newline at end of file diff --git a/assets/js/393c45a3.627c7076.js b/assets/js/393c45a3.627c7076.js deleted file mode 100644 index 683ed25001..0000000000 --- a/assets/js/393c45a3.627c7076.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[692],{10734:(e,n,t)=>{t.r(n),t.d(n,{CH:()=>p,assets:()=>u,chCodeConfig:()=>f,contentTitle:()=>h,default:()=>x,frontMatter:()=>d,metadata:()=>o,toc:()=>g});const o=JSON.parse('{"id":"Configuration/api-keys-and-authentication","title":"API keys and authentication","description":"Never expose Langflow ports directly to the internet without proper security measures.","source":"@site/docs/Configuration/api-keys-and-authentication.mdx","sourceDirName":"Configuration","slug":"/api-keys-and-authentication","permalink":"/api-keys-and-authentication","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"API keys and authentication","slug":"/api-keys-and-authentication"},"sidebar":"docs","previous":{"title":"Connect an Astra DB MCP server to Langflow","permalink":"/mcp-component-astra"},"next":{"title":"Install custom dependencies","permalink":"/install-custom-dependencies"}}');var s=t(74848),r=t(28453),a=t(24754),i=t(11470),l=t(19365),c=t(17886);const d={title:"API keys and authentication",slug:"/api-keys-and-authentication"},h=void 0,u={},p={annotations:a.hk,Code:a.Cy},f={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},g=[{value:"Langflow API keys",id:"langflow-api-keys",level:2},{value:"Langflow API key permissions",id:"langflow-api-key-permissions",level:3},{value:"Create a Langflow API key",id:"create-a-langflow-api-key",level:3},{value:"Use a Langflow API key",id:"use-a-langflow-api-key",level:3},{value:"Track API key usage",id:"track-api-key-usage",level:3},{value:"Revoke an API key",id:"revoke-an-api-key",level:3},{value:"Component API keys",id:"component-api-keys",level:2},{value:"Authentication environment variables",id:"authentication-environment-variables",level:2},{value:"LANGFLOW_AUTO_LOGIN",id:"langflow-auto-login",level:3},{value:"Default authentication enforcement and LANGFLOW_SKIP_AUTH_AUTO_LOGIN",id:"langflow-skip-auth-auto-login",level:4},{value:"LANGFLOW_ENABLE_SUPERUSER_CLI",id:"langflow-enable-superuser-cli",level:3},{value:"LANGFLOW_SUPERUSER and LANGFLOW_SUPERUSER_PASSWORD",id:"langflow-superuser",level:3},{value:"LANGFLOW_SECRET_KEY",id:"langflow-secret-key",level:3},{value:"LANGFLOW_NEW_USER_IS_ACTIVE",id:"langflow-new-user-is-active",level:3},{value:"LANGFLOW_CORS_*",id:"cors-configuration-for-authentication",level:3},{value:"Start a Langflow server with authentication enabled",id:"start-a-langflow-server-with-authentication-enabled",level:2},{value:"Start the Langflow server",id:"start-the-langflow-server",level:3},{value:"Manage users as an administrator",id:"manage-users-as-an-administrator",level:3},{value:"See also",id:"see-also",level:2}];function y(e){const n={a:"a",admonition:"admonition",code:"code",em:"em",h2:"h2",h3:"h3",h4:"h4",li:"li",ol:"ol",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,r.R)(),...e.components},{Details:t}=n;return p||L("CH",!1),p.Code||L("CH.Code",!0),t||L("Details",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n","\n",(0,s.jsx)(n.admonition,{type:"warning",children:(0,s.jsxs)(n.p,{children:["Never expose Langflow ports directly to the internet without proper security measures.\nSet ",(0,s.jsx)(n.code,{children:"LANGFLOW_AUTO_LOGIN=False"}),", use a non-default ",(0,s.jsx)(n.code,{children:"LANGFLOW_SECRET_KEY"}),", and deploy your Langflow server behind a reverse proxy with authentication enabled.\nFor more information, see ",(0,s.jsx)(n.a,{href:"#start-a-langflow-server-with-authentication-enabled",children:"Start a Langflow server with authentication enabled"}),"."]})}),"\n",(0,s.jsx)(n.p,{children:"Authentication credentials help prevent unauthorized access to your Langflow server, flows, and services connected through components."}),"\n",(0,s.jsx)(n.p,{children:"There are three types of credentials that you use in Langflow:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.a,{href:"#langflow-api-keys",children:"Langflow API keys"}),": For authentication with the Langflow API and authorizing server-side Langflow actions like running flows and uploading files."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.a,{href:"#component-api-keys",children:"Component API keys"}),": For authentication between Langflow and a service connected through a component, such as a model provider or third-party API."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.a,{href:"#authentication-environment-variables",children:"Authentication environment variables"}),": These environment variables configure how Langflow handles user authentication and authorization."]}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"langflow-api-keys",children:"Langflow API keys"}),"\n",(0,s.jsx)(n.p,{children:"You can use Langflow API keys to interact with Langflow programmatically."}),"\n",(0,s.jsxs)(n.p,{children:["By default, most Langflow API endpoints, such as ",(0,s.jsx)(n.code,{children:"/v1/run/$FLOW_ID"}),", require authentication with a Langflow API key.\nTo require API key authentication for flow webhook endpoints, use the ",(0,s.jsx)(n.a,{href:"/webhook#require-authentication-for-webhooks",children:(0,s.jsx)(n.code,{children:"LANGFLOW_WEBHOOK_AUTH_ENABLE"})})," environment variable.\nTo configure authentication for Langflow MCP servers, see ",(0,s.jsx)(n.a,{href:"/mcp-server",children:"Use Langflow as an MCP server"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"langflow-api-key-permissions",children:"Langflow API key permissions"}),"\n",(0,s.jsx)(n.p,{children:"A Langflow API key adopts the privileges of the user who created it.\nThis means that API keys you create have the same permissions and access that you do, including access to your flows, components, and Langflow database.\nA Langflow API key cannot be used to access resources outside of your own Langflow server."}),"\n",(0,s.jsx)(n.p,{children:"In single-user environments, you are always a superuser, and your Langflow API keys always have superuser privileges."}),"\n",(0,s.jsxs)(n.p,{children:["In multi-user environments, users who aren't superusers cannot use their API keys to access other users' resources.\nYou must ",(0,s.jsx)(n.a,{href:"#start-a-langflow-server-with-authentication-enabled",children:"start your Langflow server with authentication enabled"})," to allow user management and creation of non-superuser accounts."]}),"\n",(0,s.jsx)(n.h3,{id:"create-a-langflow-api-key",children:"Create a Langflow API key"}),"\n",(0,s.jsxs)(n.p,{children:["You can generate a Langflow API key in your Langflow ",(0,s.jsx)(n.strong,{children:"Settings"})," or with the Langflow CLI."]}),"\n",(0,s.jsxs)(n.p,{children:["The CLI option is required if your Langflow server is running in ",(0,s.jsx)(n.code,{children:"--backend-only"})," mode."]}),"\n",(0,s.jsxs)(i.A,{children:[(0,s.jsx)(l.A,{value:"settings",label:"Langflow Settings",default:!0,children:(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["In the Langflow header, click your profile icon, and then select ",(0,s.jsx)(n.strong,{children:"Settings"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:["Click ",(0,s.jsx)(n.strong,{children:"Langflow API Keys"}),", and then click ",(0,s.jsx)(n.strong,{children:"Add New"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:["Name your key, and then click ",(0,s.jsx)(n.strong,{children:"Create API Key"}),"."]}),"\n",(0,s.jsx)(n.li,{children:"Copy the API key and store it securely."}),"\n"]})}),(0,s.jsxs)(l.A,{value:"Langflow CLI",label:"Langflow CLI",children:[(0,s.jsxs)(n.p,{children:["If you're serving your flow with ",(0,s.jsx)(n.code,{children:"--backend-only=true"}),", you can't create API keys in your Langflow ",(0,s.jsx)(n.strong,{children:"Settings"})," because the frontend isn't running.\nIn this case, you must create API keys with the Langflow CLI."]}),(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Recommended: ",(0,s.jsx)(n.a,{href:"#start-a-langflow-server-with-authentication-enabled",children:"Start your Langflow server with authentication enabled"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["The Langflow team recommends enabling authentication for security reasons to prevent unauthorized creation of API keys and superusers, especially in production environments.\nIf authentication isn't enabled (",(0,s.jsx)(n.code,{children:"LANGFLOW_AUTO_LOGIN=True"}),"), all users are effectively superusers, and they can create API keys with the Langflow CLI."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Create an API key with ",(0,s.jsx)(n.a,{href:"/configuration-cli#langflow-api-key",children:(0,s.jsx)(n.code,{children:"langflow api-key"})}),":"]}),"\n",(0,s.jsx)(p.Code,{codeConfig:f,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"uv ",props:{style:{color:"#FFA657"}}},{content:"run langflow api-key",props:{style:{color:"#A5D6FF"}}}]}],lang:"shell"},annotations:[]}]}),"\n",(0,s.jsx)(n.p,{children:"All API keys created with the Langflow CLI have superuser privileges because the command requires superuser authentication, and Langflow API keys adopt the privileges of the user who created them."}),"\n"]}),"\n"]})]})]}),"\n",(0,s.jsx)(n.h3,{id:"use-a-langflow-api-key",children:"Use a Langflow API key"}),"\n",(0,s.jsxs)(n.p,{children:["To authenticate Langflow API requests, pass your Langflow API key an ",(0,s.jsx)(n.code,{children:"x-api-key"})," header or query parameter."]}),"\n",(0,s.jsxs)(i.A,{children:[(0,s.jsx)(l.A,{value:"header",label:"HTTP header",default:!0,children:(0,s.jsx)(p.Code,{codeConfig:f,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:"POST ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:' "http://',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_SERVER_ADDRESS",props:{style:{color:"#C9D1D9"}}},{content:"/api/v1/run/",props:{style:{color:"#A5D6FF"}}},{content:"$FLOW_ID",props:{style:{color:"#C9D1D9"}}},{content:'?stream=false" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"Content-Type: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"x-api-key: ',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -d ",props:{style:{color:"#79C0FF"}}},{content:'\'{"inputs": {"text":""}, "tweaks": {}}\'',props:{style:{color:"#A5D6FF"}}}]}],lang:"shell"},annotations:[]}]})}),(0,s.jsx)(l.A,{value:"parameter",label:"Query parameter",children:(0,s.jsx)(p.Code,{codeConfig:f,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:"POST ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:' "http://',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_SERVER_ADDRESS",props:{style:{color:"#C9D1D9"}}},{content:"/api/v1/run/",props:{style:{color:"#A5D6FF"}}},{content:"$FLOW_ID",props:{style:{color:"#C9D1D9"}}},{content:"?x-api-key=",props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"Content-Type: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -d ",props:{style:{color:"#79C0FF"}}},{content:'\'{"inputs": {"text":""}, "tweaks": {}}\'',props:{style:{color:"#A5D6FF"}}}]}],lang:"shell"},annotations:[]}]})})]}),"\n",(0,s.jsxs)(n.p,{children:["For more information about forming Langflow API requests, see ",(0,s.jsx)(n.a,{href:"/api-reference-api-examples",children:"Get started with the Langflow API"})," and ",(0,s.jsx)(n.a,{href:"/concepts-publish",children:"Trigger flows with the Langflow API"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"track-api-key-usage",children:"Track API key usage"}),"\n",(0,s.jsxs)(n.p,{children:["By default, Langflow tracks API key usage through ",(0,s.jsx)(n.code,{children:"total_uses"})," and ",(0,s.jsx)(n.code,{children:"last_used_at"})," records in your ",(0,s.jsx)(n.a,{href:"/memory",children:"Langflow database"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["To disable API key tracking, set ",(0,s.jsx)(n.code,{children:"LANGFLOW_DISABLE_TRACK_APIKEY_USAGE=True"})," in your ",(0,s.jsx)(n.a,{href:"/environment-variables",children:"Langflow environment variables"}),".\nThis can help avoid database contention during periods of high concurrency."]}),"\n",(0,s.jsx)(n.h3,{id:"revoke-an-api-key",children:"Revoke an API key"}),"\n",(0,s.jsx)(n.p,{children:"To revoke and delete an API key, do the following:"}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["In the Langflow header, click your profile icon, and then select ",(0,s.jsx)(n.strong,{children:"Settings"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:["Click ",(0,s.jsx)(n.strong,{children:"Langflow API Keys"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:["Select the keys you want to delete, and then click ",(0,s.jsx)(c.A,{name:"Trash2","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Delete"}),"."]}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:"This action immediately invalidates the key and prevents it from being used again."}),"\n",(0,s.jsx)(n.h2,{id:"component-api-keys",children:"Component API keys"}),"\n",(0,s.jsx)(n.p,{children:"Component API keys authorize access to external services that are called by components in your flows, such as model providers, databases, or third-party APIs.\nThese aren't Langflow API keys or general application credentials."}),"\n",(0,s.jsxs)(n.p,{children:["In Langflow, you can store component API keys in global variables in your ",(0,s.jsx)(n.strong,{children:"Settings"})," or import them from your runtime environment.\nFor more information, see ",(0,s.jsx)(n.a,{href:"/configuration-global-variables",children:"Global variables"}),"."]}),"\n",(0,s.jsx)(n.p,{children:"You create and manage component API keys within the service provider's platform.\nLangflow only stores the encrypted key value or a secure reference to a key stored elsewhere; it doesn't manage the actual credentials at the source.\nThis means that deleting a global variable from Langflow doesn't delete or invalidate the actual API key in the service provider's system.\nYou must delete or rotate component API keys directly using the service provider's interface or API."}),"\n",(0,s.jsxs)(n.p,{children:["For added security, you can set ",(0,s.jsx)(n.code,{children:"LANGFLOW_REMOVE_API_KEYS=True"})," to omit API keys and tokens from flow data in your ",(0,s.jsx)(n.a,{href:"/memory",children:"Langflow database"}),".\nAdditionally, when ",(0,s.jsx)(n.a,{href:"/concepts-flows-import",children:"exporting flows"}),", you can choose to omit API keys from the exported flow JSON."]}),"\n",(0,s.jsx)(n.h2,{id:"authentication-environment-variables",children:"Authentication environment variables"}),"\n",(0,s.jsx)(n.p,{children:"This section describes the available authentication configuration variables."}),"\n",(0,s.jsxs)(n.p,{children:["You can use the ",(0,s.jsx)(n.a,{href:"https://github.com/langflow-ai/langflow/blob/main/.env.example",children:(0,s.jsx)(n.code,{children:".env.example"})})," file in the Langflow repository as a template for your own ",(0,s.jsx)(n.code,{children:".env"})," file."]}),"\n",(0,s.jsx)(n.h3,{id:"langflow-auto-login",children:"LANGFLOW_AUTO_LOGIN"}),"\n",(0,s.jsx)(n.p,{children:"This variable controls whether authentication is required to access your Langflow server, including the visual editor, API, and Langflow CLI:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["If ",(0,s.jsx)(n.code,{children:"LANGFLOW_AUTO_LOGIN=False"}),", automatic login is disabled. Users must sign in to the visual editor, authenticate as a superuser to run certain Langflow CLI commands, and use a Langflow API key for Langflow API requests.\nIf false, the Langflow team recommends that you also explicitly set ",(0,s.jsxs)(n.a,{href:"#langflow-superuser",children:[(0,s.jsx)(n.code,{children:"LANGFLOW_SUPERUSER"})," and ",(0,s.jsx)(n.code,{children:"LANGFLOW_SUPERUSER_PASSWORD"})]})," to avoid using the insecure default values."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["If ",(0,s.jsx)(n.code,{children:"LANGFLOW_AUTO_LOGIN=True"})," (default), all API requests require authentication with a Langflow API key, but the visual editor automatically signs in all users as superusers, and Langflow uses ",(0,s.jsx)(n.em,{children:"only"})," the default ",(0,s.jsx)(n.a,{href:"/api-keys-and-authentication#langflow-superuser",children:"superuser credentials"}),".\nAll users access the same visual editor environment without password protection, they can run all Langflow CLI commands as superusers, and Langflow automatically authenticates internal requests between the backend and frontend based on the users' superuser privileges.\nIf you also want to bypass authentication for Langflow API requests in addition to other bypassed authentication, see ",(0,s.jsx)(n.a,{href:"/api-keys-and-authentication#langflow-skip-auth-auto-login",children:(0,s.jsx)(n.code,{children:"LANGFLOW_SKIP_AUTH_AUTO_LOGIN"})}),"."]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["Langflow doesn't allow users to simultaneously edit the same flow in real time.\nIf two users edit the same flow, Langflow saves only the work of the most recent editor based on the state of that user's ",(0,s.jsx)(n.a,{href:"/concepts-overview#workspace",children:"workspace"}),". Any changes made by the other user in the interim are overwritten."]}),"\n",(0,s.jsx)(n.h4,{id:"langflow-skip-auth-auto-login",children:"Default authentication enforcement and LANGFLOW_SKIP_AUTH_AUTO_LOGIN"}),"\n",(0,s.jsxs)(n.p,{children:["In Langflow version 1.6, the default settings are ",(0,s.jsx)(n.code,{children:"LANGFLOW_AUTO_LOGIN=True"})," and ",(0,s.jsx)(n.code,{children:"LANGFLOW_SKIP_AUTH_AUTO_LOGIN=False"}),".\nThis enforces authentication for API requests only, as explained in the preceding section."]}),"\n",(0,s.jsxs)(n.p,{children:["For temporary backwards compatibility, you can revert to the fully unauthenticated behavior from earlier versions by setting both variables to true.\nHowever, a future release will set ",(0,s.jsx)(n.code,{children:"LANGFLOW_AUTO_LOGIN=False"})," and remove ",(0,s.jsx)(n.code,{children:"LANGFLOW_SKIP_AUTH_AUTO_LOGIN"}),".\nAt that point, Langflow will strictly enforce API key authentication for API requests, and you can manually disable authentication for some features, like the visual editor, by setting ",(0,s.jsx)(n.code,{children:"LANGFLOW_AUTO_LOGIN=True"}),"."]}),"\n",(0,s.jsxs)(t,{children:[(0,s.jsx)("summary",{children:"Authentication enforcement in earlier versions"}),(0,s.jsxs)(n.p,{children:["Langflow version 1.5 was the first version that could enforce authentication for Langflow API requests, regardless of the value of ",(0,s.jsx)(n.code,{children:"LANGFLOW_AUTO_LOGIN"}),".\nAs a temporary bypass for backwards compatibility, this version added the ",(0,s.jsx)(n.code,{children:"LANGFLOW_SKIP_AUTH_AUTO_LOGIN"})," environment variable and set both variables to true by default to preserve the fully unauthenticated behavior from earlier versions.\nThis allowed users to upgrade to version 1.5 with no change in the authentication behavior."]}),(0,s.jsxs)(n.p,{children:["In Langflow versions earlier than 1.5, Langflow API requests didn't require authentication.\nAdditionally, the default setting of ",(0,s.jsx)(n.code,{children:"LANGFLOW_AUTO_LOGIN=True"})," automatically granted all users superuser privileges in the visual editor, and it allowed all users to run all Langflow CLI commands as superusers."]})]}),"\n",(0,s.jsx)(n.h3,{id:"langflow-enable-superuser-cli",children:"LANGFLOW_ENABLE_SUPERUSER_CLI"}),"\n",(0,s.jsxs)(n.p,{children:["Controls the availability of the ",(0,s.jsx)(n.code,{children:"langflow superuser"})," command in the Langflow CLI.\nThe default is true, but false is recommended to prevent unrestricted superuser creation.\nFor more information, see ",(0,s.jsx)(n.a,{href:"/configuration-cli#langflow-superuser",children:(0,s.jsx)(n.code,{children:"langflow superuser"})}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"langflow-superuser",children:"LANGFLOW_SUPERUSER and LANGFLOW_SUPERUSER_PASSWORD"}),"\n",(0,s.jsx)(n.p,{children:"These variables specify the username and password for the Langflow server's superuser."}),"\n",(0,s.jsx)(p.Code,{codeConfig:f,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"LANGFLOW_SUPERUSER=administrator",props:{}}]},{tokens:[{content:"LANGFLOW_SUPERUSER_PASSWORD=securepassword",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,s.jsxs)(n.p,{children:["They are required if ",(0,s.jsx)(n.code,{children:"LANGFLOW_AUTO_LOGIN=False"}),".\nOtherwise, they aren't relevant."]}),"\n",(0,s.jsxs)(n.p,{children:["When you ",(0,s.jsx)(n.a,{href:"#start-a-langflow-server-with-authentication-enabled",children:"start a Langflow server with authentication enabled"}),", if these variables are required but ",(0,s.jsx)(n.em,{children:"not"})," set, then Langflow uses the default values of ",(0,s.jsx)(n.code,{children:"langflow"})," and ",(0,s.jsx)(n.code,{children:"langflow"}),".\nThese defaults don't apply when using the Langflow CLI command ",(0,s.jsx)(n.a,{href:"/configuration-cli#langflow-superuser",children:(0,s.jsx)(n.code,{children:"langflow superuser"})}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"langflow-secret-key",children:"LANGFLOW_SECRET_KEY"}),"\n",(0,s.jsxs)(n.p,{children:["This environment variable stores a secret key used for encrypting sensitive data like API keys.\nLangflow uses the ",(0,s.jsx)(n.a,{href:"https://pypi.org/project/cryptography/",children:"Fernet"})," library for secret key encryption."]}),"\n",(0,s.jsx)(n.p,{children:"If no secret key is provided, Langflow automatically generates one."}),"\n",(0,s.jsx)(n.p,{children:"However, you should generate and explicitly set your own key in production environments.\nThis is particularly important for multi-instance deployments like Kubernetes to ensure consistent encryption across instances."}),"\n",(0,s.jsxs)(n.p,{children:["To generate a secret encryption key for ",(0,s.jsx)(n.code,{children:"LANGFLOW_SECRET_KEY"}),", do the following:"]}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Run the command to generate and copy a secret to the clipboard."}),"\n",(0,s.jsxs)(i.A,{children:[(0,s.jsx)(l.A,{value:"unix",label:"macOS or Linux",children:(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"macOS"}),": Generate a secret key and copy it to the clipboard:"]}),"\n",(0,s.jsx)(p.Code,{codeConfig:f,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"python3 ",props:{style:{color:"#FFA657"}}},{content:"-c ",props:{style:{color:"#79C0FF"}}},{content:"\"from secrets import token_urlsafe; print(f'LANGFLOW_SECRET_KEY={token_urlsafe(32)}')\" ",props:{style:{color:"#A5D6FF"}}},{content:"| ",props:{style:{color:"#FF7B72"}}},{content:"pbcopy",props:{style:{color:"#FFA657"}}}]}],lang:"bash"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Linux"}),": Generate a secret key and copy it to the clipboard:"]}),"\n",(0,s.jsx)(p.Code,{codeConfig:f,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"python3 ",props:{style:{color:"#FFA657"}}},{content:"-c ",props:{style:{color:"#79C0FF"}}},{content:"\"from secrets import token_urlsafe; print(f'LANGFLOW_SECRET_KEY={token_urlsafe(32)}')\" ",props:{style:{color:"#A5D6FF"}}},{content:"| ",props:{style:{color:"#FF7B72"}}},{content:"xclip ",props:{style:{color:"#FFA657"}}},{content:"-selection ",props:{style:{color:"#79C0FF"}}},{content:"clipboard",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Unix"}),": Generate a secret key and print it to the terminal to manually copy it:"]}),"\n",(0,s.jsx)(p.Code,{codeConfig:f,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"python3 ",props:{style:{color:"#FFA657"}}},{content:"-c ",props:{style:{color:"#79C0FF"}}},{content:"\"from secrets import token_urlsafe; print(f'LANGFLOW_SECRET_KEY={token_urlsafe(32)}')\"",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n"]}),"\n"]})}),(0,s.jsx)(l.A,{value:"windows",label:"Windows",children:(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Generate a secret key and copy it to the clipboard:"}),"\n",(0,s.jsx)(p.Code,{codeConfig:f,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"python ",props:{style:{color:"#FFA657"}}},{content:"-c ",props:{style:{color:"#79C0FF"}}},{content:"\"from secrets import token_urlsafe; print(f'LANGFLOW_SECRET_KEY={token_urlsafe(32)}')\"",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Generate a secret key and print it to the terminal to manually copy it:"}),"\n",(0,s.jsx)(p.Code,{codeConfig:f,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"# Or just print",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:"python ",props:{style:{color:"#FFA657"}}},{content:"-c ",props:{style:{color:"#79C0FF"}}},{content:"\"from secrets import token_urlsafe; print(f'LANGFLOW_SECRET_KEY={token_urlsafe(32)}')\"",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n"]}),"\n"]})})]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Paste the value into your ",(0,s.jsx)(n.code,{children:".env"})," file:"]}),"\n",(0,s.jsx)(p.Code,{codeConfig:f,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"LANGFLOW_SECRET_KEY=dBuu...2kM2_fb",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,s.jsxs)(n.p,{children:["If you're running Langflow on Docker, reference the ",(0,s.jsx)(n.code,{children:"LANGFLOW_SECRET_KEY"})," from your ",(0,s.jsx)(n.code,{children:".env"})," file in the ",(0,s.jsx)(n.code,{children:"docker-compose.yml"})," file like this:"]}),"\n",(0,s.jsx)(p.Code,{codeConfig:f,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"environment",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" - ",props:{style:{color:"#C9D1D9"}}},{content:"LANGFLOW_SECRET_KEY=${LANGFLOW_SECRET_KEY}",props:{style:{color:"#A5D6FF"}}}]}],lang:"yaml"},annotations:[]}]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"langflow-new-user-is-active",children:"LANGFLOW_NEW_USER_IS_ACTIVE"}),"\n",(0,s.jsxs)(n.p,{children:["When ",(0,s.jsx)(n.code,{children:"LANGFLOW_NEW_USER_IS_ACTIVE=False"})," (default), a superuser must explicitly activate a new user's account before they can sign in to the visual editor.\nThe superuser can also deactivate a user's account as needed."]}),"\n",(0,s.jsxs)(n.p,{children:["When ",(0,s.jsx)(n.code,{children:"LANGFLOW_NEW_USER_IS_ACTIVE=True"}),", new user accounts are automatically activated."]}),"\n",(0,s.jsx)(p.Code,{codeConfig:f,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"LANGFLOW_NEW_USER_IS_ACTIVE=False",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,s.jsxs)(n.p,{children:["Only superusers can manage user accounts for a Langflow server, but user management only matters if your server has authentication enabled.\nFor more information, see ",(0,s.jsx)(n.a,{href:"#start-a-langflow-server-with-authentication-enabled",children:"Start a Langflow server with authentication enabled"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"cors-configuration-for-authentication",children:"LANGFLOW_CORS_*"}),"\n",(0,s.jsxs)(n.p,{children:["Cross-Origin Resource Sharing (CORS) configuration controls how authentication credentials are handled when your Langflow frontend and backend are served from different origins.\nThe following ",(0,s.jsx)(n.code,{children:"LANGFLOW_CORS_*"})," environment variables are available:"]}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Variable"}),(0,s.jsx)(n.th,{children:"Format"}),(0,s.jsx)(n.th,{children:"Default"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"LANGFLOW_CORS_ALLOW_CREDENTIALS"})}),(0,s.jsx)(n.td,{children:"Boolean"}),(0,s.jsx)(n.td,{children:"True"}),(0,s.jsx)(n.td,{children:"Whether to allow credentials, such as cookies and authorization headers, in CORS requests."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"LANGFLOW_CORS_ALLOW_HEADERS"})}),(0,s.jsx)(n.td,{children:"List[String] or String"}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"*"})}),(0,s.jsxs)(n.td,{children:["The allowed headers for CORS requests. Provide a comma-separated list of headers or use ",(0,s.jsx)(n.code,{children:"*"})," to allow all headers."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"LANGFLOW_CORS_ALLOW_METHODS"})}),(0,s.jsx)(n.td,{children:"List[String] or String"}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"*"})}),(0,s.jsxs)(n.td,{children:["The allowed HTTP methods for CORS requests. Provide a comma-separated list of methods or use ",(0,s.jsx)(n.code,{children:"*"})," to allow all methods."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"LANGFLOW_CORS_ORIGINS"})}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"*"})}),(0,s.jsxs)(n.td,{children:["The allowed CORS origins. Provide a comma-separated list of origins or use ",(0,s.jsx)(n.code,{children:"*"})," for all origins."]})]})]})]}),"\n",(0,s.jsxs)(n.p,{children:["The default configuration enables CORS credentials and uses wildcards (",(0,s.jsx)(n.code,{children:"*"}),") to allow all origins, headers, and methods:"]}),"\n",(0,s.jsx)(p.Code,{codeConfig:f,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"LANGFLOW_CORS_ORIGINS=*",props:{}}]},{tokens:[{content:"LANGFLOW_CORS_ALLOW_CREDENTIALS=True",props:{}}]},{tokens:[{content:"LANGFLOW_CORS_ALLOW_HEADERS=*",props:{}}]},{tokens:[{content:"LANGFLOW_CORS_ALLOW_METHODS=*",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,s.jsxs)(n.admonition,{type:"danger",children:[(0,s.jsx)(n.p,{children:"Langflow's default CORS settings can be a security risk in production environments because any website can make requests to your Langflow API, and any website can include credentials in cross-origin requests, including authentication cookies and authorization headers."}),(0,s.jsxs)(n.p,{children:["In production deployments, specify exact origins in ",(0,s.jsx)(n.code,{children:"LANGFLOW_CORS_ORIGINS"}),".\nYou can also specify allowed headers and methods, if needed.\nFor example:"]}),(0,s.jsx)(p.Code,{codeConfig:f,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"LANGFLOW_CORS_ORIGINS=https://yourdomain.com,https://app.yourdomain.com",props:{}}]},{tokens:[{content:"LANGFLOW_CORS_ALLOW_CREDENTIALS=True",props:{}}]},{tokens:[{content:"LANGFLOW_CORS_ALLOW_HEADERS=Content-Type,Authorization",props:{}}]},{tokens:[{content:"LANGFLOW_CORS_ALLOW_METHODS=GET,POST,PUT",props:{}}]}],lang:"text"},annotations:[]}]})]}),"\n",(0,s.jsx)(n.h2,{id:"start-a-langflow-server-with-authentication-enabled",children:"Start a Langflow server with authentication enabled"}),"\n",(0,s.jsxs)(n.p,{children:["This section shows you how to use the ",(0,s.jsx)(n.a,{href:"/api-keys-and-authentication#authentication-environment-variables",children:"authentication environment variables"})," to deploy a Langflow server with authentication enabled.\nThis involves disabling automatic login, setting superuser credentials, generating a secret encryption key, and enabling user management."]}),"\n",(0,s.jsx)(n.p,{children:"This configuration is recommended for any deployment where Langflow is exposed to a shared or public network, or where multiple users access the same Langflow server."}),"\n",(0,s.jsxs)(n.p,{children:["With authentication enabled, all users must sign in to the visual editor with valid credentials, and API requests require authentication with a Langflow API key.\nAdditionally, you must sign in as a superuser to manage users and ",(0,s.jsx)(n.a,{href:"#create-a-langflow-api-key",children:"create a Langflow API key"})," with superuser privileges."]}),"\n",(0,s.jsx)(n.h3,{id:"start-the-langflow-server",children:"Start the Langflow server"}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Create a ",(0,s.jsx)(n.code,{children:".env"})," file with the following variables:"]}),"\n",(0,s.jsx)(p.Code,{codeConfig:f,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"LANGFLOW_AUTO_LOGIN=False",props:{}}]},{tokens:[{content:"LANGFLOW_SUPERUSER=",props:{}}]},{tokens:[{content:"LANGFLOW_SUPERUSER_PASSWORD=",props:{}}]},{tokens:[{content:"LANGFLOW_SECRET_KEY=",props:{}}]},{tokens:[{content:"LANGFLOW_NEW_USER_IS_ACTIVE=False",props:{}}]},{tokens:[{content:"LANGFLOW_ENABLE_SUPERUSER_CLI=False",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,s.jsxs)(n.p,{children:["Your ",(0,s.jsx)(n.code,{children:".env"})," file can have other environment variables.\nThis example focuses on authentication variables."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Set ",(0,s.jsx)(n.code,{children:"LANGFLOW_SUPERUSER"})," and ",(0,s.jsx)(n.code,{children:"LANGFLOW_SUPERUSER_PASSWORD"})," to your desired superuser credentials."]}),"\n",(0,s.jsxs)(n.p,{children:["For a one-time test, you can use basic credentials like ",(0,s.jsx)(n.code,{children:"administrator"})," and ",(0,s.jsx)(n.code,{children:"password"}),".\nStrong, securely-stored credentials are recommended in genuine development and production environments."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Recommended: Generate and set a ",(0,s.jsx)(n.code,{children:"LANGFLOW_SECRET_KEY"})," for encrypting sensitive data."]}),"\n",(0,s.jsx)(n.p,{children:"If you don't set a secret key, Langflow generates one automatically, but this isn't recommended for production environments."}),"\n",(0,s.jsxs)(n.p,{children:["For instructions on generating at setting a secret key, see ",(0,s.jsx)(n.a,{href:"#langflow-secret-key",children:(0,s.jsx)(n.code,{children:"LANGFLOW_SECRET_KEY"})}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Save your ",(0,s.jsx)(n.code,{children:".env"})," file with the populated variables. For example:"]}),"\n",(0,s.jsx)(p.Code,{codeConfig:f,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"LANGFLOW_AUTO_LOGIN=False",props:{}}]},{tokens:[{content:"LANGFLOW_SUPERUSER=administrator",props:{}}]},{tokens:[{content:"LANGFLOW_SUPERUSER_PASSWORD=securepassword",props:{}}]},{tokens:[{content:"LANGFLOW_SECRET_KEY=dBuu...2kM2_fb",props:{}}]},{tokens:[{content:"LANGFLOW_NEW_USER_IS_ACTIVE=False",props:{}}]},{tokens:[{content:"LANGFLOW_ENABLE_SUPERUSER_CLI=False",props:{}}]}],lang:"text"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Start Langflow with the configuration from your ",(0,s.jsx)(n.code,{children:".env"})," file:"]}),"\n",(0,s.jsx)(p.Code,{codeConfig:f,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"uv run langflow run --env-file .env",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,s.jsxs)(n.p,{children:["Starting Langflow with a ",(0,s.jsx)(n.code,{children:".env"})," file automatically authenticates you as the superuser set in ",(0,s.jsx)(n.code,{children:"LANGFLOW_SUPERUSER"})," and ",(0,s.jsx)(n.code,{children:"LANGFLOW_SUPERUSER_PASSWORD"}),".\nIf you don't explicitly set these variables, the default values are ",(0,s.jsx)(n.code,{children:"langflow"})," and ",(0,s.jsx)(n.code,{children:"langflow"})," for system auto-login."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Verify the server is running. The default location is ",(0,s.jsx)(n.code,{children:"http://localhost:7860"}),"."]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:"Next, you can add users to your Langflow server to collaborate with others on flows."}),"\n",(0,s.jsx)(n.h3,{id:"manage-users-as-an-administrator",children:"Manage users as an administrator"}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["To complete your first-time login as a superuser, go to ",(0,s.jsx)(n.code,{children:"http://localhost:7860/login"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["If you aren't using the default location, replace ",(0,s.jsx)(n.code,{children:"localhost:7860"})," with your server's address."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Log in with the superuser credentials you set in your ",(0,s.jsx)(n.code,{children:".env"})," (",(0,s.jsx)(n.code,{children:"LANGFLOW_SUPERUSER"})," and ",(0,s.jsx)(n.code,{children:"LANGFLOW_SUPERUSER_PASSWORD"}),")."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["To manage users on your server, navigate to ",(0,s.jsx)(n.code,{children:"/admin"}),", such as ",(0,s.jsx)(n.code,{children:"http://localhost:7860/admin"}),", click your profile icon, and then click ",(0,s.jsx)(n.strong,{children:"Admin Page"}),"."]}),"\n",(0,s.jsx)(n.p,{children:"As a superuser, you can add users, set permissions, reset passwords, and delete accounts."}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["To add a user, click ",(0,s.jsx)(n.strong,{children:"New User"}),", and then complete the user account form:"]}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsx)(n.li,{children:"Enter a username and password."}),"\n",(0,s.jsxs)(n.li,{children:["To activate the account immediately, select ",(0,s.jsx)(n.strong,{children:"Active"}),". Inactive users cannot sign in or access flows they created before becoming inactive."]}),"\n",(0,s.jsxs)(n.li,{children:["Deselect ",(0,s.jsx)(n.strong,{children:"Superuser"})," if you don't want the user to have full administrative privileges."]}),"\n",(0,s.jsxs)(n.li,{children:["Click ",(0,s.jsx)(n.strong,{children:"Save"}),". The new user appears in the ",(0,s.jsx)(n.strong,{children:"Admin Page"}),"."]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"To test the new user's access, sign out of Langflow, and then sign in with the new user's credentials."}),"\n",(0,s.jsxs)(n.p,{children:["Try to access the ",(0,s.jsx)(n.code,{children:"/admin"})," page.\nYou are redirected to the ",(0,s.jsx)(n.code,{children:"/flows"})," page if the new user isn't a superuser."]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"see-also",children:"See also"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"/environment-variables",children:"Langflow environment variables"})}),"\n"]})]})}function x(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(y,{...e})}):y(e)}function L(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}},11470:(e,n,t)=>{t.d(n,{A:()=>w});var o=t(96540),s=t(18215),r=t(23104),a=t(56347),i=t(205),l=t(57485),c=t(31682),d=t(70679);function h(e){return o.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,o.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function u(e){const{values:n,children:t}=e;return(0,o.useMemo)(()=>{const e=n??function(e){return h(e).map(({props:{value:e,label:n,attributes:t,default:o}})=>({value:e,label:n,attributes:t,default:o}))}(t);return function(e){const n=(0,c.XI)(e,(e,n)=>e.value===n.value);if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map(e=>e.value).join(", ")}" found in . Every value needs to be unique.`)}(e),e},[n,t])}function p({value:e,tabValues:n}){return n.some(n=>n.value===e)}function f({queryString:e=!1,groupId:n}){const t=(0,a.W6)(),s=function({queryString:e=!1,groupId:n}){if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:e,groupId:n});return[(0,l.aZ)(s),(0,o.useCallback)(e=>{if(!s)return;const n=new URLSearchParams(t.location.search);n.set(s,e),t.replace({...t.location,search:n.toString()})},[s,t])]}function g(e){const{defaultValue:n,queryString:t=!1,groupId:s}=e,r=u(e),[a,l]=(0,o.useState)(()=>function({defaultValue:e,tabValues:n}){if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(e){if(!p({value:e,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${n.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}const t=n.find(e=>e.default)??n[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:n,tabValues:r})),[c,h]=f({queryString:t,groupId:s}),[g,y]=function({groupId:e}){const n=function(e){return e?`docusaurus.tab.${e}`:null}(e),[t,s]=(0,d.Dv)(n);return[t,(0,o.useCallback)(e=>{n&&s.set(e)},[n,s])]}({groupId:s}),x=(()=>{const e=c??g;return p({value:e,tabValues:r})?e:null})();(0,i.A)(()=>{x&&l(x)},[x]);return{selectedValue:a,selectValue:(0,o.useCallback)(e=>{if(!p({value:e,tabValues:r}))throw new Error(`Can't select invalid tab value=${e}`);l(e),h(e),y(e)},[h,y,r]),tabValues:r}}var y=t(92303);const x={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var L=t(74848);function j({className:e,block:n,selectedValue:t,selectValue:o,tabValues:a}){const i=[],{blockElementScrollPositionUntilNextRender:l}=(0,r.a_)(),c=e=>{const n=e.currentTarget,s=i.indexOf(n),r=a[s].value;r!==t&&(l(n),o(r))},d=e=>{let n=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const t=i.indexOf(e.currentTarget)+1;n=i[t]??i[0];break}case"ArrowLeft":{const t=i.indexOf(e.currentTarget)-1;n=i[t]??i[i.length-1];break}}n?.focus()};return(0,L.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.A)("tabs",{"tabs--block":n},e),children:a.map(({value:e,label:n,attributes:o})=>(0,L.jsx)("li",{role:"tab",tabIndex:t===e?0:-1,"aria-selected":t===e,ref:e=>{i.push(e)},onKeyDown:d,onClick:c,...o,className:(0,s.A)("tabs__item",x.tabItem,o?.className,{"tabs__item--active":t===e}),children:n??e},e))})}function m({lazy:e,children:n,selectedValue:t}){const r=(Array.isArray(n)?n:[n]).filter(Boolean);if(e){const e=r.find(e=>e.props.value===t);return e?(0,o.cloneElement)(e,{className:(0,s.A)("margin-top--md",e.props.className)}):null}return(0,L.jsx)("div",{className:"margin-top--md",children:r.map((e,n)=>(0,o.cloneElement)(e,{key:n,hidden:e.props.value!==t}))})}function v(e){const n=g(e);return(0,L.jsxs)("div",{className:(0,s.A)("tabs-container",x.tabList),children:[(0,L.jsx)(j,{...n,...e}),(0,L.jsx)(m,{...n,...e})]})}function w(e){const n=(0,y.A)();return(0,L.jsx)(v,{...e,children:h(e.children)},String(n))}},17886:(e,n,t)=>{t.d(n,{A:()=>r});t(96540);var o=t(64058),s=t(74848);function r({name:e,...n}){const t=o[e];return t?(0,s.jsx)(t,{...n}):null}},19365:(e,n,t)=>{t.d(n,{A:()=>a});t(96540);var o=t(18215);const s={tabItem:"tabItem_Ymn6"};var r=t(74848);function a({children:e,hidden:n,className:t}){return(0,r.jsx)("div",{role:"tabpanel",className:(0,o.A)(s.tabItem,t),hidden:n,children:e})}}}]); \ No newline at end of file diff --git a/assets/js/44691977.aa3ea97b.js b/assets/js/44691977.400afc77.js similarity index 70% rename from assets/js/44691977.aa3ea97b.js rename to assets/js/44691977.400afc77.js index 0c09226913..5aeb8f0917 100644 --- a/assets/js/44691977.aa3ea97b.js +++ b/assets/js/44691977.400afc77.js @@ -1 +1 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[4876],{17886:(e,n,t)=>{t.d(n,{A:()=>o});t(96540);var r=t(64058),s=t(74848);function o({name:e,...n}){const t=r[e];return t?(0,s.jsx)(t,{...n}):null}},31929:(e,n,t)=>{t.d(n,{Ay:()=>a,RM:()=>d});var r=t(74848),s=t(28453),o=t(17886);const d=[];function i(e){const n={a:"a",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,r.jsxs)(n.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,r.jsx)(o.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Controls"})," in the ",(0,r.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function a(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(i,{...e})}):i(e)}},84753:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>l,default:()=>u,frontMatter:()=>a,metadata:()=>r,toc:()=>p});const r=JSON.parse('{"id":"Components/bundles-openrouter","title":"OpenRouter","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/bundles-openrouter.mdx","sourceDirName":"Components","slug":"/bundles-openrouter","permalink":"/bundles-openrouter","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"OpenRouter","slug":"/bundles-openrouter"},"sidebar":"docs","previous":{"title":"OpenAI","permalink":"/bundles-openai"},"next":{"title":"Perplexity","permalink":"/bundles-perplexity"}}');var s=t(74848),o=t(28453),d=t(17886),i=t(31929);const a={title:"OpenRouter",slug:"/bundles-openrouter"},l=void 0,c={},p=[{value:"OpenRouter text generation",id:"openrouter-text-generation",level:2},{value:"OpenRouter text generation parameters",id:"openrouter-text-generation-parameters",level:3},...i.RM];function h(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,o.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:[(0,s.jsx)(d.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(n.a,{href:"/components-bundle-components",children:(0,s.jsx)(n.strong,{children:"Bundles"})})," contain custom components that support specific third-party integrations with Langflow."]}),"\n",(0,s.jsxs)(n.p,{children:["This page describes the components that are available in the ",(0,s.jsx)(n.strong,{children:"OpenRouter"})," bundle."]}),"\n",(0,s.jsxs)(n.p,{children:["For more information about OpenRouter features and functionality used by OpenRouter components, see the ",(0,s.jsx)(n.a,{href:"https://openrouter.ai/docs",children:"OpenRouter documentation"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"openrouter-text-generation",children:"OpenRouter text generation"}),"\n",(0,s.jsx)(n.p,{children:"This component generates text using OpenRouter's unified API for multiple AI models from different providers."}),"\n",(0,s.jsxs)(n.p,{children:["It can output either a ",(0,s.jsx)(n.strong,{children:"Model Response"})," (",(0,s.jsx)(n.a,{href:"/data-types#message",children:(0,s.jsx)(n.code,{children:"Message"})}),") or a ",(0,s.jsx)(n.strong,{children:"Language Model"})," (",(0,s.jsx)(n.a,{href:"/data-types#languagemodel",children:(0,s.jsx)(n.code,{children:"LanguageModel"})}),")."]}),"\n",(0,s.jsxs)(n.p,{children:["Use the ",(0,s.jsx)(n.strong,{children:"Language Model"})," output when you want to use an OpenRouter model as the LLM for another LLM-driven component, such as an ",(0,s.jsx)(n.strong,{children:"Agent"})," or ",(0,s.jsx)(n.strong,{children:"Smart Function"})," component."]}),"\n",(0,s.jsxs)(n.p,{children:["For more information, see ",(0,s.jsx)(n.a,{href:"/components-models",children:"Language model components"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"openrouter-text-generation-parameters",children:"OpenRouter text generation parameters"}),"\n",(0,s.jsx)(i.Ay,{}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"api_key"}),(0,s.jsx)(n.td,{children:"SecretString"}),(0,s.jsx)(n.td,{children:"Input parameter. Your OpenRouter API key for authentication."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"site_url"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. Your site URL for OpenRouter rankings (advanced)."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"app_name"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. Your app name for OpenRouter rankings (advanced)."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"provider"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. The AI model provider to use."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"model_name"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. The specific model to use for chat completion."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"temperature"}),(0,s.jsx)(n.td,{children:"Float"}),(0,s.jsx)(n.td,{children:"Input parameter. Controls randomness in the output. Range: [0.0, 2.0]. Default: 0.7."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"max_tokens"}),(0,s.jsx)(n.td,{children:"Integer"}),(0,s.jsx)(n.td,{children:"Input parameter. The maximum number of tokens to generate (advanced)."})]})]})]})]})}function u(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(h,{...e})}):h(e)}}}]); \ No newline at end of file +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[4876],{17886:(e,n,t)=>{t.d(n,{A:()=>o});t(96540);var r=t(64058),s=t(74848);function o({name:e,...n}){const t=r[e];return t?(0,s.jsx)(t,{...n}):null}},31929:(e,n,t)=>{t.d(n,{Ay:()=>a,RM:()=>i});var r=t(74848),s=t(28453),o=t(17886);const i=[];function d(e){const n={a:"a",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,r.jsxs)(n.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,r.jsx)(o.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Controls"})," in the ",(0,r.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function a(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(d,{...e})}):d(e)}},84753:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>l,default:()=>u,frontMatter:()=>a,metadata:()=>r,toc:()=>p});const r=JSON.parse('{"id":"Components/bundles-openrouter","title":"OpenRouter","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/bundles-openrouter.mdx","sourceDirName":"Components","slug":"/bundles-openrouter","permalink":"/bundles-openrouter","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"OpenRouter","slug":"/bundles-openrouter"},"sidebar":"docs","previous":{"title":"OpenAI","permalink":"/bundles-openai"},"next":{"title":"Perplexity","permalink":"/bundles-perplexity"}}');var s=t(74848),o=t(28453),i=t(17886),d=t(31929);const a={title:"OpenRouter",slug:"/bundles-openrouter"},l=void 0,c={},p=[{value:"OpenRouter text generation",id:"openrouter-text-generation",level:2},{value:"OpenRouter text generation parameters",id:"openrouter-text-generation-parameters",level:3},...d.RM];function h(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,o.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:[(0,s.jsx)(i.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(n.a,{href:"/components-bundle-components",children:(0,s.jsx)(n.strong,{children:"Bundles"})})," contain custom components that support specific third-party integrations with Langflow."]}),"\n",(0,s.jsxs)(n.p,{children:["This page describes the components that are available in the ",(0,s.jsx)(n.strong,{children:"OpenRouter"})," bundle."]}),"\n",(0,s.jsxs)(n.p,{children:["For more information about OpenRouter features and functionality used by OpenRouter components, see the ",(0,s.jsx)(n.a,{href:"https://openrouter.ai/docs",children:"OpenRouter documentation"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"openrouter-text-generation",children:"OpenRouter text generation"}),"\n",(0,s.jsx)(n.p,{children:"This component generates text using OpenRouter's unified API for multiple AI models from different providers."}),"\n",(0,s.jsxs)(n.p,{children:["It can output either a ",(0,s.jsx)(n.strong,{children:"Model Response"})," (",(0,s.jsx)(n.a,{href:"/data-types#message",children:(0,s.jsx)(n.code,{children:"Message"})}),") or a ",(0,s.jsx)(n.strong,{children:"Language Model"})," (",(0,s.jsx)(n.a,{href:"/data-types#languagemodel",children:(0,s.jsx)(n.code,{children:"LanguageModel"})}),")."]}),"\n",(0,s.jsxs)(n.p,{children:["Use the ",(0,s.jsx)(n.strong,{children:"Language Model"})," output when you want to use an OpenRouter model as the LLM for another LLM-driven component, such as an ",(0,s.jsx)(n.strong,{children:"Agent"})," or ",(0,s.jsx)(n.strong,{children:"Smart Function"})," component."]}),"\n",(0,s.jsxs)(n.p,{children:["For more information, see ",(0,s.jsx)(n.a,{href:"/components-models",children:"Language model components"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"openrouter-text-generation-parameters",children:"OpenRouter text generation parameters"}),"\n",(0,s.jsx)(d.Ay,{}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"api_key"}),(0,s.jsx)(n.td,{children:"SecretString"}),(0,s.jsx)(n.td,{children:"Input parameter. Your OpenRouter API key for authentication."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"site_url"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. Your site URL for OpenRouter rankings."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"app_name"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. Your app name for OpenRouter rankings."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"provider"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. The AI model provider to use."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"model_name"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. The specific model to use for chat completion."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"temperature"}),(0,s.jsx)(n.td,{children:"Float"}),(0,s.jsx)(n.td,{children:"Input parameter. Controls randomness in the output. Range: [0.0, 2.0]. Default: 0.7."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"max_tokens"}),(0,s.jsx)(n.td,{children:"Integer"}),(0,s.jsx)(n.td,{children:"Input parameter. The maximum number of tokens to generate."})]})]})]})]})}function u(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(h,{...e})}):h(e)}}}]); \ No newline at end of file diff --git a/assets/js/453ae64a.14e21760.js b/assets/js/453ae64a.14e21760.js new file mode 100644 index 0000000000..a0146878e2 --- /dev/null +++ b/assets/js/453ae64a.14e21760.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[9610],{6137:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>l,default:()=>m,frontMatter:()=>a,metadata:()=>s,toc:()=>h});const s=JSON.parse('{"id":"Components/bundles-ibm","title":"IBM","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/bundles-ibm.mdx","sourceDirName":"Components","slug":"/bundles-ibm","permalink":"/bundles-ibm","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"IBM","slug":"/bundles-ibm"},"sidebar":"docs","previous":{"title":"Hugging Face","permalink":"/bundles-huggingface"},"next":{"title":"Icosa Computing","permalink":"/bundles-icosacomputing"}}');var i=t(74848),d=t(28453),o=t(17886),r=t(31929);const a={title:"IBM",slug:"/bundles-ibm"},l=void 0,c={},h=[{value:"IBM watsonx.ai",id:"ibm-watsonxai",level:2},{value:"IBM watsonx.ai parameters",id:"ibm-watsonxai-parameters",level:3},...r.RM,{value:"IBM watsonx.ai output",id:"ibm-watsonxai-output",level:3},{value:"IBM watsonx.ai Embeddings",id:"ibm-watsonxai-embeddings",level:2},{value:"IBM watsonx.ai Embeddings parameters",id:"ibm-watsonxai-embeddings-parameters",level:3},...r.RM,{value:"Default embedding models",id:"default-embedding-models",level:3},{value:"See also",id:"see-also",level:2}];function x(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,d.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(n.p,{children:[(0,i.jsx)(o.A,{name:"Blocks","aria-hidden":"true"})," ",(0,i.jsx)(n.a,{href:"/components-bundle-components",children:(0,i.jsx)(n.strong,{children:"Bundles"})})," contain custom components that support specific third-party integrations with Langflow."]}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.strong,{children:"IBM"})," bundle provides access to IBM watsonx.ai models for text and embedding generation.\nThese components require an IBM watsonx.ai deployment and watsonx API credentials."]}),"\n",(0,i.jsx)(n.h2,{id:"ibm-watsonxai",children:"IBM watsonx.ai"}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.strong,{children:"IBM watsonx.ai"})," component generates text using ",(0,i.jsx)(n.a,{href:"https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/fm-models.html?context=wx",children:"supported foundation models"})," in ",(0,i.jsx)(n.a,{href:"https://www.ibm.com/products/watsonx-ai",children:"IBM watsonx.ai"}),".\nTo use gateway models, use the ",(0,i.jsxs)(n.a,{href:"/bundles-openai",children:[(0,i.jsx)(n.strong,{children:"OpenAI"})," text generation component"]})," with the gateway model's OpenAI-compatible endpoint."]}),"\n",(0,i.jsxs)(n.p,{children:["You can use the ",(0,i.jsx)(n.strong,{children:"IBM watsonx.ai"})," component anywhere you need a language model in a flow."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"A basic prompting flow using the IBM watsonx.ai component as the central Language Model component.",src:t(68799).A+"",width:"2364",height:"1562"})}),"\n",(0,i.jsx)(n.h3,{id:"ibm-watsonxai-parameters",children:"IBM watsonx.ai parameters"}),"\n",(0,i.jsx)(r.Ay,{}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Name"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"url"}),(0,i.jsx)(n.td,{children:"String"}),(0,i.jsxs)(n.td,{children:["Input parameter. The ",(0,i.jsx)(n.a,{href:"https://cloud.ibm.com/apidocs/watsonx-ai#endpoint-url",children:"watsonx API base URL"})," for your deployment and region."]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"project_id"}),(0,i.jsx)(n.td,{children:"String"}),(0,i.jsxs)(n.td,{children:["Input parameter. Your ",(0,i.jsx)(n.a,{href:"https://www.ibm.com/docs/en/watsonx/saas?topic=projects",children:"watsonx Project ID"}),"."]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"api_key"}),(0,i.jsx)(n.td,{children:"SecretString"}),(0,i.jsxs)(n.td,{children:["Input parameter. A ",(0,i.jsx)(n.a,{href:"https://www.ibm.com/docs/en/watsonx/saas?topic=administration-managing-user-api-key",children:"watsonx API key"})," to authenticate watsonx API access to the specified watsonx.ai deployment and model."]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"model_name"}),(0,i.jsx)(n.td,{children:"String"}),(0,i.jsx)(n.td,{children:"Input parameter. The name of the watsonx model to use. Options are dynamically fetched from the API."})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"max_tokens"}),(0,i.jsx)(n.td,{children:"Integer"}),(0,i.jsxs)(n.td,{children:["Input parameter. The maximum number of tokens to generate. Default: ",(0,i.jsx)(n.code,{children:"1000"}),"."]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"stop_sequence"}),(0,i.jsx)(n.td,{children:"String"}),(0,i.jsx)(n.td,{children:"Input parameter. The sequence where generation should stop."})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"temperature"}),(0,i.jsx)(n.td,{children:"Float"}),(0,i.jsxs)(n.td,{children:["Input parameter. Controls randomness in the output. Default: ",(0,i.jsx)(n.code,{children:"0.1"}),"."]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"top_p"}),(0,i.jsx)(n.td,{children:"Float"}),(0,i.jsxs)(n.td,{children:["Input parameter. Controls nucleus sampling, which limits the model to tokens whose probability is below the ",(0,i.jsx)(n.code,{children:"top_p"})," value. Range: Default: ",(0,i.jsx)(n.code,{children:"0.9"}),"."]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"frequency_penalty"}),(0,i.jsx)(n.td,{children:"Float"}),(0,i.jsxs)(n.td,{children:["Input parameter. Controls frequency penalty. A positive value decreases the probability of repeating tokens, and a negative value increases the probability. Range: Default: ",(0,i.jsx)(n.code,{children:"0.5"}),"."]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"presence_penalty"}),(0,i.jsx)(n.td,{children:"Float"}),(0,i.jsxs)(n.td,{children:["Input parameter. Controls presence penalty. A positive value increases the likelihood of new topics being introduced. Default: ",(0,i.jsx)(n.code,{children:"0.3"}),"."]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"seed"}),(0,i.jsx)(n.td,{children:"Integer"}),(0,i.jsxs)(n.td,{children:["Input parameter. A random seed for the model. Default: ",(0,i.jsx)(n.code,{children:"8"}),"."]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"logprobs"}),(0,i.jsx)(n.td,{children:"Boolean"}),(0,i.jsxs)(n.td,{children:["Input parameter. Whether to return log probabilities of output tokens or not. Default: ",(0,i.jsx)(n.code,{children:"true"}),"."]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"top_logprobs"}),(0,i.jsx)(n.td,{children:"Integer"}),(0,i.jsxs)(n.td,{children:["Input parameter. The number of most likely tokens to return at each position. Default: ",(0,i.jsx)(n.code,{children:"3"}),"."]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"logit_bias"}),(0,i.jsx)(n.td,{children:"String"}),(0,i.jsx)(n.td,{children:"Input parameter. A JSON string of token IDs to bias or suppress."})]})]})]}),"\n",(0,i.jsx)(n.h3,{id:"ibm-watsonxai-output",children:"IBM watsonx.ai output"}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.strong,{children:"IBM watsonx.ai"})," component can output either a ",(0,i.jsx)(n.strong,{children:"Model Response"})," (",(0,i.jsx)(n.a,{href:"/data-types#message",children:(0,i.jsx)(n.code,{children:"Message"})}),") or a ",(0,i.jsx)(n.strong,{children:"Language Model"})," (",(0,i.jsx)(n.a,{href:"/data-types#languagemodel",children:(0,i.jsx)(n.code,{children:"LanguageModel"})}),")."]}),"\n",(0,i.jsxs)(n.p,{children:["Use the ",(0,i.jsx)(n.strong,{children:"Language Model"})," output when you want to use an IBM watsonx.ai model as the LLM for another LLM-driven component, such as an ",(0,i.jsx)(n.strong,{children:"Agent"})," or ",(0,i.jsx)(n.strong,{children:"Smart Function"})," component.\nFor more information, see ",(0,i.jsx)(n.a,{href:"/components-models",children:"Language model components"}),"."]}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.code,{children:"LanguageModel"})," output from the ",(0,i.jsx)(n.strong,{children:"IBM watsonx.ai"})," component is an instance of ",(0,i.jsx)(n.a,{href:"https://python.langchain.com/docs/integrations/chat/ibm_watsonx/",children:"ChatWatsonx"})," configured according to the ",(0,i.jsx)(n.a,{href:"#ibm-watsonxai-parameters",children:"component's parameters"}),"."]}),"\n",(0,i.jsx)(n.h2,{id:"ibm-watsonxai-embeddings",children:"IBM watsonx.ai Embeddings"}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.strong,{children:"IBM watsonx.ai Embeddings"})," component uses the ",(0,i.jsx)(n.a,{href:"https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/fm-models.html?context=wx",children:"supported foundation models"})," in ",(0,i.jsx)(n.a,{href:"https://www.ibm.com/products/watsonx-ai",children:"IBM watsonx.ai"})," for embedding generation."]}),"\n",(0,i.jsxs)(n.p,{children:["The output is ",(0,i.jsx)(n.a,{href:"/data-types#embeddings",children:(0,i.jsx)(n.code,{children:"Embeddings"})})," generated with ",(0,i.jsx)(n.a,{href:"https://python.langchain.com/docs/integrations/text_embedding/ibm_watsonx/",children:(0,i.jsx)(n.code,{children:"WatsonxEmbeddings"})}),"."]}),"\n",(0,i.jsxs)(n.p,{children:["For more information about using embedding model components in flows, see ",(0,i.jsx)(n.a,{href:"/components-embedding-models",children:"Embedding model components"}),"."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"A basic embedding generation flow using the IBM watsonx.ai Embeddings component",src:t(96425).A+"",width:"1714",height:"1486"})}),"\n",(0,i.jsx)(n.h3,{id:"ibm-watsonxai-embeddings-parameters",children:"IBM watsonx.ai Embeddings parameters"}),"\n",(0,i.jsx)(r.Ay,{}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Name"}),(0,i.jsx)(n.th,{children:"Display Name"}),(0,i.jsx)(n.th,{children:"Info"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"url"}),(0,i.jsx)(n.td,{children:"watsonx API Endpoint"}),(0,i.jsxs)(n.td,{children:["Input parameter. The ",(0,i.jsx)(n.a,{href:"https://cloud.ibm.com/apidocs/watsonx-ai#endpoint-url",children:"watsonx API base URL"})," for your deployment and region."]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"project_id"}),(0,i.jsx)(n.td,{children:"watsonx project id"}),(0,i.jsxs)(n.td,{children:["Input parameter. Your ",(0,i.jsx)(n.a,{href:"https://www.ibm.com/docs/en/watsonx/saas?topic=projects",children:"watsonx Project ID"}),"."]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"api_key"}),(0,i.jsx)(n.td,{children:"API Key"}),(0,i.jsxs)(n.td,{children:["Input parameter. A ",(0,i.jsx)(n.a,{href:"https://www.ibm.com/docs/en/watsonx/saas?topic=administration-managing-user-api-key",children:"watsonx API key"})," to authenticate watsonx API access to the specified watsonx.ai deployment and model."]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"model_name"}),(0,i.jsx)(n.td,{children:"Model Name"}),(0,i.jsxs)(n.td,{children:["Input parameter. The name of the embedding model to use. Supports ",(0,i.jsx)(n.a,{href:"#default-embedding-models",children:"default embedding models"})," and automatically updates after connecting to your watsonx.ai deployment."]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"truncate_input_tokens"}),(0,i.jsx)(n.td,{children:"Truncate Input Tokens"}),(0,i.jsxs)(n.td,{children:["Input parameter. The maximum number of tokens to process. Default: ",(0,i.jsx)(n.code,{children:"200"}),"."]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"input_text"}),(0,i.jsx)(n.td,{children:"Include the original text in the output"}),(0,i.jsxs)(n.td,{children:["Input parameter. Determines if the original text is included in the output. Default: ",(0,i.jsx)(n.code,{children:"true"}),"."]})]})]})]}),"\n",(0,i.jsx)(n.h3,{id:"default-embedding-models",children:"Default embedding models"}),"\n",(0,i.jsxs)(n.p,{children:["By default, the ",(0,i.jsx)(n.strong,{children:"IBM watsonx.ai Embeddings"})," component supports the following default models:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"sentence-transformers/all-minilm-l12-v2"}),": 384-dimensional embeddings"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"ibm/slate-125m-english-rtrvr-v2"}),": 768-dimensional embeddings"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"ibm/slate-30m-english-rtrvr-v2"}),": 768-dimensional embeddings"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"intfloat/multilingual-e5-large"}),": 1024-dimensional embeddings"]}),"\n"]}),"\n",(0,i.jsx)(n.p,{children:"After entering your API endpoint and credentials, the component automatically fetches the list of available models from your watsonx.ai deployment."}),"\n",(0,i.jsx)(n.h2,{id:"see-also",children:"See also"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"https://cloud.ibm.com/docs",children:"IBM documentation"})}),"\n"]})]})}function m(e={}){const{wrapper:n}={...(0,d.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(x,{...e})}):x(e)}},17886:(e,n,t)=>{t.d(n,{A:()=>d});t(96540);var s=t(64058),i=t(74848);function d({name:e,...n}){const t=s[e];return t?(0,i.jsx)(t,{...n}):null}},31929:(e,n,t)=>{t.d(n,{Ay:()=>a,RM:()=>o});var s=t(74848),i=t(28453),d=t(17886);const o=[];function r(e){const n={a:"a",p:"p",strong:"strong",...(0,i.R)(),...e.components};return(0,s.jsxs)(n.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,s.jsx)(d.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Controls"})," in the ",(0,s.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function a(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(r,{...e})}):r(e)}},68799:(e,n,t)=>{t.d(n,{A:()=>s});const s=t.p+"assets/images/component-watsonx-model-2f388a824b49f1c49287f07bc8738d0f.png"},96425:(e,n,t)=>{t.d(n,{A:()=>s});const s=t.p+"assets/images/component-watsonx-embeddings-chroma-591e45d59ab635d1e1e68ab8036cfed7.png"}}]); \ No newline at end of file diff --git a/assets/js/453ae64a.28231a75.js b/assets/js/453ae64a.28231a75.js deleted file mode 100644 index ab7b723b14..0000000000 --- a/assets/js/453ae64a.28231a75.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[9610],{6137:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>l,default:()=>x,frontMatter:()=>a,metadata:()=>s,toc:()=>h});const s=JSON.parse('{"id":"Components/bundles-ibm","title":"IBM","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/bundles-ibm.mdx","sourceDirName":"Components","slug":"/bundles-ibm","permalink":"/bundles-ibm","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"IBM","slug":"/bundles-ibm"},"sidebar":"docs","previous":{"title":"Hugging Face","permalink":"/bundles-huggingface"},"next":{"title":"Icosa Computing","permalink":"/bundles-icosacomputing"}}');var i=t(74848),d=t(28453),r=t(17886),o=t(31929);const a={title:"IBM",slug:"/bundles-ibm"},l=void 0,c={},h=[{value:"IBM watsonx.ai",id:"ibm-watsonxai",level:2},{value:"IBM watsonx.ai parameters",id:"ibm-watsonxai-parameters",level:3},...o.RM,{value:"IBM watsonx.ai output",id:"ibm-watsonxai-output",level:3},{value:"IBM watsonx.ai Embeddings",id:"ibm-watsonxai-embeddings",level:2},{value:"IBM watsonx.ai Embeddings parameters",id:"ibm-watsonxai-embeddings-parameters",level:3},...o.RM,{value:"Default embedding models",id:"default-embedding-models",level:3},{value:"See also",id:"see-also",level:2}];function m(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,d.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(n.p,{children:[(0,i.jsx)(r.A,{name:"Blocks","aria-hidden":"true"})," ",(0,i.jsx)(n.a,{href:"/components-bundle-components",children:(0,i.jsx)(n.strong,{children:"Bundles"})})," contain custom components that support specific third-party integrations with Langflow."]}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.strong,{children:"IBM"})," bundle provides access to IBM watsonx.ai models for text and embedding generation.\nThese components require an IBM watsonx.ai deployment and watsonx API credentials."]}),"\n",(0,i.jsx)(n.h2,{id:"ibm-watsonxai",children:"IBM watsonx.ai"}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.strong,{children:"IBM watsonx.ai"})," component generates text using ",(0,i.jsx)(n.a,{href:"https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/fm-models.html?context=wx",children:"supported foundation models"})," in ",(0,i.jsx)(n.a,{href:"https://www.ibm.com/products/watsonx-ai",children:"IBM watsonx.ai"}),"."]}),"\n",(0,i.jsx)(n.p,{children:"You can use this component anywhere you need a language model in a flow."}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"A basic prompting flow using the IBM watsonx.ai component as the central Language Model component.",src:t(68799).A+"",width:"2364",height:"1562"})}),"\n",(0,i.jsx)(n.h3,{id:"ibm-watsonxai-parameters",children:"IBM watsonx.ai parameters"}),"\n",(0,i.jsx)(o.Ay,{}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Name"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"url"}),(0,i.jsx)(n.td,{children:"String"}),(0,i.jsxs)(n.td,{children:["Input parameter. The ",(0,i.jsx)(n.a,{href:"https://cloud.ibm.com/apidocs/watsonx-ai#endpoint-url",children:"watsonx API base URL"})," for your deployment and region."]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"project_id"}),(0,i.jsx)(n.td,{children:"String"}),(0,i.jsxs)(n.td,{children:["Input parameter. Your ",(0,i.jsx)(n.a,{href:"https://www.ibm.com/docs/en/watsonx/saas?topic=projects",children:"watsonx Project ID"}),"."]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"api_key"}),(0,i.jsx)(n.td,{children:"SecretString"}),(0,i.jsxs)(n.td,{children:["Input parameter. A ",(0,i.jsx)(n.a,{href:"https://www.ibm.com/docs/en/watsonx/saas?topic=administration-managing-user-api-key",children:"watsonx API key"})," to authenticate watsonx API access to the specified watsonx.ai deployment and model."]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"model_name"}),(0,i.jsx)(n.td,{children:"String"}),(0,i.jsx)(n.td,{children:"Input parameter. The name of the watsonx model to use. Options are dynamically fetched from the API."})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"max_tokens"}),(0,i.jsx)(n.td,{children:"Integer"}),(0,i.jsxs)(n.td,{children:["Input parameter. The maximum number of tokens to generate. Default: ",(0,i.jsx)(n.code,{children:"1000"}),"."]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"stop_sequence"}),(0,i.jsx)(n.td,{children:"String"}),(0,i.jsx)(n.td,{children:"Input parameter. The sequence where generation should stop."})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"temperature"}),(0,i.jsx)(n.td,{children:"Float"}),(0,i.jsxs)(n.td,{children:["Input parameter. Controls randomness in the output. Default: ",(0,i.jsx)(n.code,{children:"0.1"}),"."]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"top_p"}),(0,i.jsx)(n.td,{children:"Float"}),(0,i.jsxs)(n.td,{children:["Input parameter. Controls nucleus sampling, which limits the model to tokens whose probability is below the ",(0,i.jsx)(n.code,{children:"top_p"})," value. Range: Default: ",(0,i.jsx)(n.code,{children:"0.9"}),"."]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"frequency_penalty"}),(0,i.jsx)(n.td,{children:"Float"}),(0,i.jsxs)(n.td,{children:["Input parameter. Controls frequency penalty. A positive value decreases the probability of repeating tokens, and a negative value increases the probability. Range: Default: ",(0,i.jsx)(n.code,{children:"0.5"}),"."]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"presence_penalty"}),(0,i.jsx)(n.td,{children:"Float"}),(0,i.jsxs)(n.td,{children:["Input parameter. Controls presence penalty. A positive value increases the likelihood of new topics being introduced. Default: ",(0,i.jsx)(n.code,{children:"0.3"}),"."]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"seed"}),(0,i.jsx)(n.td,{children:"Integer"}),(0,i.jsxs)(n.td,{children:["Input parameter. A random seed for the model. Default: ",(0,i.jsx)(n.code,{children:"8"}),"."]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"logprobs"}),(0,i.jsx)(n.td,{children:"Boolean"}),(0,i.jsx)(n.td,{children:"Input parameter. Whether to return log probabilities of output tokens or not. Default: true."})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"top_logprobs"}),(0,i.jsx)(n.td,{children:"Integer"}),(0,i.jsxs)(n.td,{children:["Input parameter. The number of most likely tokens to return at each position. Default: ",(0,i.jsx)(n.code,{children:"3"}),"."]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"logit_bias"}),(0,i.jsx)(n.td,{children:"String"}),(0,i.jsx)(n.td,{children:"Input parameter. A JSON string of token IDs to bias or suppress."})]})]})]}),"\n",(0,i.jsx)(n.h3,{id:"ibm-watsonxai-output",children:"IBM watsonx.ai output"}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.strong,{children:"IBM watsonx.ai"})," component can output either a ",(0,i.jsx)(n.strong,{children:"Model Response"})," (",(0,i.jsx)(n.a,{href:"/data-types#message",children:(0,i.jsx)(n.code,{children:"Message"})}),") or a ",(0,i.jsx)(n.strong,{children:"Language Model"})," (",(0,i.jsx)(n.a,{href:"/data-types#languagemodel",children:(0,i.jsx)(n.code,{children:"LanguageModel"})}),")."]}),"\n",(0,i.jsxs)(n.p,{children:["Use the ",(0,i.jsx)(n.strong,{children:"Language Model"})," output when you want to use an IBM watsonx.ai model as the LLM for another LLM-driven component, such as an ",(0,i.jsx)(n.strong,{children:"Agent"})," or ",(0,i.jsx)(n.strong,{children:"Smart Function"})," component.\nFor more information, see ",(0,i.jsx)(n.a,{href:"/components-models",children:"Language model components"}),"."]}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.code,{children:"LanguageModel"})," output from the ",(0,i.jsx)(n.strong,{children:"IBM watsonx.ai"})," component is an instance of ",(0,i.jsx)(n.a,{href:"https://python.langchain.com/docs/integrations/chat/ibm_watsonx/",children:"ChatWatsonx"})," configured according to the ",(0,i.jsx)(n.a,{href:"#ibm-watsonxai-parameters",children:"component's parameters"}),"."]}),"\n",(0,i.jsx)(n.h2,{id:"ibm-watsonxai-embeddings",children:"IBM watsonx.ai Embeddings"}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.strong,{children:"IBM watsonx.ai Embeddings"})," component uses the ",(0,i.jsx)(n.a,{href:"https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/fm-models.html?context=wx",children:"supported foundation models"})," in ",(0,i.jsx)(n.a,{href:"https://www.ibm.com/products/watsonx-ai",children:"IBM watsonx.ai"})," for embedding generation."]}),"\n",(0,i.jsxs)(n.p,{children:["The output is ",(0,i.jsx)(n.a,{href:"/data-types#embeddings",children:(0,i.jsx)(n.code,{children:"Embeddings"})})," generated with ",(0,i.jsx)(n.a,{href:"https://python.langchain.com/docs/integrations/text_embedding/ibm_watsonx/",children:(0,i.jsx)(n.code,{children:"WatsonxEmbeddings"})}),"."]}),"\n",(0,i.jsxs)(n.p,{children:["For more information about using embedding model components in flows, see ",(0,i.jsx)(n.a,{href:"/components-embedding-models",children:"Embedding model components"}),"."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"A basic embedding generation flow using the IBM watsonx.ai Embeddings component",src:t(96425).A+"",width:"1714",height:"1486"})}),"\n",(0,i.jsx)(n.h3,{id:"ibm-watsonxai-embeddings-parameters",children:"IBM watsonx.ai Embeddings parameters"}),"\n",(0,i.jsx)(o.Ay,{}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Name"}),(0,i.jsx)(n.th,{children:"Display Name"}),(0,i.jsx)(n.th,{children:"Info"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"url"}),(0,i.jsx)(n.td,{children:"watsonx API Endpoint"}),(0,i.jsxs)(n.td,{children:["Input parameter. The ",(0,i.jsx)(n.a,{href:"https://cloud.ibm.com/apidocs/watsonx-ai#endpoint-url",children:"watsonx API base URL"})," for your deployment and region."]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"project_id"}),(0,i.jsx)(n.td,{children:"watsonx project id"}),(0,i.jsxs)(n.td,{children:["Input parameter. Your ",(0,i.jsx)(n.a,{href:"https://www.ibm.com/docs/en/watsonx/saas?topic=projects",children:"watsonx Project ID"}),"."]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"api_key"}),(0,i.jsx)(n.td,{children:"API Key"}),(0,i.jsxs)(n.td,{children:["Input parameter. A ",(0,i.jsx)(n.a,{href:"https://www.ibm.com/docs/en/watsonx/saas?topic=administration-managing-user-api-key",children:"watsonx API key"})," to authenticate watsonx API access to the specified watsonx.ai deployment and model."]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"model_name"}),(0,i.jsx)(n.td,{children:"Model Name"}),(0,i.jsxs)(n.td,{children:["Input parameter. The name of the embedding model to use. Supports ",(0,i.jsx)(n.a,{href:"#default-embedding-models",children:"default embedding models"})," and automatically updates after connecting to your watsonx.ai deployment."]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"truncate_input_tokens"}),(0,i.jsx)(n.td,{children:"Truncate Input Tokens"}),(0,i.jsxs)(n.td,{children:["Input parameter. The maximum number of tokens to process. Default: ",(0,i.jsx)(n.code,{children:"200"}),"."]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"input_text"}),(0,i.jsx)(n.td,{children:"Include the original text in the output"}),(0,i.jsx)(n.td,{children:"Input parameter. Determines if the original text is included in the output. Default: true."})]})]})]}),"\n",(0,i.jsx)(n.h3,{id:"default-embedding-models",children:"Default embedding models"}),"\n",(0,i.jsxs)(n.p,{children:["By default, the ",(0,i.jsx)(n.strong,{children:"IBM watsonx.ai Embeddings"})," component supports the following default models:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"sentence-transformers/all-minilm-l12-v2"}),": 384-dimensional embeddings"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"ibm/slate-125m-english-rtrvr-v2"}),": 768-dimensional embeddings"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"ibm/slate-30m-english-rtrvr-v2"}),": 768-dimensional embeddings"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"intfloat/multilingual-e5-large"}),": 1024-dimensional embeddings"]}),"\n"]}),"\n",(0,i.jsx)(n.p,{children:"After entering your API endpoint and credentials, the component automatically fetches the list of available models from your watsonx.ai deployment."}),"\n",(0,i.jsx)(n.h2,{id:"see-also",children:"See also"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"https://cloud.ibm.com/docs",children:"IBM documentation"})}),"\n"]})]})}function x(e={}){const{wrapper:n}={...(0,d.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(m,{...e})}):m(e)}},17886:(e,n,t)=>{t.d(n,{A:()=>d});t(96540);var s=t(64058),i=t(74848);function d({name:e,...n}){const t=s[e];return t?(0,i.jsx)(t,{...n}):null}},31929:(e,n,t)=>{t.d(n,{Ay:()=>a,RM:()=>r});var s=t(74848),i=t(28453),d=t(17886);const r=[];function o(e){const n={a:"a",p:"p",strong:"strong",...(0,i.R)(),...e.components};return(0,s.jsxs)(n.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,s.jsx)(d.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Controls"})," in the ",(0,s.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function a(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(o,{...e})}):o(e)}},68799:(e,n,t)=>{t.d(n,{A:()=>s});const s=t.p+"assets/images/component-watsonx-model-2f388a824b49f1c49287f07bc8738d0f.png"},96425:(e,n,t)=>{t.d(n,{A:()=>s});const s=t.p+"assets/images/component-watsonx-embeddings-chroma-591e45d59ab635d1e1e68ab8036cfed7.png"}}]); \ No newline at end of file diff --git a/assets/js/46abd5bb.e00698a4.js b/assets/js/46abd5bb.5a4650d9.js similarity index 93% rename from assets/js/46abd5bb.e00698a4.js rename to assets/js/46abd5bb.5a4650d9.js index c544577036..3c34d795ca 100644 --- a/assets/js/46abd5bb.e00698a4.js +++ b/assets/js/46abd5bb.5a4650d9.js @@ -1 +1 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[2457],{17886:(e,t,n)=>{n.d(t,{A:()=>o});n(96540);var r=n(64058),s=n(74848);function o({name:e,...t}){const n=r[e];return n?(0,s.jsx)(n,{...t}):null}},31929:(e,t,n)=>{n.d(t,{Ay:()=>l,RM:()=>i});var r=n(74848),s=n(28453),o=n(17886);const i=[];function a(e){const t={a:"a",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,r.jsxs)(t.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,r.jsx)(o.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Controls"})," in the ",(0,r.jsx)(t.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function l(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}},76505:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>d,default:()=>x,frontMatter:()=>l,metadata:()=>r,toc:()=>p});const r=JSON.parse('{"id":"Components/bundles-perplexity","title":"Perplexity","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/bundles-perplexity.mdx","sourceDirName":"Components","slug":"/bundles-perplexity","permalink":"/bundles-perplexity","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Perplexity","slug":"/bundles-perplexity"},"sidebar":"docs","previous":{"title":"OpenRouter","permalink":"/bundles-openrouter"},"next":{"title":"pgvector","permalink":"/bundles-pgvector"}}');var s=n(74848),o=n(28453),i=n(17886),a=n(31929);const l={title:"Perplexity",slug:"/bundles-perplexity"},d=void 0,c={},p=[{value:"Perplexity text generation",id:"perplexity-text-generation",level:2},{value:"Perplexity text generation parameters",id:"perplexity-text-generation-parameters",level:3},...a.RM];function h(e){const t={a:"a",code:"code",h2:"h2",h3:"h3",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,o.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(t.p,{children:[(0,s.jsx)(i.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(t.a,{href:"/components-bundle-components",children:(0,s.jsx)(t.strong,{children:"Bundles"})})," contain custom components that support specific third-party integrations with Langflow."]}),"\n",(0,s.jsxs)(t.p,{children:["This page describes the components that are available in the ",(0,s.jsx)(t.strong,{children:"Perplexity"})," bundle."]}),"\n",(0,s.jsxs)(t.p,{children:["For more information about Perplexity features and functionality used by Perplexity components, see the ",(0,s.jsx)(t.a,{href:"https://perplexity.ai/",children:"Perplexity documentation"}),"."]}),"\n",(0,s.jsx)(t.h2,{id:"perplexity-text-generation",children:"Perplexity text generation"}),"\n",(0,s.jsx)(t.p,{children:"This component generates text using Perplexity's language models."}),"\n",(0,s.jsxs)(t.p,{children:["It can output either a ",(0,s.jsx)(t.strong,{children:"Model Response"})," (",(0,s.jsx)(t.a,{href:"/data-types#message",children:(0,s.jsx)(t.code,{children:"Message"})}),") or a ",(0,s.jsx)(t.strong,{children:"Language Model"})," (",(0,s.jsx)(t.a,{href:"/data-types#languagemodel",children:(0,s.jsx)(t.code,{children:"LanguageModel"})}),")."]}),"\n",(0,s.jsxs)(t.p,{children:["Use the ",(0,s.jsx)(t.strong,{children:"Language Model"})," output when you want to use a Perplexity model as the LLM for another LLM-driven component, such as an ",(0,s.jsx)(t.strong,{children:"Agent"})," or ",(0,s.jsx)(t.strong,{children:"Smart Function"})," component."]}),"\n",(0,s.jsxs)(t.p,{children:["For more information, see ",(0,s.jsx)(t.a,{href:"/components-models",children:"Language model components"}),"."]}),"\n",(0,s.jsx)(t.h3,{id:"perplexity-text-generation-parameters",children:"Perplexity text generation parameters"}),"\n",(0,s.jsx)(a.Ay,{}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Name"}),(0,s.jsx)(t.th,{children:"Type"}),(0,s.jsx)(t.th,{children:"Description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"model_name"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. The name of the Perplexity model to use. Options include various Llama 3.1 models."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"max_tokens"}),(0,s.jsx)(t.td,{children:"Integer"}),(0,s.jsx)(t.td,{children:"Input parameter. The maximum number of tokens to generate."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"api_key"}),(0,s.jsx)(t.td,{children:"SecretString"}),(0,s.jsx)(t.td,{children:"Input parameter. The Perplexity API Key for authentication."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"temperature"}),(0,s.jsx)(t.td,{children:"Float"}),(0,s.jsx)(t.td,{children:"Input parameter. Controls randomness in the output. Default: 0.75."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"top_p"}),(0,s.jsx)(t.td,{children:"Float"}),(0,s.jsx)(t.td,{children:"Input parameter. The maximum cumulative probability of tokens to consider when sampling (advanced)."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"n"}),(0,s.jsx)(t.td,{children:"Integer"}),(0,s.jsx)(t.td,{children:"Input parameter. Number of chat completions to generate for each prompt (advanced)."})]})]})]})]})}function x(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(h,{...e})}):h(e)}}}]); \ No newline at end of file +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[2457],{17886:(e,t,n)=>{n.d(t,{A:()=>o});n(96540);var r=n(64058),s=n(74848);function o({name:e,...t}){const n=r[e];return n?(0,s.jsx)(n,{...t}):null}},31929:(e,t,n)=>{n.d(t,{Ay:()=>l,RM:()=>i});var r=n(74848),s=n(28453),o=n(17886);const i=[];function a(e){const t={a:"a",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,r.jsxs)(t.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,r.jsx)(o.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Controls"})," in the ",(0,r.jsx)(t.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function l(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}},76505:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>d,default:()=>x,frontMatter:()=>l,metadata:()=>r,toc:()=>p});const r=JSON.parse('{"id":"Components/bundles-perplexity","title":"Perplexity","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/bundles-perplexity.mdx","sourceDirName":"Components","slug":"/bundles-perplexity","permalink":"/bundles-perplexity","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Perplexity","slug":"/bundles-perplexity"},"sidebar":"docs","previous":{"title":"OpenRouter","permalink":"/bundles-openrouter"},"next":{"title":"pgvector","permalink":"/bundles-pgvector"}}');var s=n(74848),o=n(28453),i=n(17886),a=n(31929);const l={title:"Perplexity",slug:"/bundles-perplexity"},d=void 0,c={},p=[{value:"Perplexity text generation",id:"perplexity-text-generation",level:2},{value:"Perplexity text generation parameters",id:"perplexity-text-generation-parameters",level:3},...a.RM];function h(e){const t={a:"a",code:"code",h2:"h2",h3:"h3",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,o.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(t.p,{children:[(0,s.jsx)(i.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(t.a,{href:"/components-bundle-components",children:(0,s.jsx)(t.strong,{children:"Bundles"})})," contain custom components that support specific third-party integrations with Langflow."]}),"\n",(0,s.jsxs)(t.p,{children:["This page describes the components that are available in the ",(0,s.jsx)(t.strong,{children:"Perplexity"})," bundle."]}),"\n",(0,s.jsxs)(t.p,{children:["For more information about Perplexity features and functionality used by Perplexity components, see the ",(0,s.jsx)(t.a,{href:"https://perplexity.ai/",children:"Perplexity documentation"}),"."]}),"\n",(0,s.jsx)(t.h2,{id:"perplexity-text-generation",children:"Perplexity text generation"}),"\n",(0,s.jsx)(t.p,{children:"This component generates text using Perplexity's language models."}),"\n",(0,s.jsxs)(t.p,{children:["It can output either a ",(0,s.jsx)(t.strong,{children:"Model Response"})," (",(0,s.jsx)(t.a,{href:"/data-types#message",children:(0,s.jsx)(t.code,{children:"Message"})}),") or a ",(0,s.jsx)(t.strong,{children:"Language Model"})," (",(0,s.jsx)(t.a,{href:"/data-types#languagemodel",children:(0,s.jsx)(t.code,{children:"LanguageModel"})}),")."]}),"\n",(0,s.jsxs)(t.p,{children:["Use the ",(0,s.jsx)(t.strong,{children:"Language Model"})," output when you want to use a Perplexity model as the LLM for another LLM-driven component, such as an ",(0,s.jsx)(t.strong,{children:"Agent"})," or ",(0,s.jsx)(t.strong,{children:"Smart Function"})," component."]}),"\n",(0,s.jsxs)(t.p,{children:["For more information, see ",(0,s.jsx)(t.a,{href:"/components-models",children:"Language model components"}),"."]}),"\n",(0,s.jsx)(t.h3,{id:"perplexity-text-generation-parameters",children:"Perplexity text generation parameters"}),"\n",(0,s.jsx)(a.Ay,{}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Name"}),(0,s.jsx)(t.th,{children:"Type"}),(0,s.jsx)(t.th,{children:"Description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"model_name"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. The name of the Perplexity model to use. Options include various Llama 3.1 models."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"max_tokens"}),(0,s.jsx)(t.td,{children:"Integer"}),(0,s.jsx)(t.td,{children:"Input parameter. The maximum number of tokens to generate."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"api_key"}),(0,s.jsx)(t.td,{children:"SecretString"}),(0,s.jsx)(t.td,{children:"Input parameter. The Perplexity API Key for authentication."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"temperature"}),(0,s.jsx)(t.td,{children:"Float"}),(0,s.jsx)(t.td,{children:"Input parameter. Controls randomness in the output. Default: 0.75."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"top_p"}),(0,s.jsx)(t.td,{children:"Float"}),(0,s.jsx)(t.td,{children:"Input parameter. The maximum cumulative probability of tokens to consider when sampling."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"n"}),(0,s.jsx)(t.td,{children:"Integer"}),(0,s.jsx)(t.td,{children:"Input parameter. Number of chat completions to generate for each prompt."})]})]})]})]})}function x(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(h,{...e})}):h(e)}}}]); \ No newline at end of file diff --git a/assets/js/47e58a89.4bfe7d6e.js b/assets/js/47e58a89.4bfe7d6e.js new file mode 100644 index 0000000000..54d0630e0e --- /dev/null +++ b/assets/js/47e58a89.4bfe7d6e.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[1006],{28453:(e,n,s)=>{s.d(n,{R:()=>a,x:()=>i});var o=s(96540);const t={},r=o.createContext(t);function a(e){const n=o.useContext(r);return o.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function i(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:a(e.components),o.createElement(r.Provider,{value:n},e.children)}},33354:(e,n,s)=>{s.r(n),s.d(n,{CH:()=>l,assets:()=>d,chCodeConfig:()=>h,contentTitle:()=>c,default:()=>x,frontMatter:()=>i,metadata:()=>o,toc:()=>m});const o=JSON.parse('{"id":"Develop/memory","title":"Memory management options","description":"Langflow provides flexible memory management options for storage and retrieval of data relevant to your flows and your Langflow server.","source":"@site/docs/Develop/memory.mdx","sourceDirName":"Develop","slug":"/memory","permalink":"/memory","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Memory management options","slug":"/memory"},"sidebar":"docs","previous":{"title":"Manage files","permalink":"/concepts-file-management"},"next":{"title":"Use Session IDs","permalink":"/session-id"}}');var t=s(74848),r=s(28453),a=s(24754);const i={title:"Memory management options",slug:"/memory"},c=void 0,d={},l={annotations:a.hk,Code:a.Cy},h={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},m=[{value:"Storage options and paths",id:"storage-options-and-paths",level:2},{value:"Langflow database tables",id:"langflow-database-tables",level:2},{value:"Configure external memory",id:"configure-external-memory",level:2},{value:"Configure cache memory",id:"configure-cache-memory",level:2},{value:"Store chat memory",id:"store-chat-memory",level:2},{value:"Session ID and chat memory",id:"session-id-and-chat-memory",level:3},{value:"Chat memory options",id:"chat-memory-options",level:3},{value:"See also",id:"see-also",level:2}];function f(e){const n={a:"a",admonition:"admonition",code:"code",em:"em",h2:"h2",h3:"h3",li:"li",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,r.R)(),...e.components},{Details:s}=n;return l||g("CH",!1),l.Code||g("CH.Code",!0),s||g("Details",!0),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n",(0,t.jsx)(n.p,{children:"Langflow provides flexible memory management options for storage and retrieval of data relevant to your flows and your Langflow server.\nThis includes essential Langflow database tables, file management, and caching, as well as chat memory."}),"\n",(0,t.jsx)(n.h2,{id:"storage-options-and-paths",children:"Storage options and paths"}),"\n",(0,t.jsx)(n.p,{children:"Langflow supports both local memory and external memory options."}),"\n",(0,t.jsxs)(n.p,{children:["Langflow's default storage option is a ",(0,t.jsx)(n.a,{href:"https://www.sqlite.org/",children:"SQLite"})," database.\nThe default storage path depends on your operating system and installation method:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"Langflow Desktop"}),":","\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"macOS"}),": ",(0,t.jsx)(n.code,{children:"/Users//.langflow/data/database.db"})]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"Windows"}),": ",(0,t.jsx)(n.code,{children:"C:\\Users\\\\AppData\\Roaming\\com.Langflow\\data\\langflow.db"})]}),"\n"]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"Langflow OSS"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsxs)(n.strong,{children:["macOS/Windows/Linux/WSL with ",(0,t.jsx)(n.code,{children:"uv pip install"})]}),": ",(0,t.jsx)(n.code,{children:"/lib/python3.12/site-packages/langflow/langflow.db"})," (Python version can vary. Database isn't shared between virtual environments because it is tied to the venv path.)"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsxs)(n.strong,{children:["macOS/Windows/Linux/WSL with ",(0,t.jsx)(n.code,{children:"git clone"})]}),": ",(0,t.jsx)(n.code,{children:"/src/backend/base/langflow/langflow.db"})]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(n.p,{children:"Langflow offers a few alternatives to the default database path:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"Config directory"}),": Set ",(0,t.jsx)(n.code,{children:"LANGFLOW_SAVE_DB_IN_CONFIG_DIR=True"})," to store the database in your Langflow config directory as set in ",(0,t.jsx)(n.a,{href:"/logging",children:(0,t.jsx)(n.code,{children:"LANGFLOW_CONFIG_DIR"})}),"."]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"External PostgreSQL database"}),": You can use an external PostgreSQL database for all of your Langflow storage.\nFor more information, see ",(0,t.jsx)(n.a,{href:"#configure-external-memory",children:"Configure external memory"})]}),"\n",(0,t.jsx)(n.p,{children:"External storage can be useful if you want to preserve the data after uninstalling Langflow or to share the same database between multiple virtual environments."}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"Separate chat memory"}),": You can selectively use external storage for chat memory only, separate from other Langflow storage.\nFor more information, see ",(0,t.jsx)(n.a,{href:"#store-chat-memory",children:"Store chat memory"}),"."]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"No database"}),": To disable all database operations and run a no-op session, set ",(0,t.jsx)(n.code,{children:"LANGFLOW_USE_NOOP_DATABASE=True"})," in your ",(0,t.jsx)(n.a,{href:"/environment-variables",children:"Langflow environment variables"}),".\nThis is useful for testing when you don't want to persist any data."]}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"langflow-database-tables",children:"Langflow database tables"}),"\n",(0,t.jsxs)(n.p,{children:["The following tables are stored in ",(0,t.jsx)(n.code,{children:"langflow.db"}),":"]}),"\n",(0,t.jsxs)(n.p,{children:["\u2022 ",(0,t.jsx)(n.strong,{children:"ApiKey"}),": Manages Langflow API authentication keys. Component API keys are stored in the ",(0,t.jsx)(n.strong,{children:"Variables"})," table. For more information, see ",(0,t.jsx)(n.a,{href:"/api-keys-and-authentication",children:"API keys and authentication"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["\u2022 ",(0,t.jsx)(n.strong,{children:"File"}),": Stores metadata for files uploaded to Langflow's file management system, including file names, paths, sizes, and storage providers. For more information, see ",(0,t.jsx)(n.a,{href:"/concepts-file-management",children:"Manage files"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["\u2022 ",(0,t.jsx)(n.strong,{children:"Flow"}),": Contains flow definitions, including nodes, edges, and components, stored as JSON or database records. For more information, see ",(0,t.jsx)(n.a,{href:"/concepts-flows",children:"Build flows"}),"."]}),"\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsxs)(n.p,{children:["To automatically remove API keys and tokens from flow data before saving a flow to the database, set ",(0,t.jsx)(n.code,{children:"LANGFLOW_REMOVE_API_KEYS=True"})," in your ",(0,t.jsx)(n.a,{href:"/environment-variables",children:"Langflow environment variables"}),".\nWhen ",(0,t.jsx)(n.code,{children:"true"}),", any field marked as a password field that ",(0,t.jsx)(n.em,{children:"also"})," has ",(0,t.jsx)(n.code,{children:"api"}),", ",(0,t.jsx)(n.code,{children:"key"}),", or ",(0,t.jsx)(n.code,{children:"token"})," in its name is set to ",(0,t.jsx)(n.code,{children:"null"})," before the flow is saved.\nThis helps prevent credentials from being stored in the database."]})}),"\n",(0,t.jsxs)(n.p,{children:["\u2022 ",(0,t.jsx)(n.strong,{children:"Folder"}),": Provides a structure for flow storage, including single-user folders and shared folders accessed by multiple users. For more information, see ",(0,t.jsx)(n.a,{href:"/concepts-flows#projects",children:"Manage flows in projects"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["\u2022 ",(0,t.jsx)(n.strong,{children:"Message"}),": Stores chat messages and interactions that occur between components. For more information, see ",(0,t.jsx)(n.a,{href:"/data-types#message",children:"Message objects"})," and ",(0,t.jsx)(n.a,{href:"#store-chat-memory",children:"Store chat memory"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["\u2022 ",(0,t.jsx)(n.strong,{children:"Transactions"}),": Records execution history and results of flow runs. This information is used for ",(0,t.jsx)(n.a,{href:"/logging",children:"logging"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["\u2022 ",(0,t.jsx)(n.strong,{children:"User"}),": Stores user account information including credentials, permissions, profiles, and user management settings. For more information, see ",(0,t.jsx)(n.a,{href:"/api-keys-and-authentication",children:"API keys and authentication"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["\u2022 ",(0,t.jsx)(n.strong,{children:"Variables"}),": Stores global encrypted values and credentials. For more information, see ",(0,t.jsx)(n.a,{href:"/configuration-global-variables",children:"Global variables"})," and ",(0,t.jsx)(n.a,{href:"/api-keys-and-authentication#component-api-keys",children:"Component API keys"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["\u2022 ",(0,t.jsx)(n.strong,{children:"VertexBuild"}),": Tracks the build status of individual nodes within flows. For more information, see ",(0,t.jsx)(n.a,{href:"/concepts-playground",children:"Test flows in the Playground"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["For more information, see the database models in the ",(0,t.jsx)(n.a,{href:"https://github.com/langflow-ai/langflow/tree/main/src/backend/base/langflow/services/database/models",children:"source code"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"configure-external-memory",children:"Configure external memory"}),"\n",(0,t.jsxs)(n.p,{children:["To replace the default Langflow SQLite database with another database, set the ",(0,t.jsx)(n.code,{children:"LANGFLOW_DATABASE_URL"})," environment variable to your database URL, and then start Langflow with your ",(0,t.jsx)(n.code,{children:".env"})," file.\nFor more information and examples, see ",(0,t.jsx)(n.a,{href:"/configuration-custom-database",children:"Configure an external PostgreSQL database"}),"."]}),"\n",(0,t.jsx)(l.Code,{codeConfig:h,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"LANGFLOW_DATABASE_URL=postgresql://user:password@localhost:5432/langflow",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,t.jsx)(n.p,{children:"To fine-tune your database connection pool and timeout settings, you can set the following additional environment variables:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.code,{children:"LANGFLOW_DATABASE_CONNECTION_RETRY"}),": Whether to retry lost connections to your Langflow database. If ",(0,t.jsx)(n.code,{children:"true"}),", Langflow tries to connect to the database again if the connection fails. Default: ",(0,t.jsx)(n.code,{children:"false"}),"."]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.code,{children:"LANGFLOW_DB_CONNECT_TIMEOUT"}),": The number of seconds to wait before giving up on a lock to be released or establishing a connection to the database. This may be separate from the ",(0,t.jsx)(n.code,{children:"pool_timeout"})," in ",(0,t.jsx)(n.code,{children:"LANGFLOW_DB_CONNECTION_SETTINGS"}),". Default: 30."]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.code,{children:"LANGFLOW_DB_CONNECTION_SETTINGS"}),": A a JSON dictionary containing the following database connection pool settings:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"pool_size"}),": The base number of connections to keep open in the connection pool. Default: 20."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"max_overflow"}),": Maximum number of connections that can be created in excess of ",(0,t.jsx)(n.code,{children:"pool_size"})," if needed. Default: 30."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"pool_timeout"}),": Number of seconds to wait for a connection from the pool before timing out. Default: 30."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"pool_pre_ping"}),": If ",(0,t.jsx)(n.code,{children:"true"}),", the pool tests connections for liveness upon each checkout. Default: ",(0,t.jsx)(n.code,{children:"true"}),"."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"pool_recycle"}),": Number of seconds after which a connection is automatically recycled. Default: 1800 (30 minutes)."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"echo"}),": If ",(0,t.jsx)(n.code,{children:"true"}),", SQL queries are logged for debugging purposes. Default: ",(0,t.jsx)(n.code,{children:"false"}),"."]}),"\n"]}),"\n",(0,t.jsx)(n.p,{children:"For example:"}),"\n",(0,t.jsx)(l.Code,{codeConfig:h,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:'LANGFLOW_DB_CONNECTION_SETTINGS=\'{"pool_size": 20, "max_overflow": 30, "pool_timeout": 30, "pool_pre_ping": true, "pool_recycle": 1800, "echo": false}\'',props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,t.jsxs)(n.p,{children:["Don't use the deprecated environment variables ",(0,t.jsx)(n.code,{children:"LANGFLOW_DB_POOL_SIZE"})," or ",(0,t.jsx)(n.code,{children:"LANGFLOW_DB_MAX_OVERFLOW"}),".\nInstead, use ",(0,t.jsx)(n.code,{children:"pool_size"})," and ",(0,t.jsx)(n.code,{children:"max_overflow"})," in ",(0,t.jsx)(n.code,{children:"LANGFLOW_DB_CONNECTION_SETTINGS"}),"."]}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"configure-cache-memory",children:"Configure cache memory"}),"\n",(0,t.jsx)(n.p,{children:"The default Langflow caching behavior is an asynchronous, in-memory cache:"}),"\n",(0,t.jsx)(l.Code,{codeConfig:h,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"LANGFLOW_LANGCHAIN_CACHE=InMemoryCache",props:{}}]},{tokens:[{content:"LANGFLOW_CACHE_TYPE=async",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,t.jsx)(n.p,{children:"Langflow officially supports only the default asynchronous, in-memory cache, which is suitable for most use cases.\nOther cache options, such as Redis, are experimental and can change without notice.\nIf you want to use a non-default cache setting, you can use the following environment variables:"}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Variable"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Default"}),(0,t.jsx)(n.th,{children:"Description"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"LANGFLOW_CACHE_TYPE"})}),(0,t.jsx)(n.td,{children:"String"}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"async"})}),(0,t.jsxs)(n.td,{children:["Set the cache type for Langflow's internal caching system. Possible values: ",(0,t.jsx)(n.code,{children:"async"}),", ",(0,t.jsx)(n.code,{children:"redis"}),", ",(0,t.jsx)(n.code,{children:"memory"}),", ",(0,t.jsx)(n.code,{children:"disk"}),". If you set the type to ",(0,t.jsx)(n.code,{children:"redis"}),", then you must also set the ",(0,t.jsx)(n.code,{children:"LANGFLOW_REDIS_*"})," environment variables."]})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"LANGFLOW_LANGCHAIN_CACHE"})}),(0,t.jsx)(n.td,{children:"String"}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"InMemoryCache"})}),(0,t.jsxs)(n.td,{children:["Set the cache storage type for the LangChain caching system (a Langflow dependency), either ",(0,t.jsx)(n.code,{children:"InMemoryCache"})," or ",(0,t.jsx)(n.code,{children:"SQLiteCache"}),"."]})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"LANGFLOW_REDIS_HOST"})}),(0,t.jsx)(n.td,{children:"String"}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"localhost"})}),(0,t.jsxs)(n.td,{children:["Redis server hostname if ",(0,t.jsx)(n.code,{children:"LANGFLOW_CACHE_TYPE=redis"}),"."]})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"LANGFLOW_REDIS_PORT"})}),(0,t.jsx)(n.td,{children:"Integer"}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"6379"})}),(0,t.jsxs)(n.td,{children:["Redis server port if ",(0,t.jsx)(n.code,{children:"LANGFLOW_CACHE_TYPE=redis"}),"."]})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"LANGFLOW_REDIS_DB"})}),(0,t.jsx)(n.td,{children:"Integer"}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"0"})}),(0,t.jsxs)(n.td,{children:["Redis database number if ",(0,t.jsx)(n.code,{children:"LANGFLOW_CACHE_TYPE=redis"}),"."]})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"LANGFLOW_REDIS_CACHE_EXPIRE"})}),(0,t.jsx)(n.td,{children:"Integer"}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"3600"})}),(0,t.jsxs)(n.td,{children:["Cache expiration time in seconds if ",(0,t.jsx)(n.code,{children:"LANGFLOW_CACHE_TYPE=redis"}),"."]})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"LANGFLOW_REDIS_PASSWORD"})}),(0,t.jsx)(n.td,{children:"String"}),(0,t.jsx)(n.td,{children:"Not set"}),(0,t.jsxs)(n.td,{children:["Optional password for Redis authentication if ",(0,t.jsx)(n.code,{children:"LANGFLOW_CACHE_TYPE=redis"}),"."]})]})]})]}),"\n",(0,t.jsx)(n.h2,{id:"store-chat-memory",children:"Store chat memory"}),"\n",(0,t.jsxs)(n.p,{children:["Chat-based flows with a ",(0,t.jsx)(n.strong,{children:"Chat Input"})," or ",(0,t.jsx)(n.strong,{children:"Chat Output"})," component produce chat history that is stored in the Langflow ",(0,t.jsx)(n.code,{children:"messages"})," table.\nAt minimum, this serves as a chat log, but it isn't functionally the same as chat memory that provides historical context to an LLM."]}),"\n",(0,t.jsxs)(n.p,{children:["To store and retrieve chat memories in flows, you can use a ",(0,t.jsx)(n.strong,{children:"Message History"})," component or the ",(0,t.jsx)(n.strong,{children:"Agent"})," component's built-in chat memory."]}),"\n",(0,t.jsxs)(s,{children:[(0,t.jsx)("summary",{children:"How does chat memory work?"}),(0,t.jsx)(n.p,{children:"Chat memory is a cache for an LLM or agent to preserve past conversations to retain and reference that context in future interactions.\nFor example, if a user has already told the LLM their name, the LLM can retrieve that information from chat memory rather than asking the user to repeat themselves in future conversations or messages."}),(0,t.jsx)(n.p,{children:"Chat memory is distinct from vector store memory because it is built specifically for storing and retrieving chat messages from databases."}),(0,t.jsxs)(n.p,{children:["Components that support chat memory (such as the ",(0,t.jsx)(n.strong,{children:"Agent"})," and ",(0,t.jsx)(n.strong,{children:"Message History"})," components) provide access to their respective databases ",(0,t.jsx)(n.em,{children:"as memory"}),".\nRetrieval as memory is an important distinction for LLMs and agents because this storage and retrieval mechanism is specifically designed to recall context from past conversations.\nUnlike vector stores, which are designed for semantic search and retrieval of text chunks, chat memory is designed to store and retrieve chat messages in a way that is optimized for conversation history."]})]}),"\n",(0,t.jsx)(n.h3,{id:"session-id-and-chat-memory",children:"Session ID and chat memory"}),"\n",(0,t.jsxs)(n.p,{children:["Chat history and memories are grouped by ",(0,t.jsxs)(n.a,{href:"/session-id",children:["session ID (",(0,t.jsx)(n.code,{children:"session_id"}),")"]}),"."]}),"\n",(0,t.jsx)(n.p,{children:"The default session ID is the flow ID, which means that all chat messages for a flow are stored under the same session ID as one large chat session."}),"\n",(0,t.jsx)(n.p,{children:"For better segregation of chat memory, especially in flows used by multiple users, consider using custom session IDs.\nFor example, if you use user IDs as session IDs, then each user's chat history is stored separately, isolating the context of their chats from other users' chats."}),"\n",(0,t.jsx)(n.h3,{id:"chat-memory-options",children:"Chat memory options"}),"\n",(0,t.jsx)(n.p,{children:"Where and how chat memory is stored depends on the components used in your flow:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"Agent component"}),": This component has built-in chat memory that is enabled by default.\nThis memory allows the agent to retrieve and reference messages from previous conversations associated with the same session ID.\nAll messages are stored in ",(0,t.jsx)(n.a,{href:"#storage-options-and-paths",children:"Langflow storage"}),", and the component provides minimal memory configuration options, such as the number of messages to retrieve."]}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.strong,{children:"Agent"})," component's built-in chat memory is sufficient for most use cases."]}),"\n",(0,t.jsxs)(n.p,{children:["If you want to use external chat memory storage, retrieve memories outside the context of a chat, or use chat memory with a language model component (not an agent), you must use the ",(0,t.jsx)(n.strong,{children:"Message History"})," component (with or without a third-party chat memory component)."]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"Message History component"}),": By default, this component stores and retrieves memories from Langflow storage, unless you attach a third-party chat memory component. It provides a few more options for sorting and filtering memories, although most of these options are also built-in to the ",(0,t.jsx)(n.strong,{children:"Agent"})," component as configurable or fixed parameters."]}),"\n",(0,t.jsxs)(n.p,{children:["You can use the ",(0,t.jsx)(n.strong,{children:"Message History"})," component with or without a language model or agent.\nFor example, if you need to retrieve data from memories outside of chat, you can use the ",(0,t.jsx)(n.strong,{children:"Message History"})," component to fetch that data directly from your chat memory database without feeding it into a chat."]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"Third-party chat memory components"}),": Use one of these components only if you need to store or retrieve chat memories from a dedicated external chat memory database.\nTypically, this is necessary only if you have specific storage needs that aren't met by Langflow storage.\nFor example, if you want to manage chat memory data by directly working with the database, or if you want to use a different database than the default Langflow storage."]}),"\n"]}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["For more information and examples, see ",(0,t.jsxs)(n.a,{href:"/components-helpers#message-history",children:[(0,t.jsx)(n.strong,{children:"Message History"})," component"]})," and ",(0,t.jsx)(n.a,{href:"/agents#agent-memory",children:"Agent memory"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"see-also",children:"See also"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"/concepts-file-management",children:"Langflow file management"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"/logging",children:"Langflow logs"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"/environment-variables",children:"Langflow environment variables"})}),"\n"]})]})}function x(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(f,{...e})}):f(e)}function g(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}}}]); \ No newline at end of file diff --git a/assets/js/47e58a89.4e5117ba.js b/assets/js/47e58a89.4e5117ba.js deleted file mode 100644 index 9a3627fc13..0000000000 --- a/assets/js/47e58a89.4e5117ba.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[1006],{28453:(e,n,s)=>{s.d(n,{R:()=>a,x:()=>i});var o=s(96540);const t={},r=o.createContext(t);function a(e){const n=o.useContext(r);return o.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function i(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:a(e.components),o.createElement(r.Provider,{value:n},e.children)}},33354:(e,n,s)=>{s.r(n),s.d(n,{CH:()=>l,assets:()=>d,chCodeConfig:()=>h,contentTitle:()=>c,default:()=>g,frontMatter:()=>i,metadata:()=>o,toc:()=>m});const o=JSON.parse('{"id":"Develop/memory","title":"Memory management options","description":"Langflow provides flexible memory management options for storage and retrieval of data relevant to your flows and your Langflow server.","source":"@site/docs/Develop/memory.mdx","sourceDirName":"Develop","slug":"/memory","permalink":"/memory","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Memory management options","slug":"/memory"},"sidebar":"docs","previous":{"title":"Manage files","permalink":"/concepts-file-management"},"next":{"title":"Use Session IDs","permalink":"/session-id"}}');var t=s(74848),r=s(28453),a=s(24754);const i={title:"Memory management options",slug:"/memory"},c=void 0,d={},l={annotations:a.hk,Code:a.Cy},h={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},m=[{value:"Storage options and paths",id:"storage-options-and-paths",level:2},{value:"Langflow database tables",id:"langflow-database-tables",level:2},{value:"Configure external memory",id:"configure-external-memory",level:2},{value:"Configure cache memory",id:"configure-cache-memory",level:2},{value:"Store chat memory",id:"store-chat-memory",level:2},{value:"Session ID and chat memory",id:"session-id-and-chat-memory",level:3},{value:"Chat memory options",id:"chat-memory-options",level:3},{value:"See also",id:"see-also",level:2}];function f(e){const n={a:"a",admonition:"admonition",code:"code",em:"em",h2:"h2",h3:"h3",li:"li",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,r.R)(),...e.components},{Details:s}=n;return l||x("CH",!1),l.Code||x("CH.Code",!0),s||x("Details",!0),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n",(0,t.jsx)(n.p,{children:"Langflow provides flexible memory management options for storage and retrieval of data relevant to your flows and your Langflow server.\nThis includes essential Langflow database tables, file management, and caching, as well as chat memory."}),"\n",(0,t.jsx)(n.h2,{id:"storage-options-and-paths",children:"Storage options and paths"}),"\n",(0,t.jsx)(n.p,{children:"Langflow supports both local memory and external memory options."}),"\n",(0,t.jsxs)(n.p,{children:["Langflow's default storage option is a ",(0,t.jsx)(n.a,{href:"https://www.sqlite.org/",children:"SQLite"})," database.\nThe default storage path depends on your operating system and installation method:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"Langflow Desktop"}),":","\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"macOS"}),": ",(0,t.jsx)(n.code,{children:"/Users//.langflow/data/database.db"})]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"Windows"}),": ",(0,t.jsx)(n.code,{children:"C:\\Users\\\\AppData\\Roaming\\com.Langflow\\data\\langflow.db"})]}),"\n"]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"Langflow OSS"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsxs)(n.strong,{children:["macOS/Windows/Linux/WSL with ",(0,t.jsx)(n.code,{children:"uv pip install"})]}),": ",(0,t.jsx)(n.code,{children:"/lib/python3.12/site-packages/langflow/langflow.db"})," (Python version can vary. Database isn't shared between virtual environments because it is tied to the venv path.)"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsxs)(n.strong,{children:["macOS/Windows/Linux/WSL with ",(0,t.jsx)(n.code,{children:"git clone"})]}),": ",(0,t.jsx)(n.code,{children:"/src/backend/base/langflow/langflow.db"})]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(n.p,{children:"Langflow offers a few alternatives to the default database path:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"Config directory"}),": Set ",(0,t.jsx)(n.code,{children:"LANGFLOW_SAVE_DB_IN_CONFIG_DIR=True"})," to store the database in your Langflow config directory as set in ",(0,t.jsx)(n.a,{href:"/logging",children:(0,t.jsx)(n.code,{children:"LANGFLOW_CONFIG_DIR"})}),"."]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"External PostgreSQL database"}),": You can use an external PostgreSQL database for all of your Langflow storage.\nFor more information, see ",(0,t.jsx)(n.a,{href:"#configure-external-memory",children:"Configure external memory"})]}),"\n",(0,t.jsx)(n.p,{children:"External storage can be useful if you want to preserve the data after uninstalling Langflow or to share the same database between multiple virtual environments."}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"Separate chat memory"}),": You can selectively use external storage for chat memory only, separate from other Langflow storage.\nFor more information, see ",(0,t.jsx)(n.a,{href:"#store-chat-memory",children:"Store chat memory"}),"."]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"No database"}),": To disable all database operations and run a no-op session, set ",(0,t.jsx)(n.code,{children:"LANGFLOW_USE_NOOP_DATABASE=True"})," in your ",(0,t.jsx)(n.a,{href:"/environment-variables",children:"Langflow environment variables"}),".\nThis is useful for testing when you don't want to persist any data."]}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"langflow-database-tables",children:"Langflow database tables"}),"\n",(0,t.jsxs)(n.p,{children:["The following tables are stored in ",(0,t.jsx)(n.code,{children:"langflow.db"}),":"]}),"\n",(0,t.jsxs)(n.p,{children:["\u2022 ",(0,t.jsx)(n.strong,{children:"ApiKey"}),": Manages Langflow API authentication keys. Component API keys are stored in the ",(0,t.jsx)(n.strong,{children:"Variables"})," table. For more information, see ",(0,t.jsx)(n.a,{href:"/api-keys-and-authentication",children:"API keys and authentication"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["\u2022 ",(0,t.jsx)(n.strong,{children:"File"}),": Stores metadata for files uploaded to Langflow's file management system, including file names, paths, sizes, and storage providers. For more information, see ",(0,t.jsx)(n.a,{href:"/concepts-file-management",children:"Manage files"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["\u2022 ",(0,t.jsx)(n.strong,{children:"Flow"}),": Contains flow definitions, including nodes, edges, and components, stored as JSON or database records. For more information, see ",(0,t.jsx)(n.a,{href:"/concepts-flows",children:"Build flows"}),"."]}),"\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsxs)(n.p,{children:["To automatically remove API keys and tokens from flow data before saving a flow to the database, set ",(0,t.jsx)(n.code,{children:"LANGFLOW_REMOVE_API_KEYS=True"})," in your ",(0,t.jsx)(n.a,{href:"/environment-variables",children:"Langflow environment variables"}),".\nWhen true, any field marked as a password field that ",(0,t.jsx)(n.em,{children:"also"})," has ",(0,t.jsx)(n.code,{children:"api"}),", ",(0,t.jsx)(n.code,{children:"key"}),", or ",(0,t.jsx)(n.code,{children:"token"})," in its name is set to ",(0,t.jsx)(n.code,{children:"null"})," before the flow is saved.\nThis helps prevent credentials from being stored in the database."]})}),"\n",(0,t.jsxs)(n.p,{children:["\u2022 ",(0,t.jsx)(n.strong,{children:"Folder"}),": Provides a structure for flow storage, including single-user folders and shared folders accessed by multiple users. For more information, see ",(0,t.jsx)(n.a,{href:"/concepts-flows#projects",children:"Manage flows in projects"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["\u2022 ",(0,t.jsx)(n.strong,{children:"Message"}),": Stores chat messages and interactions that occur between components. For more information, see ",(0,t.jsx)(n.a,{href:"/data-types#message",children:"Message objects"})," and ",(0,t.jsx)(n.a,{href:"#store-chat-memory",children:"Store chat memory"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["\u2022 ",(0,t.jsx)(n.strong,{children:"Transactions"}),": Records execution history and results of flow runs. This information is used for ",(0,t.jsx)(n.a,{href:"/logging",children:"logging"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["\u2022 ",(0,t.jsx)(n.strong,{children:"User"}),": Stores user account information including credentials, permissions, profiles, and user management settings. For more information, see ",(0,t.jsx)(n.a,{href:"/api-keys-and-authentication",children:"API keys and authentication"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["\u2022 ",(0,t.jsx)(n.strong,{children:"Variables"}),": Stores global encrypted values and credentials. For more information, see ",(0,t.jsx)(n.a,{href:"/configuration-global-variables",children:"Global variables"})," and ",(0,t.jsx)(n.a,{href:"/api-keys-and-authentication#component-api-keys",children:"Component API keys"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["\u2022 ",(0,t.jsx)(n.strong,{children:"VertexBuild"}),": Tracks the build status of individual nodes within flows. For more information, see ",(0,t.jsx)(n.a,{href:"/concepts-playground",children:"Test flows in the Playground"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["For more information, see the database models in the ",(0,t.jsx)(n.a,{href:"https://github.com/langflow-ai/langflow/tree/main/src/backend/base/langflow/services/database/models",children:"source code"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"configure-external-memory",children:"Configure external memory"}),"\n",(0,t.jsxs)(n.p,{children:["To replace the default Langflow SQLite database with another database, set the ",(0,t.jsx)(n.code,{children:"LANGFLOW_DATABASE_URL"})," environment variable to your database URL, and then start Langflow with your ",(0,t.jsx)(n.code,{children:".env"})," file.\nFor more information and examples, see ",(0,t.jsx)(n.a,{href:"/configuration-custom-database",children:"Configure an external PostgreSQL database"}),"."]}),"\n",(0,t.jsx)(l.Code,{codeConfig:h,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"LANGFLOW_DATABASE_URL=postgresql://user:password@localhost:5432/langflow",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,t.jsx)(n.p,{children:"To fine-tune your database connection pool and timeout settings, you can set the following additional environment variables:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.code,{children:"LANGFLOW_DATABASE_CONNECTION_RETRY"}),": Whether to retry lost connections to your Langflow database. If true, Langflow tries to connect to the database again if the connection fails. Default: False."]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.code,{children:"LANGFLOW_DB_CONNECT_TIMEOUT"}),": The number of seconds to wait before giving up on a lock to be released or establishing a connection to the database. This may be separate from the ",(0,t.jsx)(n.code,{children:"pool_timeout"})," in ",(0,t.jsx)(n.code,{children:"LANGFLOW_DB_CONNECTION_SETTINGS"}),". Default: 30."]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.code,{children:"LANGFLOW_DB_CONNECTION_SETTINGS"}),": A a JSON dictionary containing the following database connection pool settings:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"pool_size"}),": The base number of connections to keep open in the connection pool. Default: 20."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"max_overflow"}),": Maximum number of connections that can be created in excess of ",(0,t.jsx)(n.code,{children:"pool_size"})," if needed. Default: 30."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"pool_timeout"}),": Number of seconds to wait for a connection from the pool before timing out. Default: 30."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"pool_pre_ping"}),": If true, the pool tests connections for liveness upon each checkout. Default: True."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"pool_recycle"}),": Number of seconds after which a connection is automatically recycled. Default: 1800 (30 minutes)."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"echo"}),": If true, SQL queries are logged for debugging purposes. Default: False."]}),"\n"]}),"\n",(0,t.jsx)(n.p,{children:"For example:"}),"\n",(0,t.jsx)(l.Code,{codeConfig:h,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:'LANGFLOW_DB_CONNECTION_SETTINGS=\'{"pool_size": 20, "max_overflow": 30, "pool_timeout": 30, "pool_pre_ping": true, "pool_recycle": 1800, "echo": false}\'',props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,t.jsxs)(n.p,{children:["Don't use the deprecated environment variables ",(0,t.jsx)(n.code,{children:"LANGFLOW_DB_POOL_SIZE"})," or ",(0,t.jsx)(n.code,{children:"LANGFLOW_DB_MAX_OVERFLOW"}),".\nInstead, use ",(0,t.jsx)(n.code,{children:"pool_size"})," and ",(0,t.jsx)(n.code,{children:"max_overflow"})," in ",(0,t.jsx)(n.code,{children:"LANGFLOW_DB_CONNECTION_SETTINGS"}),"."]}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"configure-cache-memory",children:"Configure cache memory"}),"\n",(0,t.jsx)(n.p,{children:"The default Langflow caching behavior is an asynchronous, in-memory cache:"}),"\n",(0,t.jsx)(l.Code,{codeConfig:h,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"LANGFLOW_LANGCHAIN_CACHE=InMemoryCache",props:{}}]},{tokens:[{content:"LANGFLOW_CACHE_TYPE=async",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,t.jsx)(n.p,{children:"Langflow officially supports only the default asynchronous, in-memory cache, which is suitable for most use cases.\nOther cache options, such as Redis, are experimental and can change without notice.\nIf you want to use a non-default cache setting, you can use the following environment variables:"}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Variable"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Default"}),(0,t.jsx)(n.th,{children:"Description"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"LANGFLOW_CACHE_TYPE"})}),(0,t.jsx)(n.td,{children:"String"}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"async"})}),(0,t.jsxs)(n.td,{children:["Set the cache type for Langflow's internal caching system. Possible values: ",(0,t.jsx)(n.code,{children:"async"}),", ",(0,t.jsx)(n.code,{children:"redis"}),", ",(0,t.jsx)(n.code,{children:"memory"}),", ",(0,t.jsx)(n.code,{children:"disk"}),". If you set the type to ",(0,t.jsx)(n.code,{children:"redis"}),", then you must also set the ",(0,t.jsx)(n.code,{children:"LANGFLOW_REDIS_*"})," environment variables."]})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"LANGFLOW_LANGCHAIN_CACHE"})}),(0,t.jsx)(n.td,{children:"String"}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"InMemoryCache"})}),(0,t.jsxs)(n.td,{children:["Set the cache storage type for the LangChain caching system (a Langflow dependency), either ",(0,t.jsx)(n.code,{children:"InMemoryCache"})," or ",(0,t.jsx)(n.code,{children:"SQLiteCache"}),"."]})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"LANGFLOW_REDIS_HOST"})}),(0,t.jsx)(n.td,{children:"String"}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"localhost"})}),(0,t.jsxs)(n.td,{children:["Redis server hostname if ",(0,t.jsx)(n.code,{children:"LANGFLOW_CACHE_TYPE=redis"}),"."]})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"LANGFLOW_REDIS_PORT"})}),(0,t.jsx)(n.td,{children:"Integer"}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"6379"})}),(0,t.jsxs)(n.td,{children:["Redis server port if ",(0,t.jsx)(n.code,{children:"LANGFLOW_CACHE_TYPE=redis"}),"."]})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"LANGFLOW_REDIS_DB"})}),(0,t.jsx)(n.td,{children:"Integer"}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"0"})}),(0,t.jsxs)(n.td,{children:["Redis database number if ",(0,t.jsx)(n.code,{children:"LANGFLOW_CACHE_TYPE=redis"}),"."]})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"LANGFLOW_REDIS_CACHE_EXPIRE"})}),(0,t.jsx)(n.td,{children:"Integer"}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"3600"})}),(0,t.jsxs)(n.td,{children:["Cache expiration time in seconds if ",(0,t.jsx)(n.code,{children:"LANGFLOW_CACHE_TYPE=redis"}),"."]})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"LANGFLOW_REDIS_PASSWORD"})}),(0,t.jsx)(n.td,{children:"String"}),(0,t.jsx)(n.td,{children:"Not set"}),(0,t.jsxs)(n.td,{children:["Optional password for Redis authentication if ",(0,t.jsx)(n.code,{children:"LANGFLOW_CACHE_TYPE=redis"}),"."]})]})]})]}),"\n",(0,t.jsx)(n.h2,{id:"store-chat-memory",children:"Store chat memory"}),"\n",(0,t.jsxs)(n.p,{children:["Chat-based flows with a ",(0,t.jsx)(n.strong,{children:"Chat Input"})," or ",(0,t.jsx)(n.strong,{children:"Chat Output"})," component produce chat history that is stored in the Langflow ",(0,t.jsx)(n.code,{children:"messages"})," table.\nAt minimum, this serves as a chat log, but it isn't functionally the same as chat memory that provides historical context to an LLM."]}),"\n",(0,t.jsxs)(n.p,{children:["To store and retrieve chat memories in flows, you can use a ",(0,t.jsx)(n.strong,{children:"Message History"})," component or the ",(0,t.jsx)(n.strong,{children:"Agent"})," component's built-in chat memory."]}),"\n",(0,t.jsxs)(s,{children:[(0,t.jsx)("summary",{children:"How does chat memory work?"}),(0,t.jsx)(n.p,{children:"Chat memory is a cache for an LLM or agent to preserve past conversations to retain and reference that context in future interactions.\nFor example, if a user has already told the LLM their name, the LLM can retrieve that information from chat memory rather than asking the user to repeat themselves in future conversations or messages."}),(0,t.jsx)(n.p,{children:"Chat memory is distinct from vector store memory because it is built specifically for storing and retrieving chat messages from databases."}),(0,t.jsxs)(n.p,{children:["Components that support chat memory (such as the ",(0,t.jsx)(n.strong,{children:"Agent"})," and ",(0,t.jsx)(n.strong,{children:"Message History"})," components) provide access to their respective databases ",(0,t.jsx)(n.em,{children:"as memory"}),".\nRetrieval as memory is an important distinction for LLMs and agents because this storage and retrieval mechanism is specifically designed to recall context from past conversations.\nUnlike vector stores, which are designed for semantic search and retrieval of text chunks, chat memory is designed to store and retrieve chat messages in a way that is optimized for conversation history."]})]}),"\n",(0,t.jsx)(n.h3,{id:"session-id-and-chat-memory",children:"Session ID and chat memory"}),"\n",(0,t.jsxs)(n.p,{children:["Chat history and memories are grouped by ",(0,t.jsxs)(n.a,{href:"/session-id",children:["session ID (",(0,t.jsx)(n.code,{children:"session_id"}),")"]}),"."]}),"\n",(0,t.jsx)(n.p,{children:"The default session ID is the flow ID, which means that all chat messages for a flow are stored under the same session ID as one large chat session."}),"\n",(0,t.jsx)(n.p,{children:"For better segregation of chat memory, especially in flows used by multiple users, consider using custom session IDs.\nFor example, if you use user IDs as session IDs, then each user's chat history is stored separately, isolating the context of their chats from other users' chats."}),"\n",(0,t.jsx)(n.h3,{id:"chat-memory-options",children:"Chat memory options"}),"\n",(0,t.jsx)(n.p,{children:"Where and how chat memory is stored depends on the components used in your flow:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"Agent component"}),": This component has built-in chat memory that is enabled by default.\nThis memory allows the agent to retrieve and reference messages from previous conversations associated with the same session ID.\nAll messages are stored in ",(0,t.jsx)(n.a,{href:"#storage-options-and-paths",children:"Langflow storage"}),", and the component provides minimal memory configuration options, such as the number of messages to retrieve."]}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.strong,{children:"Agent"})," component's built-in chat memory is sufficient for most use cases."]}),"\n",(0,t.jsxs)(n.p,{children:["If you want to use external chat memory storage, retrieve memories outside the context of a chat, or use chat memory with a language model component (not an agent), you must use the ",(0,t.jsx)(n.strong,{children:"Message History"})," component (with or without a third-party chat memory component)."]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"Message History component"}),": By default, this component stores and retrieves memories from Langflow storage, unless you attach a third-party chat memory component. It provides a few more options for sorting and filtering memories, although most of these options are also built-in to the ",(0,t.jsx)(n.strong,{children:"Agent"})," component as configurable or fixed parameters."]}),"\n",(0,t.jsxs)(n.p,{children:["You can use the ",(0,t.jsx)(n.strong,{children:"Message History"})," component with or without a language model or agent.\nFor example, if you need to retrieve data from memories outside of chat, you can use the ",(0,t.jsx)(n.strong,{children:"Message History"})," component to fetch that data directly from your chat memory database without feeding it into a chat."]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"Third-party chat memory components"}),": Use one of these components only if you need to store or retrieve chat memories from a dedicated external chat memory database.\nTypically, this is necessary only if you have specific storage needs that aren't met by Langflow storage.\nFor example, if you want to manage chat memory data by directly working with the database, or if you want to use a different database than the default Langflow storage."]}),"\n"]}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["For more information and examples, see ",(0,t.jsxs)(n.a,{href:"/components-helpers#message-history",children:[(0,t.jsx)(n.strong,{children:"Message History"})," component"]})," and ",(0,t.jsx)(n.a,{href:"/agents#agent-memory",children:"Agent memory"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"see-also",children:"See also"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"/concepts-file-management",children:"Langflow file management"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"/logging",children:"Langflow logs"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"/environment-variables",children:"Langflow environment variables"})}),"\n"]})]})}function g(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(f,{...e})}):f(e)}function x(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}}}]); \ No newline at end of file diff --git a/assets/js/5015646b.33dbb4ec.js b/assets/js/5015646b.33dbb4ec.js deleted file mode 100644 index f7fdad0a3e..0000000000 --- a/assets/js/5015646b.33dbb4ec.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[824],{11470:(e,n,t)=>{t.d(n,{A:()=>w});var s=t(96540),r=t(18215),o=t(23104),a=t(56347),i=t(205),c=t(57485),l=t(31682),d=t(70679);function h(e){return s.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,s.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function p(e){const{values:n,children:t}=e;return(0,s.useMemo)(()=>{const e=n??function(e){return h(e).map(({props:{value:e,label:n,attributes:t,default:s}})=>({value:e,label:n,attributes:t,default:s}))}(t);return function(e){const n=(0,l.XI)(e,(e,n)=>e.value===n.value);if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map(e=>e.value).join(", ")}" found in . Every value needs to be unique.`)}(e),e},[n,t])}function m({value:e,tabValues:n}){return n.some(n=>n.value===e)}function u({queryString:e=!1,groupId:n}){const t=(0,a.W6)(),r=function({queryString:e=!1,groupId:n}){if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:e,groupId:n});return[(0,c.aZ)(r),(0,s.useCallback)(e=>{if(!r)return;const n=new URLSearchParams(t.location.search);n.set(r,e),t.replace({...t.location,search:n.toString()})},[r,t])]}function x(e){const{defaultValue:n,queryString:t=!1,groupId:r}=e,o=p(e),[a,c]=(0,s.useState)(()=>function({defaultValue:e,tabValues:n}){if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(e){if(!m({value:e,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${n.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}const t=n.find(e=>e.default)??n[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:n,tabValues:o})),[l,h]=u({queryString:t,groupId:r}),[x,j]=function({groupId:e}){const n=function(e){return e?`docusaurus.tab.${e}`:null}(e),[t,r]=(0,d.Dv)(n);return[t,(0,s.useCallback)(e=>{n&&r.set(e)},[n,r])]}({groupId:r}),g=(()=>{const e=l??x;return m({value:e,tabValues:o})?e:null})();(0,i.A)(()=>{g&&c(g)},[g]);return{selectedValue:a,selectValue:(0,s.useCallback)(e=>{if(!m({value:e,tabValues:o}))throw new Error(`Can't select invalid tab value=${e}`);c(e),h(e),j(e)},[h,j,o]),tabValues:o}}var j=t(92303);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=t(74848);function y({className:e,block:n,selectedValue:t,selectValue:s,tabValues:a}){const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,o.a_)(),l=e=>{const n=e.currentTarget,r=i.indexOf(n),o=a[r].value;o!==t&&(c(n),s(o))},d=e=>{let n=null;switch(e.key){case"Enter":l(e);break;case"ArrowRight":{const t=i.indexOf(e.currentTarget)+1;n=i[t]??i[0];break}case"ArrowLeft":{const t=i.indexOf(e.currentTarget)-1;n=i[t]??i[i.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.A)("tabs",{"tabs--block":n},e),children:a.map(({value:e,label:n,attributes:s})=>(0,f.jsx)("li",{role:"tab",tabIndex:t===e?0:-1,"aria-selected":t===e,ref:e=>{i.push(e)},onKeyDown:d,onClick:l,...s,className:(0,r.A)("tabs__item",g.tabItem,s?.className,{"tabs__item--active":t===e}),children:n??e},e))})}function b({lazy:e,children:n,selectedValue:t}){const o=(Array.isArray(n)?n:[n]).filter(Boolean);if(e){const e=o.find(e=>e.props.value===t);return e?(0,s.cloneElement)(e,{className:(0,r.A)("margin-top--md",e.props.className)}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:o.map((e,n)=>(0,s.cloneElement)(e,{key:n,hidden:e.props.value!==t}))})}function v(e){const n=x(e);return(0,f.jsxs)("div",{className:(0,r.A)("tabs-container",g.tabList),children:[(0,f.jsx)(y,{...n,...e}),(0,f.jsx)(b,{...n,...e})]})}function w(e){const n=(0,j.A)();return(0,f.jsx)(v,{...e,children:h(e.children)},String(n))}},17886:(e,n,t)=>{t.d(n,{A:()=>o});t(96540);var s=t(64058),r=t(74848);function o({name:e,...n}){const t=s[e];return t?(0,r.jsx)(t,{...n}):null}},19365:(e,n,t)=>{t.d(n,{A:()=>a});t(96540);var s=t(18215);const r={tabItem:"tabItem_Ymn6"};var o=t(74848);function a({children:e,hidden:n,className:t}){return(0,o.jsx)("div",{role:"tabpanel",className:(0,s.A)(r.tabItem,t),hidden:n,children:e})}},28838:(e,n,t)=>{t.r(n),t.d(n,{CH:()=>x,assets:()=>u,chCodeConfig:()=>j,contentTitle:()=>m,default:()=>y,frontMatter:()=>p,metadata:()=>s,toc:()=>g});const s=JSON.parse('{"id":"Components/components-helpers","title":"Helpers","description":"Helper components provide utility functions to help manage data and perform simple tasks in your flow.","source":"@site/docs/Components/components-helpers.mdx","sourceDirName":"Components","slug":"/components-helpers","permalink":"/components-helpers","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Helpers","slug":"/components-helpers"},"sidebar":"docs","previous":{"title":"Logic","permalink":"/components-logic"},"next":{"title":"Tools","permalink":"/components-tools"}}');var r=t(74848),o=t(28453),a=t(24754),i=t(17886),c=t(11470),l=t(19365),d=t(31929),h=t(36813);const p={title:"Helpers",slug:"/components-helpers"},m=void 0,u={},x={annotations:a.hk,Code:a.Cy},j={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},g=[{value:"Calculator",id:"calculator",level:2},{value:"Calculator parameters",id:"calculator-parameters",level:3},{value:"Current Date",id:"current-date",level:2},{value:"Current Date parameters",id:"current-date-parameters",level:3},{value:"Message History",id:"message-history",level:2},{value:"Use the Message History component in a flow",id:"use-the-message-history-component-in-a-flow",level:3},{value:"Message History parameters",id:"message-history-parameters",level:3},...d.RM,{value:"Message History output",id:"message-history-output",level:3},{value:"Legacy Helper components",id:"legacy-helper-components",level:2},...h.RM];function f(e){const n={a:"a",admonition:"admonition",code:"code",em:"em",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,o.R)(),...e.components};return x||b("CH",!1),x.Code||b("CH.Code",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n","\n",(0,r.jsx)(n.p,{children:"Helper components provide utility functions to help manage data and perform simple tasks in your flow."}),"\n",(0,r.jsx)(n.h2,{id:"calculator",children:"Calculator"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"Calculator"})," component performs basic arithmetic operations on mathematical expressions.\nIt supports addition, subtraction, multiplication, division, and exponentiation operations."]}),"\n",(0,r.jsxs)(n.p,{children:["For an example of using this component in a flow, see the ",(0,r.jsxs)(n.a,{href:"/components-processing#python-interpreter",children:[(0,r.jsx)(n.strong,{children:"Python Interpreter"})," component"]}),"."]}),"\n",(0,r.jsx)(n.h3,{id:"calculator-parameters",children:"Calculator parameters"}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"expression"}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsxs)(n.td,{children:["Input parameter. The arithmetic expression to evaluate, such as ",(0,r.jsx)(n.code,{children:"4*4*(33/22)+12-20"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"result"}),(0,r.jsx)(n.td,{children:"Data"}),(0,r.jsxs)(n.td,{children:["Output parameter. The calculation result as a ",(0,r.jsxs)(n.a,{href:"/data-types",children:[(0,r.jsx)(n.code,{children:"Data"})," object"]})," containing the evaluated expression."]})]})]})]}),"\n",(0,r.jsx)(n.h2,{id:"current-date",children:"Current Date"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"Current Date"})," component returns the current date and time in a selected timezone. This component provides a flexible way to obtain timezone-specific date and time information within a Langflow pipeline."]}),"\n",(0,r.jsx)(n.h3,{id:"current-date-parameters",children:"Current Date parameters"}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"timezone"}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsx)(n.td,{children:"Input parameter. The timezone for the current date and time."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"current_date"}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsx)(n.td,{children:"Output parameter. The resulting current date and time in the selected timezone."})]})]})]}),"\n",(0,r.jsx)(n.h2,{id:"message-history",children:"Message History"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"Message History"})," component provides combined chat history and message storage functionality.\nIt can store and retrieve chat messages from either ",(0,r.jsx)(n.a,{href:"/memory",children:"Langflow storage"})," ",(0,r.jsx)(n.em,{children:"or"})," a dedicated chat memory database like Mem0 or Redis."]}),"\n",(0,r.jsxs)(n.admonition,{type:"important",children:[(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"Agent"})," component has built-in chat memory that is enabled by default and uses Langflow storage.\nThis built-in chat memory functionality is sufficient for most use cases."]}),(0,r.jsxs)(n.p,{children:["Use the ",(0,r.jsx)(n.strong,{children:"Message History"})," component for the following use cases:"]}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"You need to store and retrieve chat memory for a language model component (not an agent)."}),"\n",(0,r.jsx)(n.li,{children:"You need to retrieve chat memories outside the chat context, such as a sentiment analysis flow that retrieves and analyzes recently stored memories."}),"\n",(0,r.jsx)(n.li,{children:"You want to store memories in a specific database that is separate from Langflow storage."}),"\n"]}),(0,r.jsxs)(n.p,{children:["For more information, see ",(0,r.jsx)(n.a,{href:"/memory#store-chat-memory",children:"Store chat memory"}),"."]})]}),"\n",(0,r.jsx)(n.h3,{id:"use-the-message-history-component-in-a-flow",children:"Use the Message History component in a flow"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"Message History"})," component has two modes, depending on where you want to use it in your flow:"]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Retrieve mode"}),": The component retrieves chat messages from your Langflow database or external memory."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Store mode"}),": The component stores chat messages in your Langflow database or external memory."]}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["This means that you need multiple ",(0,r.jsx)(n.strong,{children:"Message History"})," components in your flow if you want to both store and retrieve chat messages."]}),"\n",(0,r.jsxs)(c.A,{children:[(0,r.jsxs)(l.A,{value:"langflow",label:"Use Langflow storage",default:!0,children:[(0,r.jsxs)(n.p,{children:["The following steps explain how to create a chat-based flow that uses ",(0,r.jsx)(n.strong,{children:"Message History"})," components to store and retrieve chat memory from your Langflow installation's database:"]}),(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Create or edit a flow where you want to use chat memory."}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["At the beginning of the flow, add a ",(0,r.jsx)(n.strong,{children:"Message History"})," component, and then set it to ",(0,r.jsx)(n.strong,{children:"Retrieve"})," mode."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Optional: In the ",(0,r.jsx)(n.strong,{children:"Message History"})," ",(0,r.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),", click ",(0,r.jsx)(i.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Controls"})," to enable parameters for memory sorting, filtering, and limits."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Add a ",(0,r.jsxs)(n.a,{href:"/components-prompts",children:[(0,r.jsx)(n.strong,{children:"Prompt Template"})," component"]}),", add a ",(0,r.jsx)(n.code,{children:"{memory}"})," variable to the ",(0,r.jsx)(n.strong,{children:"Template"})," field, and then connect the ",(0,r.jsx)(n.strong,{children:"Message History"})," output to the ",(0,r.jsx)(n.strong,{children:"memory"})," input."]}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"Prompt Template"})," component supplies instructions and context to LLMs, separate from chat messages passed through a ",(0,r.jsx)(n.strong,{children:"Chat Input"})," component.\nThe template can include any text and variables that you want to supply to the LLM, for example:"]}),"\n",(0,r.jsx)(x.Code,{codeConfig:j,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"You are a helpful assistant that answers questions.",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"Use markdown to format your answer, properly embedding images and urls.",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"History:",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"{memory}",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,r.jsxs)(n.p,{children:["Variables (",(0,r.jsx)(n.code,{children:"{variable}"}),") in the template dynamically add fields to the ",(0,r.jsx)(n.strong,{children:"Prompt Template"})," component so that your flow can receive definitions for those values from elsewhere, such as other components, Langflow global variables, or runtime input."]}),"\n",(0,r.jsxs)(n.p,{children:["In this example, the ",(0,r.jsx)(n.code,{children:"{memory}"})," variable is populated by the retrieved chat memories, which are then passed to a ",(0,r.jsx)(n.strong,{children:"Language Model"})," or ",(0,r.jsx)(n.strong,{children:"Agent"})," component to provide additional context to the LLM."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Connect the ",(0,r.jsx)(n.strong,{children:"Prompt Template"})," component's output to a ",(0,r.jsx)(n.strong,{children:"Language Model"})," component's ",(0,r.jsx)(n.strong,{children:"System Message"})," input."]}),"\n",(0,r.jsxs)(n.p,{children:["This example uses the ",(0,r.jsx)(n.strong,{children:"Language Model"})," core component as the central chat driver, but you can also use another language model component or the ",(0,r.jsx)(n.strong,{children:"Agent"})," component."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Add a ",(0,r.jsx)(n.strong,{children:"Chat Input"})," component, and then connect it to the ",(0,r.jsx)(n.strong,{children:"Language Model"})," component's ",(0,r.jsx)(n.strong,{children:"Input"})," field."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Connect the ",(0,r.jsx)(n.strong,{children:"Language Model"})," component's output to a ",(0,r.jsx)(n.strong,{children:"Chat Output"})," component."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["At the end of the flow, add another ",(0,r.jsx)(n.strong,{children:"Message History"})," component, and then set it to ",(0,r.jsx)(n.strong,{children:"Store"})," mode."]}),"\n",(0,r.jsxs)(n.p,{children:["Configure any additional parameters in the second ",(0,r.jsx)(n.strong,{children:"Message History"})," component as needed, taking into consideration that this particular component will store chat messages rather than retrieve them."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Connect the ",(0,r.jsx)(n.strong,{children:"Chat Output"})," component's output to the ",(0,r.jsx)(n.strong,{children:"Message History"})," component's ",(0,r.jsx)(n.strong,{children:"Message"})," input."]}),"\n",(0,r.jsxs)(n.p,{children:["Each response from the LLM is output from the ",(0,r.jsx)(n.strong,{children:"Language Model"})," component to the ",(0,r.jsx)(n.strong,{children:"Chat Output"})," component, and then stored in chat memory by the final ",(0,r.jsx)(n.strong,{children:"Message History"})," component."]}),"\n"]}),"\n"]})]}),(0,r.jsxs)(l.A,{value:"external",label:"Use external chat memory",children:[(0,r.jsxs)(n.p,{children:["To store and retrieve chat memory from a dedicated, external chat memory database, use the ",(0,r.jsx)(n.strong,{children:"Message History"})," component ",(0,r.jsx)(n.em,{children:"and"})," a provider-specific chat memory component."]}),(0,r.jsxs)(n.p,{children:["The following steps explain how to create a flow that stores and retrieves chat memory from a ",(0,r.jsxs)(n.a,{href:"/bundles-redis",children:[(0,r.jsx)(n.strong,{children:"Redis Chat Memory"})," component"]}),".\nOther options include the ",(0,r.jsxs)(n.a,{href:"/bundles-mem0",children:[(0,r.jsx)(n.strong,{children:"Mem0 Chat Memory"})," component"]})," and ",(0,r.jsxs)(n.a,{href:"/bundles-cassandra#cassandra-chat-memory",children:[(0,r.jsx)(n.strong,{children:"Cassandra Chat Memory"})," component"]}),"."]}),(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Create or edit a flow where you want to use chat memory."}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["At the beginning of the flow, add a ",(0,r.jsx)(n.strong,{children:"Message History"})," component and a ",(0,r.jsx)(n.strong,{children:"Redis Chat Memory"})," component:"]}),"\n",(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Configure the ",(0,r.jsx)(n.strong,{children:"Redis Chat Memory"})," component to connect to your Redis database. For more information, see the ",(0,r.jsx)(n.a,{href:"https://redis.io/docs/latest/",children:"Redis documentation"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Set the ",(0,r.jsx)(n.strong,{children:"Message History"})," component to ",(0,r.jsx)(n.strong,{children:"Retrieve"})," mode."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["In the ",(0,r.jsx)(n.strong,{children:"Message History"})," ",(0,r.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),", click ",(0,r.jsx)(i.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Controls"}),", enable ",(0,r.jsx)(n.strong,{children:"External Memory"}),", and then click ",(0,r.jsx)(n.strong,{children:"Close"}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["In ",(0,r.jsx)(n.strong,{children:"Controls"}),", you can also enable parameters for memory sorting, filtering, and limits."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Connect the ",(0,r.jsx)(n.strong,{children:"Redis Chat Memory"})," component's output to the ",(0,r.jsx)(n.strong,{children:"Message History"})," component's ",(0,r.jsx)(n.strong,{children:"External Memory"})," input."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Add a ",(0,r.jsxs)(n.a,{href:"/components-prompts",children:[(0,r.jsx)(n.strong,{children:"Prompt Template"})," component"]}),", add a ",(0,r.jsx)(n.code,{children:"{memory}"})," variable to the ",(0,r.jsx)(n.strong,{children:"Template"})," field, and then connect the ",(0,r.jsx)(n.strong,{children:"Message History"})," output to the ",(0,r.jsx)(n.strong,{children:"memory"})," input."]}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"Prompt Template"})," component supplies instructions and context to LLMs, separate from chat messages passed through a ",(0,r.jsx)(n.strong,{children:"Chat Input"})," component.\nThe template can include any text and variables that you want to supply to the LLM, for example:"]}),"\n",(0,r.jsx)(x.Code,{codeConfig:j,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"You are a helpful assistant that answers questions.",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"Use markdown to format your answer, properly embedding images and urls.",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"History:",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"{memory}",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,r.jsxs)(n.p,{children:["Variables (",(0,r.jsx)(n.code,{children:"{variable}"}),") in the template dynamically add fields to the ",(0,r.jsx)(n.strong,{children:"Prompt Template"})," component so that your flow can receive definitions for those values from elsewhere, such as other components, Langflow global variables, or runtime input."]}),"\n",(0,r.jsxs)(n.p,{children:["In this example, the ",(0,r.jsx)(n.code,{children:"{memory}"})," variable is populated by the retrieved chat memories, which are then passed to a ",(0,r.jsx)(n.strong,{children:"Language Model"})," or ",(0,r.jsx)(n.strong,{children:"Agent"})," component to provide additional context to the LLM."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Connect the ",(0,r.jsx)(n.strong,{children:"Prompt Template"})," component's output to a ",(0,r.jsx)(n.strong,{children:"Language Model"})," component's ",(0,r.jsx)(n.strong,{children:"System Message"})," input."]}),"\n",(0,r.jsxs)(n.p,{children:["This example uses the ",(0,r.jsx)(n.strong,{children:"Language Model"})," core component as the central chat driver, but you can also use another language model component or the ",(0,r.jsx)(n.strong,{children:"Agent"})," component."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Add a ",(0,r.jsx)(n.strong,{children:"Chat Input"})," component, and then connect it to the ",(0,r.jsx)(n.strong,{children:"Language Model"})," component's ",(0,r.jsx)(n.strong,{children:"Input"})," input."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Connect the ",(0,r.jsx)(n.strong,{children:"Language Model"})," component's output to a ",(0,r.jsx)(n.strong,{children:"Chat Output"})," component."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["At the end of the flow, add another pair of ",(0,r.jsx)(n.strong,{children:"Message History"})," and ",(0,r.jsx)(n.strong,{children:"Redis Chat Memory"})," components:"]}),"\n",(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Configure the ",(0,r.jsx)(n.strong,{children:"Redis Chat Memory"})," component to connect to your Redis database."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Set the ",(0,r.jsx)(n.strong,{children:"Message History"})," component to ",(0,r.jsx)(n.strong,{children:"Store"})," mode."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["In the ",(0,r.jsx)(n.strong,{children:"Message History"})," ",(0,r.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),", click ",(0,r.jsx)(i.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Controls"}),", enable ",(0,r.jsx)(n.strong,{children:"External Memory"}),", and then click ",(0,r.jsx)(n.strong,{children:"Close"}),"."]}),"\n",(0,r.jsx)(n.p,{children:"Configure any additional parameters in this component as needed, taking into consideration that this particular component will store chat messages rather than retrieve them."}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Connect the ",(0,r.jsx)(n.strong,{children:"Redis Chat Memory"})," component to the ",(0,r.jsx)(n.strong,{children:"Message History"})," component's ",(0,r.jsx)(n.strong,{children:"External Memory"})," input."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Connect the ",(0,r.jsx)(n.strong,{children:"Chat Output"})," component's output to the ",(0,r.jsx)(n.strong,{children:"Message History"})," component's ",(0,r.jsx)(n.strong,{children:"Message"})," input."]}),"\n",(0,r.jsxs)(n.p,{children:["Each response from the LLM is output from the ",(0,r.jsx)(n.strong,{children:"Language Model"})," component to the ",(0,r.jsx)(n.strong,{children:"Chat Output"})," component, and then stored in chat memory by passing it to the final ",(0,r.jsx)(n.strong,{children:"Message History"})," and ",(0,r.jsx)(n.strong,{children:"Redis Chat Memory"})," components."]}),"\n"]}),"\n"]}),(0,r.jsx)(n.p,{children:(0,r.jsx)(n.img,{alt:"A flow with Message History and Redis Chat Memory components",src:t(96841).A+"",width:"4000",height:"1768"})})]})]}),"\n",(0,r.jsx)(n.h3,{id:"message-history-parameters",children:"Message History parameters"}),"\n","\n",(0,r.jsx)(d.Ay,{}),"\n",(0,r.jsxs)(n.p,{children:["The available parameters depend on whether the component is in ",(0,r.jsx)(n.strong,{children:"Retrieve"})," or ",(0,r.jsx)(n.strong,{children:"Store"})," mode."]}),"\n",(0,r.jsxs)(c.A,{children:[(0,r.jsx)(l.A,{value:"retrieve",label:"Retrieve mode",children:(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.strong,{children:"Template"})," (",(0,r.jsx)(n.code,{children:"template"}),")"]}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsxs)(n.td,{children:["Input parameter. The template to use for formatting the data. It can contain the keys ",(0,r.jsx)(n.code,{children:"{text}"}),", ",(0,r.jsx)(n.code,{children:"{sender}"})," or any other key in the message data."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.strong,{children:"External Memory"})," (",(0,r.jsx)(n.code,{children:"memory"}),")"]}),(0,r.jsx)(n.td,{children:"External Memory"}),(0,r.jsx)(n.td,{children:"Input parameter. Retrieve messages from an external memory. If empty, Langflow storage is used."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.strong,{children:"Number of Messages"})," (",(0,r.jsx)(n.code,{children:"n_messages"}),")"]}),(0,r.jsx)(n.td,{children:"Integer"}),(0,r.jsx)(n.td,{children:"Input parameter. The number of messages to retrieve. Default: 100."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.strong,{children:"Order"})," (",(0,r.jsx)(n.code,{children:"order"}),")"]}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsxs)(n.td,{children:["Input parameter. The order of the messages. Default: ",(0,r.jsx)(n.code,{children:"Ascending"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.strong,{children:"Sender Type"})," (",(0,r.jsx)(n.code,{children:"sender_type"}),")"]}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsxs)(n.td,{children:["Input parameter. Filter by sender type, one of ",(0,r.jsx)(n.code,{children:"User"}),", ",(0,r.jsx)(n.code,{children:"Machine"}),", or ",(0,r.jsx)(n.code,{children:"Machine and User"})," (default)."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.strong,{children:"Session ID"})," (",(0,r.jsx)(n.code,{children:"session_id"}),")"]}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsxs)(n.td,{children:["Input parameter. The ",(0,r.jsx)(n.a,{href:"/session-id",children:"session ID"})," of the chat memories to retrieve. If omitted or empty, the current session ID for the flow run is used."]})]})]})]})}),(0,r.jsx)(l.A,{value:"store",label:"Store mode",children:(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.strong,{children:"Template"})," (",(0,r.jsx)(n.code,{children:"template"}),")"]}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsxs)(n.td,{children:["Input parameter. The template to use for formatting the data. It can contain the keys ",(0,r.jsx)(n.code,{children:"{text}"}),", ",(0,r.jsx)(n.code,{children:"{sender}"})," or any other key in the message data."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.strong,{children:"Message"})," (",(0,r.jsx)(n.code,{children:"message"}),")"]}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsxs)(n.td,{children:["Input parameter. The message to store, typically provided by connecting a ",(0,r.jsx)(n.strong,{children:"Chat Output"})," component."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.strong,{children:"External Memory"})," (",(0,r.jsx)(n.code,{children:"memory"}),")"]}),(0,r.jsx)(n.td,{children:"External Memory"}),(0,r.jsx)(n.td,{children:"Input parameter. Store messages in external memory. If empty, Langflow storage is used."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.strong,{children:"Sender"})," (",(0,r.jsx)(n.code,{children:"sender"}),")"]}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsxs)(n.td,{children:["Input parameter. Choose which messages to store based on sender, one of ",(0,r.jsx)(n.code,{children:"User"}),", ",(0,r.jsx)(n.code,{children:"Machine"}),", or ",(0,r.jsx)(n.code,{children:"Machine and User"})," (default)."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.strong,{children:"Sender Name"})," (",(0,r.jsx)(n.code,{children:"sender_name"}),")"]}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsxs)(n.td,{children:["Input parameter. A backup ",(0,r.jsx)(n.code,{children:"sender"})," label to use if a message doesn't have sender metadata."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.strong,{children:"Session ID"})," (",(0,r.jsx)(n.code,{children:"session_id"}),")"]}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsxs)(n.td,{children:["Input parameter. The ",(0,r.jsx)(n.a,{href:"/session-id",children:"session ID"})," of the chat memories to store. If omitted or empty, the current session ID for the flow run is used. Use custom session IDs if you need to segregate chat memory for different users or applications that run the same flow."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.strong,{children:"Sender Type"})," (",(0,r.jsx)(n.code,{children:"sender_type"}),")"]}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsxs)(n.td,{children:["Input parameter. Filter by sender type, one of ",(0,r.jsx)(n.code,{children:"User"}),", ",(0,r.jsx)(n.code,{children:"Machine"}),", or ",(0,r.jsx)(n.code,{children:"Machine and User"})," (default)."]})]})]})]})})]}),"\n",(0,r.jsx)(n.h3,{id:"message-history-output",children:"Message History output"}),"\n",(0,r.jsx)(n.p,{children:"Memories can be retrieved in one of two formats:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Message"}),": Retrieve memories as ",(0,r.jsx)(n.code,{children:"Message"})," objects, including ",(0,r.jsx)(n.code,{children:"messages_text"})," containing retrieved chat message text.\nThis is the typical output format used to pass memories ",(0,r.jsx)(n.em,{children:"as chat messages"})," to another component."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"DataFrame"}),": Returns memories as a ",(0,r.jsx)(n.code,{children:"DataFrame"})," containing the message data.\nUseful for cases where you need to retrieve memories in a tabular format rather than as chat messages."]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"You can set the output type near the component's output port."}),"\n",(0,r.jsx)(n.h2,{id:"legacy-helper-components",children:"Legacy Helper components"}),"\n","\n",(0,r.jsx)(h.Ay,{}),"\n",(0,r.jsx)(n.p,{children:"The following Helper components are in legacy status:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Message Store"}),": Replaced by the ",(0,r.jsxs)(n.a,{href:"#message-history",children:[(0,r.jsx)(n.strong,{children:"Message History"})," component"]})]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Create List"}),": Replace with ",(0,r.jsx)(n.a,{href:"/components-processing",children:"Processing components"})]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"ID Generator"}),": Replace with a component that executes arbitrary code to generate an ID or embed an ID generator script your application code (external to your Langflow flows)."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Output Parser"}),": Replace with the ",(0,r.jsxs)(n.a,{href:"/components-processing#structured-output",children:[(0,r.jsx)(n.strong,{children:"Structured Output"})," component"]})," and ",(0,r.jsxs)(n.a,{href:"/components-processing#parser",children:[(0,r.jsx)(n.strong,{children:"Parser"})," component"]}),".\nThe components you need depend on the data types and complexity of the parsing task."]}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"Output Parser"})," component transformed the output of a language model into comma-separated values (CSV) format, such as ",(0,r.jsx)(n.code,{children:'["item1", "item2", "item3"]'}),", using LangChain's ",(0,r.jsx)(n.code,{children:"CommaSeparatedListOutputParser"}),".\nThe ",(0,r.jsx)(n.strong,{children:"Structured Output"})," component is a good alternative for this component because it also formats LLM responses with support for custom schemas and more complex parsing."]}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Parsing"})," components only provide formatting instructions and parsing functionality.\n",(0,r.jsx)(n.em,{children:"They don't include prompts."}),"\nYou must connect parsers to ",(0,r.jsx)(n.strong,{children:"Prompt Template"})," components to create prompts that LLMs can use."]}),"\n"]}),"\n"]})]})}function y(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(f,{...e})}):f(e)}function b(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}},31929:(e,n,t)=>{t.d(n,{Ay:()=>c,RM:()=>a});var s=t(74848),r=t(28453),o=t(17886);const a=[];function i(e){const n={a:"a",p:"p",strong:"strong",...(0,r.R)(),...e.components};return(0,s.jsxs)(n.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,s.jsx)(o.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Controls"})," in the ",(0,s.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function c(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(i,{...e})}):i(e)}},36813:(e,n,t)=>{t.d(n,{Ay:()=>c,RM:()=>a});var s=t(74848),r=t(28453),o=t(17886);const a=[];function i(e){const n={a:"a",p:"p",strong:"strong",...(0,r.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:["Legacy components are longer supported and can be removed in a future release.\nYou can continue to use them in existing flows, but it is recommended that you replace them with supported components as soon as possible.\nSuggested replacements are included in the ",(0,s.jsx)(n.strong,{children:"Legacy"})," banner on components in your flows.\nThey are also given in release notes and Langflow documentation whenever possible."]}),"\n",(0,s.jsxs)(n.p,{children:["If you aren't sure how to replace a legacy component, ",(0,s.jsx)(o.A,{name:"Search","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Search"})," for components by provider, service, or component name.\nThe component may have been deprecated in favor of a completely new component, a similar component, or a new version of the same component in a different category."]}),"\n",(0,s.jsxs)(n.p,{children:["If there is no obvious replacement, consider whether another component can be adapted to your use case.\nFor example, many ",(0,s.jsx)(o.A,{name:"Component","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Core components"})," provide generic functionality that can support multiple providers and use cases, such as the ",(0,s.jsxs)(n.a,{href:"/components-data#api-request",children:[(0,s.jsx)(n.strong,{children:"API Request"})," component"]}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["If neither of these options are viable, you could use the legacy component's code to create your own custom component, or ",(0,s.jsx)(n.a,{href:"/contributing-github-issues",children:"start a discussion"})," about the legacy component."]}),"\n",(0,s.jsxs)(n.p,{children:["To discourage use of legacy components in new flows, these components are hidden by default.\nIn the visual editor, you can click ",(0,s.jsx)(o.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Component settings"})," to toggle the ",(0,s.jsx)(n.strong,{children:"Legacy"})," filter."]})]})}function c(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(i,{...e})}):i(e)}},96841:(e,n,t)=>{t.d(n,{A:()=>s});const s=t.p+"assets/images/component-message-history-external-memory-7e32402d0b6e819f5539adfbfbd3620f.png"}}]); \ No newline at end of file diff --git a/assets/js/5015646b.e6ec1d45.js b/assets/js/5015646b.e6ec1d45.js new file mode 100644 index 0000000000..9b7ca19792 --- /dev/null +++ b/assets/js/5015646b.e6ec1d45.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[824],{11470:(e,n,t)=>{t.d(n,{A:()=>w});var s=t(96540),r=t(18215),o=t(23104),a=t(56347),i=t(205),c=t(57485),l=t(31682),d=t(70679);function h(e){return s.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,s.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function p(e){const{values:n,children:t}=e;return(0,s.useMemo)(()=>{const e=n??function(e){return h(e).map(({props:{value:e,label:n,attributes:t,default:s}})=>({value:e,label:n,attributes:t,default:s}))}(t);return function(e){const n=(0,l.XI)(e,(e,n)=>e.value===n.value);if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map(e=>e.value).join(", ")}" found in . Every value needs to be unique.`)}(e),e},[n,t])}function m({value:e,tabValues:n}){return n.some(n=>n.value===e)}function u({queryString:e=!1,groupId:n}){const t=(0,a.W6)(),r=function({queryString:e=!1,groupId:n}){if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:e,groupId:n});return[(0,c.aZ)(r),(0,s.useCallback)(e=>{if(!r)return;const n=new URLSearchParams(t.location.search);n.set(r,e),t.replace({...t.location,search:n.toString()})},[r,t])]}function x(e){const{defaultValue:n,queryString:t=!1,groupId:r}=e,o=p(e),[a,c]=(0,s.useState)(()=>function({defaultValue:e,tabValues:n}){if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(e){if(!m({value:e,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${n.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}const t=n.find(e=>e.default)??n[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:n,tabValues:o})),[l,h]=u({queryString:t,groupId:r}),[x,j]=function({groupId:e}){const n=function(e){return e?`docusaurus.tab.${e}`:null}(e),[t,r]=(0,d.Dv)(n);return[t,(0,s.useCallback)(e=>{n&&r.set(e)},[n,r])]}({groupId:r}),g=(()=>{const e=l??x;return m({value:e,tabValues:o})?e:null})();(0,i.A)(()=>{g&&c(g)},[g]);return{selectedValue:a,selectValue:(0,s.useCallback)(e=>{if(!m({value:e,tabValues:o}))throw new Error(`Can't select invalid tab value=${e}`);c(e),h(e),j(e)},[h,j,o]),tabValues:o}}var j=t(92303);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=t(74848);function y({className:e,block:n,selectedValue:t,selectValue:s,tabValues:a}){const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,o.a_)(),l=e=>{const n=e.currentTarget,r=i.indexOf(n),o=a[r].value;o!==t&&(c(n),s(o))},d=e=>{let n=null;switch(e.key){case"Enter":l(e);break;case"ArrowRight":{const t=i.indexOf(e.currentTarget)+1;n=i[t]??i[0];break}case"ArrowLeft":{const t=i.indexOf(e.currentTarget)-1;n=i[t]??i[i.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.A)("tabs",{"tabs--block":n},e),children:a.map(({value:e,label:n,attributes:s})=>(0,f.jsx)("li",{role:"tab",tabIndex:t===e?0:-1,"aria-selected":t===e,ref:e=>{i.push(e)},onKeyDown:d,onClick:l,...s,className:(0,r.A)("tabs__item",g.tabItem,s?.className,{"tabs__item--active":t===e}),children:n??e},e))})}function b({lazy:e,children:n,selectedValue:t}){const o=(Array.isArray(n)?n:[n]).filter(Boolean);if(e){const e=o.find(e=>e.props.value===t);return e?(0,s.cloneElement)(e,{className:(0,r.A)("margin-top--md",e.props.className)}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:o.map((e,n)=>(0,s.cloneElement)(e,{key:n,hidden:e.props.value!==t}))})}function v(e){const n=x(e);return(0,f.jsxs)("div",{className:(0,r.A)("tabs-container",g.tabList),children:[(0,f.jsx)(y,{...n,...e}),(0,f.jsx)(b,{...n,...e})]})}function w(e){const n=(0,j.A)();return(0,f.jsx)(v,{...e,children:h(e.children)},String(n))}},17886:(e,n,t)=>{t.d(n,{A:()=>o});t(96540);var s=t(64058),r=t(74848);function o({name:e,...n}){const t=s[e];return t?(0,r.jsx)(t,{...n}):null}},19365:(e,n,t)=>{t.d(n,{A:()=>a});t(96540);var s=t(18215);const r={tabItem:"tabItem_Ymn6"};var o=t(74848);function a({children:e,hidden:n,className:t}){return(0,o.jsx)("div",{role:"tabpanel",className:(0,s.A)(r.tabItem,t),hidden:n,children:e})}},28838:(e,n,t)=>{t.r(n),t.d(n,{CH:()=>x,assets:()=>u,chCodeConfig:()=>j,contentTitle:()=>m,default:()=>y,frontMatter:()=>p,metadata:()=>s,toc:()=>g});const s=JSON.parse('{"id":"Components/components-helpers","title":"Helpers","description":"Helper components provide utility functions to help manage data and perform simple tasks in your flow.","source":"@site/docs/Components/components-helpers.mdx","sourceDirName":"Components","slug":"/components-helpers","permalink":"/components-helpers","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Helpers","slug":"/components-helpers"},"sidebar":"docs","previous":{"title":"Logic","permalink":"/components-logic"},"next":{"title":"Tools","permalink":"/components-tools"}}');var r=t(74848),o=t(28453),a=t(24754),i=t(17886),c=t(11470),l=t(19365),d=t(31929),h=t(36813);const p={title:"Helpers",slug:"/components-helpers"},m=void 0,u={},x={annotations:a.hk,Code:a.Cy},j={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},g=[{value:"Calculator",id:"calculator",level:2},{value:"Calculator parameters",id:"calculator-parameters",level:3},{value:"Current Date",id:"current-date",level:2},{value:"Current Date parameters",id:"current-date-parameters",level:3},{value:"Message History",id:"message-history",level:2},{value:"Use the Message History component in a flow",id:"use-the-message-history-component-in-a-flow",level:3},{value:"Message History parameters",id:"message-history-parameters",level:3},...d.RM,{value:"Message History output",id:"message-history-output",level:3},{value:"Legacy Helper components",id:"legacy-helper-components",level:2},...h.RM];function f(e){const n={a:"a",admonition:"admonition",code:"code",em:"em",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,o.R)(),...e.components};return x||b("CH",!1),x.Code||b("CH.Code",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n","\n",(0,r.jsx)(n.p,{children:"Helper components provide utility functions to help manage data and perform simple tasks in your flow."}),"\n",(0,r.jsx)(n.h2,{id:"calculator",children:"Calculator"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"Calculator"})," component performs basic arithmetic operations on mathematical expressions.\nIt supports addition, subtraction, multiplication, division, and exponentiation operations."]}),"\n",(0,r.jsxs)(n.p,{children:["For an example of using this component in a flow, see the ",(0,r.jsxs)(n.a,{href:"/components-processing#python-interpreter",children:[(0,r.jsx)(n.strong,{children:"Python Interpreter"})," component"]}),"."]}),"\n",(0,r.jsx)(n.h3,{id:"calculator-parameters",children:"Calculator parameters"}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"expression"}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsxs)(n.td,{children:["Input parameter. The arithmetic expression to evaluate, such as ",(0,r.jsx)(n.code,{children:"4*4*(33/22)+12-20"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"result"}),(0,r.jsx)(n.td,{children:"Data"}),(0,r.jsxs)(n.td,{children:["Output parameter. The calculation result as a ",(0,r.jsxs)(n.a,{href:"/data-types",children:[(0,r.jsx)(n.code,{children:"Data"})," object"]})," containing the evaluated expression."]})]})]})]}),"\n",(0,r.jsx)(n.h2,{id:"current-date",children:"Current Date"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"Current Date"})," component returns the current date and time in a selected timezone. This component provides a flexible way to obtain timezone-specific date and time information within a Langflow pipeline."]}),"\n",(0,r.jsx)(n.h3,{id:"current-date-parameters",children:"Current Date parameters"}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"timezone"}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsx)(n.td,{children:"Input parameter. The timezone for the current date and time."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"current_date"}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsx)(n.td,{children:"Output parameter. The resulting current date and time in the selected timezone."})]})]})]}),"\n",(0,r.jsx)(n.h2,{id:"message-history",children:"Message History"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"Message History"})," component provides combined chat history and message storage functionality.\nIt can store and retrieve chat messages from either ",(0,r.jsx)(n.a,{href:"/memory",children:"Langflow storage"})," ",(0,r.jsx)(n.em,{children:"or"})," a dedicated chat memory database like Mem0 or Redis."]}),"\n",(0,r.jsxs)(n.admonition,{type:"tip",children:[(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"Agent"})," component has built-in chat memory that is enabled by default and uses Langflow storage.\nThis built-in chat memory functionality is sufficient for most use cases."]}),(0,r.jsxs)(n.p,{children:["Use the ",(0,r.jsx)(n.strong,{children:"Message History"})," component for the following use cases:"]}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"You need to store and retrieve chat memory for a language model component (not an agent)."}),"\n",(0,r.jsx)(n.li,{children:"You need to retrieve chat memories outside the chat context, such as a sentiment analysis flow that retrieves and analyzes recently stored memories."}),"\n",(0,r.jsx)(n.li,{children:"You want to store memories in a specific database that is separate from Langflow storage."}),"\n"]}),(0,r.jsxs)(n.p,{children:["For more information, see ",(0,r.jsx)(n.a,{href:"/memory#store-chat-memory",children:"Store chat memory"}),"."]})]}),"\n",(0,r.jsx)(n.h3,{id:"use-the-message-history-component-in-a-flow",children:"Use the Message History component in a flow"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"Message History"})," component has two modes, depending on where you want to use it in your flow:"]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Retrieve mode"}),": The component retrieves chat messages from your Langflow database or external memory."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Store mode"}),": The component stores chat messages in your Langflow database or external memory."]}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["This means that you need multiple ",(0,r.jsx)(n.strong,{children:"Message History"})," components in your flow if you want to both store and retrieve chat messages."]}),"\n",(0,r.jsxs)(c.A,{children:[(0,r.jsxs)(l.A,{value:"langflow",label:"Use Langflow storage",default:!0,children:[(0,r.jsxs)(n.p,{children:["The following steps explain how to create a chat-based flow that uses ",(0,r.jsx)(n.strong,{children:"Message History"})," components to store and retrieve chat memory from your Langflow installation's database:"]}),(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Create or edit a flow where you want to use chat memory."}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["At the beginning of the flow, add a ",(0,r.jsx)(n.strong,{children:"Message History"})," component, and then set it to ",(0,r.jsx)(n.strong,{children:"Retrieve"})," mode."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Optional: In the ",(0,r.jsx)(n.strong,{children:"Message History"})," ",(0,r.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),", click ",(0,r.jsx)(i.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Controls"})," to enable parameters for memory sorting, filtering, and limits."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Add a ",(0,r.jsx)(n.strong,{children:"Prompt Template"})," component, add a ",(0,r.jsx)(n.code,{children:"{memory}"})," variable to the ",(0,r.jsx)(n.strong,{children:"Template"})," field, and then connect the ",(0,r.jsx)(n.strong,{children:"Message History"})," output to the ",(0,r.jsx)(n.strong,{children:"memory"})," input."]}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"Prompt Template"})," component supplies instructions and context to LLMs, separate from chat messages passed through a ",(0,r.jsx)(n.strong,{children:"Chat Input"})," component.\nThe template can include any text and variables that you want to supply to the LLM, for example:"]}),"\n",(0,r.jsx)(x.Code,{codeConfig:j,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"You are a helpful assistant that answers questions.",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"Use markdown to format your answer, properly embedding images and urls.",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"History:",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"{memory}",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,r.jsxs)(n.p,{children:["Variables (",(0,r.jsx)(n.code,{children:"{variable}"}),") in the template dynamically add fields to the ",(0,r.jsx)(n.strong,{children:"Prompt Template"})," component so that your flow can receive definitions for those values from elsewhere, such as other components, Langflow global variables, or runtime input.\nFor more information, see ",(0,r.jsx)(n.a,{href:"/components-prompts#define-variables-in-prompts",children:"Define variables in prompts"}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["In this example, the ",(0,r.jsx)(n.code,{children:"{memory}"})," variable is populated by the retrieved chat memories, which are then passed to a ",(0,r.jsx)(n.strong,{children:"Language Model"})," or ",(0,r.jsx)(n.strong,{children:"Agent"})," component to provide additional context to the LLM."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Connect the ",(0,r.jsx)(n.strong,{children:"Prompt Template"})," component's output to a ",(0,r.jsx)(n.strong,{children:"Language Model"})," component's ",(0,r.jsx)(n.strong,{children:"System Message"})," input."]}),"\n",(0,r.jsxs)(n.p,{children:["This example uses the ",(0,r.jsx)(n.strong,{children:"Language Model"})," core component as the central chat driver, but you can also use another language model component or the ",(0,r.jsx)(n.strong,{children:"Agent"})," component."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Add a ",(0,r.jsx)(n.strong,{children:"Chat Input"})," component, and then connect it to the ",(0,r.jsx)(n.strong,{children:"Language Model"})," component's ",(0,r.jsx)(n.strong,{children:"Input"})," field."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Connect the ",(0,r.jsx)(n.strong,{children:"Language Model"})," component's output to a ",(0,r.jsx)(n.strong,{children:"Chat Output"})," component."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["At the end of the flow, add another ",(0,r.jsx)(n.strong,{children:"Message History"})," component, and then set it to ",(0,r.jsx)(n.strong,{children:"Store"})," mode."]}),"\n",(0,r.jsxs)(n.p,{children:["Configure any additional parameters in the second ",(0,r.jsx)(n.strong,{children:"Message History"})," component as needed, taking into consideration that this particular component will store chat messages rather than retrieve them."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Connect the ",(0,r.jsx)(n.strong,{children:"Chat Output"})," component's output to the ",(0,r.jsx)(n.strong,{children:"Message History"})," component's ",(0,r.jsx)(n.strong,{children:"Message"})," input."]}),"\n",(0,r.jsxs)(n.p,{children:["Each response from the LLM is output from the ",(0,r.jsx)(n.strong,{children:"Language Model"})," component to the ",(0,r.jsx)(n.strong,{children:"Chat Output"})," component, and then stored in chat memory by the final ",(0,r.jsx)(n.strong,{children:"Message History"})," component."]}),"\n"]}),"\n"]})]}),(0,r.jsxs)(l.A,{value:"external",label:"Use external chat memory",children:[(0,r.jsxs)(n.p,{children:["To store and retrieve chat memory from a dedicated, external chat memory database, use the ",(0,r.jsx)(n.strong,{children:"Message History"})," component ",(0,r.jsx)(n.em,{children:"and"})," a provider-specific chat memory component."]}),(0,r.jsxs)(n.p,{children:["The following steps explain how to create a flow that stores and retrieves chat memory from a ",(0,r.jsxs)(n.a,{href:"/bundles-redis",children:[(0,r.jsx)(n.strong,{children:"Redis Chat Memory"})," component"]}),".\nOther options include the ",(0,r.jsxs)(n.a,{href:"/bundles-mem0",children:[(0,r.jsx)(n.strong,{children:"Mem0 Chat Memory"})," component"]})," and ",(0,r.jsxs)(n.a,{href:"/bundles-cassandra#cassandra-chat-memory",children:[(0,r.jsx)(n.strong,{children:"Cassandra Chat Memory"})," component"]}),"."]}),(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Create or edit a flow where you want to use chat memory."}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["At the beginning of the flow, add a ",(0,r.jsx)(n.strong,{children:"Message History"})," component and a ",(0,r.jsx)(n.strong,{children:"Redis Chat Memory"})," component:"]}),"\n",(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Configure the ",(0,r.jsx)(n.strong,{children:"Redis Chat Memory"})," component to connect to your Redis database. For more information, see the ",(0,r.jsx)(n.a,{href:"https://redis.io/docs/latest/",children:"Redis documentation"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Set the ",(0,r.jsx)(n.strong,{children:"Message History"})," component to ",(0,r.jsx)(n.strong,{children:"Retrieve"})," mode."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["In the ",(0,r.jsx)(n.strong,{children:"Message History"})," ",(0,r.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),", click ",(0,r.jsx)(i.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Controls"}),", enable ",(0,r.jsx)(n.strong,{children:"External Memory"}),", and then click ",(0,r.jsx)(n.strong,{children:"Close"}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["In ",(0,r.jsx)(n.strong,{children:"Controls"}),", you can also enable parameters for memory sorting, filtering, and limits."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Connect the ",(0,r.jsx)(n.strong,{children:"Redis Chat Memory"})," component's output to the ",(0,r.jsx)(n.strong,{children:"Message History"})," component's ",(0,r.jsx)(n.strong,{children:"External Memory"})," input."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Add a ",(0,r.jsx)(n.strong,{children:"Prompt Template"})," component, add a ",(0,r.jsx)(n.code,{children:"{memory}"})," variable to the ",(0,r.jsx)(n.strong,{children:"Template"})," field, and then connect the ",(0,r.jsx)(n.strong,{children:"Message History"})," output to the ",(0,r.jsx)(n.strong,{children:"memory"})," input."]}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"Prompt Template"})," component supplies instructions and context to LLMs, separate from chat messages passed through a ",(0,r.jsx)(n.strong,{children:"Chat Input"})," component.\nThe template can include any text and variables that you want to supply to the LLM, for example:"]}),"\n",(0,r.jsx)(x.Code,{codeConfig:j,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"You are a helpful assistant that answers questions.",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"Use markdown to format your answer, properly embedding images and urls.",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"History:",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"{memory}",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,r.jsxs)(n.p,{children:["Variables (",(0,r.jsx)(n.code,{children:"{variable}"}),") in the template dynamically add fields to the ",(0,r.jsx)(n.strong,{children:"Prompt Template"})," component so that your flow can receive definitions for those values from elsewhere, such as other components, Langflow global variables, or runtime input.\nFor more information, see ",(0,r.jsx)(n.a,{href:"/components-prompts#define-variables-in-prompts",children:"Define variables in prompts"}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["In this example, the ",(0,r.jsx)(n.code,{children:"{memory}"})," variable is populated by the retrieved chat memories, which are then passed to a ",(0,r.jsx)(n.strong,{children:"Language Model"})," or ",(0,r.jsx)(n.strong,{children:"Agent"})," component to provide additional context to the LLM."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Connect the ",(0,r.jsx)(n.strong,{children:"Prompt Template"})," component's output to a ",(0,r.jsx)(n.strong,{children:"Language Model"})," component's ",(0,r.jsx)(n.strong,{children:"System Message"})," input."]}),"\n",(0,r.jsxs)(n.p,{children:["This example uses the ",(0,r.jsx)(n.strong,{children:"Language Model"})," core component as the central chat driver, but you can also use another language model component or the ",(0,r.jsx)(n.strong,{children:"Agent"})," component."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Add a ",(0,r.jsx)(n.strong,{children:"Chat Input"})," component, and then connect it to the ",(0,r.jsx)(n.strong,{children:"Language Model"})," component's ",(0,r.jsx)(n.strong,{children:"Input"})," input."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Connect the ",(0,r.jsx)(n.strong,{children:"Language Model"})," component's output to a ",(0,r.jsx)(n.strong,{children:"Chat Output"})," component."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["At the end of the flow, add another pair of ",(0,r.jsx)(n.strong,{children:"Message History"})," and ",(0,r.jsx)(n.strong,{children:"Redis Chat Memory"})," components:"]}),"\n",(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Configure the ",(0,r.jsx)(n.strong,{children:"Redis Chat Memory"})," component to connect to your Redis database."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Set the ",(0,r.jsx)(n.strong,{children:"Message History"})," component to ",(0,r.jsx)(n.strong,{children:"Store"})," mode."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["In the ",(0,r.jsx)(n.strong,{children:"Message History"})," ",(0,r.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),", click ",(0,r.jsx)(i.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Controls"}),", enable ",(0,r.jsx)(n.strong,{children:"External Memory"}),", and then click ",(0,r.jsx)(n.strong,{children:"Close"}),"."]}),"\n",(0,r.jsx)(n.p,{children:"Configure any additional parameters in this component as needed, taking into consideration that this particular component will store chat messages rather than retrieve them."}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Connect the ",(0,r.jsx)(n.strong,{children:"Redis Chat Memory"})," component to the ",(0,r.jsx)(n.strong,{children:"Message History"})," component's ",(0,r.jsx)(n.strong,{children:"External Memory"})," input."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Connect the ",(0,r.jsx)(n.strong,{children:"Chat Output"})," component's output to the ",(0,r.jsx)(n.strong,{children:"Message History"})," component's ",(0,r.jsx)(n.strong,{children:"Message"})," input."]}),"\n",(0,r.jsxs)(n.p,{children:["Each response from the LLM is output from the ",(0,r.jsx)(n.strong,{children:"Language Model"})," component to the ",(0,r.jsx)(n.strong,{children:"Chat Output"})," component, and then stored in chat memory by passing it to the final ",(0,r.jsx)(n.strong,{children:"Message History"})," and ",(0,r.jsx)(n.strong,{children:"Redis Chat Memory"})," components."]}),"\n"]}),"\n"]}),(0,r.jsx)(n.p,{children:(0,r.jsx)(n.img,{alt:"A flow with Message History and Redis Chat Memory components",src:t(96841).A+"",width:"4000",height:"1768"})})]})]}),"\n",(0,r.jsx)(n.h3,{id:"message-history-parameters",children:"Message History parameters"}),"\n","\n",(0,r.jsx)(d.Ay,{}),"\n",(0,r.jsxs)(n.p,{children:["The available parameters depend on whether the component is in ",(0,r.jsx)(n.strong,{children:"Retrieve"})," or ",(0,r.jsx)(n.strong,{children:"Store"})," mode."]}),"\n",(0,r.jsxs)(c.A,{children:[(0,r.jsx)(l.A,{value:"retrieve",label:"Retrieve mode",children:(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.strong,{children:"Template"})," (",(0,r.jsx)(n.code,{children:"template"}),")"]}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsxs)(n.td,{children:["Input parameter. The template to use for formatting the data. It can contain the keys ",(0,r.jsx)(n.code,{children:"{text}"}),", ",(0,r.jsx)(n.code,{children:"{sender}"})," or any other key in the message data."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.strong,{children:"External Memory"})," (",(0,r.jsx)(n.code,{children:"memory"}),")"]}),(0,r.jsx)(n.td,{children:"External Memory"}),(0,r.jsx)(n.td,{children:"Input parameter. Retrieve messages from an external memory. If empty, Langflow storage is used."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.strong,{children:"Number of Messages"})," (",(0,r.jsx)(n.code,{children:"n_messages"}),")"]}),(0,r.jsx)(n.td,{children:"Integer"}),(0,r.jsx)(n.td,{children:"Input parameter. The number of messages to retrieve. Default: 100."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.strong,{children:"Order"})," (",(0,r.jsx)(n.code,{children:"order"}),")"]}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsxs)(n.td,{children:["Input parameter. The order of the messages. Default: ",(0,r.jsx)(n.code,{children:"Ascending"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.strong,{children:"Sender Type"})," (",(0,r.jsx)(n.code,{children:"sender_type"}),")"]}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsxs)(n.td,{children:["Input parameter. Filter by sender type, one of ",(0,r.jsx)(n.code,{children:"User"}),", ",(0,r.jsx)(n.code,{children:"Machine"}),", or ",(0,r.jsx)(n.code,{children:"Machine and User"})," (default)."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.strong,{children:"Session ID"})," (",(0,r.jsx)(n.code,{children:"session_id"}),")"]}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsxs)(n.td,{children:["Input parameter. The ",(0,r.jsx)(n.a,{href:"/session-id",children:"session ID"})," of the chat memories to retrieve. If omitted or empty, the current session ID for the flow run is used."]})]})]})]})}),(0,r.jsx)(l.A,{value:"store",label:"Store mode",children:(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.strong,{children:"Template"})," (",(0,r.jsx)(n.code,{children:"template"}),")"]}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsxs)(n.td,{children:["Input parameter. The template to use for formatting the data. It can contain the keys ",(0,r.jsx)(n.code,{children:"{text}"}),", ",(0,r.jsx)(n.code,{children:"{sender}"})," or any other key in the message data."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.strong,{children:"Message"})," (",(0,r.jsx)(n.code,{children:"message"}),")"]}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsxs)(n.td,{children:["Input parameter. The message to store, typically provided by connecting a ",(0,r.jsx)(n.strong,{children:"Chat Output"})," component."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.strong,{children:"External Memory"})," (",(0,r.jsx)(n.code,{children:"memory"}),")"]}),(0,r.jsx)(n.td,{children:"External Memory"}),(0,r.jsx)(n.td,{children:"Input parameter. Store messages in external memory. If empty, Langflow storage is used."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.strong,{children:"Sender"})," (",(0,r.jsx)(n.code,{children:"sender"}),")"]}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsxs)(n.td,{children:["Input parameter. Choose which messages to store based on sender, one of ",(0,r.jsx)(n.code,{children:"User"}),", ",(0,r.jsx)(n.code,{children:"Machine"}),", or ",(0,r.jsx)(n.code,{children:"Machine and User"})," (default)."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.strong,{children:"Sender Name"})," (",(0,r.jsx)(n.code,{children:"sender_name"}),")"]}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsxs)(n.td,{children:["Input parameter. A backup ",(0,r.jsx)(n.code,{children:"sender"})," label to use if a message doesn't have sender metadata."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.strong,{children:"Session ID"})," (",(0,r.jsx)(n.code,{children:"session_id"}),")"]}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsxs)(n.td,{children:["Input parameter. The ",(0,r.jsx)(n.a,{href:"/session-id",children:"session ID"})," of the chat memories to store. If omitted or empty, the current session ID for the flow run is used. Use custom session IDs if you need to segregate chat memory for different users or applications that run the same flow."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.strong,{children:"Sender Type"})," (",(0,r.jsx)(n.code,{children:"sender_type"}),")"]}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsxs)(n.td,{children:["Input parameter. Filter by sender type, one of ",(0,r.jsx)(n.code,{children:"User"}),", ",(0,r.jsx)(n.code,{children:"Machine"}),", or ",(0,r.jsx)(n.code,{children:"Machine and User"})," (default)."]})]})]})]})})]}),"\n",(0,r.jsx)(n.h3,{id:"message-history-output",children:"Message History output"}),"\n",(0,r.jsx)(n.p,{children:"Memories can be retrieved in one of two formats:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Message"}),": Retrieve memories as ",(0,r.jsx)(n.code,{children:"Message"})," objects, including ",(0,r.jsx)(n.code,{children:"messages_text"})," containing retrieved chat message text.\nThis is the typical output format used to pass memories ",(0,r.jsx)(n.em,{children:"as chat messages"})," to another component."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"DataFrame"}),": Returns memories as a ",(0,r.jsx)(n.code,{children:"DataFrame"})," containing the message data.\nUseful for cases where you need to retrieve memories in a tabular format rather than as chat messages."]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"You can set the output type near the component's output port."}),"\n",(0,r.jsx)(n.h2,{id:"legacy-helper-components",children:"Legacy Helper components"}),"\n","\n",(0,r.jsx)(h.Ay,{}),"\n",(0,r.jsx)(n.p,{children:"The following Helper components are in legacy status:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Message Store"}),": Replaced by the ",(0,r.jsxs)(n.a,{href:"#message-history",children:[(0,r.jsx)(n.strong,{children:"Message History"})," component"]})]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Create List"}),": Replace with ",(0,r.jsx)(n.a,{href:"/components-processing",children:"Processing components"})]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"ID Generator"}),": Replace with a component that executes arbitrary code to generate an ID or embed an ID generator script your application code (external to your Langflow flows)."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Output Parser"}),": Replace with the ",(0,r.jsxs)(n.a,{href:"/components-processing#structured-output",children:[(0,r.jsx)(n.strong,{children:"Structured Output"})," component"]})," and ",(0,r.jsxs)(n.a,{href:"/components-processing#parser",children:[(0,r.jsx)(n.strong,{children:"Parser"})," component"]}),".\nThe components you need depend on the data types and complexity of the parsing task."]}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"Output Parser"})," component transformed the output of a language model into comma-separated values (CSV) format, such as ",(0,r.jsx)(n.code,{children:'["item1", "item2", "item3"]'}),", using LangChain's ",(0,r.jsx)(n.code,{children:"CommaSeparatedListOutputParser"}),".\nThe ",(0,r.jsx)(n.strong,{children:"Structured Output"})," component is a good alternative for this component because it also formats LLM responses with support for custom schemas and more complex parsing."]}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Parsing"})," components only provide formatting instructions and parsing functionality.\n",(0,r.jsx)(n.em,{children:"They don't include prompts."}),"\nYou must connect parsers to ",(0,r.jsx)(n.strong,{children:"Prompt Template"})," components to create prompts that LLMs can use."]}),"\n"]}),"\n"]})]})}function y(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(f,{...e})}):f(e)}function b(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}},31929:(e,n,t)=>{t.d(n,{Ay:()=>c,RM:()=>a});var s=t(74848),r=t(28453),o=t(17886);const a=[];function i(e){const n={a:"a",p:"p",strong:"strong",...(0,r.R)(),...e.components};return(0,s.jsxs)(n.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,s.jsx)(o.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Controls"})," in the ",(0,s.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function c(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(i,{...e})}):i(e)}},36813:(e,n,t)=>{t.d(n,{Ay:()=>c,RM:()=>a});var s=t(74848),r=t(28453),o=t(17886);const a=[];function i(e){const n={a:"a",p:"p",strong:"strong",...(0,r.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:["Legacy components are longer supported and can be removed in a future release.\nYou can continue to use them in existing flows, but it is recommended that you replace them with supported components as soon as possible.\nSuggested replacements are included in the ",(0,s.jsx)(n.strong,{children:"Legacy"})," banner on components in your flows.\nThey are also given in release notes and Langflow documentation whenever possible."]}),"\n",(0,s.jsxs)(n.p,{children:["If you aren't sure how to replace a legacy component, ",(0,s.jsx)(o.A,{name:"Search","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Search"})," for components by provider, service, or component name.\nThe component may have been deprecated in favor of a completely new component, a similar component, or a new version of the same component in a different category."]}),"\n",(0,s.jsxs)(n.p,{children:["If there is no obvious replacement, consider whether another component can be adapted to your use case.\nFor example, many ",(0,s.jsx)(o.A,{name:"Component","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Core components"})," provide generic functionality that can support multiple providers and use cases, such as the ",(0,s.jsxs)(n.a,{href:"/components-data#api-request",children:[(0,s.jsx)(n.strong,{children:"API Request"})," component"]}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["If neither of these options are viable, you could use the legacy component's code to create your own custom component, or ",(0,s.jsx)(n.a,{href:"/contributing-github-issues",children:"start a discussion"})," about the legacy component."]}),"\n",(0,s.jsxs)(n.p,{children:["To discourage use of legacy components in new flows, these components are hidden by default.\nIn the visual editor, you can click ",(0,s.jsx)(o.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Component settings"})," to toggle the ",(0,s.jsx)(n.strong,{children:"Legacy"})," filter."]})]})}function c(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(i,{...e})}):i(e)}},96841:(e,n,t)=>{t.d(n,{A:()=>s});const s=t.p+"assets/images/component-message-history-external-memory-7e32402d0b6e819f5539adfbfbd3620f.png"}}]); \ No newline at end of file diff --git a/assets/js/56350599.5dbc634f.js b/assets/js/56350599.5dbc634f.js new file mode 100644 index 0000000000..f1f18d4f5e --- /dev/null +++ b/assets/js/56350599.5dbc634f.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[8593],{11470:(e,n,o)=>{o.d(n,{A:()=>L});var t=o(96540),s=o(18215),r=o(23104),l=o(56347),i=o(205),c=o(57485),a=o(31682),d=o(70679);function h(e){return t.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,t.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function u(e){const{values:n,children:o}=e;return(0,t.useMemo)(()=>{const e=n??function(e){return h(e).map(({props:{value:e,label:n,attributes:o,default:t}})=>({value:e,label:n,attributes:o,default:t}))}(o);return function(e){const n=(0,a.XI)(e,(e,n)=>e.value===n.value);if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map(e=>e.value).join(", ")}" found in . Every value needs to be unique.`)}(e),e},[n,o])}function g({value:e,tabValues:n}){return n.some(n=>n.value===e)}function p({queryString:e=!1,groupId:n}){const o=(0,l.W6)(),s=function({queryString:e=!1,groupId:n}){if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:e,groupId:n});return[(0,c.aZ)(s),(0,t.useCallback)(e=>{if(!s)return;const n=new URLSearchParams(o.location.search);n.set(s,e),o.replace({...o.location,search:n.toString()})},[s,o])]}function f(e){const{defaultValue:n,queryString:o=!1,groupId:s}=e,r=u(e),[l,c]=(0,t.useState)(()=>function({defaultValue:e,tabValues:n}){if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(e){if(!g({value:e,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${n.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}const o=n.find(e=>e.default)??n[0];if(!o)throw new Error("Unexpected error: 0 tabValues");return o.value}({defaultValue:n,tabValues:r})),[a,h]=p({queryString:o,groupId:s}),[f,x]=function({groupId:e}){const n=function(e){return e?`docusaurus.tab.${e}`:null}(e),[o,s]=(0,d.Dv)(n);return[o,(0,t.useCallback)(e=>{n&&s.set(e)},[n,s])]}({groupId:s}),j=(()=>{const e=a??f;return g({value:e,tabValues:r})?e:null})();(0,i.A)(()=>{j&&c(j)},[j]);return{selectedValue:l,selectValue:(0,t.useCallback)(e=>{if(!g({value:e,tabValues:r}))throw new Error(`Can't select invalid tab value=${e}`);c(e),h(e),x(e)},[h,x,r]),tabValues:r}}var x=o(92303);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var m=o(74848);function b({className:e,block:n,selectedValue:o,selectValue:t,tabValues:l}){const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,r.a_)(),a=e=>{const n=e.currentTarget,s=i.indexOf(n),r=l[s].value;r!==o&&(c(n),t(r))},d=e=>{let n=null;switch(e.key){case"Enter":a(e);break;case"ArrowRight":{const o=i.indexOf(e.currentTarget)+1;n=i[o]??i[0];break}case"ArrowLeft":{const o=i.indexOf(e.currentTarget)-1;n=i[o]??i[i.length-1];break}}n?.focus()};return(0,m.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.A)("tabs",{"tabs--block":n},e),children:l.map(({value:e,label:n,attributes:t})=>(0,m.jsx)("li",{role:"tab",tabIndex:o===e?0:-1,"aria-selected":o===e,ref:e=>{i.push(e)},onKeyDown:d,onClick:a,...t,className:(0,s.A)("tabs__item",j.tabItem,t?.className,{"tabs__item--active":o===e}),children:n??e},e))})}function w({lazy:e,children:n,selectedValue:o}){const r=(Array.isArray(n)?n:[n]).filter(Boolean);if(e){const e=r.find(e=>e.props.value===o);return e?(0,t.cloneElement)(e,{className:(0,s.A)("margin-top--md",e.props.className)}):null}return(0,m.jsx)("div",{className:"margin-top--md",children:r.map((e,n)=>(0,t.cloneElement)(e,{key:n,hidden:e.props.value!==o}))})}function v(e){const n=f(e);return(0,m.jsxs)("div",{className:(0,s.A)("tabs-container",j.tabList),children:[(0,m.jsx)(b,{...n,...e}),(0,m.jsx)(w,{...n,...e})]})}function L(e){const n=(0,x.A)();return(0,m.jsx)(v,{...e,children:h(e.children)},String(n))}},17886:(e,n,o)=>{o.d(n,{A:()=>r});o(96540);var t=o(64058),s=o(74848);function r({name:e,...n}){const o=t[e];return o?(0,s.jsx)(o,{...n}):null}},19365:(e,n,o)=>{o.d(n,{A:()=>l});o(96540);var t=o(18215);const s={tabItem:"tabItem_Ymn6"};var r=o(74848);function l({children:e,hidden:n,className:o}){return(0,r.jsx)("div",{role:"tabpanel",className:(0,t.A)(s.tabItem,o),hidden:n,children:e})}},77232:(e,n,o)=>{o.d(n,{A:()=>t});const t=o.p+"assets/images/logs-cc30f076e63a5e443cf04855559703a3.png"},88262:(e,n,o)=>{o.r(n),o.d(n,{CH:()=>g,assets:()=>u,chCodeConfig:()=>p,contentTitle:()=>h,default:()=>j,frontMatter:()=>d,metadata:()=>t,toc:()=>f});const t=JSON.parse('{"id":"Develop/logging","title":"Logs","description":"Langflow produces logs for individual flows and the Langflow application itself using the structlog library for logging.","source":"@site/docs/Develop/logging.mdx","sourceDirName":"Develop","slug":"/logging","permalink":"/logging","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Logs","slug":"/logging"},"sidebar":"docs","previous":{"title":"Database guide for enterprise administrators","permalink":"/enterprise-database-guide"},"next":{"title":"Arize","permalink":"/integrations-arize"}}');var s=o(74848),r=o(28453),l=o(24754),i=o(17886),c=o(11470),a=o(19365);const d={title:"Logs",slug:"/logging"},h=void 0,u={},g={annotations:l.hk,Code:l.Cy},p={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},f=[{value:"Log storage",id:"log-storage",level:2},{value:"View logs in real-time",id:"view-logs-in-real-time",level:2},{value:"Flow and component logs",id:"flow-and-component-logs",level:2},{value:"View flow logs",id:"view-flow-logs",level:3},{value:"View chat logs",id:"view-chat-logs",level:3},{value:"View output from a single component",id:"view-output-from-a-single-component",level:3},{value:"Access Langflow Desktop logs",id:"desktop-logs",level:2},{value:"See also",id:"see-also",level:2}];function x(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,r.R)(),...e.components};return g||m("CH",!1),g.Code||m("CH.Code",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n","\n",(0,s.jsxs)(n.p,{children:["Langflow produces logs for individual flows and the Langflow application itself using the ",(0,s.jsx)(n.a,{href:"https://www.structlog.org",children:"structlog"})," library for logging."]}),"\n",(0,s.jsxs)(n.p,{children:["The default, primary logfile is named ",(0,s.jsx)(n.code,{children:"langflow.log"}),"."]}),"\n",(0,s.jsx)(n.p,{children:"Log files are stored in JSON format with structured metadata."}),"\n",(0,s.jsx)(n.h2,{id:"log-storage",children:"Log storage"}),"\n",(0,s.jsxs)(n.p,{children:["Langflow logs are stored in the config directory specified in the ",(0,s.jsx)(n.code,{children:"LANGFLOW_CONFIG_DIR"})," environment variable.\nThe default config directory location depends on your operating system and installation method:"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Langflow Desktop"}),":"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"macOS"}),": ",(0,s.jsx)(n.code,{children:"/Users//Library/Logs/com.Langflow"})]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Windows"}),": ",(0,s.jsx)(n.code,{children:"C:\\Users\\\\AppData\\Roaming\\com.Langflow\\cache"})]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"OSS Langflow"}),":"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsxs)(n.strong,{children:["macOS with ",(0,s.jsx)(n.code,{children:"uv pip install"})]}),": ",(0,s.jsx)(n.code,{children:"/Users//Library/Caches/langflow"})]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsxs)(n.strong,{children:["Linux with ",(0,s.jsx)(n.code,{children:"uv pip install"})]}),": ",(0,s.jsx)(n.code,{children:"/home//.cache/langflow"})]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsxs)(n.strong,{children:["Windows/WSL with ",(0,s.jsx)(n.code,{children:"uv pip install"})]}),": ",(0,s.jsx)(n.code,{children:"C:\\Users\\\\AppData\\Local\\langflow\\langflow\\Cache"})]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsxs)(n.strong,{children:["macOS/Windows/Linux/WSL with ",(0,s.jsx)(n.code,{children:"git clone"})]}),": ",(0,s.jsx)(n.code,{children:"/src/backend/base/langflow/"})]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["To customize log storage locations and behaviors, set the following ",(0,s.jsx)(n.a,{href:"/environment-variables",children:"Langflow environment variables"})," in your Langflow ",(0,s.jsx)(n.code,{children:".env"})," file, and then start Langflow with ",(0,s.jsx)(n.code,{children:"uv run langflow run --env-file .env"}),":"]}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Variable"}),(0,s.jsx)(n.th,{children:"Format"}),(0,s.jsx)(n.th,{children:"Default"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"LANGFLOW_CONFIG_DIR"})}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Varies"}),(0,s.jsx)(n.td,{children:"Set the Langflow configuration directory where files and logs are stored. Default path depends on your installation, as described in the preceding list."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"LANGFLOW_LOG_LEVEL"})}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"ERROR"})}),(0,s.jsxs)(n.td,{children:["Sets the log level as one of ",(0,s.jsx)(n.code,{children:"DEBUG"}),", ",(0,s.jsx)(n.code,{children:"ERROR"}),", ",(0,s.jsx)(n.code,{children:"INFO"}),", ",(0,s.jsx)(n.code,{children:"WARNING"}),", and ",(0,s.jsx)(n.code,{children:"CRITICAL"}),". For example, ",(0,s.jsx)(n.code,{children:"LANGFLOW_LOG_LEVEL=DEBUG"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"LANGFLOW_LOG_FILE"})}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Not set"}),(0,s.jsxs)(n.td,{children:["Sets the log file storage location if you want to use a non-default location. For example, ",(0,s.jsx)(n.code,{children:"LANGFLOW_LOG_FILE=path/to/logfile.log"}),". If not set, logs are written to stdout."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"LANGFLOW_LOG_ENV"})}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"default"})}),(0,s.jsxs)(n.td,{children:["This variable is the primary log format controller. ",(0,s.jsx)(n.code,{children:"container"}),": JSON format for Docker/structured logging. ",(0,s.jsx)(n.code,{children:"container_csv"}),": Key-value format for data analysis. ",(0,s.jsx)(n.code,{children:"default"})," or unset: Uses ",(0,s.jsx)(n.code,{children:"LANGFLOW_PRETTY_LOGS"})," to determine format."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"LANGFLOW_PRETTY_LOGS"})}),(0,s.jsx)(n.td,{children:"Boolean"}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"True"})}),(0,s.jsxs)(n.td,{children:["This variable controls log output format when ",(0,s.jsx)(n.code,{children:"LANGFLOW_LOG_ENV=default"})," or unset. When ",(0,s.jsx)(n.code,{children:"true"}),", uses structlog's ",(0,s.jsx)(n.a,{href:"https://www.structlog.org/en/stable/console-output.html",children:"ConsoleRenderer"}),". When ",(0,s.jsx)(n.code,{children:"false"}),", outputs logs in JSON format."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"LANGFLOW_LOG_FORMAT"})}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Not set"}),(0,s.jsxs)(n.td,{children:["Switch between key-value format and console format. Set to ",(0,s.jsx)(n.code,{children:"key_value"})," for key-value format or ",(0,s.jsx)(n.code,{children:"console"})," to use structlog's ",(0,s.jsx)(n.a,{href:"https://www.structlog.org/en/stable/console-output.html",children:"ConsoleRenderer"}),". This variable only works when ",(0,s.jsx)(n.code,{children:"LANGFLOW_LOG_ENV=default"})," and ",(0,s.jsx)(n.code,{children:"LANGFLOW_PRETTY_LOGS=true"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"LANGFLOW_LOG_ROTATION"})}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"1 day"})}),(0,s.jsxs)(n.td,{children:["Controls when the log file is rotated, either based on time or file size. For time-based rotation, set to ",(0,s.jsx)(n.code,{children:"1 day"}),", ",(0,s.jsx)(n.code,{children:"12 hours"}),", or ",(0,s.jsx)(n.code,{children:"1 week"}),". For size-based rotation, set to ",(0,s.jsx)(n.code,{children:"10 MB"})," or ",(0,s.jsx)(n.code,{children:"1 GB"}),". To disable rotation, set to ",(0,s.jsx)(n.code,{children:"None"}),". If disabled, log files grow without limit."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"LANGFLOW_ENABLE_LOG_RETRIEVAL"})}),(0,s.jsx)(n.td,{children:"Boolean"}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"False"})}),(0,s.jsxs)(n.td,{children:["Enables retrieval of logs from your Langflow instance with ",(0,s.jsx)(n.a,{href:"/api-logs",children:"Logs endpoints"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"LANGFLOW_LOG_RETRIEVER_BUFFER_SIZE"})}),(0,s.jsx)(n.td,{children:"Integer"}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"10000"})}),(0,s.jsxs)(n.td,{children:["Set the buffer size for log retrieval if ",(0,s.jsx)(n.code,{children:"LANGFLOW_ENABLE_LOG_RETRIEVAL=True"}),". Must be greater than ",(0,s.jsx)(n.code,{children:"0"})," for log retrieval to function."]})]})]})]}),"\n",(0,s.jsx)(n.h2,{id:"view-logs-in-real-time",children:"View logs in real-time"}),"\n",(0,s.jsx)(n.p,{children:"To monitor Langflow logs as they are generated, you can follow the log file:"}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Change to your ",(0,s.jsx)(n.a,{href:"#log-storage",children:"Langflow config directory"}),":"]}),"\n",(0,s.jsxs)(c.A,{groupId:"cd-command",children:[(0,s.jsx)(a.A,{value:"macOS",label:"macOS",default:!0,children:(0,s.jsx)(g.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"cd ",props:{style:{color:"#79C0FF"}}},{content:"/Users/",props:{style:{color:"#A5D6FF"}}},{content:"**",props:{style:{color:"#79C0FF"}}},{content:"USERNAME",props:{style:{color:"#A5D6FF"}}},{content:"**",props:{style:{color:"#79C0FF"}}},{content:"/Library/Caches/langflow",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]})}),(0,s.jsx)(a.A,{value:"Windows",label:"Windows",children:(0,s.jsx)(g.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"cd C:\\Users\\",props:{style:{color:"#C9D1D9"}}},{content:"**",props:{style:{color:"#FF7B72"}}},{content:"USERNAME",props:{style:{color:"#C9D1D9"}}},{content:"**",props:{style:{color:"#FF7B72"}}},{content:"\\AppData\\Local\\langflow\\langflow\\Cache",props:{style:{color:"#C9D1D9"}}}]}],lang:"cmd"},annotations:[]}]})})]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Tail the main log file:"}),"\n",(0,s.jsxs)(c.A,{groupId:"tail-command",children:[(0,s.jsx)(a.A,{value:"macOS",label:"macOS",default:!0,children:(0,s.jsx)(g.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"tail ",props:{style:{color:"#FFA657"}}},{content:"-f ",props:{style:{color:"#79C0FF"}}},{content:"langflow.log",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]})}),(0,s.jsx)(a.A,{value:"Windows",label:"Windows",children:(0,s.jsx)(g.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"Get-",props:{style:{color:"#FF7B72"}}},{content:"Content ",props:{style:{color:"#C9D1D9"}}},{content:"-",props:{style:{color:"#FF7B72"}}},{content:"Wait ",props:{style:{color:"#C9D1D9"}}},{content:"-",props:{style:{color:"#FF7B72"}}},{content:"Path langflow.",props:{style:{color:"#C9D1D9"}}},{content:"log",props:{style:{color:"#79C0FF"}}}]}],lang:"cmd"},annotations:[]}]})})]}),"\n",(0,s.jsx)(n.p,{children:"If you don't see new log entries, check that Langflow is running, and perform some actions to generate logs events. You can also check the terminal where you started Langflow to see if logs are being printed there."}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"flow-and-component-logs",children:"Flow and component logs"}),"\n",(0,s.jsxs)(n.p,{children:["After you run a flow, you can inspect the logs for the each component and flow run.\nFor example, you can inspect ",(0,s.jsx)(n.code,{children:"Message"})," objects ingested and generated by ",(0,s.jsx)(n.a,{href:"/components-io",children:"Input and Output components"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"view-flow-logs",children:"View flow logs"}),"\n",(0,s.jsxs)(n.p,{children:["In the visual editor, click ",(0,s.jsx)(n.strong,{children:"Logs"})," to view logs for the entire flow:"]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"Logs pane",src:o(77232).A+"",width:"4000",height:"2180"})}),"\n",(0,s.jsxs)(n.p,{children:["Then, click the cells in the ",(0,s.jsx)(n.strong,{children:"inputs"})," and ",(0,s.jsx)(n.strong,{children:"outputs"})," columns to inspect the ",(0,s.jsx)(n.code,{children:"Message"})," objects.\nFor example, the following ",(0,s.jsx)(n.code,{children:"Message"})," data could be the output from a ",(0,s.jsx)(n.strong,{children:"Chat Input"})," component:"]}),"\n",(0,s.jsx)(g.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:' "messages": [',props:{}}]},{tokens:[{content:" {",props:{}}]},{tokens:[{content:' "message": "What\'s the recommended way to install Docker on Mac M1?",',props:{}}]},{tokens:[{content:' "sender": "User",',props:{}}]},{tokens:[{content:' "sender_name": "User",',props:{}}]},{tokens:[{content:' "session_id": "Session Apr 21, 17:37:04",',props:{}}]},{tokens:[{content:' "stream_url": null,',props:{}}]},{tokens:[{content:' "component_id": "ChatInput-4WKag",',props:{}}]},{tokens:[{content:' "files": [],',props:{}}]},{tokens:[{content:' "type": "text"',props:{}}]},{tokens:[{content:" }",props:{}}]},{tokens:[{content:" ],",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,s.jsxs)(n.p,{children:["In the case of Input/Output components, the original input might not be structured as a ",(0,s.jsx)(n.code,{children:"Message"})," object.\nFor example, a language model component can pass a raw text response to a ",(0,s.jsx)(n.strong,{children:"Chat Output"})," component that is then transformed into a ",(0,s.jsx)(n.code,{children:"Message"})," object."]}),"\n",(0,s.jsxs)(n.p,{children:["You can find ",(0,s.jsx)(n.code,{children:".log"})," files for flows at your Langflow installation's log storage location.\nFor filepaths, see ",(0,s.jsx)(n.a,{href:"#log-storage",children:"Log storage"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"view-chat-logs",children:"View chat logs"}),"\n",(0,s.jsxs)(n.p,{children:["In the ",(0,s.jsx)(n.strong,{children:"Playground"}),", you can inspect the chat history for each chat session.\nFor more information, see ",(0,s.jsx)(n.a,{href:"/concepts-playground#view-chat-history",children:"View chat history"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"view-output-from-a-single-component",children:"View output from a single component"}),"\n",(0,s.jsx)(n.p,{children:"When debugging issues with the format or content of a flow's output, it can help to inspect each component's output to determine where data is being lost or malformed."}),"\n",(0,s.jsxs)(n.p,{children:["To view the output produced by a single component during the most recent run, click ",(0,s.jsx)(i.A,{name:"TextSearch","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Inspect output"})," on the component in the visual editor."]}),"\n",(0,s.jsx)(n.h2,{id:"desktop-logs",children:"Access Langflow Desktop logs"}),"\n",(0,s.jsx)(n.p,{children:"If you encounter issues with Langflow Desktop, you might need to access startup logs for debugging.\nFollow the steps for your operating system."}),"\n",(0,s.jsxs)(c.A,{children:[(0,s.jsx)(a.A,{value:"macos",label:"macOS",children:(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Open Terminal and run:"}),"\n",(0,s.jsx)(g.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"cd ",props:{style:{color:"#79C0FF"}}},{content:"~/Library/Logs/com.Langflow",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"To open the folder and view the log files, run the command:"}),"\n",(0,s.jsx)(g.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"open ",props:{style:{color:"#FFA657"}}},{content:".",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Locate the ",(0,s.jsx)(n.code,{children:"langflow.log"})," file."]}),"\n"]}),"\n"]})}),(0,s.jsx)(a.A,{value:"windows",label:"Windows",children:(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Open the Command Prompt (CMD), and then run the following command:"}),"\n",(0,s.jsx)(g.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"cd ",props:{style:{color:"#C9D1D9"}}},{content:"%",props:{style:{color:"#FF7B72"}}},{content:"LOCALAPPDATA",props:{style:{color:"#C9D1D9"}}},{content:"%",props:{style:{color:"#FF7B72"}}},{content:"\\com.langflow\\logs",props:{style:{color:"#C9D1D9"}}}]}],lang:"cmd"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Open the folder and view the log files:"}),"\n",(0,s.jsx)(g.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"start .",props:{style:{color:"#C9D1D9"}}}]}],lang:"cmd"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Locate the ",(0,s.jsx)(n.code,{children:"langflow.log"})," file."]}),"\n"]}),"\n"]})})]}),"\n",(0,s.jsxs)(n.p,{children:["You can use the log file to investigate the issue on your own, add context to a ",(0,s.jsx)(n.a,{href:"/contributing-github-issues",children:"GitHub Issue"}),", or send it to ",(0,s.jsx)(n.a,{href:"/luna-for-langflow",children:"support"})," for debugging assistance."]}),"\n",(0,s.jsx)(n.p,{children:"The log file is only created when Langflow Desktop runs. If you don't see a log file, try starting Langflow Desktop first, then check for the log file."}),"\n",(0,s.jsx)(n.h2,{id:"see-also",children:"See also"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"/api-logs",children:"Logs endpoints"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"/memory",children:"Memory management options"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"/configuration-custom-database",children:"Configure an external PostgreSQL database"})}),"\n"]})]})}function j(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(x,{...e})}):x(e)}function m(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}}}]); \ No newline at end of file diff --git a/assets/js/56350599.6bd91968.js b/assets/js/56350599.6bd91968.js deleted file mode 100644 index 6558cc0885..0000000000 --- a/assets/js/56350599.6bd91968.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[8593],{11470:(e,n,o)=>{o.d(n,{A:()=>L});var t=o(96540),s=o(18215),r=o(23104),l=o(56347),i=o(205),a=o(57485),c=o(31682),d=o(70679);function h(e){return t.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,t.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function u(e){const{values:n,children:o}=e;return(0,t.useMemo)(()=>{const e=n??function(e){return h(e).map(({props:{value:e,label:n,attributes:o,default:t}})=>({value:e,label:n,attributes:o,default:t}))}(o);return function(e){const n=(0,c.XI)(e,(e,n)=>e.value===n.value);if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map(e=>e.value).join(", ")}" found in . Every value needs to be unique.`)}(e),e},[n,o])}function g({value:e,tabValues:n}){return n.some(n=>n.value===e)}function p({queryString:e=!1,groupId:n}){const o=(0,l.W6)(),s=function({queryString:e=!1,groupId:n}){if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:e,groupId:n});return[(0,a.aZ)(s),(0,t.useCallback)(e=>{if(!s)return;const n=new URLSearchParams(o.location.search);n.set(s,e),o.replace({...o.location,search:n.toString()})},[s,o])]}function f(e){const{defaultValue:n,queryString:o=!1,groupId:s}=e,r=u(e),[l,a]=(0,t.useState)(()=>function({defaultValue:e,tabValues:n}){if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(e){if(!g({value:e,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${n.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}const o=n.find(e=>e.default)??n[0];if(!o)throw new Error("Unexpected error: 0 tabValues");return o.value}({defaultValue:n,tabValues:r})),[c,h]=p({queryString:o,groupId:s}),[f,x]=function({groupId:e}){const n=function(e){return e?`docusaurus.tab.${e}`:null}(e),[o,s]=(0,d.Dv)(n);return[o,(0,t.useCallback)(e=>{n&&s.set(e)},[n,s])]}({groupId:s}),j=(()=>{const e=c??f;return g({value:e,tabValues:r})?e:null})();(0,i.A)(()=>{j&&a(j)},[j]);return{selectedValue:l,selectValue:(0,t.useCallback)(e=>{if(!g({value:e,tabValues:r}))throw new Error(`Can't select invalid tab value=${e}`);a(e),h(e),x(e)},[h,x,r]),tabValues:r}}var x=o(92303);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var m=o(74848);function b({className:e,block:n,selectedValue:o,selectValue:t,tabValues:l}){const i=[],{blockElementScrollPositionUntilNextRender:a}=(0,r.a_)(),c=e=>{const n=e.currentTarget,s=i.indexOf(n),r=l[s].value;r!==o&&(a(n),t(r))},d=e=>{let n=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const o=i.indexOf(e.currentTarget)+1;n=i[o]??i[0];break}case"ArrowLeft":{const o=i.indexOf(e.currentTarget)-1;n=i[o]??i[i.length-1];break}}n?.focus()};return(0,m.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.A)("tabs",{"tabs--block":n},e),children:l.map(({value:e,label:n,attributes:t})=>(0,m.jsx)("li",{role:"tab",tabIndex:o===e?0:-1,"aria-selected":o===e,ref:e=>{i.push(e)},onKeyDown:d,onClick:c,...t,className:(0,s.A)("tabs__item",j.tabItem,t?.className,{"tabs__item--active":o===e}),children:n??e},e))})}function w({lazy:e,children:n,selectedValue:o}){const r=(Array.isArray(n)?n:[n]).filter(Boolean);if(e){const e=r.find(e=>e.props.value===o);return e?(0,t.cloneElement)(e,{className:(0,s.A)("margin-top--md",e.props.className)}):null}return(0,m.jsx)("div",{className:"margin-top--md",children:r.map((e,n)=>(0,t.cloneElement)(e,{key:n,hidden:e.props.value!==o}))})}function v(e){const n=f(e);return(0,m.jsxs)("div",{className:(0,s.A)("tabs-container",j.tabList),children:[(0,m.jsx)(b,{...n,...e}),(0,m.jsx)(w,{...n,...e})]})}function L(e){const n=(0,x.A)();return(0,m.jsx)(v,{...e,children:h(e.children)},String(n))}},17886:(e,n,o)=>{o.d(n,{A:()=>r});o(96540);var t=o(64058),s=o(74848);function r({name:e,...n}){const o=t[e];return o?(0,s.jsx)(o,{...n}):null}},19365:(e,n,o)=>{o.d(n,{A:()=>l});o(96540);var t=o(18215);const s={tabItem:"tabItem_Ymn6"};var r=o(74848);function l({children:e,hidden:n,className:o}){return(0,r.jsx)("div",{role:"tabpanel",className:(0,t.A)(s.tabItem,o),hidden:n,children:e})}},77232:(e,n,o)=>{o.d(n,{A:()=>t});const t=o.p+"assets/images/logs-cc30f076e63a5e443cf04855559703a3.png"},88262:(e,n,o)=>{o.r(n),o.d(n,{CH:()=>g,assets:()=>u,chCodeConfig:()=>p,contentTitle:()=>h,default:()=>j,frontMatter:()=>d,metadata:()=>t,toc:()=>f});const t=JSON.parse('{"id":"Develop/logging","title":"Logs","description":"Langflow produces logs for individual flows and the Langflow application itself using the structlog library for logging.","source":"@site/docs/Develop/logging.mdx","sourceDirName":"Develop","slug":"/logging","permalink":"/logging","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Logs","slug":"/logging"},"sidebar":"docs","previous":{"title":"Database guide for enterprise administrators","permalink":"/enterprise-database-guide"},"next":{"title":"Arize","permalink":"/integrations-arize"}}');var s=o(74848),r=o(28453),l=o(24754),i=o(17886),a=o(11470),c=o(19365);const d={title:"Logs",slug:"/logging"},h=void 0,u={},g={annotations:l.hk,Code:l.Cy},p={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},f=[{value:"Log storage",id:"log-storage",level:2},{value:"View logs in real-time",id:"view-logs-in-real-time",level:2},{value:"Flow and component logs",id:"flow-and-component-logs",level:2},{value:"View flow logs",id:"view-flow-logs",level:3},{value:"View chat logs",id:"view-chat-logs",level:3},{value:"View output from a single component",id:"view-output-from-a-single-component",level:3},{value:"Access Langflow Desktop logs",id:"desktop-logs",level:2},{value:"See also",id:"see-also",level:2}];function x(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,r.R)(),...e.components};return g||m("CH",!1),g.Code||m("CH.Code",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n","\n",(0,s.jsxs)(n.p,{children:["Langflow produces logs for individual flows and the Langflow application itself using the ",(0,s.jsx)(n.a,{href:"https://www.structlog.org",children:"structlog"})," library for logging."]}),"\n",(0,s.jsxs)(n.p,{children:["The default, primary logfile is named ",(0,s.jsx)(n.code,{children:"langflow.log"}),"."]}),"\n",(0,s.jsx)(n.p,{children:"Log files are stored in JSON format with structured metadata."}),"\n",(0,s.jsx)(n.h2,{id:"log-storage",children:"Log storage"}),"\n",(0,s.jsxs)(n.p,{children:["Langflow logs are stored in the config directory specified in the ",(0,s.jsx)(n.code,{children:"LANGFLOW_CONFIG_DIR"})," environment variable.\nThe default config directory location depends on your operating system and installation method:"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Langflow Desktop"}),":"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"macOS"}),": ",(0,s.jsx)(n.code,{children:"/Users//Library/Logs/com.Langflow"})]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Windows"}),": ",(0,s.jsx)(n.code,{children:"C:\\Users\\\\AppData\\Roaming\\com.Langflow\\cache"})]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"OSS Langflow"}),":"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsxs)(n.strong,{children:["macOS with ",(0,s.jsx)(n.code,{children:"uv pip install"})]}),": ",(0,s.jsx)(n.code,{children:"/Users//Library/Caches/langflow"})]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsxs)(n.strong,{children:["Linux with ",(0,s.jsx)(n.code,{children:"uv pip install"})]}),": ",(0,s.jsx)(n.code,{children:"/home//.cache/langflow"})]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsxs)(n.strong,{children:["Windows/WSL with ",(0,s.jsx)(n.code,{children:"uv pip install"})]}),": ",(0,s.jsx)(n.code,{children:"C:\\Users\\\\AppData\\Local\\langflow\\langflow\\Cache"})]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsxs)(n.strong,{children:["macOS/Windows/Linux/WSL with ",(0,s.jsx)(n.code,{children:"git clone"})]}),": ",(0,s.jsx)(n.code,{children:"/src/backend/base/langflow/"})]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["To customize log storage locations and behaviors, set the following ",(0,s.jsx)(n.a,{href:"/environment-variables",children:"Langflow environment variables"})," in your Langflow ",(0,s.jsx)(n.code,{children:".env"})," file, and then start Langflow with ",(0,s.jsx)(n.code,{children:"uv run langflow run --env-file .env"}),":"]}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Variable"}),(0,s.jsx)(n.th,{children:"Format"}),(0,s.jsx)(n.th,{children:"Default"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"LANGFLOW_CONFIG_DIR"})}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Varies"}),(0,s.jsx)(n.td,{children:"Set the Langflow configuration directory where files and logs are stored. Default path depends on your installation, as described in the preceding list."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"LANGFLOW_LOG_LEVEL"})}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"ERROR"})}),(0,s.jsxs)(n.td,{children:["Sets the log level as one of ",(0,s.jsx)(n.code,{children:"DEBUG"}),", ",(0,s.jsx)(n.code,{children:"ERROR"}),", ",(0,s.jsx)(n.code,{children:"INFO"}),", ",(0,s.jsx)(n.code,{children:"WARNING"}),", and ",(0,s.jsx)(n.code,{children:"CRITICAL"}),". For example, ",(0,s.jsx)(n.code,{children:"LANGFLOW_LOG_LEVEL=DEBUG"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"LANGFLOW_LOG_FILE"})}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Not set"}),(0,s.jsxs)(n.td,{children:["Sets the log file storage location if you want to use a non-default location. For example, ",(0,s.jsx)(n.code,{children:"LANGFLOW_LOG_FILE=path/to/logfile.log"}),". If not set, logs are written to stdout."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"LANGFLOW_LOG_ENV"})}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"default"})}),(0,s.jsxs)(n.td,{children:["This variable is the primary log format controller. ",(0,s.jsx)(n.code,{children:"container"}),": JSON format for Docker/structured logging. ",(0,s.jsx)(n.code,{children:"container_csv"}),": Key-value format for data analysis. ",(0,s.jsx)(n.code,{children:"default"})," or unset: Uses ",(0,s.jsx)(n.code,{children:"LANGFLOW_PRETTY_LOGS"})," to determine format."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"LANGFLOW_PRETTY_LOGS"})}),(0,s.jsx)(n.td,{children:"Boolean"}),(0,s.jsx)(n.td,{children:"True"}),(0,s.jsxs)(n.td,{children:["This variable controls log output format when ",(0,s.jsx)(n.code,{children:"LANGFLOW_LOG_ENV=default"})," or unset. When ",(0,s.jsx)(n.code,{children:"true"}),", uses structlog's ",(0,s.jsx)(n.a,{href:"https://www.structlog.org/en/stable/console-output.html",children:"ConsoleRenderer"}),". When ",(0,s.jsx)(n.code,{children:"false"}),", outputs logs in JSON format."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"LANGFLOW_LOG_FORMAT"})}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Not set"}),(0,s.jsxs)(n.td,{children:["Switch between key-value format and console format. Set to ",(0,s.jsx)(n.code,{children:"key_value"})," for key-value format or ",(0,s.jsx)(n.code,{children:"console"})," to use structlog's ",(0,s.jsx)(n.a,{href:"https://www.structlog.org/en/stable/console-output.html",children:"ConsoleRenderer"}),". This variable only works when ",(0,s.jsx)(n.code,{children:"LANGFLOW_LOG_ENV=default"})," and ",(0,s.jsx)(n.code,{children:"LANGFLOW_PRETTY_LOGS=true"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"LANGFLOW_LOG_ROTATION"})}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"1 day"})}),(0,s.jsxs)(n.td,{children:["Controls when the log file is rotated, either based on time or file size. For time-based rotation, set to ",(0,s.jsx)(n.code,{children:"1 day"}),", ",(0,s.jsx)(n.code,{children:"12 hours"}),", or ",(0,s.jsx)(n.code,{children:"1 week"}),". For size-based rotation, set to ",(0,s.jsx)(n.code,{children:"10 MB"})," or ",(0,s.jsx)(n.code,{children:"1 GB"}),". To disable rotation, set to ",(0,s.jsx)(n.code,{children:"None"}),". If disabled, log files grow without limit."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"LANGFLOW_ENABLE_LOG_RETRIEVAL"})}),(0,s.jsx)(n.td,{children:"Boolean"}),(0,s.jsx)(n.td,{children:"False"}),(0,s.jsxs)(n.td,{children:["Enables retrieval of logs from your Langflow instance with ",(0,s.jsx)(n.a,{href:"/api-logs",children:"Logs endpoints"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"LANGFLOW_LOG_RETRIEVER_BUFFER_SIZE"})}),(0,s.jsx)(n.td,{children:"Integer"}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"10000"})}),(0,s.jsxs)(n.td,{children:["Set the buffer size for log retrieval if ",(0,s.jsx)(n.code,{children:"LANGFLOW_ENABLE_LOG_RETRIEVAL=True"}),". Must be greater than ",(0,s.jsx)(n.code,{children:"0"})," for log retrieval to function."]})]})]})]}),"\n",(0,s.jsx)(n.h2,{id:"view-logs-in-real-time",children:"View logs in real-time"}),"\n",(0,s.jsx)(n.p,{children:"To monitor Langflow logs as they are generated, you can follow the log file:"}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Change to your ",(0,s.jsx)(n.a,{href:"#log-storage",children:"Langflow config directory"}),":"]}),"\n",(0,s.jsxs)(a.A,{groupId:"cd-command",children:[(0,s.jsx)(c.A,{value:"macOS",label:"macOS",default:!0,children:(0,s.jsx)(g.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"cd ",props:{style:{color:"#79C0FF"}}},{content:"/Users/",props:{style:{color:"#A5D6FF"}}},{content:"**",props:{style:{color:"#79C0FF"}}},{content:"USERNAME",props:{style:{color:"#A5D6FF"}}},{content:"**",props:{style:{color:"#79C0FF"}}},{content:"/Library/Caches/langflow",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]})}),(0,s.jsx)(c.A,{value:"Windows",label:"Windows",children:(0,s.jsx)(g.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"cd C:\\Users\\",props:{style:{color:"#C9D1D9"}}},{content:"**",props:{style:{color:"#FF7B72"}}},{content:"USERNAME",props:{style:{color:"#C9D1D9"}}},{content:"**",props:{style:{color:"#FF7B72"}}},{content:"\\AppData\\Local\\langflow\\langflow\\Cache",props:{style:{color:"#C9D1D9"}}}]}],lang:"cmd"},annotations:[]}]})})]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Tail the main log file:"}),"\n",(0,s.jsxs)(a.A,{groupId:"tail-command",children:[(0,s.jsx)(c.A,{value:"macOS",label:"macOS",default:!0,children:(0,s.jsx)(g.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"tail ",props:{style:{color:"#FFA657"}}},{content:"-f ",props:{style:{color:"#79C0FF"}}},{content:"langflow.log",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]})}),(0,s.jsx)(c.A,{value:"Windows",label:"Windows",children:(0,s.jsx)(g.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"Get-",props:{style:{color:"#FF7B72"}}},{content:"Content ",props:{style:{color:"#C9D1D9"}}},{content:"-",props:{style:{color:"#FF7B72"}}},{content:"Wait ",props:{style:{color:"#C9D1D9"}}},{content:"-",props:{style:{color:"#FF7B72"}}},{content:"Path langflow.",props:{style:{color:"#C9D1D9"}}},{content:"log",props:{style:{color:"#79C0FF"}}}]}],lang:"cmd"},annotations:[]}]})})]}),"\n",(0,s.jsx)(n.p,{children:"If you don't see new log entries, check that Langflow is running, and perform some actions to generate logs events. You can also check the terminal where you started Langflow to see if logs are being printed there."}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"flow-and-component-logs",children:"Flow and component logs"}),"\n",(0,s.jsxs)(n.p,{children:["After you run a flow, you can inspect the logs for the each component and flow run.\nFor example, you can inspect ",(0,s.jsx)(n.code,{children:"Message"})," objects ingested and generated by ",(0,s.jsx)(n.a,{href:"/components-io",children:"Input and Output components"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"view-flow-logs",children:"View flow logs"}),"\n",(0,s.jsxs)(n.p,{children:["In the visual editor, click ",(0,s.jsx)(n.strong,{children:"Logs"})," to view logs for the entire flow:"]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"Logs pane",src:o(77232).A+"",width:"4000",height:"2180"})}),"\n",(0,s.jsxs)(n.p,{children:["Then, click the cells in the ",(0,s.jsx)(n.strong,{children:"inputs"})," and ",(0,s.jsx)(n.strong,{children:"outputs"})," columns to inspect the ",(0,s.jsx)(n.code,{children:"Message"})," objects.\nFor example, the following ",(0,s.jsx)(n.code,{children:"Message"})," data could be the output from a ",(0,s.jsx)(n.strong,{children:"Chat Input"})," component:"]}),"\n",(0,s.jsx)(g.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:' "messages": [',props:{}}]},{tokens:[{content:" {",props:{}}]},{tokens:[{content:' "message": "What\'s the recommended way to install Docker on Mac M1?",',props:{}}]},{tokens:[{content:' "sender": "User",',props:{}}]},{tokens:[{content:' "sender_name": "User",',props:{}}]},{tokens:[{content:' "session_id": "Session Apr 21, 17:37:04",',props:{}}]},{tokens:[{content:' "stream_url": null,',props:{}}]},{tokens:[{content:' "component_id": "ChatInput-4WKag",',props:{}}]},{tokens:[{content:' "files": [],',props:{}}]},{tokens:[{content:' "type": "text"',props:{}}]},{tokens:[{content:" }",props:{}}]},{tokens:[{content:" ],",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,s.jsxs)(n.p,{children:["In the case of Input/Output components, the original input might not be structured as a ",(0,s.jsx)(n.code,{children:"Message"})," object.\nFor example, a language model component can pass a raw text response to a ",(0,s.jsx)(n.strong,{children:"Chat Output"})," component that is then transformed into a ",(0,s.jsx)(n.code,{children:"Message"})," object."]}),"\n",(0,s.jsxs)(n.p,{children:["You can find ",(0,s.jsx)(n.code,{children:".log"})," files for flows at your Langflow installation's log storage location.\nFor filepaths, see ",(0,s.jsx)(n.a,{href:"#log-storage",children:"Log storage"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"view-chat-logs",children:"View chat logs"}),"\n",(0,s.jsxs)(n.p,{children:["In the ",(0,s.jsx)(n.strong,{children:"Playground"}),", you can inspect the chat history for each chat session.\nFor more information, see ",(0,s.jsx)(n.a,{href:"/concepts-playground#view-chat-history",children:"View chat history"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"view-output-from-a-single-component",children:"View output from a single component"}),"\n",(0,s.jsx)(n.p,{children:"When debugging issues with the format or content of a flow's output, it can help to inspect each component's output to determine where data is being lost or malformed."}),"\n",(0,s.jsxs)(n.p,{children:["To view the output produced by a single component during the most recent run, click ",(0,s.jsx)(i.A,{name:"TextSearch","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Inspect output"})," on the component in the visual editor."]}),"\n",(0,s.jsx)(n.h2,{id:"desktop-logs",children:"Access Langflow Desktop logs"}),"\n",(0,s.jsx)(n.p,{children:"If you encounter issues with Langflow Desktop, you might need to access startup logs for debugging.\nFollow the steps for your operating system."}),"\n",(0,s.jsxs)(a.A,{children:[(0,s.jsx)(c.A,{value:"macos",label:"macOS",children:(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Open Terminal and run:"}),"\n",(0,s.jsx)(g.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"cd ",props:{style:{color:"#79C0FF"}}},{content:"~/Library/Logs/com.Langflow",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"To open the folder and view the log files, run the command:"}),"\n",(0,s.jsx)(g.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"open ",props:{style:{color:"#FFA657"}}},{content:".",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Locate the ",(0,s.jsx)(n.code,{children:"langflow.log"})," file."]}),"\n"]}),"\n"]})}),(0,s.jsx)(c.A,{value:"windows",label:"Windows",children:(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Open the Command Prompt (CMD), and then run the following command:"}),"\n",(0,s.jsx)(g.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"cd ",props:{style:{color:"#C9D1D9"}}},{content:"%",props:{style:{color:"#FF7B72"}}},{content:"LOCALAPPDATA",props:{style:{color:"#C9D1D9"}}},{content:"%",props:{style:{color:"#FF7B72"}}},{content:"\\com.langflow\\logs",props:{style:{color:"#C9D1D9"}}}]}],lang:"cmd"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Open the folder and view the log files:"}),"\n",(0,s.jsx)(g.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"start .",props:{style:{color:"#C9D1D9"}}}]}],lang:"cmd"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Locate the ",(0,s.jsx)(n.code,{children:"langflow.log"})," file."]}),"\n"]}),"\n"]})})]}),"\n",(0,s.jsxs)(n.p,{children:["You can use the log file to investigate the issue on your own, add context to a ",(0,s.jsx)(n.a,{href:"/contributing-github-issues",children:"GitHub Issue"}),", or send it to ",(0,s.jsx)(n.a,{href:"/luna-for-langflow",children:"support"})," for debugging assistance."]}),"\n",(0,s.jsx)(n.p,{children:"The log file is only created when Langflow Desktop runs. If you don't see a log file, try starting Langflow Desktop first, then check for the log file."}),"\n",(0,s.jsx)(n.h2,{id:"see-also",children:"See also"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"/api-logs",children:"Logs endpoints"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"/memory",children:"Memory management options"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"/configuration-custom-database",children:"Configure an external PostgreSQL database"})}),"\n"]})]})}function j(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(x,{...e})}):x(e)}function m(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}}}]); \ No newline at end of file diff --git a/assets/js/56c23a02.5d3a8e4f.js b/assets/js/56c23a02.f13de791.js similarity index 76% rename from assets/js/56c23a02.5d3a8e4f.js rename to assets/js/56c23a02.f13de791.js index cad9850a7f..4832d821c1 100644 --- a/assets/js/56c23a02.5d3a8e4f.js +++ b/assets/js/56c23a02.f13de791.js @@ -1 +1 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[8963],{17886:(e,n,t)=>{t.d(n,{A:()=>o});t(96540);var s=t(64058),r=t(74848);function o({name:e,...n}){const t=s[e];return t?(0,r.jsx)(t,{...n}):null}},31929:(e,n,t)=>{t.d(n,{Ay:()=>a,RM:()=>i});var s=t(74848),r=t(28453),o=t(17886);const i=[];function d(e){const n={a:"a",p:"p",strong:"strong",...(0,r.R)(),...e.components};return(0,s.jsxs)(n.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,s.jsx)(o.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Controls"})," in the ",(0,s.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function a(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}},99987:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>l,default:()=>p,frontMatter:()=>a,metadata:()=>s,toc:()=>h});const s=JSON.parse('{"id":"Components/bundles-xai","title":"xAI","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/bundles-xai.mdx","sourceDirName":"Components","slug":"/bundles-xai","permalink":"/bundles-xai","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"xAI","slug":"/bundles-xai"},"sidebar":"docs","previous":{"title":"Wikipedia","permalink":"/bundles-wikipedia"},"next":{"title":"Create custom Python components","permalink":"/components-custom-components"}}');var r=t(74848),o=t(28453),i=t(17886),d=t(31929);const a={title:"xAI",slug:"/bundles-xai"},l=void 0,c={},h=[{value:"xAI text generation",id:"xai-text-generation",level:2},{value:"xAI text generation parameters",id:"xai-text-generation-parameters",level:3},...d.RM];function x(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,o.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(n.p,{children:[(0,r.jsx)(i.A,{name:"Blocks","aria-hidden":"true"})," ",(0,r.jsx)(n.a,{href:"/components-bundle-components",children:(0,r.jsx)(n.strong,{children:"Bundles"})})," contain custom components that support specific third-party integrations with Langflow."]}),"\n",(0,r.jsxs)(n.p,{children:["This page describes the components that are available in the ",(0,r.jsx)(n.strong,{children:"xAI"})," bundle."]}),"\n",(0,r.jsxs)(n.p,{children:["For more information about xAI features and functionality used by xAI components, see the ",(0,r.jsx)(n.a,{href:"https://x.ai/",children:"xAI documentation"}),"."]}),"\n",(0,r.jsx)(n.h2,{id:"xai-text-generation",children:"xAI text generation"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"xAI"})," component generates text using xAI models like ",(0,r.jsx)(n.a,{href:"https://x.ai/grok",children:"Grok"}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["It can output either a ",(0,r.jsx)(n.strong,{children:"Model Response"})," (",(0,r.jsx)(n.a,{href:"/data-types#message",children:(0,r.jsx)(n.code,{children:"Message"})}),") or a ",(0,r.jsx)(n.strong,{children:"Language Model"})," (",(0,r.jsx)(n.a,{href:"/data-types#languagemodel",children:(0,r.jsx)(n.code,{children:"LanguageModel"})}),")."]}),"\n",(0,r.jsxs)(n.p,{children:["Use the ",(0,r.jsx)(n.strong,{children:"Language Model"})," output when you want to use an xAI model as the LLM for another LLM-driven component, such as an ",(0,r.jsx)(n.strong,{children:"Agent"})," or ",(0,r.jsx)(n.strong,{children:"Smart Function"})," component."]}),"\n",(0,r.jsxs)(n.p,{children:["For more information, see ",(0,r.jsx)(n.a,{href:"/components-models",children:"Language model components"}),"."]}),"\n",(0,r.jsx)(n.h3,{id:"xai-text-generation-parameters",children:"xAI text generation parameters"}),"\n",(0,r.jsx)(d.Ay,{}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"max_tokens"}),(0,r.jsx)(n.td,{children:"Integer"}),(0,r.jsxs)(n.td,{children:["Input parameter. Maximum number of tokens to generate. Set to ",(0,r.jsx)(n.code,{children:"0"})," for unlimited. Range: ",(0,r.jsx)(n.code,{children:"0-128000"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"model_kwargs"}),(0,r.jsx)(n.td,{children:"Dictionary"}),(0,r.jsx)(n.td,{children:"Input parameter. Additional keyword arguments for the model."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"json_mode"}),(0,r.jsx)(n.td,{children:"Boolean"}),(0,r.jsx)(n.td,{children:"Input parameter. If true, outputs JSON regardless of passing a schema."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"model_name"}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsxs)(n.td,{children:["Input parameter. The xAI model to use. Default: ",(0,r.jsx)(n.code,{children:"grok-2-latest"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"base_url"}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsxs)(n.td,{children:["Input parameter. Base URL for API requests. Default: ",(0,r.jsx)(n.code,{children:"https://api.x.ai/v1"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"api_key"}),(0,r.jsx)(n.td,{children:"SecretString"}),(0,r.jsx)(n.td,{children:"Input parameter. Your xAI API key for authentication."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"temperature"}),(0,r.jsx)(n.td,{children:"Float"}),(0,r.jsxs)(n.td,{children:["Input parameter. Controls randomness in the output. Range: ",(0,r.jsx)(n.code,{children:"[0.0, 2.0]"}),". Default: ",(0,r.jsx)(n.code,{children:"0.1"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"seed"}),(0,r.jsx)(n.td,{children:"Integer"}),(0,r.jsx)(n.td,{children:"Input parameter. Controls reproducibility of the job."})]})]})]})]})}function p(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(x,{...e})}):x(e)}}}]); \ No newline at end of file +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[8963],{17886:(e,n,t)=>{t.d(n,{A:()=>o});t(96540);var s=t(64058),r=t(74848);function o({name:e,...n}){const t=s[e];return t?(0,r.jsx)(t,{...n}):null}},31929:(e,n,t)=>{t.d(n,{Ay:()=>a,RM:()=>i});var s=t(74848),r=t(28453),o=t(17886);const i=[];function d(e){const n={a:"a",p:"p",strong:"strong",...(0,r.R)(),...e.components};return(0,s.jsxs)(n.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,s.jsx)(o.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Controls"})," in the ",(0,s.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function a(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}},99987:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>l,default:()=>p,frontMatter:()=>a,metadata:()=>s,toc:()=>h});const s=JSON.parse('{"id":"Components/bundles-xai","title":"xAI","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/bundles-xai.mdx","sourceDirName":"Components","slug":"/bundles-xai","permalink":"/bundles-xai","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"xAI","slug":"/bundles-xai"},"sidebar":"docs","previous":{"title":"Wikipedia","permalink":"/bundles-wikipedia"},"next":{"title":"Create custom Python components","permalink":"/components-custom-components"}}');var r=t(74848),o=t(28453),i=t(17886),d=t(31929);const a={title:"xAI",slug:"/bundles-xai"},l=void 0,c={},h=[{value:"xAI text generation",id:"xai-text-generation",level:2},{value:"xAI text generation parameters",id:"xai-text-generation-parameters",level:3},...d.RM];function x(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,o.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(n.p,{children:[(0,r.jsx)(i.A,{name:"Blocks","aria-hidden":"true"})," ",(0,r.jsx)(n.a,{href:"/components-bundle-components",children:(0,r.jsx)(n.strong,{children:"Bundles"})})," contain custom components that support specific third-party integrations with Langflow."]}),"\n",(0,r.jsxs)(n.p,{children:["This page describes the components that are available in the ",(0,r.jsx)(n.strong,{children:"xAI"})," bundle."]}),"\n",(0,r.jsxs)(n.p,{children:["For more information about xAI features and functionality used by xAI components, see the ",(0,r.jsx)(n.a,{href:"https://x.ai/",children:"xAI documentation"}),"."]}),"\n",(0,r.jsx)(n.h2,{id:"xai-text-generation",children:"xAI text generation"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"xAI"})," component generates text using xAI models like ",(0,r.jsx)(n.a,{href:"https://x.ai/grok",children:"Grok"}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["It can output either a ",(0,r.jsx)(n.strong,{children:"Model Response"})," (",(0,r.jsx)(n.a,{href:"/data-types#message",children:(0,r.jsx)(n.code,{children:"Message"})}),") or a ",(0,r.jsx)(n.strong,{children:"Language Model"})," (",(0,r.jsx)(n.a,{href:"/data-types#languagemodel",children:(0,r.jsx)(n.code,{children:"LanguageModel"})}),")."]}),"\n",(0,r.jsxs)(n.p,{children:["Use the ",(0,r.jsx)(n.strong,{children:"Language Model"})," output when you want to use an xAI model as the LLM for another LLM-driven component, such as an ",(0,r.jsx)(n.strong,{children:"Agent"})," or ",(0,r.jsx)(n.strong,{children:"Smart Function"})," component."]}),"\n",(0,r.jsxs)(n.p,{children:["For more information, see ",(0,r.jsx)(n.a,{href:"/components-models",children:"Language model components"}),"."]}),"\n",(0,r.jsx)(n.h3,{id:"xai-text-generation-parameters",children:"xAI text generation parameters"}),"\n",(0,r.jsx)(d.Ay,{}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"max_tokens"}),(0,r.jsx)(n.td,{children:"Integer"}),(0,r.jsxs)(n.td,{children:["Input parameter. Maximum number of tokens to generate. Set to ",(0,r.jsx)(n.code,{children:"0"})," for unlimited. Range: ",(0,r.jsx)(n.code,{children:"0-128000"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"model_kwargs"}),(0,r.jsx)(n.td,{children:"Dictionary"}),(0,r.jsx)(n.td,{children:"Input parameter. Additional keyword arguments for the model."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"json_mode"}),(0,r.jsx)(n.td,{children:"Boolean"}),(0,r.jsxs)(n.td,{children:["Input parameter. If ",(0,r.jsx)(n.code,{children:"true"}),", outputs JSON regardless of passing a schema."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"model_name"}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsxs)(n.td,{children:["Input parameter. The xAI model to use. Default: ",(0,r.jsx)(n.code,{children:"grok-2-latest"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"base_url"}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsxs)(n.td,{children:["Input parameter. Base URL for API requests. Default: ",(0,r.jsx)(n.code,{children:"https://api.x.ai/v1"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"api_key"}),(0,r.jsx)(n.td,{children:"SecretString"}),(0,r.jsx)(n.td,{children:"Input parameter. Your xAI API key for authentication."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"temperature"}),(0,r.jsx)(n.td,{children:"Float"}),(0,r.jsxs)(n.td,{children:["Input parameter. Controls randomness in the output. Range: ",(0,r.jsx)(n.code,{children:"[0.0, 2.0]"}),". Default: ",(0,r.jsx)(n.code,{children:"0.1"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"seed"}),(0,r.jsx)(n.td,{children:"Integer"}),(0,r.jsx)(n.td,{children:"Input parameter. Controls reproducibility of the job."})]})]})]})]})}function p(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(x,{...e})}):x(e)}}}]); \ No newline at end of file diff --git a/assets/js/619c7267.62f82708.js b/assets/js/619c7267.62f82708.js deleted file mode 100644 index e5031d0dfa..0000000000 --- a/assets/js/619c7267.62f82708.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[7902],{17886:(e,r,n)=>{n.d(r,{A:()=>d});n(96540);var t=n(64058),s=n(74848);function d({name:e,...r}){const n=t[e];return n?(0,s.jsx)(n,{...r}):null}},31929:(e,r,n)=>{n.d(r,{Ay:()=>h,RM:()=>o});var t=n(74848),s=n(28453),d=n(17886);const o=[];function i(e){const r={a:"a",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,t.jsxs)(r.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,t.jsx)(d.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,t.jsx)(r.strong,{children:"Controls"})," in the ",(0,t.jsx)(r.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function h(e={}){const{wrapper:r}={...(0,s.R)(),...e.components};return r?(0,t.jsx)(r,{...e,children:(0,t.jsx)(i,{...e})}):i(e)}},98406:(e,r,n)=>{n.r(r),n.d(r,{assets:()=>c,contentTitle:()=>a,default:()=>m,frontMatter:()=>h,metadata:()=>t,toc:()=>l});const t=JSON.parse('{"id":"Components/bundles-cohere","title":"Cohere","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/bundles-cohere.mdx","sourceDirName":"Components","slug":"/bundles-cohere","permalink":"/bundles-cohere","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Cohere","slug":"/bundles-cohere"},"sidebar":"docs","previous":{"title":"Cloudflare","permalink":"/bundles-cloudflare"},"next":{"title":"Composio","permalink":"/integrations-composio"}}');var s=n(74848),d=n(28453),o=n(17886),i=n(31929);const h={title:"Cohere",slug:"/bundles-cohere"},a=void 0,c={},l=[{value:"Cohere text generation",id:"cohere-text-generation",level:2},{value:"Cohere text generation parameters",id:"cohere-text-generation-parameters",level:3},...i.RM,{value:"Cohere Embeddings",id:"cohere-embeddings",level:2},{value:"Cohere Embeddings parameters",id:"cohere-embeddings-parameters",level:3},...i.RM,{value:"Cohere Rerank",id:"cohere-rerank",level:2},{value:"Cohere Rerank parameters",id:"cohere-rerank-parameters",level:3},...i.RM];function x(e){const r={a:"a",code:"code",h2:"h2",h3:"h3",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,d.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(r.p,{children:[(0,s.jsx)(o.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(r.a,{href:"/components-bundle-components",children:(0,s.jsx)(r.strong,{children:"Bundles"})})," contain custom components that support specific third-party integrations with Langflow."]}),"\n",(0,s.jsxs)(r.p,{children:["This page describes the components that are available in the ",(0,s.jsx)(r.strong,{children:"Cohere"})," bundle."]}),"\n",(0,s.jsxs)(r.p,{children:["For more information about Cohere features and functionality used by Cohere components, see the ",(0,s.jsx)(r.a,{href:"https://cohere.ai/",children:"Cohere documentation"}),"."]}),"\n",(0,s.jsx)(r.h2,{id:"cohere-text-generation",children:"Cohere text generation"}),"\n",(0,s.jsx)(r.p,{children:"This component generates text using Cohere's language models."}),"\n",(0,s.jsxs)(r.p,{children:["It can output either a ",(0,s.jsx)(r.strong,{children:"Model Response"})," (",(0,s.jsx)(r.a,{href:"/data-types#message",children:(0,s.jsx)(r.code,{children:"Message"})}),") or a ",(0,s.jsx)(r.strong,{children:"Language Model"})," (",(0,s.jsx)(r.a,{href:"/data-types#languagemodel",children:(0,s.jsx)(r.code,{children:"LanguageModel"})}),")."]}),"\n",(0,s.jsxs)(r.p,{children:["Use the ",(0,s.jsx)(r.strong,{children:"Language Model"})," output when you want to use a Cohere model as the LLM for another LLM-driven component, such as an ",(0,s.jsx)(r.strong,{children:"Agent"})," or ",(0,s.jsx)(r.strong,{children:"Smart Function"})," component."]}),"\n",(0,s.jsxs)(r.p,{children:["For more information, see ",(0,s.jsx)(r.a,{href:"/components-models",children:"Language model components"}),"."]}),"\n",(0,s.jsx)(r.h3,{id:"cohere-text-generation-parameters",children:"Cohere text generation parameters"}),"\n",(0,s.jsx)(i.Ay,{}),"\n",(0,s.jsxs)(r.table,{children:[(0,s.jsx)(r.thead,{children:(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.th,{children:"Name"}),(0,s.jsx)(r.th,{children:"Type"}),(0,s.jsx)(r.th,{children:"Description"})]})}),(0,s.jsxs)(r.tbody,{children:[(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.td,{children:"Input"}),(0,s.jsx)(r.td,{children:"String"}),(0,s.jsx)(r.td,{children:"Input parameter. Specifies the input text for text generation."})]}),(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.td,{children:"System Message"}),(0,s.jsx)(r.td,{children:"String"}),(0,s.jsxs)(r.td,{children:["Input parameter. A ",(0,s.jsx)(r.a,{href:"https://docs.cohere.com/docs/system-instructions",children:"system message"})," to pass to the model."]})]}),(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.td,{children:"Stream"}),(0,s.jsx)(r.td,{children:"Boolean"}),(0,s.jsx)(r.td,{children:"Input parameter. Whether to stream the response. Only works in chat. Default: false."})]}),(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.td,{children:"Cohere API Key"}),(0,s.jsx)(r.td,{children:"SecretString"}),(0,s.jsx)(r.td,{children:"Input parameter. Your Cohere API key."})]}),(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.td,{children:"Temperature"}),(0,s.jsx)(r.td,{children:"Float"}),(0,s.jsxs)(r.td,{children:["Input parameter. Specifies the randomness of sampling. Lower values (near 0) are more deterministic, and higher values (near 1) are more creative. Defaults to ",(0,s.jsx)(r.code,{children:"0.75"}),"."]})]})]})]}),"\n",(0,s.jsx)(r.h2,{id:"cohere-embeddings",children:"Cohere Embeddings"}),"\n",(0,s.jsxs)(r.p,{children:["The ",(0,s.jsx)(r.strong,{children:"Cohere Embeddings"})," component is used to load embedding models from Cohere."]}),"\n",(0,s.jsxs)(r.p,{children:["For more information about using embedding model components in flows, see ",(0,s.jsx)(r.a,{href:"/components-embedding-models",children:"Embedding model components"}),"."]}),"\n",(0,s.jsx)(r.h3,{id:"cohere-embeddings-parameters",children:"Cohere Embeddings parameters"}),"\n",(0,s.jsx)(i.Ay,{}),"\n",(0,s.jsxs)(r.table,{children:[(0,s.jsx)(r.thead,{children:(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.th,{children:"Name"}),(0,s.jsx)(r.th,{children:"Type"}),(0,s.jsx)(r.th,{children:"Description"})]})}),(0,s.jsxs)(r.tbody,{children:[(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.td,{children:"cohere_api_key"}),(0,s.jsx)(r.td,{children:"SecretString"}),(0,s.jsx)(r.td,{children:"Input parameter. The API key required to authenticate with the Cohere service."})]}),(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.td,{children:"model"}),(0,s.jsx)(r.td,{children:"String"}),(0,s.jsxs)(r.td,{children:["Input parameter. The language model used for embedding text documents and performing queries. Default: ",(0,s.jsx)(r.code,{children:"embed-english-v2.0"})]})]}),(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.td,{children:"truncate"}),(0,s.jsx)(r.td,{children:"Boolean"}),(0,s.jsxs)(r.td,{children:["Input parameter. How to handle input that exceeds the model's token limit. One of ",(0,s.jsx)(r.code,{children:"NONE"}),", ",(0,s.jsx)(r.code,{children:"START"}),", or ",(0,s.jsx)(r.code,{children:"END"})," (default). For more information, see the ",(0,s.jsxs)(r.a,{href:"https://docs.cohere.com/reference/embed#request.body.truncate",children:["Cohere ",(0,s.jsx)(r.code,{children:"truncate"})," API reference"]}),"."]})]}),(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.td,{children:"max_retries"}),(0,s.jsx)(r.td,{children:"Integer"}),(0,s.jsxs)(r.td,{children:["Input parameter. The maximum number of retry attempts for failed requests. Default: ",(0,s.jsx)(r.code,{children:"3"})]})]}),(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.td,{children:"user_agent"}),(0,s.jsx)(r.td,{children:"String"}),(0,s.jsxs)(r.td,{children:["Input parameter. A user agent string to include in requests. Default: ",(0,s.jsx)(r.code,{children:"langchain"})]})]}),(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.td,{children:"request_timeout"}),(0,s.jsx)(r.td,{children:"Float"}),(0,s.jsx)(r.td,{children:"Input parameter. The timeout duration for requests in seconds. Default: None"})]})]})]}),"\n",(0,s.jsx)(r.h2,{id:"cohere-rerank",children:"Cohere Rerank"}),"\n",(0,s.jsx)(r.p,{children:"This component finds and reranks documents using the Cohere API."}),"\n",(0,s.jsxs)(r.p,{children:["Outputs ",(0,s.jsx)(r.code,{children:"Data"})," containing the reranked documents, limited by the ",(0,s.jsx)(r.strong,{children:"Top N"})," parameter."]}),"\n",(0,s.jsx)(r.h3,{id:"cohere-rerank-parameters",children:"Cohere Rerank parameters"}),"\n",(0,s.jsx)(i.Ay,{}),"\n",(0,s.jsxs)(r.table,{children:[(0,s.jsx)(r.thead,{children:(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.th,{children:"Name"}),(0,s.jsx)(r.th,{children:"Type"}),(0,s.jsx)(r.th,{children:"Description"})]})}),(0,s.jsxs)(r.tbody,{children:[(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.td,{children:(0,s.jsx)(r.strong,{children:"Search Query"})}),(0,s.jsx)(r.td,{children:"String"}),(0,s.jsx)(r.td,{children:"Input parameter. The search query for reranking documents."})]}),(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.td,{children:(0,s.jsx)(r.strong,{children:"Search Results"})}),(0,s.jsx)(r.td,{children:"Data"}),(0,s.jsx)(r.td,{children:"Input parameter. Connect search results output from a vector store component. Use this parameter to apply reranking after running a similarity search on your vector database."})]}),(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.td,{children:(0,s.jsx)(r.strong,{children:"Top N"})}),(0,s.jsx)(r.td,{children:"Integer"}),(0,s.jsxs)(r.td,{children:["Input parameter. The number of documents to return after reranking. Default: ",(0,s.jsx)(r.code,{children:"3"}),"."]})]}),(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.td,{children:(0,s.jsx)(r.strong,{children:"Cohere API Key"})}),(0,s.jsx)(r.td,{children:"SecretString"}),(0,s.jsx)(r.td,{children:"Input parameter. Your Cohere API key."})]}),(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.td,{children:(0,s.jsx)(r.strong,{children:"Model"})}),(0,s.jsx)(r.td,{children:"String"}),(0,s.jsxs)(r.td,{children:["Input parameter. The re-ranker model to use. Default: ",(0,s.jsx)(r.code,{children:"rerank-english-v3.0"})]})]})]})]})]})}function m(e={}){const{wrapper:r}={...(0,d.R)(),...e.components};return r?(0,s.jsx)(r,{...e,children:(0,s.jsx)(x,{...e})}):x(e)}}}]); \ No newline at end of file diff --git a/assets/js/619c7267.a968ec97.js b/assets/js/619c7267.a968ec97.js new file mode 100644 index 0000000000..83c5c5d282 --- /dev/null +++ b/assets/js/619c7267.a968ec97.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[7902],{17886:(e,r,n)=>{n.d(r,{A:()=>d});n(96540);var t=n(64058),s=n(74848);function d({name:e,...r}){const n=t[e];return n?(0,s.jsx)(n,{...r}):null}},31929:(e,r,n)=>{n.d(r,{Ay:()=>h,RM:()=>o});var t=n(74848),s=n(28453),d=n(17886);const o=[];function i(e){const r={a:"a",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,t.jsxs)(r.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,t.jsx)(d.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,t.jsx)(r.strong,{children:"Controls"})," in the ",(0,t.jsx)(r.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function h(e={}){const{wrapper:r}={...(0,s.R)(),...e.components};return r?(0,t.jsx)(r,{...e,children:(0,t.jsx)(i,{...e})}):i(e)}},98406:(e,r,n)=>{n.r(r),n.d(r,{assets:()=>a,contentTitle:()=>c,default:()=>m,frontMatter:()=>h,metadata:()=>t,toc:()=>l});const t=JSON.parse('{"id":"Components/bundles-cohere","title":"Cohere","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/bundles-cohere.mdx","sourceDirName":"Components","slug":"/bundles-cohere","permalink":"/bundles-cohere","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Cohere","slug":"/bundles-cohere"},"sidebar":"docs","previous":{"title":"Cloudflare","permalink":"/bundles-cloudflare"},"next":{"title":"Composio","permalink":"/integrations-composio"}}');var s=n(74848),d=n(28453),o=n(17886),i=n(31929);const h={title:"Cohere",slug:"/bundles-cohere"},c=void 0,a={},l=[{value:"Cohere text generation",id:"cohere-text-generation",level:2},{value:"Cohere text generation parameters",id:"cohere-text-generation-parameters",level:3},...i.RM,{value:"Cohere Embeddings",id:"cohere-embeddings",level:2},{value:"Cohere Embeddings parameters",id:"cohere-embeddings-parameters",level:3},...i.RM,{value:"Cohere Rerank",id:"cohere-rerank",level:2},{value:"Cohere Rerank parameters",id:"cohere-rerank-parameters",level:3},...i.RM];function x(e){const r={a:"a",code:"code",h2:"h2",h3:"h3",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,d.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(r.p,{children:[(0,s.jsx)(o.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(r.a,{href:"/components-bundle-components",children:(0,s.jsx)(r.strong,{children:"Bundles"})})," contain custom components that support specific third-party integrations with Langflow."]}),"\n",(0,s.jsxs)(r.p,{children:["This page describes the components that are available in the ",(0,s.jsx)(r.strong,{children:"Cohere"})," bundle."]}),"\n",(0,s.jsxs)(r.p,{children:["For more information about Cohere features and functionality used by Cohere components, see the ",(0,s.jsx)(r.a,{href:"https://cohere.ai/",children:"Cohere documentation"}),"."]}),"\n",(0,s.jsx)(r.h2,{id:"cohere-text-generation",children:"Cohere text generation"}),"\n",(0,s.jsx)(r.p,{children:"This component generates text using Cohere's language models."}),"\n",(0,s.jsxs)(r.p,{children:["It can output either a ",(0,s.jsx)(r.strong,{children:"Model Response"})," (",(0,s.jsx)(r.a,{href:"/data-types#message",children:(0,s.jsx)(r.code,{children:"Message"})}),") or a ",(0,s.jsx)(r.strong,{children:"Language Model"})," (",(0,s.jsx)(r.a,{href:"/data-types#languagemodel",children:(0,s.jsx)(r.code,{children:"LanguageModel"})}),")."]}),"\n",(0,s.jsxs)(r.p,{children:["Use the ",(0,s.jsx)(r.strong,{children:"Language Model"})," output when you want to use a Cohere model as the LLM for another LLM-driven component, such as an ",(0,s.jsx)(r.strong,{children:"Agent"})," or ",(0,s.jsx)(r.strong,{children:"Smart Function"})," component."]}),"\n",(0,s.jsxs)(r.p,{children:["For more information, see ",(0,s.jsx)(r.a,{href:"/components-models",children:"Language model components"}),"."]}),"\n",(0,s.jsx)(r.h3,{id:"cohere-text-generation-parameters",children:"Cohere text generation parameters"}),"\n",(0,s.jsx)(i.Ay,{}),"\n",(0,s.jsxs)(r.table,{children:[(0,s.jsx)(r.thead,{children:(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.th,{children:"Name"}),(0,s.jsx)(r.th,{children:"Type"}),(0,s.jsx)(r.th,{children:"Description"})]})}),(0,s.jsxs)(r.tbody,{children:[(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.td,{children:"Input"}),(0,s.jsx)(r.td,{children:"String"}),(0,s.jsx)(r.td,{children:"Input parameter. Specifies the input text for text generation."})]}),(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.td,{children:"System Message"}),(0,s.jsx)(r.td,{children:"String"}),(0,s.jsxs)(r.td,{children:["Input parameter. A ",(0,s.jsx)(r.a,{href:"https://docs.cohere.com/docs/system-instructions",children:"system message"})," to pass to the model."]})]}),(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.td,{children:"Stream"}),(0,s.jsx)(r.td,{children:"Boolean"}),(0,s.jsxs)(r.td,{children:["Input parameter. Whether to stream the response. Only works in chat. Default: ",(0,s.jsx)(r.code,{children:"false"}),"."]})]}),(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.td,{children:"Cohere API Key"}),(0,s.jsx)(r.td,{children:"SecretString"}),(0,s.jsx)(r.td,{children:"Input parameter. Your Cohere API key."})]}),(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.td,{children:"Temperature"}),(0,s.jsx)(r.td,{children:"Float"}),(0,s.jsxs)(r.td,{children:["Input parameter. Specifies the randomness of sampling. Lower values (near 0) are more deterministic, and higher values (near 1) are more creative. Defaults to ",(0,s.jsx)(r.code,{children:"0.75"}),"."]})]})]})]}),"\n",(0,s.jsx)(r.h2,{id:"cohere-embeddings",children:"Cohere Embeddings"}),"\n",(0,s.jsxs)(r.p,{children:["The ",(0,s.jsx)(r.strong,{children:"Cohere Embeddings"})," component is used to load embedding models from Cohere."]}),"\n",(0,s.jsxs)(r.p,{children:["For more information about using embedding model components in flows, see ",(0,s.jsx)(r.a,{href:"/components-embedding-models",children:"Embedding model components"}),"."]}),"\n",(0,s.jsx)(r.h3,{id:"cohere-embeddings-parameters",children:"Cohere Embeddings parameters"}),"\n",(0,s.jsx)(i.Ay,{}),"\n",(0,s.jsxs)(r.table,{children:[(0,s.jsx)(r.thead,{children:(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.th,{children:"Name"}),(0,s.jsx)(r.th,{children:"Type"}),(0,s.jsx)(r.th,{children:"Description"})]})}),(0,s.jsxs)(r.tbody,{children:[(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.td,{children:"cohere_api_key"}),(0,s.jsx)(r.td,{children:"SecretString"}),(0,s.jsx)(r.td,{children:"Input parameter. The API key required to authenticate with the Cohere service."})]}),(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.td,{children:"model"}),(0,s.jsx)(r.td,{children:"String"}),(0,s.jsxs)(r.td,{children:["Input parameter. The language model used for embedding text documents and performing queries. Default: ",(0,s.jsx)(r.code,{children:"embed-english-v2.0"})]})]}),(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.td,{children:"truncate"}),(0,s.jsx)(r.td,{children:"Boolean"}),(0,s.jsxs)(r.td,{children:["Input parameter. How to handle input that exceeds the model's token limit. One of ",(0,s.jsx)(r.code,{children:"NONE"}),", ",(0,s.jsx)(r.code,{children:"START"}),", or ",(0,s.jsx)(r.code,{children:"END"})," (default). For more information, see the ",(0,s.jsxs)(r.a,{href:"https://docs.cohere.com/reference/embed#request.body.truncate",children:["Cohere ",(0,s.jsx)(r.code,{children:"truncate"})," API reference"]}),"."]})]}),(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.td,{children:"max_retries"}),(0,s.jsx)(r.td,{children:"Integer"}),(0,s.jsxs)(r.td,{children:["Input parameter. The maximum number of retry attempts for failed requests. Default: ",(0,s.jsx)(r.code,{children:"3"})]})]}),(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.td,{children:"user_agent"}),(0,s.jsx)(r.td,{children:"String"}),(0,s.jsxs)(r.td,{children:["Input parameter. A user agent string to include in requests. Default: ",(0,s.jsx)(r.code,{children:"langchain"})]})]}),(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.td,{children:"request_timeout"}),(0,s.jsx)(r.td,{children:"Float"}),(0,s.jsx)(r.td,{children:"Input parameter. The timeout duration for requests in seconds. Default: None"})]})]})]}),"\n",(0,s.jsx)(r.h2,{id:"cohere-rerank",children:"Cohere Rerank"}),"\n",(0,s.jsx)(r.p,{children:"This component finds and reranks documents using the Cohere API."}),"\n",(0,s.jsxs)(r.p,{children:["Outputs ",(0,s.jsx)(r.code,{children:"Data"})," containing the reranked documents, limited by the ",(0,s.jsx)(r.strong,{children:"Top N"})," parameter."]}),"\n",(0,s.jsx)(r.h3,{id:"cohere-rerank-parameters",children:"Cohere Rerank parameters"}),"\n",(0,s.jsx)(i.Ay,{}),"\n",(0,s.jsxs)(r.table,{children:[(0,s.jsx)(r.thead,{children:(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.th,{children:"Name"}),(0,s.jsx)(r.th,{children:"Type"}),(0,s.jsx)(r.th,{children:"Description"})]})}),(0,s.jsxs)(r.tbody,{children:[(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.td,{children:(0,s.jsx)(r.strong,{children:"Search Query"})}),(0,s.jsx)(r.td,{children:"String"}),(0,s.jsx)(r.td,{children:"Input parameter. The search query for reranking documents."})]}),(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.td,{children:(0,s.jsx)(r.strong,{children:"Search Results"})}),(0,s.jsx)(r.td,{children:"Data"}),(0,s.jsx)(r.td,{children:"Input parameter. Connect search results output from a vector store component. Use this parameter to apply reranking after running a similarity search on your vector database."})]}),(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.td,{children:(0,s.jsx)(r.strong,{children:"Top N"})}),(0,s.jsx)(r.td,{children:"Integer"}),(0,s.jsxs)(r.td,{children:["Input parameter. The number of documents to return after reranking. Default: ",(0,s.jsx)(r.code,{children:"3"}),"."]})]}),(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.td,{children:(0,s.jsx)(r.strong,{children:"Cohere API Key"})}),(0,s.jsx)(r.td,{children:"SecretString"}),(0,s.jsx)(r.td,{children:"Input parameter. Your Cohere API key."})]}),(0,s.jsxs)(r.tr,{children:[(0,s.jsx)(r.td,{children:(0,s.jsx)(r.strong,{children:"Model"})}),(0,s.jsx)(r.td,{children:"String"}),(0,s.jsxs)(r.td,{children:["Input parameter. The re-ranker model to use. Default: ",(0,s.jsx)(r.code,{children:"rerank-english-v3.0"})]})]})]})]})]})}function m(e={}){const{wrapper:r}={...(0,d.R)(),...e.components};return r?(0,s.jsx)(r,{...e,children:(0,s.jsx)(x,{...e})}):x(e)}}}]); \ No newline at end of file diff --git a/assets/js/622bdc6f.77fab5c3.js b/assets/js/622bdc6f.77fab5c3.js new file mode 100644 index 0000000000..5cfdd6fbb8 --- /dev/null +++ b/assets/js/622bdc6f.77fab5c3.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[4384],{17886:(e,n,t)=>{t.d(n,{A:()=>r});t(96540);var i=t(64058),s=t(74848);function r({name:e,...n}){const t=i[e];return t?(0,s.jsx)(t,{...n}):null}},35775:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>o,default:()=>m,frontMatter:()=>a,metadata:()=>i,toc:()=>l});const i=JSON.parse('{"id":"Components/bundles-nvidia","title":"NVIDIA components","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/bundles-nvidia.mdx","sourceDirName":"Components","slug":"/bundles-nvidia","permalink":"/bundles-nvidia","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"NVIDIA components","slug":"/bundles-nvidia"},"sidebar":"docs","previous":{"title":"Novita","permalink":"/bundles-novita"},"next":{"title":"NVIDIA Ingest","permalink":"/integrations-nvidia-ingest"}}');var s=t(74848),r=t(28453),d=t(17886);const a={title:"NVIDIA components",slug:"/bundles-nvidia"},o=void 0,c={},l=[{value:"NVIDIA",id:"nvidia",level:2},{value:"NVIDIA parameters",id:"nvidia-parameters",level:3},{value:"NVIDIA Embeddings",id:"nvidia-embeddings",level:2},{value:"NVIDIA Embeddings parameters",id:"nvidia-embeddings-parameters",level:3},{value:"NVIDIA Rerank",id:"nvidia-rerank",level:2},{value:"NVIDIA Retriever Extraction",id:"nvidia-retriever-extraction",level:2},{value:"NVIDIA System-Assist",id:"nvidia-system-assist",level:2}];function h(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,r.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:[(0,s.jsx)(d.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(n.a,{href:"/components-bundle-components",children:(0,s.jsx)(n.strong,{children:"Bundles"})})," contain custom components that support specific third-party integrations with Langflow."]}),"\n",(0,s.jsxs)(n.p,{children:["This page describes the components that are available in the ",(0,s.jsx)(n.strong,{children:"NVIDIA"})," bundle."]}),"\n",(0,s.jsx)(n.h2,{id:"nvidia",children:"NVIDIA"}),"\n",(0,s.jsxs)(n.p,{children:["This component generates text using NVIDIA LLMs.\nFor more information about NVIDIA LLMs, see the ",(0,s.jsx)(n.a,{href:"https://developer.nvidia.com/generative-ai",children:"NVIDIA AI documentation"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["For an example of this component in a flow, see ",(0,s.jsx)(n.a,{href:"/integrations-nvidia-ingest-wsl2",children:"Integrate NVIDIA NIMs with Langflow"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"nvidia-parameters",children:"NVIDIA parameters"}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"max_tokens"}),(0,s.jsx)(n.td,{children:"Integer"}),(0,s.jsxs)(n.td,{children:["Input parameter. The maximum number of tokens to generate. Set to ",(0,s.jsx)(n.code,{children:"0"})," for unlimited tokens."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"model_name"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsxs)(n.td,{children:["Input parameter. The name of the NVIDIA model to use. Default: ",(0,s.jsx)(n.code,{children:"mistralai/mixtral-8x7b-instruct-v0.1"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"base_url"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsxs)(n.td,{children:["Input parameter. The base URL of the NVIDIA API. Default: ",(0,s.jsx)(n.code,{children:"https://integrate.api.nvidia.com/v1"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"nvidia_api_key"}),(0,s.jsx)(n.td,{children:"SecretString"}),(0,s.jsx)(n.td,{children:"Input parameter. The NVIDIA API Key for authentication."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"temperature"}),(0,s.jsx)(n.td,{children:"Float"}),(0,s.jsxs)(n.td,{children:["Input parameter. Controls randomness in the output. Default: ",(0,s.jsx)(n.code,{children:"0.1"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"seed"}),(0,s.jsx)(n.td,{children:"Integer"}),(0,s.jsxs)(n.td,{children:["Input parameter. The seed controls the reproducibility of the job. Default: ",(0,s.jsx)(n.code,{children:"1"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"model"}),(0,s.jsx)(n.td,{children:"LanguageModel"}),(0,s.jsx)(n.td,{children:"Output parameter. An instance of ChatNVIDIA configured with the specified parameters."})]})]})]}),"\n",(0,s.jsx)(n.h2,{id:"nvidia-embeddings",children:"NVIDIA Embeddings"}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"NVIDIA Embeddings"})," component generates embeddings using ",(0,s.jsx)(n.a,{href:"https://docs.nvidia.com",children:"NVIDIA models"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["For more information about using embedding model components in flows, see ",(0,s.jsx)(n.a,{href:"/components-embedding-models",children:"Embedding model components"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"nvidia-embeddings-parameters",children:"NVIDIA Embeddings parameters"}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"model"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsxs)(n.td,{children:["Input parameter. The NVIDIA model to use for embeddings, such as ",(0,s.jsx)(n.code,{children:"nvidia/nv-embed-v1"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"base_url"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsxs)(n.td,{children:["Input parameter. The base URL for the NVIDIA API. Default: ",(0,s.jsx)(n.code,{children:"https://integrate.api.nvidia.com/v1"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"nvidia_api_key"}),(0,s.jsx)(n.td,{children:"SecretString"}),(0,s.jsx)(n.td,{children:"Input parameter. The API key for authenticating with NVIDIA's service."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"temperature"}),(0,s.jsx)(n.td,{children:"Float"}),(0,s.jsxs)(n.td,{children:["Input parameter. The model temperature for embedding generation. Default: ",(0,s.jsx)(n.code,{children:"0.1"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"embeddings"}),(0,s.jsx)(n.td,{children:"Embeddings"}),(0,s.jsxs)(n.td,{children:["Output parameter. An ",(0,s.jsx)(n.code,{children:"NVIDIAEmbeddings"})," instance for generating embeddings."]})]})]})]}),"\n",(0,s.jsx)(n.admonition,{title:"Tokenization considerations",type:"tip",children:(0,s.jsxs)(n.p,{children:["Be aware of your embedding model's chunk size limit.\nTokenization errors can occur if your text chunks are too large.\nFor more information, see ",(0,s.jsx)(n.a,{href:"/components-processing#chunk-size",children:"Tokenization errors due to chunk size"}),"."]})}),"\n",(0,s.jsx)(n.h2,{id:"nvidia-rerank",children:"NVIDIA Rerank"}),"\n",(0,s.jsx)(n.p,{children:"This component finds and reranks documents using the NVIDIA API."}),"\n",(0,s.jsx)(n.h2,{id:"nvidia-retriever-extraction",children:"NVIDIA Retriever Extraction"}),"\n",(0,s.jsxs)(n.p,{children:["This component uses the NVIDIA ",(0,s.jsx)(n.code,{children:"nv-ingest"})," microservice for data ingestion, processing, and extraction of text files.\nFor more information, see ",(0,s.jsx)(n.a,{href:"/integrations-nvidia-ingest",children:"Integrate NVIDIA Retriever Extraction with Langflow"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"nvidia-system-assist",children:"NVIDIA System-Assist"}),"\n",(0,s.jsxs)(n.p,{children:["This component requires a specific system environment.\nFor information about this component, see ",(0,s.jsx)(n.a,{href:"/integrations-nvidia-g-assist",children:"Integrate NVIDIA G-Assist with Langflow"}),"."]})]})}function m(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(h,{...e})}):h(e)}}}]); \ No newline at end of file diff --git a/assets/js/622bdc6f.be41b7ec.js b/assets/js/622bdc6f.be41b7ec.js deleted file mode 100644 index d09dd26dc5..0000000000 --- a/assets/js/622bdc6f.be41b7ec.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[4384],{17886:(e,n,t)=>{t.d(n,{A:()=>r});t(96540);var i=t(64058),s=t(74848);function r({name:e,...n}){const t=i[e];return t?(0,s.jsx)(t,{...n}):null}},35775:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>o,default:()=>m,frontMatter:()=>a,metadata:()=>i,toc:()=>l});const i=JSON.parse('{"id":"Components/bundles-nvidia","title":"NVIDIA components","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/bundles-nvidia.mdx","sourceDirName":"Components","slug":"/bundles-nvidia","permalink":"/bundles-nvidia","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"NVIDIA components","slug":"/bundles-nvidia"},"sidebar":"docs","previous":{"title":"Novita","permalink":"/bundles-novita"},"next":{"title":"NVIDIA Ingest","permalink":"/integrations-nvidia-ingest"}}');var s=t(74848),r=t(28453),d=t(17886);const a={title:"NVIDIA components",slug:"/bundles-nvidia"},o=void 0,c={},l=[{value:"NVIDIA",id:"nvidia",level:2},{value:"NVIDIA parameters",id:"nvidia-parameters",level:3},{value:"NVIDIA Embeddings",id:"nvidia-embeddings",level:2},{value:"NVIDIA Embeddings parameters",id:"nvidia-embeddings-parameters",level:3},{value:"NVIDIA Rerank",id:"nvidia-rerank",level:2},{value:"NVIDIA Retriever Extraction",id:"nvidia-retriever-extraction",level:2},{value:"NVIDIA System-Assist",id:"nvidia-system-assist",level:2}];function h(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,r.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:[(0,s.jsx)(d.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(n.a,{href:"/components-bundle-components",children:(0,s.jsx)(n.strong,{children:"Bundles"})})," contain custom components that support specific third-party integrations with Langflow."]}),"\n",(0,s.jsxs)(n.p,{children:["This page describes the components that are available in the ",(0,s.jsx)(n.strong,{children:"NVIDIA"})," bundle."]}),"\n",(0,s.jsx)(n.h2,{id:"nvidia",children:"NVIDIA"}),"\n",(0,s.jsxs)(n.p,{children:["This component generates text using NVIDIA LLMs.\nFor more information about NVIDIA LLMs, see the ",(0,s.jsx)(n.a,{href:"https://developer.nvidia.com/generative-ai",children:"NVIDIA AI documentation"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["For an example of this component in a flow, see ",(0,s.jsx)(n.a,{href:"/integrations-nvidia-ingest-wsl2",children:"Integrate NVIDIA NIMs with Langflow"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"nvidia-parameters",children:"NVIDIA parameters"}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"max_tokens"}),(0,s.jsx)(n.td,{children:"Integer"}),(0,s.jsxs)(n.td,{children:["Input parameter. The maximum number of tokens to generate. Set to ",(0,s.jsx)(n.code,{children:"0"})," for unlimited tokens (advanced)."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"model_name"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsxs)(n.td,{children:["Input parameter. The name of the NVIDIA model to use. Default: ",(0,s.jsx)(n.code,{children:"mistralai/mixtral-8x7b-instruct-v0.1"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"base_url"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsxs)(n.td,{children:["Input parameter. The base URL of the NVIDIA API. Default: ",(0,s.jsx)(n.code,{children:"https://integrate.api.nvidia.com/v1"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"nvidia_api_key"}),(0,s.jsx)(n.td,{children:"SecretString"}),(0,s.jsx)(n.td,{children:"Input parameter. The NVIDIA API Key for authentication."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"temperature"}),(0,s.jsx)(n.td,{children:"Float"}),(0,s.jsxs)(n.td,{children:["Input parameter. Controls randomness in the output. Default: ",(0,s.jsx)(n.code,{children:"0.1"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"seed"}),(0,s.jsx)(n.td,{children:"Integer"}),(0,s.jsxs)(n.td,{children:["Input parameter. The seed controls the reproducibility of the job (advanced). Default: ",(0,s.jsx)(n.code,{children:"1"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"model"}),(0,s.jsx)(n.td,{children:"LanguageModel"}),(0,s.jsx)(n.td,{children:"Output parameter. An instance of ChatNVIDIA configured with the specified parameters."})]})]})]}),"\n",(0,s.jsx)(n.h2,{id:"nvidia-embeddings",children:"NVIDIA Embeddings"}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"NVIDIA Embeddings"})," component generates embeddings using ",(0,s.jsx)(n.a,{href:"https://docs.nvidia.com",children:"NVIDIA models"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["For more information about using embedding model components in flows, see ",(0,s.jsx)(n.a,{href:"/components-embedding-models",children:"Embedding model components"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"nvidia-embeddings-parameters",children:"NVIDIA Embeddings parameters"}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"model"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsxs)(n.td,{children:["Input parameter. The NVIDIA model to use for embeddings, such as ",(0,s.jsx)(n.code,{children:"nvidia/nv-embed-v1"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"base_url"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsxs)(n.td,{children:["Input parameter. The base URL for the NVIDIA API. Default: ",(0,s.jsx)(n.code,{children:"https://integrate.api.nvidia.com/v1"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"nvidia_api_key"}),(0,s.jsx)(n.td,{children:"SecretString"}),(0,s.jsx)(n.td,{children:"Input parameter. The API key for authenticating with NVIDIA's service."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"temperature"}),(0,s.jsx)(n.td,{children:"Float"}),(0,s.jsxs)(n.td,{children:["Input parameter. The model temperature for embedding generation. Default: ",(0,s.jsx)(n.code,{children:"0.1"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"embeddings"}),(0,s.jsx)(n.td,{children:"Embeddings"}),(0,s.jsxs)(n.td,{children:["Output parameter. An ",(0,s.jsx)(n.code,{children:"NVIDIAEmbeddings"})," instance for generating embeddings."]})]})]})]}),"\n",(0,s.jsx)(n.admonition,{title:"Tokenization considerations",type:"tip",children:(0,s.jsxs)(n.p,{children:["Be aware of your embedding model's chunk size limit.\nTokenization errors can occur if your text chunks are too large.\nFor more information, see ",(0,s.jsx)(n.a,{href:"/components-processing#chunk-size",children:"Tokenization errors due to chunk size"}),"."]})}),"\n",(0,s.jsx)(n.h2,{id:"nvidia-rerank",children:"NVIDIA Rerank"}),"\n",(0,s.jsx)(n.p,{children:"This component finds and reranks documents using the NVIDIA API."}),"\n",(0,s.jsx)(n.h2,{id:"nvidia-retriever-extraction",children:"NVIDIA Retriever Extraction"}),"\n",(0,s.jsxs)(n.p,{children:["This component uses the NVIDIA ",(0,s.jsx)(n.code,{children:"nv-ingest"})," microservice for data ingestion, processing, and extraction of text files.\nFor more information, see ",(0,s.jsx)(n.a,{href:"/integrations-nvidia-ingest",children:"Integrate NVIDIA Retriever Extraction with Langflow"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"nvidia-system-assist",children:"NVIDIA System-Assist"}),"\n",(0,s.jsxs)(n.p,{children:["This component requires a specific system environment.\nFor information about this component, see ",(0,s.jsx)(n.a,{href:"/integrations-nvidia-g-assist",children:"Integrate NVIDIA G-Assist with Langflow"}),"."]})]})}function m(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(h,{...e})}):h(e)}}}]); \ No newline at end of file diff --git a/assets/js/622fd833.0304e923.js b/assets/js/622fd833.b6cd4e24.js similarity index 78% rename from assets/js/622fd833.0304e923.js rename to assets/js/622fd833.b6cd4e24.js index 0da173357a..052c526eed 100644 --- a/assets/js/622fd833.0304e923.js +++ b/assets/js/622fd833.b6cd4e24.js @@ -1 +1 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[2565],{11470:(e,n,t)=>{t.d(n,{A:()=>v});var r=t(96540),s=t(18215),i=t(23104),o=t(56347),a=t(205),l=t(57485),d=t(31682),c=t(70679);function h(e){return r.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function u(e){const{values:n,children:t}=e;return(0,r.useMemo)(()=>{const e=n??function(e){return h(e).map(({props:{value:e,label:n,attributes:t,default:r}})=>({value:e,label:n,attributes:t,default:r}))}(t);return function(e){const n=(0,d.XI)(e,(e,n)=>e.value===n.value);if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map(e=>e.value).join(", ")}" found in . Every value needs to be unique.`)}(e),e},[n,t])}function p({value:e,tabValues:n}){return n.some(n=>n.value===e)}function x({queryString:e=!1,groupId:n}){const t=(0,o.W6)(),s=function({queryString:e=!1,groupId:n}){if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:e,groupId:n});return[(0,l.aZ)(s),(0,r.useCallback)(e=>{if(!s)return;const n=new URLSearchParams(t.location.search);n.set(s,e),t.replace({...t.location,search:n.toString()})},[s,t])]}function m(e){const{defaultValue:n,queryString:t=!1,groupId:s}=e,i=u(e),[o,l]=(0,r.useState)(()=>function({defaultValue:e,tabValues:n}){if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(e){if(!p({value:e,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${n.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}const t=n.find(e=>e.default)??n[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:n,tabValues:i})),[d,h]=x({queryString:t,groupId:s}),[m,j]=function({groupId:e}){const n=function(e){return e?`docusaurus.tab.${e}`:null}(e),[t,s]=(0,c.Dv)(n);return[t,(0,r.useCallback)(e=>{n&&s.set(e)},[n,s])]}({groupId:s}),g=(()=>{const e=d??m;return p({value:e,tabValues:i})?e:null})();(0,a.A)(()=>{g&&l(g)},[g]);return{selectedValue:o,selectValue:(0,r.useCallback)(e=>{if(!p({value:e,tabValues:i}))throw new Error(`Can't select invalid tab value=${e}`);l(e),h(e),j(e)},[h,j,i]),tabValues:i}}var j=t(92303);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=t(74848);function b({className:e,block:n,selectedValue:t,selectValue:r,tabValues:o}){const a=[],{blockElementScrollPositionUntilNextRender:l}=(0,i.a_)(),d=e=>{const n=e.currentTarget,s=a.indexOf(n),i=o[s].value;i!==t&&(l(n),r(i))},c=e=>{let n=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const t=a.indexOf(e.currentTarget)+1;n=a[t]??a[0];break}case"ArrowLeft":{const t=a.indexOf(e.currentTarget)-1;n=a[t]??a[a.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.A)("tabs",{"tabs--block":n},e),children:o.map(({value:e,label:n,attributes:r})=>(0,f.jsx)("li",{role:"tab",tabIndex:t===e?0:-1,"aria-selected":t===e,ref:e=>{a.push(e)},onKeyDown:c,onClick:d,...r,className:(0,s.A)("tabs__item",g.tabItem,r?.className,{"tabs__item--active":t===e}),children:n??e},e))})}function y({lazy:e,children:n,selectedValue:t}){const i=(Array.isArray(n)?n:[n]).filter(Boolean);if(e){const e=i.find(e=>e.props.value===t);return e?(0,r.cloneElement)(e,{className:(0,s.A)("margin-top--md",e.props.className)}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:i.map((e,n)=>(0,r.cloneElement)(e,{key:n,hidden:e.props.value!==t}))})}function w(e){const n=m(e);return(0,f.jsxs)("div",{className:(0,s.A)("tabs-container",g.tabList),children:[(0,f.jsx)(b,{...n,...e}),(0,f.jsx)(y,{...n,...e})]})}function v(e){const n=(0,j.A)();return(0,f.jsx)(w,{...e,children:h(e.children)},String(n))}},17886:(e,n,t)=>{t.d(n,{A:()=>i});t(96540);var r=t(64058),s=t(74848);function i({name:e,...n}){const t=r[e];return t?(0,s.jsx)(t,{...n}):null}},19365:(e,n,t)=>{t.d(n,{A:()=>o});t(96540);var r=t(18215);const s={tabItem:"tabItem_Ymn6"};var i=t(74848);function o({children:e,hidden:n,className:t}){return(0,i.jsx)("div",{role:"tabpanel",className:(0,r.A)(s.tabItem,t),hidden:n,children:e})}},31929:(e,n,t)=>{t.d(n,{Ay:()=>l,RM:()=>o});var r=t(74848),s=t(28453),i=t(17886);const o=[];function a(e){const n={a:"a",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,r.jsxs)(n.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,r.jsx)(i.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Controls"})," in the ",(0,r.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function l(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}},36813:(e,n,t)=>{t.d(n,{Ay:()=>l,RM:()=>o});var r=t(74848),s=t(28453),i=t(17886);const o=[];function a(e){const n={a:"a",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(n.p,{children:["Legacy components are longer supported and can be removed in a future release.\nYou can continue to use them in existing flows, but it is recommended that you replace them with supported components as soon as possible.\nSuggested replacements are included in the ",(0,r.jsx)(n.strong,{children:"Legacy"})," banner on components in your flows.\nThey are also given in release notes and Langflow documentation whenever possible."]}),"\n",(0,r.jsxs)(n.p,{children:["If you aren't sure how to replace a legacy component, ",(0,r.jsx)(i.A,{name:"Search","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Search"})," for components by provider, service, or component name.\nThe component may have been deprecated in favor of a completely new component, a similar component, or a new version of the same component in a different category."]}),"\n",(0,r.jsxs)(n.p,{children:["If there is no obvious replacement, consider whether another component can be adapted to your use case.\nFor example, many ",(0,r.jsx)(i.A,{name:"Component","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Core components"})," provide generic functionality that can support multiple providers and use cases, such as the ",(0,r.jsxs)(n.a,{href:"/components-data#api-request",children:[(0,r.jsx)(n.strong,{children:"API Request"})," component"]}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["If neither of these options are viable, you could use the legacy component's code to create your own custom component, or ",(0,r.jsx)(n.a,{href:"/contributing-github-issues",children:"start a discussion"})," about the legacy component."]}),"\n",(0,r.jsxs)(n.p,{children:["To discourage use of legacy components in new flows, these components are hidden by default.\nIn the visual editor, you can click ",(0,r.jsx)(i.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Component settings"})," to toggle the ",(0,r.jsx)(n.strong,{children:"Legacy"})," filter."]})]})}function l(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}},55246:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>p,contentTitle:()=>u,default:()=>j,frontMatter:()=>h,metadata:()=>r,toc:()=>x});const r=JSON.parse('{"id":"Components/components-bundles","title":"About bundles","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/components-bundles.mdx","sourceDirName":"Components","slug":"/components-bundle-components","permalink":"/components-bundle-components","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"About bundles","slug":"/components-bundle-components"},"sidebar":"docs","previous":{"title":"Tools","permalink":"/components-tools"},"next":{"title":"AI/ML API","permalink":"/bundles-aiml"}}');var s=t(74848),i=t(28453),o=t(17886),a=t(11470),l=t(19365),d=t(31929),c=t(36813);const h={title:"About bundles",slug:"/components-bundle-components"},u=void 0,p={},x=[{value:"Bundle maintenance and documentation",id:"bundle-maintenance-and-documentation",level:2},{value:"Component parameters",id:"component-parameters",level:2},...d.RM,{value:"Core components and bundles",id:"core-components-and-bundles",level:2},{value:"Legacy bundles",id:"legacy-bundles",level:2},...c.RM,{value:"CrewAI bundle",id:"crewai-bundle",level:3},{value:"Embeddings bundle",id:"embeddings-bundle",level:3},{value:"Vector Stores bundle",id:"vector-stores-bundle",level:3},{value:"Zep bundle",id:"zep-bundle",level:3},{value:"See also",id:"see-also",level:2}];function m(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,i.R)(),...e.components},{Details:r}=n;return r||function(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.p,{children:"Bundles contain custom components that support specific third-party integrations with Langflow.\nYou add them to your flows and configure them in the same way as Langflow's core components."}),"\n",(0,s.jsxs)(n.p,{children:["To browse bundles, click ",(0,s.jsx)(o.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Bundles"})," in the visual editor."]}),"\n",(0,s.jsx)(n.h2,{id:"bundle-maintenance-and-documentation",children:"Bundle maintenance and documentation"}),"\n",(0,s.jsx)(n.p,{children:"Many bundled components are developed by third-party contributors to the Langflow codebase."}),"\n",(0,s.jsx)(n.p,{children:"Some providers contribute documentation with their bundles, whereas others document their bundles in their own documentation.\nSome bundles have no documentation."}),"\n",(0,s.jsx)(n.p,{children:"To find documentation for a specific bundled component, browse the Langflow docs and your provider's documentation.\nIf available, you can also find links to relevant documentation, such as API endpoints, through the component itself:"}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["Click the component to expose the ",(0,s.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:["Click ",(0,s.jsx)(o.A,{name:"Ellipsis","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"More"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:["Select ",(0,s.jsx)(n.strong,{children:"Docs"}),"."]}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:"The Langflow documentation focuses on using bundles within flows.\nFor that reason, it focuses on the Langflow-specific configuration steps for bundled components.\nFor information about provider-specific features or APIs, see the provider's documentation."}),"\n",(0,s.jsx)(n.h2,{id:"component-parameters",children:"Component parameters"}),"\n","\n",(0,s.jsx)(d.Ay,{}),"\n",(0,s.jsx)(n.h2,{id:"core-components-and-bundles",children:"Core components and bundles"}),"\n",(0,s.jsxs)(n.admonition,{type:"tip",children:[(0,s.jsxs)(n.p,{children:["The Langflow documentation doesn't list all bundles or components in bundles.\nFor the most accurate and up-to-date list of bundles and components for your version of Langflow, check ",(0,s.jsx)(o.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Bundles"})," in the visual editor."]}),(0,s.jsxs)(n.p,{children:["If you can't find a component that you used in an earlier version of Langflow, it may have been removed or marked as a ",(0,s.jsx)(n.a,{href:"#legacy-bundles",children:"legacy component"}),"."]})]}),"\n",(0,s.jsxs)(n.p,{children:["Langflow offers generic ",(0,s.jsx)(o.A,{name:"Component","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Core components"})," in addition to third-party, provider-specific bundles."]}),"\n",(0,s.jsxs)(n.p,{children:["If you are looking for a specific service or integration, you can ",(0,s.jsx)(o.A,{name:"Search","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Search"})," components in the visual editor."]}),"\n",(0,s.jsxs)(n.p,{children:["If all else fails, you can always create your own ",(0,s.jsx)(n.a,{href:"/components-custom-components",children:"custom components"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"legacy-bundles",children:"Legacy bundles"}),"\n","\n",(0,s.jsx)(c.Ay,{}),"\n",(0,s.jsx)(n.p,{children:"The following bundles include only legacy components."}),"\n",(0,s.jsx)(n.h3,{id:"crewai-bundle",children:"CrewAI bundle"}),"\n",(0,s.jsxs)(n.p,{children:["Replace the following legacy CrewAI components with other agentic components, such as the ",(0,s.jsxs)(n.a,{href:"/components-agents",children:[(0,s.jsx)(n.strong,{children:"Agent"})," component"]}),"."]}),"\n",(0,s.jsxs)(r,{children:[(0,s.jsx)("summary",{children:"CrewAI Agent"}),(0,s.jsxs)(n.p,{children:["This component represents CrewAI agents, allowing for the creation of specialized AI agents with defined roles goals and capabilities within a crew.\nFor more information, see the ",(0,s.jsx)(n.a,{href:"https://docs.crewai.com/core-concepts/Agents/",children:"CrewAI agents documentation"}),"."]}),(0,s.jsx)(n.p,{children:"This component accepts the following parameters:"}),(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Display Name"}),(0,s.jsx)(n.th,{children:"Info"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"role"}),(0,s.jsx)(n.td,{children:"Role"}),(0,s.jsx)(n.td,{children:"Input parameter. The role of the agent."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"goal"}),(0,s.jsx)(n.td,{children:"Goal"}),(0,s.jsx)(n.td,{children:"Input parameter. The objective of the agent."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"backstory"}),(0,s.jsx)(n.td,{children:"Backstory"}),(0,s.jsx)(n.td,{children:"Input parameter. The backstory of the agent."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"tools"}),(0,s.jsx)(n.td,{children:"Tools"}),(0,s.jsx)(n.td,{children:"Input parameter. The tools at the agent's disposal."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"llm"}),(0,s.jsx)(n.td,{children:"Language Model"}),(0,s.jsx)(n.td,{children:"Input parameter. The language model that runs the agent."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"memory"}),(0,s.jsx)(n.td,{children:"Memory"}),(0,s.jsx)(n.td,{children:"Input parameter. This determines whether the agent should have memory or not."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"verbose"}),(0,s.jsx)(n.td,{children:"Verbose"}),(0,s.jsx)(n.td,{children:"Input parameter. This enables verbose output."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"allow_delegation"}),(0,s.jsx)(n.td,{children:"Allow Delegation"}),(0,s.jsx)(n.td,{children:"Input parameter. This determines whether the agent is allowed to delegate tasks to other agents."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"allow_code_execution"}),(0,s.jsx)(n.td,{children:"Allow Code Execution"}),(0,s.jsx)(n.td,{children:"Input parameter. This determines whether the agent is allowed to execute code."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"kwargs"}),(0,s.jsx)(n.td,{children:"kwargs"}),(0,s.jsx)(n.td,{children:"Input parameter. Additional keyword arguments for the agent."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"output"}),(0,s.jsx)(n.td,{children:"Agent"}),(0,s.jsx)(n.td,{children:"Output parameter. The constructed CrewAI Agent object."})]})]})]})]}),"\n",(0,s.jsxs)(r,{children:[(0,s.jsx)("summary",{children:"CrewAI Hierarchical Crew, CrewAI Hierarchical Task"}),(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"CrewAI Hierarchical Crew"})," component represents a group of agents managing how they should collaborate and the tasks they should perform in a hierarchical structure. This component allows for the creation of a crew with a manager overseeing the task execution.\nFor more information, see the ",(0,s.jsx)(n.a,{href:"https://docs.crewai.com/how-to/Hierarchical/",children:"CrewAI hierarchical crew documentation"}),"."]}),(0,s.jsx)(n.p,{children:"It accepts the following parameters:"}),(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Display Name"}),(0,s.jsx)(n.th,{children:"Info"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"agents"}),(0,s.jsx)(n.td,{children:"Agents"}),(0,s.jsx)(n.td,{children:"Input parameter. The list of Agent objects representing the crew members."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"tasks"}),(0,s.jsx)(n.td,{children:"Tasks"}),(0,s.jsx)(n.td,{children:"Input parameter. The list of HierarchicalTask objects representing the tasks to be executed."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"manager_llm"}),(0,s.jsx)(n.td,{children:"Manager LLM"}),(0,s.jsx)(n.td,{children:"Input parameter. The language model for the manager agent."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"manager_agent"}),(0,s.jsx)(n.td,{children:"Manager Agent"}),(0,s.jsx)(n.td,{children:"Input parameter. The specific agent to act as the manager."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"verbose"}),(0,s.jsx)(n.td,{children:"Verbose"}),(0,s.jsx)(n.td,{children:"Input parameter. This enables verbose output for detailed logging."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"memory"}),(0,s.jsx)(n.td,{children:"Memory"}),(0,s.jsx)(n.td,{children:"Input parameter. The memory configuration for the crew."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"use_cache"}),(0,s.jsx)(n.td,{children:"Use Cache"}),(0,s.jsx)(n.td,{children:"Input parameter. This enables caching of results."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"max_rpm"}),(0,s.jsx)(n.td,{children:"Max RPM"}),(0,s.jsx)(n.td,{children:"Input parameter. This sets the maximum requests per minute."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"share_crew"}),(0,s.jsx)(n.td,{children:"Share Crew"}),(0,s.jsx)(n.td,{children:"Input parameter. This determines if the crew information is shared among agents."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"function_calling_llm"}),(0,s.jsx)(n.td,{children:"Function Calling LLM"}),(0,s.jsx)(n.td,{children:"Input parameter. The language model for function calling."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"crew"}),(0,s.jsx)(n.td,{children:"Crew"}),(0,s.jsx)(n.td,{children:"Output parameter. The constructed Crew object with hierarchical task execution."})]})]})]})]}),"\n",(0,s.jsxs)(r,{children:[(0,s.jsx)("summary",{children:"CrewAI Sequential Crew, CrewAI Sequential Task"}),(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"CrewAI Sequential Crew"})," component represents a group of agents with tasks that are executed sequentially. This component allows for the creation of a crew that performs tasks in a specific order.\nFor more information, see the ",(0,s.jsx)(n.a,{href:"https://docs.crewai.com/how-to/Sequential/",children:"CrewAI sequential crew documentation"}),"."]}),(0,s.jsx)(n.p,{children:"It accepts the following parameters:"}),(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Display Name"}),(0,s.jsx)(n.th,{children:"Info"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"tasks"}),(0,s.jsx)(n.td,{children:"Tasks"}),(0,s.jsx)(n.td,{children:"Input parameter. The list of SequentialTask objects representing the tasks to be executed."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"verbose"}),(0,s.jsx)(n.td,{children:"Verbose"}),(0,s.jsx)(n.td,{children:"Input parameter. This enables verbose output for detailed logging."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"memory"}),(0,s.jsx)(n.td,{children:"Memory"}),(0,s.jsx)(n.td,{children:"Input parameter. The memory configuration for the crew."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"use_cache"}),(0,s.jsx)(n.td,{children:"Use Cache"}),(0,s.jsx)(n.td,{children:"Input parameter. This enables caching of results."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"max_rpm"}),(0,s.jsx)(n.td,{children:"Max RPM"}),(0,s.jsx)(n.td,{children:"Input parameter. This sets the maximum requests per minute."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"share_crew"}),(0,s.jsx)(n.td,{children:"Share Crew"}),(0,s.jsx)(n.td,{children:"Input parameter. This determines if the crew information is shared among agents."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"function_calling_llm"}),(0,s.jsx)(n.td,{children:"Function Calling LLM"}),(0,s.jsx)(n.td,{children:"Input parameter. The language model for function calling."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"crew"}),(0,s.jsx)(n.td,{children:"Crew"}),(0,s.jsx)(n.td,{children:"Output parameter. The constructed Crew object with sequential task execution."})]})]})]})]}),"\n",(0,s.jsxs)(r,{children:[(0,s.jsx)("summary",{children:"CrewAI Sequential Task Agent"}),(0,s.jsxs)(n.p,{children:["This component creates a CrewAI Task and its associated agent allowing for the definition of sequential tasks with specific agent roles and capabilities.\nFor more information, see the ",(0,s.jsx)(n.a,{href:"https://docs.crewai.com/how-to/Sequential/",children:"CrewAI sequential agents documentation"}),"."]}),(0,s.jsx)(n.p,{children:"It accepts the following parameters:"}),(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Display Name"}),(0,s.jsx)(n.th,{children:"Info"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"role"}),(0,s.jsx)(n.td,{children:"Role"}),(0,s.jsx)(n.td,{children:"Input parameter. The role of the agent."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"goal"}),(0,s.jsx)(n.td,{children:"Goal"}),(0,s.jsx)(n.td,{children:"Input parameter. The objective of the agent."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"backstory"}),(0,s.jsx)(n.td,{children:"Backstory"}),(0,s.jsx)(n.td,{children:"Input parameter. The backstory of the agent."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"tools"}),(0,s.jsx)(n.td,{children:"Tools"}),(0,s.jsx)(n.td,{children:"Input parameter. The tools at the agent's disposal."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"llm"}),(0,s.jsx)(n.td,{children:"Language Model"}),(0,s.jsx)(n.td,{children:"Input parameter. The language model that runs the agent."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"memory"}),(0,s.jsx)(n.td,{children:"Memory"}),(0,s.jsx)(n.td,{children:"Input parameter. This determines whether the agent should have memory or not."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"verbose"}),(0,s.jsx)(n.td,{children:"Verbose"}),(0,s.jsx)(n.td,{children:"Input parameter. This enables verbose output."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"allow_delegation"}),(0,s.jsx)(n.td,{children:"Allow Delegation"}),(0,s.jsx)(n.td,{children:"Input parameter. This determines whether the agent is allowed to delegate tasks to other agents."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"allow_code_execution"}),(0,s.jsx)(n.td,{children:"Allow Code Execution"}),(0,s.jsx)(n.td,{children:"Input parameter. This determines whether the agent is allowed to execute code."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"agent_kwargs"}),(0,s.jsx)(n.td,{children:"Agent kwargs"}),(0,s.jsx)(n.td,{children:"Input parameter. The additional kwargs for the agent."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"task_description"}),(0,s.jsx)(n.td,{children:"Task Description"}),(0,s.jsx)(n.td,{children:"Input parameter. The descriptive text detailing the task's purpose and execution."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"expected_output"}),(0,s.jsx)(n.td,{children:"Expected Task Output"}),(0,s.jsx)(n.td,{children:"Input parameter. The clear definition of the expected task outcome."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"async_execution"}),(0,s.jsx)(n.td,{children:"Async Execution"}),(0,s.jsx)(n.td,{children:"Input parameter. Boolean flag indicating asynchronous task execution."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"previous_task"}),(0,s.jsx)(n.td,{children:"Previous Task"}),(0,s.jsx)(n.td,{children:"Input parameter. The previous task in the sequence for chaining."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"task_output"}),(0,s.jsx)(n.td,{children:"Sequential Task"}),(0,s.jsx)(n.td,{children:"Output parameter. The list of SequentialTask objects representing the created tasks."})]})]})]})]}),"\n",(0,s.jsx)(n.h3,{id:"embeddings-bundle",children:"Embeddings bundle"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Embedding Similarity"}),": Replaced by built-in similarity search functionality in vector store components."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Text Embedder"}),": Replaced by the embedding model components."]}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"vector-stores-bundle",children:"Vector Stores bundle"}),"\n",(0,s.jsxs)(n.p,{children:["This bundle contains only the legacy ",(0,s.jsx)(n.strong,{children:"Local DB"})," component.\nAll other vector store components can be found within their respective provider-specific bundles, such as the ",(0,s.jsxs)(n.a,{href:"/bundles-datastax",children:[(0,s.jsx)(n.strong,{children:"DataStax"})," bundle"]}),"."]}),"\n",(0,s.jsxs)(r,{children:[(0,s.jsx)("summary",{children:"Local DB"}),(0,s.jsxs)(n.p,{children:["Replace the ",(0,s.jsx)(n.strong,{children:"Local DB"})," component with the ",(0,s.jsx)(n.strong,{children:"Chroma DB"})," vector store component (in the ",(0,s.jsx)(n.strong,{children:"Chroma"})," bundle) or another vector store component."]}),(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"Local DB"})," component reads and writes to a persistent, in-memory Chroma DB instance intended for use with Langflow.\nIt has separate modes for reads and writes, automatic collection management, and default persistence in your Langflow cache directory."]}),(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"A basic flow with a Local DB component in Retrieve mode.",src:t(60159).A+"",width:"4000",height:"2188"})}),(0,s.jsxs)(n.p,{children:["Set the ",(0,s.jsx)(n.strong,{children:"Mode"})," parameter to reflect the operation you want the component to perform, and then configure the other parameters accordingly.\nSome parameters are only available for one mode."]}),(0,s.jsxs)(a.A,{children:[(0,s.jsxs)(l.A,{value:"ingest",label:"Ingest",children:[(0,s.jsxs)(n.p,{children:["To create or write to your local Chroma vector store, use ",(0,s.jsx)(n.strong,{children:"Ingest"})," mode."]}),(0,s.jsxs)(n.p,{children:["The following parameters are available in ",(0,s.jsx)(n.strong,{children:"Ingest"})," mode:"]}),(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Name Your Collection"})," (",(0,s.jsx)(n.code,{children:"collection_name"}),")"]}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsxs)(n.td,{children:["Input parameter. The name for your Chroma vector store collection. Default: ",(0,s.jsx)(n.code,{children:"langflow"}),". Only available in ",(0,s.jsx)(n.strong,{children:"Ingest"})," mode."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Persist Directory"})," (",(0,s.jsx)(n.code,{children:"persist_directory"}),")"]}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsxs)(n.td,{children:["Input parameter. The base directory where you want to create and persist the vector store. If you use the ",(0,s.jsx)(n.strong,{children:"Local DB"})," component in multiple flows or to create multiple collections, collections are stored at ",(0,s.jsx)(n.code,{children:"$PERSISTENT_DIRECTORY/vector_stores/$COLLECTION_NAME"}),". If not specified, the default location is your Langflow configuration directory. For more information, see ",(0,s.jsx)(n.a,{href:"/memory",children:"Memory management options"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Embedding"})," (",(0,s.jsx)(n.code,{children:"embedding"}),")"]}),(0,s.jsx)(n.td,{children:"Embeddings"}),(0,s.jsx)(n.td,{children:"Input parameter. The embedding function to use for the vector store."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Allow Duplicates"})," (",(0,s.jsx)(n.code,{children:"allow_duplicates"}),")"]}),(0,s.jsx)(n.td,{children:"Boolean"}),(0,s.jsxs)(n.td,{children:["Input parameter. If true (default), writes don't check for existing duplicates in the collection, allowing you to store multiple copies of the same content. If false, writes won't add documents that match existing documents already present in the collection. If false, it can strictly enforce deduplication by searching the entire collection or only search the number of records, specified in ",(0,s.jsx)(n.code,{children:"limit"}),". Only available in ",(0,s.jsx)(n.strong,{children:"Ingest"})," mode."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Ingest Data"})," (",(0,s.jsx)(n.code,{children:"ingest_data"}),")"]}),(0,s.jsx)(n.td,{children:"Data or DataFrame"}),(0,s.jsxs)(n.td,{children:["Input parameter. The records to write to the collection. Records are embedded and indexed for semantic search. Only available in ",(0,s.jsx)(n.strong,{children:"Ingest"})," mode."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Limit"})," (",(0,s.jsx)(n.code,{children:"limit"}),")"]}),(0,s.jsx)(n.td,{children:"Integer"}),(0,s.jsxs)(n.td,{children:["Input parameter. Limit the number of records to compare when ",(0,s.jsx)(n.strong,{children:"Allow Duplicates"})," is false. This can help improve performance when writing to large collections, but it can result in some duplicate records. Only available in ",(0,s.jsx)(n.strong,{children:"Ingest"})," mode."]})]})]})]})]}),(0,s.jsxs)(l.A,{value:"retrieve",label:"Retrieve",children:[(0,s.jsxs)(n.p,{children:["To read from your local Chroma vector store, use ",(0,s.jsx)(n.strong,{children:"Retrieve"})," mode."]}),(0,s.jsxs)(n.p,{children:["The following parameters are available in ",(0,s.jsx)(n.strong,{children:"Retrieve"})," mode:"]}),(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Persist Directory"})," (",(0,s.jsx)(n.code,{children:"persist_directory"}),")"]}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsxs)(n.td,{children:["Input parameter. The base directory where you want to create and persist the vector store. If you use the ",(0,s.jsx)(n.strong,{children:"Local DB"})," component in multiple flows or to create multiple collections, collections are stored at ",(0,s.jsx)(n.code,{children:"$PERSISTENT_DIRECTORY/vector_stores/$COLLECTION_NAME"}),". If not specified, the default location is your Langflow configuration directory. For more information, see ",(0,s.jsx)(n.a,{href:"/memory",children:"Memory management options"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Existing Collections"})," (",(0,s.jsx)(n.code,{children:"existing_collections"}),")"]}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsxs)(n.td,{children:["Input parameter. Select a previously-created collection to search. Only available in ",(0,s.jsx)(n.strong,{children:"Retrieve"})," mode."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Embedding"})," (",(0,s.jsx)(n.code,{children:"embedding"}),")"]}),(0,s.jsx)(n.td,{children:"Embeddings"}),(0,s.jsx)(n.td,{children:"Input parameter. The embedding function to use for the vector store."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Search Type"})," (",(0,s.jsx)(n.code,{children:"search_type"}),")"]}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsxs)(n.td,{children:["Input parameter. The type of search to perform, either ",(0,s.jsx)(n.code,{children:"Similarity"})," or ",(0,s.jsx)(n.code,{children:"MMR"}),". Only available in ",(0,s.jsx)(n.strong,{children:"Retrieve"})," mode."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Search Query"})," (",(0,s.jsx)(n.code,{children:"search_query"}),")"]}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsxs)(n.td,{children:["Input parameter. Enter a query for similarity search. Only available in ",(0,s.jsx)(n.strong,{children:"Retrieve"})," mode."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Number of Results"})," (",(0,s.jsx)(n.code,{children:"number_of_results"}),")"]}),(0,s.jsx)(n.td,{children:"Integer"}),(0,s.jsxs)(n.td,{children:["Input parameter. Number of search results to return. Default: 10. Only available in ",(0,s.jsx)(n.strong,{children:"Retrieve"})," mode."]})]})]})]})]})]})]}),"\n",(0,s.jsx)(n.h3,{id:"zep-bundle",children:"Zep bundle"}),"\n",(0,s.jsxs)(r,{children:[(0,s.jsx)("summary",{children:"Zep Chat Memory"}),(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"Zep Chat Memory"})," component is a legacy component.\nReplace this component with the ",(0,s.jsxs)(n.a,{href:"/components-helpers#message-history",children:[(0,s.jsx)(n.strong,{children:"Message History"})," component"]}),"."]}),(0,s.jsxs)(n.p,{children:["This component creates a ",(0,s.jsx)(n.code,{children:"ZepChatMessageHistory"})," instance, enabling storage and retrieval of chat messages using Zep, a memory server for LLMs."]}),(0,s.jsx)(n.p,{children:"It accepts the following parameters:"}),(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"url"}),(0,s.jsx)(n.td,{children:"MessageText"}),(0,s.jsx)(n.td,{children:"Input parameter. The URL of the Zep instance. Required."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"api_key"}),(0,s.jsx)(n.td,{children:"SecretString"}),(0,s.jsx)(n.td,{children:"Input parameter. The API Key for authentication with the Zep instance."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"api_base_path"}),(0,s.jsx)(n.td,{children:"Dropdown"}),(0,s.jsx)(n.td,{children:"Input parameter. The API version to use. Options include api/v1 or api/v2."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"session_id"}),(0,s.jsx)(n.td,{children:"MessageText"}),(0,s.jsx)(n.td,{children:"Input parameter. The unique identifier for the chat session. Optional."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"message_history"}),(0,s.jsx)(n.td,{children:"BaseChatMessageHistory"}),(0,s.jsx)(n.td,{children:"Output parameter. An instance of ZepChatMessageHistory for the session."})]})]})]})]}),"\n",(0,s.jsx)(n.h2,{id:"see-also",children:"See also"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"/integrations-langwatch",children:"LangWatch observability and evaluation"})}),"\n"]})]})}function j(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(m,{...e})}):m(e)}},60159:(e,n,t)=>{t.d(n,{A:()=>r});const r=t.p+"assets/images/component-local-db-5ba34611640c3e325d9dd3cdcb591d1f.png"}}]); \ No newline at end of file +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[2565],{11470:(e,n,t)=>{t.d(n,{A:()=>v});var r=t(96540),s=t(18215),i=t(23104),o=t(56347),a=t(205),l=t(57485),d=t(31682),c=t(70679);function h(e){return r.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function u(e){const{values:n,children:t}=e;return(0,r.useMemo)(()=>{const e=n??function(e){return h(e).map(({props:{value:e,label:n,attributes:t,default:r}})=>({value:e,label:n,attributes:t,default:r}))}(t);return function(e){const n=(0,d.XI)(e,(e,n)=>e.value===n.value);if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map(e=>e.value).join(", ")}" found in . Every value needs to be unique.`)}(e),e},[n,t])}function x({value:e,tabValues:n}){return n.some(n=>n.value===e)}function p({queryString:e=!1,groupId:n}){const t=(0,o.W6)(),s=function({queryString:e=!1,groupId:n}){if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:e,groupId:n});return[(0,l.aZ)(s),(0,r.useCallback)(e=>{if(!s)return;const n=new URLSearchParams(t.location.search);n.set(s,e),t.replace({...t.location,search:n.toString()})},[s,t])]}function m(e){const{defaultValue:n,queryString:t=!1,groupId:s}=e,i=u(e),[o,l]=(0,r.useState)(()=>function({defaultValue:e,tabValues:n}){if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(e){if(!x({value:e,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${n.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}const t=n.find(e=>e.default)??n[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:n,tabValues:i})),[d,h]=p({queryString:t,groupId:s}),[m,j]=function({groupId:e}){const n=function(e){return e?`docusaurus.tab.${e}`:null}(e),[t,s]=(0,c.Dv)(n);return[t,(0,r.useCallback)(e=>{n&&s.set(e)},[n,s])]}({groupId:s}),g=(()=>{const e=d??m;return x({value:e,tabValues:i})?e:null})();(0,a.A)(()=>{g&&l(g)},[g]);return{selectedValue:o,selectValue:(0,r.useCallback)(e=>{if(!x({value:e,tabValues:i}))throw new Error(`Can't select invalid tab value=${e}`);l(e),h(e),j(e)},[h,j,i]),tabValues:i}}var j=t(92303);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=t(74848);function b({className:e,block:n,selectedValue:t,selectValue:r,tabValues:o}){const a=[],{blockElementScrollPositionUntilNextRender:l}=(0,i.a_)(),d=e=>{const n=e.currentTarget,s=a.indexOf(n),i=o[s].value;i!==t&&(l(n),r(i))},c=e=>{let n=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const t=a.indexOf(e.currentTarget)+1;n=a[t]??a[0];break}case"ArrowLeft":{const t=a.indexOf(e.currentTarget)-1;n=a[t]??a[a.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.A)("tabs",{"tabs--block":n},e),children:o.map(({value:e,label:n,attributes:r})=>(0,f.jsx)("li",{role:"tab",tabIndex:t===e?0:-1,"aria-selected":t===e,ref:e=>{a.push(e)},onKeyDown:c,onClick:d,...r,className:(0,s.A)("tabs__item",g.tabItem,r?.className,{"tabs__item--active":t===e}),children:n??e},e))})}function y({lazy:e,children:n,selectedValue:t}){const i=(Array.isArray(n)?n:[n]).filter(Boolean);if(e){const e=i.find(e=>e.props.value===t);return e?(0,r.cloneElement)(e,{className:(0,s.A)("margin-top--md",e.props.className)}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:i.map((e,n)=>(0,r.cloneElement)(e,{key:n,hidden:e.props.value!==t}))})}function w(e){const n=m(e);return(0,f.jsxs)("div",{className:(0,s.A)("tabs-container",g.tabList),children:[(0,f.jsx)(b,{...n,...e}),(0,f.jsx)(y,{...n,...e})]})}function v(e){const n=(0,j.A)();return(0,f.jsx)(w,{...e,children:h(e.children)},String(n))}},17886:(e,n,t)=>{t.d(n,{A:()=>i});t(96540);var r=t(64058),s=t(74848);function i({name:e,...n}){const t=r[e];return t?(0,s.jsx)(t,{...n}):null}},19365:(e,n,t)=>{t.d(n,{A:()=>o});t(96540);var r=t(18215);const s={tabItem:"tabItem_Ymn6"};var i=t(74848);function o({children:e,hidden:n,className:t}){return(0,i.jsx)("div",{role:"tabpanel",className:(0,r.A)(s.tabItem,t),hidden:n,children:e})}},31929:(e,n,t)=>{t.d(n,{Ay:()=>l,RM:()=>o});var r=t(74848),s=t(28453),i=t(17886);const o=[];function a(e){const n={a:"a",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,r.jsxs)(n.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,r.jsx)(i.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Controls"})," in the ",(0,r.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function l(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}},36813:(e,n,t)=>{t.d(n,{Ay:()=>l,RM:()=>o});var r=t(74848),s=t(28453),i=t(17886);const o=[];function a(e){const n={a:"a",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(n.p,{children:["Legacy components are longer supported and can be removed in a future release.\nYou can continue to use them in existing flows, but it is recommended that you replace them with supported components as soon as possible.\nSuggested replacements are included in the ",(0,r.jsx)(n.strong,{children:"Legacy"})," banner on components in your flows.\nThey are also given in release notes and Langflow documentation whenever possible."]}),"\n",(0,r.jsxs)(n.p,{children:["If you aren't sure how to replace a legacy component, ",(0,r.jsx)(i.A,{name:"Search","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Search"})," for components by provider, service, or component name.\nThe component may have been deprecated in favor of a completely new component, a similar component, or a new version of the same component in a different category."]}),"\n",(0,r.jsxs)(n.p,{children:["If there is no obvious replacement, consider whether another component can be adapted to your use case.\nFor example, many ",(0,r.jsx)(i.A,{name:"Component","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Core components"})," provide generic functionality that can support multiple providers and use cases, such as the ",(0,r.jsxs)(n.a,{href:"/components-data#api-request",children:[(0,r.jsx)(n.strong,{children:"API Request"})," component"]}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["If neither of these options are viable, you could use the legacy component's code to create your own custom component, or ",(0,r.jsx)(n.a,{href:"/contributing-github-issues",children:"start a discussion"})," about the legacy component."]}),"\n",(0,r.jsxs)(n.p,{children:["To discourage use of legacy components in new flows, these components are hidden by default.\nIn the visual editor, you can click ",(0,r.jsx)(i.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Component settings"})," to toggle the ",(0,r.jsx)(n.strong,{children:"Legacy"})," filter."]})]})}function l(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}},55246:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>x,contentTitle:()=>u,default:()=>j,frontMatter:()=>h,metadata:()=>r,toc:()=>p});const r=JSON.parse('{"id":"Components/components-bundles","title":"About bundles","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/components-bundles.mdx","sourceDirName":"Components","slug":"/components-bundle-components","permalink":"/components-bundle-components","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"About bundles","slug":"/components-bundle-components"},"sidebar":"docs","previous":{"title":"Tools","permalink":"/components-tools"},"next":{"title":"AI/ML API","permalink":"/bundles-aiml"}}');var s=t(74848),i=t(28453),o=t(17886),a=t(11470),l=t(19365),d=t(31929),c=t(36813);const h={title:"About bundles",slug:"/components-bundle-components"},u=void 0,x={},p=[{value:"Bundle maintenance and documentation",id:"bundle-maintenance-and-documentation",level:2},{value:"Component parameters",id:"component-parameters",level:2},...d.RM,{value:"Core components and bundles",id:"core-components-and-bundles",level:2},{value:"Legacy bundles",id:"legacy-bundles",level:2},...c.RM,{value:"CrewAI bundle",id:"crewai-bundle",level:3},{value:"Embeddings bundle",id:"embeddings-bundle",level:3},{value:"Vector Stores bundle",id:"vector-stores-bundle",level:3},{value:"Zep bundle",id:"zep-bundle",level:3},{value:"See also",id:"see-also",level:2}];function m(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,i.R)(),...e.components},{Details:r}=n;return r||function(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.p,{children:"Bundles contain custom components that support specific third-party integrations with Langflow.\nYou add them to your flows and configure them in the same way as Langflow's core components."}),"\n",(0,s.jsxs)(n.p,{children:["To browse bundles, click ",(0,s.jsx)(o.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Bundles"})," in the visual editor."]}),"\n",(0,s.jsx)(n.h2,{id:"bundle-maintenance-and-documentation",children:"Bundle maintenance and documentation"}),"\n",(0,s.jsx)(n.p,{children:"Many bundled components are developed by third-party contributors to the Langflow codebase."}),"\n",(0,s.jsx)(n.p,{children:"Some providers contribute documentation with their bundles, whereas others document their bundles in their own documentation.\nSome bundles have no documentation."}),"\n",(0,s.jsx)(n.p,{children:"To find documentation for a specific bundled component, browse the Langflow docs and your provider's documentation.\nIf available, you can also find links to relevant documentation, such as API endpoints, through the component itself:"}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["Click the component to expose the ",(0,s.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:["Click ",(0,s.jsx)(o.A,{name:"Ellipsis","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"More"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:["Select ",(0,s.jsx)(n.strong,{children:"Docs"}),"."]}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:"The Langflow documentation focuses on using bundles within flows.\nFor that reason, it focuses on the Langflow-specific configuration steps for bundled components.\nFor information about provider-specific features or APIs, see the provider's documentation."}),"\n",(0,s.jsx)(n.h2,{id:"component-parameters",children:"Component parameters"}),"\n","\n",(0,s.jsx)(d.Ay,{}),"\n",(0,s.jsx)(n.h2,{id:"core-components-and-bundles",children:"Core components and bundles"}),"\n",(0,s.jsxs)(n.admonition,{type:"tip",children:[(0,s.jsxs)(n.p,{children:["The Langflow documentation doesn't list all bundles or components in bundles.\nFor the most accurate and up-to-date list of bundles and components for your version of Langflow, check ",(0,s.jsx)(o.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Bundles"})," in the visual editor."]}),(0,s.jsxs)(n.p,{children:["If you can't find a component that you used in an earlier version of Langflow, it may have been removed or marked as a ",(0,s.jsx)(n.a,{href:"#legacy-bundles",children:"legacy component"}),"."]})]}),"\n",(0,s.jsxs)(n.p,{children:["Langflow offers generic ",(0,s.jsx)(o.A,{name:"Component","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Core components"})," in addition to third-party, provider-specific bundles."]}),"\n",(0,s.jsxs)(n.p,{children:["If you are looking for a specific service or integration, you can ",(0,s.jsx)(o.A,{name:"Search","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Search"})," components in the visual editor."]}),"\n",(0,s.jsxs)(n.p,{children:["If all else fails, you can always create your own ",(0,s.jsx)(n.a,{href:"/components-custom-components",children:"custom components"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"legacy-bundles",children:"Legacy bundles"}),"\n","\n",(0,s.jsx)(c.Ay,{}),"\n",(0,s.jsx)(n.p,{children:"The following bundles include only legacy components."}),"\n",(0,s.jsx)(n.h3,{id:"crewai-bundle",children:"CrewAI bundle"}),"\n",(0,s.jsxs)(n.p,{children:["Replace the following legacy CrewAI components with other agentic components, such as the ",(0,s.jsxs)(n.a,{href:"/components-agents",children:[(0,s.jsx)(n.strong,{children:"Agent"})," component"]}),"."]}),"\n",(0,s.jsxs)(r,{children:[(0,s.jsx)("summary",{children:"CrewAI Agent"}),(0,s.jsxs)(n.p,{children:["This component represents CrewAI agents, allowing for the creation of specialized AI agents with defined roles goals and capabilities within a crew.\nFor more information, see the ",(0,s.jsx)(n.a,{href:"https://docs.crewai.com/core-concepts/Agents/",children:"CrewAI agents documentation"}),"."]}),(0,s.jsx)(n.p,{children:"This component accepts the following parameters:"}),(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Display Name"}),(0,s.jsx)(n.th,{children:"Info"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"role"}),(0,s.jsx)(n.td,{children:"Role"}),(0,s.jsx)(n.td,{children:"Input parameter. The role of the agent."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"goal"}),(0,s.jsx)(n.td,{children:"Goal"}),(0,s.jsx)(n.td,{children:"Input parameter. The objective of the agent."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"backstory"}),(0,s.jsx)(n.td,{children:"Backstory"}),(0,s.jsx)(n.td,{children:"Input parameter. The backstory of the agent."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"tools"}),(0,s.jsx)(n.td,{children:"Tools"}),(0,s.jsx)(n.td,{children:"Input parameter. The tools at the agent's disposal."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"llm"}),(0,s.jsx)(n.td,{children:"Language Model"}),(0,s.jsx)(n.td,{children:"Input parameter. The language model that runs the agent."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"memory"}),(0,s.jsx)(n.td,{children:"Memory"}),(0,s.jsx)(n.td,{children:"Input parameter. This determines whether the agent should have memory or not."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"verbose"}),(0,s.jsx)(n.td,{children:"Verbose"}),(0,s.jsx)(n.td,{children:"Input parameter. This enables verbose output."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"allow_delegation"}),(0,s.jsx)(n.td,{children:"Allow Delegation"}),(0,s.jsx)(n.td,{children:"Input parameter. This determines whether the agent is allowed to delegate tasks to other agents."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"allow_code_execution"}),(0,s.jsx)(n.td,{children:"Allow Code Execution"}),(0,s.jsx)(n.td,{children:"Input parameter. This determines whether the agent is allowed to execute code."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"kwargs"}),(0,s.jsx)(n.td,{children:"kwargs"}),(0,s.jsx)(n.td,{children:"Input parameter. Additional keyword arguments for the agent."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"output"}),(0,s.jsx)(n.td,{children:"Agent"}),(0,s.jsx)(n.td,{children:"Output parameter. The constructed CrewAI Agent object."})]})]})]})]}),"\n",(0,s.jsxs)(r,{children:[(0,s.jsx)("summary",{children:"CrewAI Hierarchical Crew, CrewAI Hierarchical Task"}),(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"CrewAI Hierarchical Crew"})," component represents a group of agents managing how they should collaborate and the tasks they should perform in a hierarchical structure. This component allows for the creation of a crew with a manager overseeing the task execution.\nFor more information, see the ",(0,s.jsx)(n.a,{href:"https://docs.crewai.com/how-to/Hierarchical/",children:"CrewAI hierarchical crew documentation"}),"."]}),(0,s.jsx)(n.p,{children:"It accepts the following parameters:"}),(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Display Name"}),(0,s.jsx)(n.th,{children:"Info"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"agents"}),(0,s.jsx)(n.td,{children:"Agents"}),(0,s.jsx)(n.td,{children:"Input parameter. The list of Agent objects representing the crew members."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"tasks"}),(0,s.jsx)(n.td,{children:"Tasks"}),(0,s.jsx)(n.td,{children:"Input parameter. The list of HierarchicalTask objects representing the tasks to be executed."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"manager_llm"}),(0,s.jsx)(n.td,{children:"Manager LLM"}),(0,s.jsx)(n.td,{children:"Input parameter. The language model for the manager agent."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"manager_agent"}),(0,s.jsx)(n.td,{children:"Manager Agent"}),(0,s.jsx)(n.td,{children:"Input parameter. The specific agent to act as the manager."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"verbose"}),(0,s.jsx)(n.td,{children:"Verbose"}),(0,s.jsx)(n.td,{children:"Input parameter. This enables verbose output for detailed logging."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"memory"}),(0,s.jsx)(n.td,{children:"Memory"}),(0,s.jsx)(n.td,{children:"Input parameter. The memory configuration for the crew."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"use_cache"}),(0,s.jsx)(n.td,{children:"Use Cache"}),(0,s.jsx)(n.td,{children:"Input parameter. This enables caching of results."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"max_rpm"}),(0,s.jsx)(n.td,{children:"Max RPM"}),(0,s.jsx)(n.td,{children:"Input parameter. This sets the maximum requests per minute."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"share_crew"}),(0,s.jsx)(n.td,{children:"Share Crew"}),(0,s.jsx)(n.td,{children:"Input parameter. This determines if the crew information is shared among agents."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"function_calling_llm"}),(0,s.jsx)(n.td,{children:"Function Calling LLM"}),(0,s.jsx)(n.td,{children:"Input parameter. The language model for function calling."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"crew"}),(0,s.jsx)(n.td,{children:"Crew"}),(0,s.jsx)(n.td,{children:"Output parameter. The constructed Crew object with hierarchical task execution."})]})]})]})]}),"\n",(0,s.jsxs)(r,{children:[(0,s.jsx)("summary",{children:"CrewAI Sequential Crew, CrewAI Sequential Task"}),(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"CrewAI Sequential Crew"})," component represents a group of agents with tasks that are executed sequentially. This component allows for the creation of a crew that performs tasks in a specific order.\nFor more information, see the ",(0,s.jsx)(n.a,{href:"https://docs.crewai.com/how-to/Sequential/",children:"CrewAI sequential crew documentation"}),"."]}),(0,s.jsx)(n.p,{children:"It accepts the following parameters:"}),(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Display Name"}),(0,s.jsx)(n.th,{children:"Info"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"tasks"}),(0,s.jsx)(n.td,{children:"Tasks"}),(0,s.jsx)(n.td,{children:"Input parameter. The list of SequentialTask objects representing the tasks to be executed."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"verbose"}),(0,s.jsx)(n.td,{children:"Verbose"}),(0,s.jsx)(n.td,{children:"Input parameter. This enables verbose output for detailed logging."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"memory"}),(0,s.jsx)(n.td,{children:"Memory"}),(0,s.jsx)(n.td,{children:"Input parameter. The memory configuration for the crew."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"use_cache"}),(0,s.jsx)(n.td,{children:"Use Cache"}),(0,s.jsx)(n.td,{children:"Input parameter. This enables caching of results."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"max_rpm"}),(0,s.jsx)(n.td,{children:"Max RPM"}),(0,s.jsx)(n.td,{children:"Input parameter. This sets the maximum requests per minute."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"share_crew"}),(0,s.jsx)(n.td,{children:"Share Crew"}),(0,s.jsx)(n.td,{children:"Input parameter. This determines if the crew information is shared among agents."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"function_calling_llm"}),(0,s.jsx)(n.td,{children:"Function Calling LLM"}),(0,s.jsx)(n.td,{children:"Input parameter. The language model for function calling."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"crew"}),(0,s.jsx)(n.td,{children:"Crew"}),(0,s.jsx)(n.td,{children:"Output parameter. The constructed Crew object with sequential task execution."})]})]})]})]}),"\n",(0,s.jsxs)(r,{children:[(0,s.jsx)("summary",{children:"CrewAI Sequential Task Agent"}),(0,s.jsxs)(n.p,{children:["This component creates a CrewAI Task and its associated agent allowing for the definition of sequential tasks with specific agent roles and capabilities.\nFor more information, see the ",(0,s.jsx)(n.a,{href:"https://docs.crewai.com/how-to/Sequential/",children:"CrewAI sequential agents documentation"}),"."]}),(0,s.jsx)(n.p,{children:"It accepts the following parameters:"}),(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Display Name"}),(0,s.jsx)(n.th,{children:"Info"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"role"}),(0,s.jsx)(n.td,{children:"Role"}),(0,s.jsx)(n.td,{children:"Input parameter. The role of the agent."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"goal"}),(0,s.jsx)(n.td,{children:"Goal"}),(0,s.jsx)(n.td,{children:"Input parameter. The objective of the agent."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"backstory"}),(0,s.jsx)(n.td,{children:"Backstory"}),(0,s.jsx)(n.td,{children:"Input parameter. The backstory of the agent."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"tools"}),(0,s.jsx)(n.td,{children:"Tools"}),(0,s.jsx)(n.td,{children:"Input parameter. The tools at the agent's disposal."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"llm"}),(0,s.jsx)(n.td,{children:"Language Model"}),(0,s.jsx)(n.td,{children:"Input parameter. The language model that runs the agent."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"memory"}),(0,s.jsx)(n.td,{children:"Memory"}),(0,s.jsx)(n.td,{children:"Input parameter. This determines whether the agent should have memory or not."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"verbose"}),(0,s.jsx)(n.td,{children:"Verbose"}),(0,s.jsx)(n.td,{children:"Input parameter. This enables verbose output."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"allow_delegation"}),(0,s.jsx)(n.td,{children:"Allow Delegation"}),(0,s.jsx)(n.td,{children:"Input parameter. This determines whether the agent is allowed to delegate tasks to other agents."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"allow_code_execution"}),(0,s.jsx)(n.td,{children:"Allow Code Execution"}),(0,s.jsx)(n.td,{children:"Input parameter. This determines whether the agent is allowed to execute code."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"agent_kwargs"}),(0,s.jsx)(n.td,{children:"Agent kwargs"}),(0,s.jsx)(n.td,{children:"Input parameter. The additional kwargs for the agent."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"task_description"}),(0,s.jsx)(n.td,{children:"Task Description"}),(0,s.jsx)(n.td,{children:"Input parameter. The descriptive text detailing the task's purpose and execution."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"expected_output"}),(0,s.jsx)(n.td,{children:"Expected Task Output"}),(0,s.jsx)(n.td,{children:"Input parameter. The clear definition of the expected task outcome."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"async_execution"}),(0,s.jsx)(n.td,{children:"Async Execution"}),(0,s.jsx)(n.td,{children:"Input parameter. Boolean flag indicating asynchronous task execution."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"previous_task"}),(0,s.jsx)(n.td,{children:"Previous Task"}),(0,s.jsx)(n.td,{children:"Input parameter. The previous task in the sequence for chaining."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"task_output"}),(0,s.jsx)(n.td,{children:"Sequential Task"}),(0,s.jsx)(n.td,{children:"Output parameter. The list of SequentialTask objects representing the created tasks."})]})]})]})]}),"\n",(0,s.jsx)(n.h3,{id:"embeddings-bundle",children:"Embeddings bundle"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Embedding Similarity"}),": Replaced by built-in similarity search functionality in vector store components."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Text Embedder"}),": Replaced by the embedding model components."]}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"vector-stores-bundle",children:"Vector Stores bundle"}),"\n",(0,s.jsxs)(n.p,{children:["This bundle contains only the legacy ",(0,s.jsx)(n.strong,{children:"Local DB"})," component.\nAll other vector store components can be found within their respective provider-specific bundles, such as the ",(0,s.jsxs)(n.a,{href:"/bundles-datastax",children:[(0,s.jsx)(n.strong,{children:"DataStax"})," bundle"]}),"."]}),"\n",(0,s.jsxs)(r,{children:[(0,s.jsx)("summary",{children:"Local DB"}),(0,s.jsxs)(n.p,{children:["Replace the ",(0,s.jsx)(n.strong,{children:"Local DB"})," component with the ",(0,s.jsx)(n.strong,{children:"Chroma DB"})," vector store component (in the ",(0,s.jsx)(n.strong,{children:"Chroma"})," bundle) or another vector store component."]}),(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"Local DB"})," component reads and writes to a persistent, in-memory Chroma DB instance intended for use with Langflow.\nIt has separate modes for reads and writes, automatic collection management, and default persistence in your Langflow cache directory."]}),(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"A basic flow with a Local DB component in Retrieve mode.",src:t(60159).A+"",width:"4000",height:"2188"})}),(0,s.jsxs)(n.p,{children:["Set the ",(0,s.jsx)(n.strong,{children:"Mode"})," parameter to reflect the operation you want the component to perform, and then configure the other parameters accordingly.\nSome parameters are only available for one mode."]}),(0,s.jsxs)(a.A,{children:[(0,s.jsxs)(l.A,{value:"ingest",label:"Ingest",children:[(0,s.jsxs)(n.p,{children:["To create or write to your local Chroma vector store, use ",(0,s.jsx)(n.strong,{children:"Ingest"})," mode."]}),(0,s.jsxs)(n.p,{children:["The following parameters are available in ",(0,s.jsx)(n.strong,{children:"Ingest"})," mode:"]}),(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Name Your Collection"})," (",(0,s.jsx)(n.code,{children:"collection_name"}),")"]}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsxs)(n.td,{children:["Input parameter. The name for your Chroma vector store collection. Default: ",(0,s.jsx)(n.code,{children:"langflow"}),". Only available in ",(0,s.jsx)(n.strong,{children:"Ingest"})," mode."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Persist Directory"})," (",(0,s.jsx)(n.code,{children:"persist_directory"}),")"]}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsxs)(n.td,{children:["Input parameter. The base directory where you want to create and persist the vector store. If you use the ",(0,s.jsx)(n.strong,{children:"Local DB"})," component in multiple flows or to create multiple collections, collections are stored at ",(0,s.jsx)(n.code,{children:"$PERSISTENT_DIRECTORY/vector_stores/$COLLECTION_NAME"}),". If not specified, the default location is your Langflow configuration directory. For more information, see ",(0,s.jsx)(n.a,{href:"/memory",children:"Memory management options"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Embedding"})," (",(0,s.jsx)(n.code,{children:"embedding"}),")"]}),(0,s.jsx)(n.td,{children:"Embeddings"}),(0,s.jsx)(n.td,{children:"Input parameter. The embedding function to use for the vector store."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Allow Duplicates"})," (",(0,s.jsx)(n.code,{children:"allow_duplicates"}),")"]}),(0,s.jsx)(n.td,{children:"Boolean"}),(0,s.jsxs)(n.td,{children:["Input parameter. If ",(0,s.jsx)(n.code,{children:"true"})," (default), writes don't check for existing duplicates in the collection, allowing you to store multiple copies of the same content. If ",(0,s.jsx)(n.code,{children:"false"}),", writes won't add documents that match existing documents already present in the collection. If ",(0,s.jsx)(n.code,{children:"false"}),", it can strictly enforce deduplication by searching the entire collection or only search the number of records, specified in ",(0,s.jsx)(n.code,{children:"limit"}),". Only available in ",(0,s.jsx)(n.strong,{children:"Ingest"})," mode."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Ingest Data"})," (",(0,s.jsx)(n.code,{children:"ingest_data"}),")"]}),(0,s.jsx)(n.td,{children:"Data or DataFrame"}),(0,s.jsxs)(n.td,{children:["Input parameter. The records to write to the collection. Records are embedded and indexed for semantic search. Only available in ",(0,s.jsx)(n.strong,{children:"Ingest"})," mode."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Limit"})," (",(0,s.jsx)(n.code,{children:"limit"}),")"]}),(0,s.jsx)(n.td,{children:"Integer"}),(0,s.jsxs)(n.td,{children:["Input parameter. Limit the number of records to compare when ",(0,s.jsx)(n.strong,{children:"Allow Duplicates"})," is ",(0,s.jsx)(n.code,{children:"false"}),". This can help improve performance when writing to large collections, but it can result in some duplicate records. Only available in ",(0,s.jsx)(n.strong,{children:"Ingest"})," mode."]})]})]})]})]}),(0,s.jsxs)(l.A,{value:"retrieve",label:"Retrieve",children:[(0,s.jsxs)(n.p,{children:["To read from your local Chroma vector store, use ",(0,s.jsx)(n.strong,{children:"Retrieve"})," mode."]}),(0,s.jsxs)(n.p,{children:["The following parameters are available in ",(0,s.jsx)(n.strong,{children:"Retrieve"})," mode:"]}),(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Persist Directory"})," (",(0,s.jsx)(n.code,{children:"persist_directory"}),")"]}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsxs)(n.td,{children:["Input parameter. The base directory where you want to create and persist the vector store. If you use the ",(0,s.jsx)(n.strong,{children:"Local DB"})," component in multiple flows or to create multiple collections, collections are stored at ",(0,s.jsx)(n.code,{children:"$PERSISTENT_DIRECTORY/vector_stores/$COLLECTION_NAME"}),". If not specified, the default location is your Langflow configuration directory. For more information, see ",(0,s.jsx)(n.a,{href:"/memory",children:"Memory management options"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Existing Collections"})," (",(0,s.jsx)(n.code,{children:"existing_collections"}),")"]}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsxs)(n.td,{children:["Input parameter. Select a previously-created collection to search. Only available in ",(0,s.jsx)(n.strong,{children:"Retrieve"})," mode."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Embedding"})," (",(0,s.jsx)(n.code,{children:"embedding"}),")"]}),(0,s.jsx)(n.td,{children:"Embeddings"}),(0,s.jsx)(n.td,{children:"Input parameter. The embedding function to use for the vector store."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Search Type"})," (",(0,s.jsx)(n.code,{children:"search_type"}),")"]}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsxs)(n.td,{children:["Input parameter. The type of search to perform, either ",(0,s.jsx)(n.code,{children:"Similarity"})," or ",(0,s.jsx)(n.code,{children:"MMR"}),". Only available in ",(0,s.jsx)(n.strong,{children:"Retrieve"})," mode."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Search Query"})," (",(0,s.jsx)(n.code,{children:"search_query"}),")"]}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsxs)(n.td,{children:["Input parameter. Enter a query for similarity search. Only available in ",(0,s.jsx)(n.strong,{children:"Retrieve"})," mode."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Number of Results"})," (",(0,s.jsx)(n.code,{children:"number_of_results"}),")"]}),(0,s.jsx)(n.td,{children:"Integer"}),(0,s.jsxs)(n.td,{children:["Input parameter. Number of search results to return. Default: 10. Only available in ",(0,s.jsx)(n.strong,{children:"Retrieve"})," mode."]})]})]})]})]})]})]}),"\n",(0,s.jsx)(n.h3,{id:"zep-bundle",children:"Zep bundle"}),"\n",(0,s.jsxs)(r,{children:[(0,s.jsx)("summary",{children:"Zep Chat Memory"}),(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"Zep Chat Memory"})," component is a legacy component.\nReplace this component with the ",(0,s.jsxs)(n.a,{href:"/components-helpers#message-history",children:[(0,s.jsx)(n.strong,{children:"Message History"})," component"]}),"."]}),(0,s.jsxs)(n.p,{children:["This component creates a ",(0,s.jsx)(n.code,{children:"ZepChatMessageHistory"})," instance, enabling storage and retrieval of chat messages using Zep, a memory server for LLMs."]}),(0,s.jsx)(n.p,{children:"It accepts the following parameters:"}),(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"url"}),(0,s.jsx)(n.td,{children:"MessageText"}),(0,s.jsx)(n.td,{children:"Input parameter. The URL of the Zep instance. Required."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"api_key"}),(0,s.jsx)(n.td,{children:"SecretString"}),(0,s.jsx)(n.td,{children:"Input parameter. The API Key for authentication with the Zep instance."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"api_base_path"}),(0,s.jsx)(n.td,{children:"Dropdown"}),(0,s.jsx)(n.td,{children:"Input parameter. The API version to use. Options include api/v1 or api/v2."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"session_id"}),(0,s.jsx)(n.td,{children:"MessageText"}),(0,s.jsx)(n.td,{children:"Input parameter. The unique identifier for the chat session. Optional."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"message_history"}),(0,s.jsx)(n.td,{children:"BaseChatMessageHistory"}),(0,s.jsx)(n.td,{children:"Output parameter. An instance of ZepChatMessageHistory for the session."})]})]})]})]}),"\n",(0,s.jsx)(n.h2,{id:"see-also",children:"See also"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"/integrations-langwatch",children:"LangWatch observability and evaluation"})}),"\n"]})]})}function j(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(m,{...e})}):m(e)}},60159:(e,n,t)=>{t.d(n,{A:()=>r});const r=t.p+"assets/images/component-local-db-5ba34611640c3e325d9dd3cdcb591d1f.png"}}]); \ No newline at end of file diff --git a/assets/js/62d1268c.50766477.js b/assets/js/62d1268c.50766477.js new file mode 100644 index 0000000000..2d0a94d4c8 --- /dev/null +++ b/assets/js/62d1268c.50766477.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[9213],{7369:(e,n,s)=>{s.d(n,{A:()=>l});const l=s.p+"assets/images/component-ollama-embeddings-chromadb-c02d6ef9e753b61c274778d90f2a6eec.png"},17287:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>d,contentTitle:()=>i,default:()=>m,frontMatter:()=>r,metadata:()=>l,toc:()=>c});const l=JSON.parse('{"id":"Components/bundles-ollama","title":"Ollama","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/bundles-ollama.mdx","sourceDirName":"Components","slug":"/bundles-ollama","permalink":"/bundles-ollama","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Ollama","slug":"/bundles-ollama"},"sidebar":"docs","previous":{"title":"NVIDIA System-Assist","permalink":"/integrations-nvidia-g-assist"},"next":{"title":"OpenAI","permalink":"/bundles-openai"}}');var o=s(74848),t=s(28453),a=s(17886);const r={title:"Ollama",slug:"/bundles-ollama"},i=void 0,d={},c=[{value:"Ollama text generation",id:"ollama-text-generation",level:2},{value:"Ollama Embeddings",id:"ollama-embeddings",level:2}];function h(e){const n={a:"a",code:"code",h2:"h2",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",...(0,t.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(n.p,{children:[(0,o.jsx)(a.A,{name:"Blocks","aria-hidden":"true"})," ",(0,o.jsx)(n.a,{href:"/components-bundle-components",children:(0,o.jsx)(n.strong,{children:"Bundles"})})," contain custom components that support specific third-party integrations with Langflow."]}),"\n",(0,o.jsxs)(n.p,{children:["This page describes the components that are available in the ",(0,o.jsx)(n.strong,{children:"Ollama"})," bundle."]}),"\n",(0,o.jsxs)(n.p,{children:["For more information about Ollama features and functionality used by Ollama components, see the ",(0,o.jsx)(n.a,{href:"https://ollama.com/",children:"Ollama documentation"}),"."]}),"\n",(0,o.jsx)(n.h2,{id:"ollama-text-generation",children:"Ollama text generation"}),"\n",(0,o.jsxs)(n.p,{children:["This component generates text using ",(0,o.jsx)(n.a,{href:"https://ollama.com/library",children:"Ollama's language models"}),"."]}),"\n",(0,o.jsxs)(n.p,{children:["To use the ",(0,o.jsx)(n.strong,{children:"Ollama"})," component in a flow, connect Langflow to your locally running Ollama server and select a model:"]}),"\n",(0,o.jsxs)(n.ol,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Add the ",(0,o.jsx)(n.strong,{children:"Ollama"})," component to your flow."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["In the ",(0,o.jsx)(n.strong,{children:"Base URL"})," field, enter the address for your locally running Ollama server."]}),"\n",(0,o.jsxs)(n.p,{children:["This value is set as the ",(0,o.jsx)(n.code,{children:"OLLAMA_HOST"})," environment variable in Ollama.\nThe default base URL is ",(0,o.jsx)(n.code,{children:"http://127.0.0.1:11434"}),"."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Once the connection is established, select a model in the ",(0,o.jsx)(n.strong,{children:"Model Name"})," field, such as ",(0,o.jsx)(n.code,{children:"llama3.2:latest"}),"."]}),"\n",(0,o.jsxs)(n.p,{children:["To refresh the server's list of models, click ",(0,o.jsx)(a.A,{name:"RefreshCw","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Refresh"}),"."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Optional: To configure additional parameters, such as temperature or max tokens, click ",(0,o.jsx)(a.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Controls"})," in the ",(0,o.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Connect the ",(0,o.jsx)(n.strong,{children:"Ollama"})," component to other components in the flow, depending on how you want to use the model."]}),"\n",(0,o.jsxs)(n.p,{children:["Language model components can output either a ",(0,o.jsx)(n.strong,{children:"Model Response"})," (",(0,o.jsx)(n.a,{href:"/data-types#message",children:(0,o.jsx)(n.code,{children:"Message"})}),") or a ",(0,o.jsx)(n.strong,{children:"Language Model"})," (",(0,o.jsx)(n.a,{href:"/data-types#languagemodel",children:(0,o.jsx)(n.code,{children:"LanguageModel"})}),"). Use the ",(0,o.jsx)(n.strong,{children:"Language Model"})," output when you want to use an Ollama model as the LLM for another LLM-driven component, such as an ",(0,o.jsx)(n.strong,{children:"Agent"})," or ",(0,o.jsx)(n.strong,{children:"Smart Function"})," component. For more information, see ",(0,o.jsx)(n.a,{href:"/components-models",children:"Language model components"}),"."]}),"\n",(0,o.jsxs)(n.p,{children:["In the following example, the flow uses ",(0,o.jsx)(n.code,{children:"LanguageModel"})," output to use an Ollama model as the LLM for an ",(0,o.jsxs)(n.a,{href:"/components-agents",children:[(0,o.jsx)(n.strong,{children:"Agent"})," component"]}),"."]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.img,{alt:"Ollama component used as the LLM in an agent flow",src:s(92757).A+"",width:"4000",height:"2668"})}),"\n"]}),"\n"]}),"\n",(0,o.jsx)(n.h2,{id:"ollama-embeddings",children:"Ollama Embeddings"}),"\n",(0,o.jsxs)(n.p,{children:["The ",(0,o.jsx)(n.strong,{children:"Ollama Embeddings"})," component generates embeddings using ",(0,o.jsx)(n.a,{href:"https://ollama.com/search?c=embedding",children:"Ollama embedding models"}),"."]}),"\n",(0,o.jsx)(n.p,{children:"To use this component in a flow, connect Langflow to your locally running Ollama server and select an embeddings model:"}),"\n",(0,o.jsxs)(n.ol,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Add the ",(0,o.jsx)(n.strong,{children:"Ollama Embeddings"})," component to your flow."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["In the ",(0,o.jsx)(n.strong,{children:"Ollama Base URL"})," field, enter the address for your locally running Ollama server."]}),"\n",(0,o.jsxs)(n.p,{children:["This value is set as the ",(0,o.jsx)(n.code,{children:"OLLAMA_HOST"})," environment variable in Ollama.\nThe default base URL is ",(0,o.jsx)(n.code,{children:"http://127.0.0.1:11434"}),"."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Once the connection is established, select a model in the ",(0,o.jsx)(n.strong,{children:"Ollama Model"})," field, such as ",(0,o.jsx)(n.code,{children:"all-minilm:latest"}),"."]}),"\n",(0,o.jsxs)(n.p,{children:["To refresh the server's list of models, click ",(0,o.jsx)(a.A,{name:"RefreshCw","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Refresh"}),"."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Optional: To configure additional parameters, such as temperature or max tokens, click ",(0,o.jsx)(a.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Controls"})," in the ",(0,o.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),".\nAvailable parameters depend on the selected model."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Connect the ",(0,o.jsx)(n.strong,{children:"Ollama Embeddings"})," component to other components in the flow.\nFor more information about using embedding model components in flows, see ",(0,o.jsx)(n.a,{href:"/components-embedding-models",children:"Embedding model components"}),"."]}),"\n",(0,o.jsxs)(n.p,{children:["This example connects the ",(0,o.jsx)(n.strong,{children:"Ollama Embeddings"})," component to generate embeddings for text chunks extracted from a PDF file, and then stores the embeddings and chunks in a Chroma DB vector store."]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.img,{alt:"Ollama Embeddings component in an embedding generation flow",src:s(7369).A+"",width:"1098",height:"811"})}),"\n"]}),"\n"]})]})}function m(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(h,{...e})}):h(e)}},17886:(e,n,s)=>{s.d(n,{A:()=>t});s(96540);var l=s(64058),o=s(74848);function t({name:e,...n}){const s=l[e];return s?(0,o.jsx)(s,{...n}):null}},92757:(e,n,s)=>{s.d(n,{A:()=>l});const l=s.p+"assets/images/component-ollama-model-5755eab19c67fb10ee0533b3f7ade726.png"}}]); \ No newline at end of file diff --git a/assets/js/62d1268c.cd1d1343.js b/assets/js/62d1268c.cd1d1343.js deleted file mode 100644 index daeca0443e..0000000000 --- a/assets/js/62d1268c.cd1d1343.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[9213],{7369:(e,n,s)=>{s.d(n,{A:()=>l});const l=s.p+"assets/images/component-ollama-embeddings-chromadb-c02d6ef9e753b61c274778d90f2a6eec.png"},17287:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>d,contentTitle:()=>i,default:()=>m,frontMatter:()=>r,metadata:()=>l,toc:()=>c});const l=JSON.parse('{"id":"Components/bundles-ollama","title":"Ollama","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/bundles-ollama.mdx","sourceDirName":"Components","slug":"/bundles-ollama","permalink":"/bundles-ollama","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Ollama","slug":"/bundles-ollama"},"sidebar":"docs","previous":{"title":"NVIDIA G-Assist","permalink":"/integrations-nvidia-g-assist"},"next":{"title":"OpenAI","permalink":"/bundles-openai"}}');var o=s(74848),t=s(28453),a=s(17886);const r={title:"Ollama",slug:"/bundles-ollama"},i=void 0,d={},c=[{value:"Ollama text generation",id:"ollama-text-generation",level:2},{value:"Ollama Embeddings",id:"ollama-embeddings",level:2}];function h(e){const n={a:"a",code:"code",h2:"h2",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",...(0,t.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(n.p,{children:[(0,o.jsx)(a.A,{name:"Blocks","aria-hidden":"true"})," ",(0,o.jsx)(n.a,{href:"/components-bundle-components",children:(0,o.jsx)(n.strong,{children:"Bundles"})})," contain custom components that support specific third-party integrations with Langflow."]}),"\n",(0,o.jsxs)(n.p,{children:["This page describes the components that are available in the ",(0,o.jsx)(n.strong,{children:"Ollama"})," bundle."]}),"\n",(0,o.jsxs)(n.p,{children:["For more information about Ollama features and functionality used by Ollama components, see the ",(0,o.jsx)(n.a,{href:"https://ollama.com/",children:"Ollama documentation"}),"."]}),"\n",(0,o.jsx)(n.h2,{id:"ollama-text-generation",children:"Ollama text generation"}),"\n",(0,o.jsxs)(n.p,{children:["This component generates text using ",(0,o.jsx)(n.a,{href:"https://ollama.com/library",children:"Ollama's language models"}),"."]}),"\n",(0,o.jsxs)(n.p,{children:["To use the ",(0,o.jsx)(n.strong,{children:"Ollama"})," component in a flow, connect Langflow to your locally running Ollama server and select a model:"]}),"\n",(0,o.jsxs)(n.ol,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Add the ",(0,o.jsx)(n.strong,{children:"Ollama"})," component to your flow."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["In the ",(0,o.jsx)(n.strong,{children:"Base URL"})," field, enter the address for your locally running Ollama server."]}),"\n",(0,o.jsxs)(n.p,{children:["This value is set as the ",(0,o.jsx)(n.code,{children:"OLLAMA_HOST"})," environment variable in Ollama.\nThe default base URL is ",(0,o.jsx)(n.code,{children:"http://127.0.0.1:11434"}),"."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Once the connection is established, select a model in the ",(0,o.jsx)(n.strong,{children:"Model Name"})," field, such as ",(0,o.jsx)(n.code,{children:"llama3.2:latest"}),"."]}),"\n",(0,o.jsxs)(n.p,{children:["To refresh the server's list of models, click ",(0,o.jsx)(a.A,{name:"RefreshCw","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Refresh"}),"."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Optional: To configure additional parameters, such as temperature or max tokens, click ",(0,o.jsx)(a.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Controls"})," in the ",(0,o.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Connect the ",(0,o.jsx)(n.strong,{children:"Ollama"})," component to other components in the flow, depending on how you want to use the model."]}),"\n",(0,o.jsxs)(n.p,{children:["Language model components can output either a ",(0,o.jsx)(n.strong,{children:"Model Response"})," (",(0,o.jsx)(n.a,{href:"/data-types#message",children:(0,o.jsx)(n.code,{children:"Message"})}),") or a ",(0,o.jsx)(n.strong,{children:"Language Model"})," (",(0,o.jsx)(n.a,{href:"/data-types#languagemodel",children:(0,o.jsx)(n.code,{children:"LanguageModel"})}),"). Use the ",(0,o.jsx)(n.strong,{children:"Language Model"})," output when you want to use an Ollama model as the LLM for another LLM-driven component, such as an ",(0,o.jsx)(n.strong,{children:"Agent"})," or ",(0,o.jsx)(n.strong,{children:"Smart Function"})," component. For more information, see ",(0,o.jsx)(n.a,{href:"/components-models",children:"Language model components"}),"."]}),"\n",(0,o.jsxs)(n.p,{children:["In the following example, the flow uses ",(0,o.jsx)(n.code,{children:"LanguageModel"})," output to use an Ollama model as the LLM for an ",(0,o.jsxs)(n.a,{href:"/components-agents",children:[(0,o.jsx)(n.strong,{children:"Agent"})," component"]}),"."]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.img,{alt:"Ollama component used as the LLM in an agent flow",src:s(92757).A+"",width:"4000",height:"2668"})}),"\n"]}),"\n"]}),"\n",(0,o.jsx)(n.h2,{id:"ollama-embeddings",children:"Ollama Embeddings"}),"\n",(0,o.jsxs)(n.p,{children:["The ",(0,o.jsx)(n.strong,{children:"Ollama Embeddings"})," component generates embeddings using ",(0,o.jsx)(n.a,{href:"https://ollama.com/search?c=embedding",children:"Ollama embedding models"}),"."]}),"\n",(0,o.jsx)(n.p,{children:"To use this component in a flow, connect Langflow to your locally running Ollama server and select an embeddings model:"}),"\n",(0,o.jsxs)(n.ol,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Add the ",(0,o.jsx)(n.strong,{children:"Ollama Embeddings"})," component to your flow."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["In the ",(0,o.jsx)(n.strong,{children:"Ollama Base URL"})," field, enter the address for your locally running Ollama server."]}),"\n",(0,o.jsxs)(n.p,{children:["This value is set as the ",(0,o.jsx)(n.code,{children:"OLLAMA_HOST"})," environment variable in Ollama.\nThe default base URL is ",(0,o.jsx)(n.code,{children:"http://127.0.0.1:11434"}),"."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Once the connection is established, select a model in the ",(0,o.jsx)(n.strong,{children:"Ollama Model"})," field, such as ",(0,o.jsx)(n.code,{children:"all-minilm:latest"}),"."]}),"\n",(0,o.jsxs)(n.p,{children:["To refresh the server's list of models, click ",(0,o.jsx)(a.A,{name:"RefreshCw","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Refresh"}),"."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Optional: To configure additional parameters, such as temperature or max tokens, click ",(0,o.jsx)(a.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Controls"})," in the ",(0,o.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),".\nAvailable parameters depend on the selected model."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Connect the ",(0,o.jsx)(n.strong,{children:"Ollama Embeddings"})," component to other components in the flow.\nFor more information about using embedding model components in flows, see ",(0,o.jsx)(n.a,{href:"/components-embedding-models",children:"Embedding model components"}),"."]}),"\n",(0,o.jsxs)(n.p,{children:["This example connects the ",(0,o.jsx)(n.strong,{children:"Ollama Embeddings"})," component to generate embeddings for text chunks extracted from a PDF file, and then stores the embeddings and chunks in a Chroma DB vector store."]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.img,{alt:"Ollama Embeddings component in an embedding generation flow",src:s(7369).A+"",width:"1098",height:"811"})}),"\n"]}),"\n"]})]})}function m(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(h,{...e})}):h(e)}},17886:(e,n,s)=>{s.d(n,{A:()=>t});s(96540);var l=s(64058),o=s(74848);function t({name:e,...n}){const s=l[e];return s?(0,o.jsx)(s,{...n}):null}},92757:(e,n,s)=>{s.d(n,{A:()=>l});const l=s.p+"assets/images/component-ollama-model-5755eab19c67fb10ee0533b3f7ade726.png"}}]); \ No newline at end of file diff --git a/assets/js/6888b60e.0decf17b.js b/assets/js/6888b60e.0decf17b.js new file mode 100644 index 0000000000..4dd00db3fc --- /dev/null +++ b/assets/js/6888b60e.0decf17b.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[6256],{17886:(e,t,r)=>{r.d(t,{A:()=>c});r(96540);var n=r(64058),s=r(74848);function c({name:e,...t}){const r=n[e];return r?(0,s.jsx)(r,{...t}):null}},31929:(e,t,r)=>{r.d(t,{Ay:()=>o,RM:()=>a});var n=r(74848),s=r(28453),c=r(17886);const a=[];function i(e){const t={a:"a",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,n.jsxs)(t.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,n.jsx)(c.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,n.jsx)(t.strong,{children:"Controls"})," in the ",(0,n.jsx)(t.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function o(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(i,{...e})}):i(e)}},50005:(e,t,r)=>{r.d(t,{Ay:()=>i,RM:()=>c});var n=r(74848),s=r(28453);const c=[];function a(e){const t={a:"a",code:"code",p:"p",...(0,s.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(t.p,{children:["Because Langflow is based on LangChain, vector store components use an instance of ",(0,n.jsx)(t.a,{href:"https://python.langchain.com/docs/integrations/vectorstores/",children:"LangChain vector store"})," to drive the underlying read and write functions.\nThese instances are provider-specific and configured according to the component's parameters, such as the connection string, index name, and schema."]}),"\n",(0,n.jsxs)(t.p,{children:["In component code, this is often instantiated as ",(0,n.jsx)(t.code,{children:"vector_store"}),", but some vector store components use a different name, such as the provider name."]}),"\n",(0,n.jsx)(t.p,{children:"Some LangChain classes don't expose all possible options as component parameters.\nDepending on the provider, these options might use default values or allow modification through environment variables, if they are supported in Langflow.\nFor information about specific options, see the LangChain API reference and vector store provider's documentation."})]})}function i(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(a,{...e})}):a(e)}},80223:(e,t,r)=>{r.d(t,{Ay:()=>i,RM:()=>c});var n=r(74848),s=r(28453);const c=[];function a(e){const t={p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,n.jsxs)(t.p,{children:["Some parameters are conditional, and they are only available after you set other parameters or select specific options for other parameters.\nConditional parameters may not be visible on the ",(0,n.jsx)(t.strong,{children:"Controls"})," pane until you set the required dependencies."]})}function i(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(a,{...e})}):a(e)}},82603:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>u,contentTitle:()=>p,default:()=>m,frontMatter:()=>l,metadata:()=>n,toc:()=>x});const n=JSON.parse('{"id":"Components/bundles-elastic","title":"Elastic","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/bundles-elastic.mdx","sourceDirName":"Components","slug":"/bundles-elastic","permalink":"/bundles-elastic","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Elastic","slug":"/bundles-elastic"},"sidebar":"docs","previous":{"title":"DuckDuckGo","permalink":"/bundles-duckduckgo"},"next":{"title":"Exa","permalink":"/bundles-exa"}}');var s=r(74848),c=r(28453),a=r(17886),i=r(31929),o=r(80223),d=r(90465),h=r(50005);const l={title:"Elastic",slug:"/bundles-elastic"},p=void 0,u={},x=[{value:"Elasticsearch",id:"elasticsearch",level:2},...h.RM,...d.RM,{value:"Elasticsearch parameters",id:"elasticsearch-parameters",level:3},...i.RM,...o.RM,{value:"OpenSearch",id:"opensearch",level:2},...h.RM,{value:"OpenSearch parameters",id:"opensearch-parameters",level:3},...i.RM,...o.RM,{value:"OpenSearch output",id:"opensearch-output",level:3},...d.RM];function j(e){const t={a:"a",code:"code",h2:"h2",h3:"h3",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,c.R)(),...e.components},{Details:r}=t;return r||function(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(t.p,{children:[(0,s.jsx)(a.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(t.a,{href:"/components-bundle-components",children:(0,s.jsx)(t.strong,{children:"Bundles"})})," contain custom components that support specific third-party integrations with Langflow."]}),"\n",(0,s.jsxs)(t.p,{children:["This page describes the components that are available in the ",(0,s.jsx)(t.strong,{children:"Elastic"})," bundle."]}),"\n",(0,s.jsx)(t.h2,{id:"elasticsearch",children:"Elasticsearch"}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.strong,{children:"Elasticsearch"})," component reads and writes to an Elasticsearch instance using ",(0,s.jsx)(t.a,{href:"https://python.langchain.com/docs/integrations/vectorstores/elasticsearch/",children:(0,s.jsx)(t.code,{children:"ElasticsearchStore"})}),"."]}),"\n",(0,s.jsxs)(r,{children:[(0,s.jsx)("summary",{children:"About vector store instances"}),(0,s.jsx)(h.Ay,{})]}),"\n",(0,s.jsx)(d.Ay,{}),"\n",(0,s.jsx)(t.h3,{id:"elasticsearch-parameters",children:"Elasticsearch parameters"}),"\n",(0,s.jsx)(t.p,{children:"You can inspect a vector store component's parameters to learn more about the inputs it accepts, the features it supports, and how to configure it."}),"\n",(0,s.jsx)(i.Ay,{}),"\n",(0,s.jsx)(o.Ay,{}),"\n",(0,s.jsxs)(t.p,{children:["For information about accepted values and functionality, see the ",(0,s.jsx)(t.a,{href:"https://www.elastic.co/guide/en/elasticsearch/reference/current/dense-vector.html",children:"Elasticsearch documentation"})," or inspect ",(0,s.jsx)(t.a,{href:"/concepts-components#component-code",children:"component code"}),"."]}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Name"}),(0,s.jsx)(t.th,{children:"Type"}),(0,s.jsx)(t.th,{children:"Description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"elasticsearch_url"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. Elasticsearch server URL."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"cloud_id"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. Elasticsearch Cloud ID."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"index_name"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. Name of the Elasticsearch index."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"ingest_data"}),(0,s.jsx)(t.td,{children:"Data"}),(0,s.jsx)(t.td,{children:"Input parameter. Records to load into the vector store."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"search_query"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. Query string for similarity search."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"cache_vector_store"}),(0,s.jsx)(t.td,{children:"Boolean"}),(0,s.jsxs)(t.td,{children:["Input parameter. If ",(0,s.jsx)(t.code,{children:"true"}),", the component caches the vector store in memory for faster reads. Default: Enabled (",(0,s.jsx)(t.code,{children:"true"}),")."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"username"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsxs)(t.td,{children:["Input parameter. Username for Elasticsearch authentication. Required for all local deployments. Required for cloud deployments if ",(0,s.jsx)(t.code,{children:"api_key"})," is empty."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"password"}),(0,s.jsx)(t.td,{children:"SecretString"}),(0,s.jsxs)(t.td,{children:["Input parameter. Password for Elasticsearch authentication. Required for all local deployments. Required for cloud deployments if ",(0,s.jsx)(t.code,{children:"api_key"})," is empty"]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"embedding"}),(0,s.jsx)(t.td,{children:"Embeddings"}),(0,s.jsx)(t.td,{children:"Input parameter. The embedding model to use."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"search_type"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsxs)(t.td,{children:["Input parameter. The type of search to perform. Options are ",(0,s.jsx)(t.code,{children:"similarity"})," (default) or ",(0,s.jsx)(t.code,{children:"mmr"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"number_of_results"}),(0,s.jsx)(t.td,{children:"Integer"}),(0,s.jsx)(t.td,{children:"Input parameter. Number of search results to return. Default: 4."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"search_score_threshold"}),(0,s.jsx)(t.td,{children:"Float"}),(0,s.jsx)(t.td,{children:"Input parameter. The minimum similarity score threshold for search results. Default: 0."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"api_key"}),(0,s.jsx)(t.td,{children:"SecretString"}),(0,s.jsxs)(t.td,{children:["Input parameter. API key for Elastic Cloud authentication. If provided, ",(0,s.jsx)(t.code,{children:"username"})," and ",(0,s.jsx)(t.code,{children:"password"})," aren't required."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"verify_certs"}),(0,s.jsx)(t.td,{children:"Boolean"}),(0,s.jsxs)(t.td,{children:["Input parameter. Whether to verify SSL certificates when connecting to Elasticsearch. Default: Enabled (",(0,s.jsx)(t.code,{children:"true"}),")."]})]})]})]}),"\n",(0,s.jsx)(t.h2,{id:"opensearch",children:"OpenSearch"}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.strong,{children:"OpenSearch"})," component reads and writes to OpenSearch instances using ",(0,s.jsx)(t.a,{href:"https://python.langchain.com/docs/integrations/vectorstores/opensearch/",children:(0,s.jsx)(t.code,{children:"OpenSearchVectorSearch"})}),"."]}),"\n",(0,s.jsxs)(r,{children:[(0,s.jsx)("summary",{children:"About vector store instances"}),(0,s.jsx)(h.Ay,{})]}),"\n",(0,s.jsx)(t.h3,{id:"opensearch-parameters",children:"OpenSearch parameters"}),"\n",(0,s.jsx)(t.p,{children:"You can inspect a vector store component's parameters to learn more about the inputs it accepts, the features it supports, and how to configure it.;"}),"\n",(0,s.jsx)(i.Ay,{}),"\n",(0,s.jsx)(o.Ay,{}),"\n",(0,s.jsxs)(t.p,{children:["For information about accepted values and functionality, see the ",(0,s.jsx)(t.a,{href:"https://opensearch.org/platform/search/vector-database.html",children:"OpenSearch documentation"})," or inspect ",(0,s.jsx)(t.a,{href:"/concepts-components#component-code",children:"component code"}),"."]}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Name"}),(0,s.jsx)(t.th,{children:"Type"}),(0,s.jsx)(t.th,{children:"Description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"opensearch_url"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsxs)(t.td,{children:["Input parameter. URL for OpenSearch cluster, such as ",(0,s.jsx)(t.code,{children:"https://192.168.1.1:9200"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"index_name"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsxs)(t.td,{children:["Input parameter. The index name where the vectors are stored in OpenSearch cluster. Default: ",(0,s.jsx)(t.code,{children:"langflow"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"ingest_data"}),(0,s.jsx)(t.td,{children:"Data"}),(0,s.jsx)(t.td,{children:"Input parameter. The data to be ingested into the vector store."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"search_input"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. Enter a search query. Leave empty to retrieve all documents or if hybrid search is being used."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"cache_vector_store"}),(0,s.jsx)(t.td,{children:"Boolean"}),(0,s.jsxs)(t.td,{children:["Input parameter. If ",(0,s.jsx)(t.code,{children:"true"}),", the component caches the vector store in memory for faster reads. Default: Enabled (",(0,s.jsx)(t.code,{children:"true"}),")."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"embedding"}),(0,s.jsx)(t.td,{children:"Embeddings"}),(0,s.jsxs)(t.td,{children:["Input parameter. Attach an ",(0,s.jsx)(t.a,{href:"/components-embedding-models",children:"embedding model component"})," to use to generate an embedding from the search query."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"search_type"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsxs)(t.td,{children:["Input parameter. The type of search to perform. Options are ",(0,s.jsx)(t.code,{children:"similarity"})," (default), ",(0,s.jsx)(t.code,{children:"similarity_score_threshold"}),", ",(0,s.jsx)(t.code,{children:"mmr"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"number_of_results"}),(0,s.jsx)(t.td,{children:"Integer"}),(0,s.jsx)(t.td,{children:"Input parameter. The number of results to return in search. Default: 4."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"search_score_threshold"}),(0,s.jsx)(t.td,{children:"Float"}),(0,s.jsx)(t.td,{children:"Input parameter. The minimum similarity score threshold for search results. Default: 0."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"username"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsxs)(t.td,{children:["Input parameter. The username for the OpenSearch cluster. Default: ",(0,s.jsx)(t.code,{children:"admin"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"password"}),(0,s.jsx)(t.td,{children:"SecretString"}),(0,s.jsx)(t.td,{children:"Input parameter. The password for the OpenSearch cluster."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"use_ssl"}),(0,s.jsx)(t.td,{children:"Boolean"}),(0,s.jsxs)(t.td,{children:["Input parameter. Whether to use SSL. Default: Enabled (",(0,s.jsx)(t.code,{children:"true"}),")."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"verify_certs"}),(0,s.jsx)(t.td,{children:"Boolean"}),(0,s.jsxs)(t.td,{children:["Input parameter. Whether to verify SSL certificates. Default: Disabled (",(0,s.jsx)(t.code,{children:"false"}),")."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"hybrid_search_query"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. Provide a custom hybrid search query in JSON format. This allows you to combine vector similarity and keyword matching."})]})]})]}),"\n",(0,s.jsx)(t.h3,{id:"opensearch-output",children:"OpenSearch output"}),"\n",(0,s.jsx)(d.Ay,{}),"\n",(0,s.jsxs)(r,{children:[(0,s.jsx)("summary",{children:"Vector Store Connection port"}),(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.strong,{children:"OpenSearch"})," component has an additional deprecated ",(0,s.jsx)(t.strong,{children:"Vector Store Connection"})," output.\nThis output can only connect to a ",(0,s.jsx)(t.code,{children:"VectorStore"})," input port, and it was intended for use with dedicated Graph RAG components."]}),(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.strong,{children:"OpenSearch"})," component doesn't require a separate Graph RAG component because OpenSearch instances support Graph traversal through built-in RAG functionality and plugins."]})]})]})}function m(e={}){const{wrapper:t}={...(0,c.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(j,{...e})}):j(e)}},90465:(e,t,r)=>{r.d(t,{Ay:()=>i,RM:()=>c});var n=r(74848),s=r(28453);const c=[];function a(e){const t={a:"a",code:"code",p:"p",...(0,s.R)(),...e.components};return(0,n.jsxs)(t.p,{children:["If you use a vector store component to query your vector database, it produces search results that you can pass to downstream components in your flow as a list of ",(0,n.jsx)(t.a,{href:"/data-types#data",children:(0,n.jsx)(t.code,{children:"Data"})})," objects or a tabular ",(0,n.jsx)(t.a,{href:"/data-types#dataframe",children:(0,n.jsx)(t.code,{children:"DataFrame"})}),".\nIf both types are supported, you can set the format near the vector store component's output port in the visual editor."]})}function i(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(a,{...e})}):a(e)}}}]); \ No newline at end of file diff --git a/assets/js/6888b60e.eeba29c3.js b/assets/js/6888b60e.eeba29c3.js deleted file mode 100644 index 93511d2958..0000000000 --- a/assets/js/6888b60e.eeba29c3.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[6256],{17886:(e,t,r)=>{r.d(t,{A:()=>c});r(96540);var n=r(64058),s=r(74848);function c({name:e,...t}){const r=n[e];return r?(0,s.jsx)(r,{...t}):null}},31929:(e,t,r)=>{r.d(t,{Ay:()=>o,RM:()=>a});var n=r(74848),s=r(28453),c=r(17886);const a=[];function i(e){const t={a:"a",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,n.jsxs)(t.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,n.jsx)(c.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,n.jsx)(t.strong,{children:"Controls"})," in the ",(0,n.jsx)(t.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function o(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(i,{...e})}):i(e)}},50005:(e,t,r)=>{r.d(t,{Ay:()=>i,RM:()=>c});var n=r(74848),s=r(28453);const c=[];function a(e){const t={a:"a",code:"code",p:"p",...(0,s.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(t.p,{children:["Because Langflow is based on LangChain, vector store components use an instance of ",(0,n.jsx)(t.a,{href:"https://python.langchain.com/docs/integrations/vectorstores/",children:"LangChain vector store"})," to drive the underlying read and write functions.\nThese instances are provider-specific and configured according to the component's parameters, such as the connection string, index name, and schema."]}),"\n",(0,n.jsxs)(t.p,{children:["In component code, this is often instantiated as ",(0,n.jsx)(t.code,{children:"vector_store"}),", but some vector store components use a different name, such as the provider name."]}),"\n",(0,n.jsx)(t.p,{children:"Some LangChain classes don't expose all possible options as component parameters.\nDepending on the provider, these options might use default values or allow modification through environment variables, if they are supported in Langflow.\nFor information about specific options, see the LangChain API reference and vector store provider's documentation."})]})}function i(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(a,{...e})}):a(e)}},80223:(e,t,r)=>{r.d(t,{Ay:()=>i,RM:()=>c});var n=r(74848),s=r(28453);const c=[];function a(e){const t={p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,n.jsxs)(t.p,{children:["Some parameters are conditional, and they are only available after you set other parameters or select specific options for other parameters.\nConditional parameters may not be visible on the ",(0,n.jsx)(t.strong,{children:"Controls"})," pane until you set the required dependencies."]})}function i(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(a,{...e})}):a(e)}},82603:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>u,contentTitle:()=>p,default:()=>m,frontMatter:()=>l,metadata:()=>n,toc:()=>x});const n=JSON.parse('{"id":"Components/bundles-elastic","title":"Elastic","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/bundles-elastic.mdx","sourceDirName":"Components","slug":"/bundles-elastic","permalink":"/bundles-elastic","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Elastic","slug":"/bundles-elastic"},"sidebar":"docs","previous":{"title":"DuckDuckGo","permalink":"/bundles-duckduckgo"},"next":{"title":"Exa","permalink":"/bundles-exa"}}');var s=r(74848),c=r(28453),a=r(17886),i=r(31929),o=r(80223),d=r(90465),h=r(50005);const l={title:"Elastic",slug:"/bundles-elastic"},p=void 0,u={},x=[{value:"Elasticsearch",id:"elasticsearch",level:2},...h.RM,...d.RM,{value:"Elasticsearch parameters",id:"elasticsearch-parameters",level:3},...i.RM,...o.RM,{value:"OpenSearch",id:"opensearch",level:2},...h.RM,{value:"OpenSearch parameters",id:"opensearch-parameters",level:3},...i.RM,...o.RM,{value:"OpenSearch output",id:"opensearch-output",level:3},...d.RM];function j(e){const t={a:"a",code:"code",h2:"h2",h3:"h3",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,c.R)(),...e.components},{Details:r}=t;return r||function(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(t.p,{children:[(0,s.jsx)(a.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(t.a,{href:"/components-bundle-components",children:(0,s.jsx)(t.strong,{children:"Bundles"})})," contain custom components that support specific third-party integrations with Langflow."]}),"\n",(0,s.jsxs)(t.p,{children:["This page describes the components that are available in the ",(0,s.jsx)(t.strong,{children:"Elastic"})," bundle."]}),"\n",(0,s.jsx)(t.h2,{id:"elasticsearch",children:"Elasticsearch"}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.strong,{children:"Elasticsearch"})," component reads and writes to an Elasticsearch instance using ",(0,s.jsx)(t.a,{href:"https://python.langchain.com/docs/integrations/vectorstores/elasticsearch/",children:(0,s.jsx)(t.code,{children:"ElasticsearchStore"})}),"."]}),"\n",(0,s.jsxs)(r,{children:[(0,s.jsx)("summary",{children:"About vector store instances"}),(0,s.jsx)(h.Ay,{})]}),"\n",(0,s.jsx)(d.Ay,{}),"\n",(0,s.jsx)(t.h3,{id:"elasticsearch-parameters",children:"Elasticsearch parameters"}),"\n",(0,s.jsx)(t.p,{children:"You can inspect a vector store component's parameters to learn more about the inputs it accepts, the features it supports, and how to configure it."}),"\n",(0,s.jsx)(i.Ay,{}),"\n",(0,s.jsx)(o.Ay,{}),"\n",(0,s.jsxs)(t.p,{children:["For information about accepted values and functionality, see the ",(0,s.jsx)(t.a,{href:"https://www.elastic.co/guide/en/elasticsearch/reference/current/dense-vector.html",children:"Elasticsearch documentation"})," or inspect ",(0,s.jsx)(t.a,{href:"/concepts-components#component-code",children:"component code"}),"."]}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Name"}),(0,s.jsx)(t.th,{children:"Type"}),(0,s.jsx)(t.th,{children:"Description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"elasticsearch_url"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. Elasticsearch server URL."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"cloud_id"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. Elasticsearch Cloud ID."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"index_name"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. Name of the Elasticsearch index."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"ingest_data"}),(0,s.jsx)(t.td,{children:"Data"}),(0,s.jsx)(t.td,{children:"Input parameter. Records to load into the vector store."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"search_query"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. Query string for similarity search."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"cache_vector_store"}),(0,s.jsx)(t.td,{children:"Boolean"}),(0,s.jsx)(t.td,{children:"Input parameter. If true, the component caches the vector store in memory for faster reads. Default: Enabled (true)."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"username"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsxs)(t.td,{children:["Input parameter. Username for Elasticsearch authentication. Required for all local deployments. Required for cloud deployments if ",(0,s.jsx)(t.code,{children:"api_key"})," is empty."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"password"}),(0,s.jsx)(t.td,{children:"SecretString"}),(0,s.jsxs)(t.td,{children:["Input parameter. Password for Elasticsearch authentication. Required for all local deployments. Required for cloud deployments if ",(0,s.jsx)(t.code,{children:"api_key"})," is empty"]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"embedding"}),(0,s.jsx)(t.td,{children:"Embeddings"}),(0,s.jsx)(t.td,{children:"Input parameter. The embedding model to use."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"search_type"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsxs)(t.td,{children:["Input parameter. The type of search to perform. Options are ",(0,s.jsx)(t.code,{children:"similarity"})," (default) or ",(0,s.jsx)(t.code,{children:"mmr"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"number_of_results"}),(0,s.jsx)(t.td,{children:"Integer"}),(0,s.jsx)(t.td,{children:"Input parameter. Number of search results to return. Default: 4."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"search_score_threshold"}),(0,s.jsx)(t.td,{children:"Float"}),(0,s.jsx)(t.td,{children:"Input parameter. The minimum similarity score threshold for search results. Default: 0."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"api_key"}),(0,s.jsx)(t.td,{children:"SecretString"}),(0,s.jsxs)(t.td,{children:["Input parameter. API key for Elastic Cloud authentication. If provided, ",(0,s.jsx)(t.code,{children:"username"})," and ",(0,s.jsx)(t.code,{children:"password"})," aren't required."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"verify_certs"}),(0,s.jsx)(t.td,{children:"Boolean"}),(0,s.jsx)(t.td,{children:"Input parameter. Whether to verify SSL certificates when connecting to Elasticsearch. Default: Enabled (true)."})]})]})]}),"\n",(0,s.jsx)(t.h2,{id:"opensearch",children:"OpenSearch"}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.strong,{children:"OpenSearch"})," component reads and writes to OpenSearch instances using ",(0,s.jsx)(t.a,{href:"https://python.langchain.com/docs/integrations/vectorstores/opensearch/",children:(0,s.jsx)(t.code,{children:"OpenSearchVectorSearch"})}),"."]}),"\n",(0,s.jsxs)(r,{children:[(0,s.jsx)("summary",{children:"About vector store instances"}),(0,s.jsx)(h.Ay,{})]}),"\n",(0,s.jsx)(t.h3,{id:"opensearch-parameters",children:"OpenSearch parameters"}),"\n",(0,s.jsx)(t.p,{children:"You can inspect a vector store component's parameters to learn more about the inputs it accepts, the features it supports, and how to configure it.;"}),"\n",(0,s.jsx)(i.Ay,{}),"\n",(0,s.jsx)(o.Ay,{}),"\n",(0,s.jsxs)(t.p,{children:["For information about accepted values and functionality, see the ",(0,s.jsx)(t.a,{href:"https://opensearch.org/platform/search/vector-database.html",children:"OpenSearch documentation"})," or inspect ",(0,s.jsx)(t.a,{href:"/concepts-components#component-code",children:"component code"}),"."]}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Name"}),(0,s.jsx)(t.th,{children:"Type"}),(0,s.jsx)(t.th,{children:"Description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"opensearch_url"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsxs)(t.td,{children:["Input parameter. URL for OpenSearch cluster, such as ",(0,s.jsx)(t.code,{children:"https://192.168.1.1:9200"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"index_name"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsxs)(t.td,{children:["Input parameter. The index name where the vectors are stored in OpenSearch cluster. Default: ",(0,s.jsx)(t.code,{children:"langflow"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"ingest_data"}),(0,s.jsx)(t.td,{children:"Data"}),(0,s.jsx)(t.td,{children:"Input parameter. The data to be ingested into the vector store."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"search_input"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. Enter a search query. Leave empty to retrieve all documents or if hybrid search is being used."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"cache_vector_store"}),(0,s.jsx)(t.td,{children:"Boolean"}),(0,s.jsx)(t.td,{children:"Input parameter. If true, the component caches the vector store in memory for faster reads. Default: Enabled (true)."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"embedding"}),(0,s.jsx)(t.td,{children:"Embeddings"}),(0,s.jsxs)(t.td,{children:["Input parameter. Attach an ",(0,s.jsx)(t.a,{href:"/components-embedding-models",children:"embedding model component"})," to use to generate an embedding from the search query."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"search_type"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsxs)(t.td,{children:["Input parameter. The type of search to perform. Options are ",(0,s.jsx)(t.code,{children:"similarity"})," (default), ",(0,s.jsx)(t.code,{children:"similarity_score_threshold"}),", ",(0,s.jsx)(t.code,{children:"mmr"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"number_of_results"}),(0,s.jsx)(t.td,{children:"Integer"}),(0,s.jsx)(t.td,{children:"Input parameter. The number of results to return in search. Default: 4."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"search_score_threshold"}),(0,s.jsx)(t.td,{children:"Float"}),(0,s.jsx)(t.td,{children:"Input parameter. The minimum similarity score threshold for search results. Default: 0."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"username"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsxs)(t.td,{children:["Input parameter. The username for the OpenSearch cluster. Default: ",(0,s.jsx)(t.code,{children:"admin"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"password"}),(0,s.jsx)(t.td,{children:"SecretString"}),(0,s.jsx)(t.td,{children:"Input parameter. The password for the OpenSearch cluster."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"use_ssl"}),(0,s.jsx)(t.td,{children:"Boolean"}),(0,s.jsx)(t.td,{children:"Input parameter. Whether to use SSL. Default: Enabled (true)."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"verify_certs"}),(0,s.jsx)(t.td,{children:"Boolean"}),(0,s.jsx)(t.td,{children:"Input parameter. Whether to verify SSL certificates. Default: Disabled (false)."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"hybrid_search_query"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. Provide a custom hybrid search query in JSON format. This allows you to combine vector similarity and keyword matching."})]})]})]}),"\n",(0,s.jsx)(t.h3,{id:"opensearch-output",children:"OpenSearch output"}),"\n",(0,s.jsx)(d.Ay,{}),"\n",(0,s.jsxs)(r,{children:[(0,s.jsx)("summary",{children:"Vector Store Connection port"}),(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.strong,{children:"OpenSearch"})," component has an additional deprecated ",(0,s.jsx)(t.strong,{children:"Vector Store Connection"})," output.\nThis output can only connect to a ",(0,s.jsx)(t.code,{children:"VectorStore"})," input port, and it was intended for use with dedicated Graph RAG components."]}),(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.strong,{children:"OpenSearch"})," component doesn't require a separate Graph RAG component because OpenSearch instances support Graph traversal through built-in RAG functionality and plugins."]})]})]})}function m(e={}){const{wrapper:t}={...(0,c.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(j,{...e})}):j(e)}},90465:(e,t,r)=>{r.d(t,{Ay:()=>i,RM:()=>c});var n=r(74848),s=r(28453);const c=[];function a(e){const t={a:"a",code:"code",p:"p",...(0,s.R)(),...e.components};return(0,n.jsxs)(t.p,{children:["If you use a vector store component to query your vector database, it produces search results that you can pass to downstream components in your flow as a list of ",(0,n.jsx)(t.a,{href:"/data-types#data",children:(0,n.jsx)(t.code,{children:"Data"})})," objects or a tabular ",(0,n.jsx)(t.a,{href:"/data-types#dataframe",children:(0,n.jsx)(t.code,{children:"DataFrame"})}),".\nIf both types are supported, you can set the format near the vector store component's output port in the visual editor."]})}function i(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(a,{...e})}):a(e)}}}]); \ No newline at end of file diff --git a/assets/js/709203b3.a0da7bd4.js b/assets/js/709203b3.a0da7bd4.js deleted file mode 100644 index 8c29128010..0000000000 --- a/assets/js/709203b3.a0da7bd4.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[7253],{17886:(e,n,o)=>{o.d(n,{A:()=>r});o(96540);var t=o(64058),s=o(74848);function r({name:e,...n}){const o=t[e];return o?(0,s.jsx)(o,{...n}):null}},17901:(e,n,o)=>{o.d(n,{A:()=>t});const t=o.p+"assets/images/prompt-component-with-multiple-inputs-6e43783422ff57a873929aa2c97f43f0.png"},27389:(e,n,o)=>{o.d(n,{A:()=>t});const t=o.p+"assets/images/prompt-component-4917278161834031f30525642b4fd87e.png"},32662:(e,n,o)=>{o.r(n),o.d(n,{CH:()=>h,assets:()=>d,chCodeConfig:()=>u,contentTitle:()=>p,default:()=>x,frontMatter:()=>a,metadata:()=>t,toc:()=>m});const t=JSON.parse('{"id":"Concepts/concepts-components","title":"Components overview","description":"Components are the building blocks of your flows.","source":"@site/docs/Concepts/concepts-components.mdx","sourceDirName":"Concepts","slug":"/concepts-components","permalink":"/concepts-components","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Components overview","slug":"/concepts-components"},"sidebar":"docs","previous":{"title":"Render","permalink":"/deployment-render"},"next":{"title":"Input / Output","permalink":"/components-io"}}');var s=o(74848),r=o(28453),c=o(24754),l=o(17886),i=o(36813);const a={title:"Components overview",slug:"/concepts-components"},p=void 0,d={},h={annotations:c.hk,Code:c.Cy},u={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},m=[{value:"Add a component to a flow",id:"component-menus",level:2},{value:"Configure a component",id:"configure-a-component",level:3},{value:"Component header menus",id:"component-header-menus",level:3},{value:"Rename a component",id:"rename-a-component",level:3},{value:"Run a component",id:"run-a-component",level:3},{value:"Inspect component output and logs",id:"inspect-component-output-and-logs",level:3},{value:"Freeze a component",id:"freeze-a-component",level:3},{value:"Component ports",id:"component-ports",level:2},{value:"Dynamic ports",id:"dynamic-ports",level:3},{value:"Output type selection",id:"output-type-selection",level:3},{value:"Port colors",id:"port-colors",level:3},{value:"Component code",id:"component-code",level:2},{value:"Component versions",id:"component-versions",level:2},{value:"Update component versions",id:"update-component-versions",level:3},{value:"Group components",id:"group-components",level:2},{value:"Legacy components",id:"legacy-components",level:2},...i.RM];function g(e){const n={a:"a",admonition:"admonition",code:"code",em:"em",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,r.R)(),...e.components};return h||y("CH",!1),h.Code||y("CH.Code",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n","\n",(0,s.jsx)(n.p,{children:"Components are the building blocks of your flows.\nLike classes in an application, each component is designed for a specific use case or integration."}),"\n",(0,s.jsxs)(n.admonition,{type:"tip",children:[(0,s.jsx)(n.p,{children:"Langflow provides keyboard shortcuts for the workspace."}),(0,s.jsxs)(n.p,{children:["In the Langflow header, click your profile icon, select ",(0,s.jsx)(n.strong,{children:"Settings"}),", and then click ",(0,s.jsx)(n.strong,{children:"Shortcuts"})," to view the available shortcuts."]})]}),"\n",(0,s.jsx)(n.h2,{id:"component-menus",children:"Add a component to a flow"}),"\n",(0,s.jsxs)(n.p,{children:["To add a component to a flow, drag the component from the ",(0,s.jsx)(l.A,{name:"Component","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Core components"})," or ",(0,s.jsx)(l.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Bundles"})," menu into the ",(0,s.jsx)(n.a,{href:"/concepts-overview#workspace",children:"workspace"}),"."]}),"\n",(0,s.jsx)(n.p,{children:"Components are grouped by type or provider, and some components are hidden by default:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(l.A,{name:"Component","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Core components"}),": Langflow's base components are grouped by purpose, such as ",(0,s.jsx)(n.strong,{children:"Inputs and Outputs"})," or ",(0,s.jsx)(n.strong,{children:"Data"}),".\nThese components either provide generic functionality, like loops and parsing, or they provide single components that support multiple third-party integrations."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(l.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Bundles"}),": Bundles contain one or more components that support specific third-party integrations, and they are grouped by service provider."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Legacy"}),": These components are hidden by default.\nFor more information, see ",(0,s.jsx)(n.a,{href:"#legacy-components",children:"Legacy components"}),"."]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"configure-a-component",children:"Configure a component"}),"\n",(0,s.jsx)(n.p,{children:"After adding a component to a flow, configure the component's parameters and connect it to the other components in your flows."}),"\n",(0,s.jsxs)(n.p,{children:["Each component has inputs, outputs, parameters, and controls related to the component's purpose.\nBy default, components show only required and common options.\nTo access additional settings and controls, including meta settings, use the ",(0,s.jsx)(n.a,{href:"#component-header-menus",children:"component's header menu"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"component-header-menus",children:"Component header menus"}),"\n",(0,s.jsx)(n.p,{children:"To access a component's header menu, click the component in your workspace."}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"Agent component",src:o(58876).A+"",width:"1948",height:"3344"})}),"\n",(0,s.jsx)(n.p,{children:"A few options are available directly on the header menu.\nFor example:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Code"}),": Modify component settings by directly editing the component's Python code."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Controls"}),": Adjust all component parameters, including optional settings that are hidden by default."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Tool Mode"}),": Enable this option when combining a component with an ",(0,s.jsx)(n.strong,{children:"Agent"})," component."]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["For all other options, including ",(0,s.jsx)(n.strong,{children:"Delete"})," and ",(0,s.jsx)(n.strong,{children:"Duplicate"})," controls, click ",(0,s.jsx)(l.A,{name:"Ellipsis","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Show More"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"rename-a-component",children:"Rename a component"}),"\n",(0,s.jsxs)(n.p,{children:["To modify a component's name or description, click the component in the workspace, and then click ",(0,s.jsx)(l.A,{name:"PencilLine","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Edit"}),".\nComponent descriptions accept Markdown syntax."]}),"\n",(0,s.jsx)(n.h3,{id:"run-a-component",children:"Run a component"}),"\n",(0,s.jsxs)(n.p,{children:["To run a single component, click ",(0,s.jsx)(l.A,{name:"Play","aria-label":"Play button"})," ",(0,s.jsx)(n.strong,{children:"Run component"}),".\nA ",(0,s.jsx)(n.strong,{children:"Last Run"})," value indicates that the component ran successfully."]}),"\n",(0,s.jsxs)(n.p,{children:["Running a single component is different from running an entire flow. In a single component run, the ",(0,s.jsx)(n.code,{children:"build_vertex"})," function is called, which builds and runs only the single component with direct inputs provided through the visual editor (the ",(0,s.jsx)(n.code,{children:"inputs_dict"})," parameter). The ",(0,s.jsx)(n.code,{children:"VertexBuildResult"})," data is passed to the ",(0,s.jsx)(n.code,{children:"build_and_run"})," method that calls the component's ",(0,s.jsx)(n.code,{children:"build"})," method and runs it. Unlike running an entire flow, running a single component doesn't automatically execute its upstream dependencies."]}),"\n",(0,s.jsx)(n.h3,{id:"inspect-component-output-and-logs",children:"Inspect component output and logs"}),"\n",(0,s.jsxs)(n.p,{children:["To view the output and logs for a single component, click ",(0,s.jsx)(l.A,{name:"TextSearch","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Inspect"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"freeze-a-component",children:"Freeze a component"}),"\n",(0,s.jsx)(n.admonition,{type:"important",children:(0,s.jsx)(n.p,{children:"Freezing a component also freezes all components upstream of the selected component."})}),"\n",(0,s.jsxs)(n.p,{children:["Use the freeze option if you expect consistent output from a component ",(0,s.jsx)(n.em,{children:"and all upstream components"}),", and you only need to run those components once."]}),"\n",(0,s.jsx)(n.p,{children:"Freezing a component prevents that component and all upstream components from re-running, and it preserves the last output state for those components.\nAny future flow runs use the preserved output."}),"\n",(0,s.jsxs)(n.p,{children:["To freeze a component, click the component in the workspace to expose the component's header menu, click ",(0,s.jsx)(l.A,{name:"Ellipsis","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Show More"}),", and then select ",(0,s.jsx)(n.strong,{children:"Freeze"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"component-ports",children:"Component ports"}),"\n",(0,s.jsxs)(n.p,{children:["Around the border of each component, there are circular port icons like ",(0,s.jsx)(l.A,{name:"Circle",size:"16","aria-label":"Indigo message port",style:{color:"#4f46e5",fill:"#4f46e5"}}),".\nThese indicate a component ",(0,s.jsx)(n.em,{children:"connection point"})," or ",(0,s.jsx)(n.em,{children:"port"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["Ports either accept input or produce output of a specific data type.\nYou can infer the data type from the field the port is attached to or from the ",(0,s.jsx)(n.a,{href:"#port-colors",children:"port's color"}),".\nFor example, the ",(0,s.jsx)(n.strong,{children:"System Message"})," field accepts ",(0,s.jsx)(n.a,{href:"/data-types#message",children:"message data"}),", as illustrated by the blue port icon: ",(0,s.jsx)(l.A,{name:"Circle",size:"16","aria-label":"Indigo message port",style:{color:"#4f46e5",fill:"#4f46e5"}}),"."]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"Prompt Template component with multiple inputs",src:o(27389).A+"",width:"2600",height:"3020"})}),"\n",(0,s.jsxs)(n.p,{children:["When building flows, connect output ports to input ports of the same type (color) to transfer that type of data between two components.\nFor information about the programmatic representation of each data type, see ",(0,s.jsx)(n.a,{href:"/data-types",children:"Langflow data types"}),"."]}),"\n",(0,s.jsx)(n.admonition,{type:"tip",children:(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["In the workspace, hover over a port to see connection details for that port.\nClick a port to ",(0,s.jsx)(l.A,{name:"Search","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Search"})," for compatible components."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["If two components have incompatible data types, you can use a processing component like the ",(0,s.jsxs)(n.a,{href:"/components-processing#type-convert",children:[(0,s.jsx)(n.strong,{children:"Type Convert"})," component"]})," to convert the data between components."]}),"\n"]}),"\n"]})}),"\n",(0,s.jsx)(n.h3,{id:"dynamic-ports",children:"Dynamic ports"}),"\n",(0,s.jsxs)(n.p,{children:["Some components have ports that are dynamically added or removed.\nFor example, the ",(0,s.jsx)(n.strong,{children:"Prompt Template"})," component accepts inputs within curly braces, and new ports are opened when a value within curly braces is detected in the ",(0,s.jsx)(n.strong,{children:"Template"})," field."]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"Prompt Template component with multiple inputs",src:o(17901).A+"",width:"2104",height:"2928"})}),"\n",(0,s.jsx)(n.h3,{id:"output-type-selection",children:"Output type selection"}),"\n",(0,s.jsx)(n.p,{children:"All components produce output that is either sent to another component in the flow or returned as the final flow result."}),"\n",(0,s.jsx)(n.p,{children:"Some components can produce multiple types of output:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["If the component emits all types at once, the component has multiple output ports in the visual editor. In component code, this is represented by ",(0,s.jsx)(n.code,{children:"group_outputs=True"})]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["If the component emits only one type, you must select the output type by clicking the output label near the output port, and then selecting the desired output type. In component code, this is represented by ",(0,s.jsx)(n.code,{children:"group_outputs=False"})," or omitting the ",(0,s.jsx)(n.code,{children:"group_outputs"})," parameter."]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["For example, a language model component can output ",(0,s.jsx)(n.em,{children:"either"})," a ",(0,s.jsx)(n.strong,{children:"Model Response"})," or ",(0,s.jsx)(n.strong,{children:"Language Model"}),".\nThe ",(0,s.jsx)(n.strong,{children:"Model Response"})," output produces ",(0,s.jsx)(n.a,{href:"/data-types#message",children:(0,s.jsx)(n.code,{children:"Message"})})," data that can be passed to another component's ",(0,s.jsx)(n.code,{children:"Message"})," port.\nThe ",(0,s.jsx)(n.strong,{children:"Language Model"})," output must be connected to a component with a ",(0,s.jsx)(n.strong,{children:"Language Model"})," input, such as the ",(0,s.jsxs)(n.a,{href:"/components-processing#structured-output",children:[(0,s.jsx)(n.strong,{children:"Structured Output"})," component"]}),", that uses the attached LLM to power the receiving component's reasoning."]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"Output type selection in the Language Model component",src:o(64599).A+"",width:"280",height:"446"})}),"\n",(0,s.jsx)(n.h3,{id:"port-colors",children:"Port colors"}),"\n",(0,s.jsxs)(n.p,{children:["Component port colors indicate the data type ingested or emitted by the port.\nFor example, a ",(0,s.jsx)(n.strong,{children:"Message"})," port either accepts or emits ",(0,s.jsx)(n.code,{children:"Message"})," data."]}),"\n",(0,s.jsx)(n.p,{children:"The following table lists the component data types and their corresponding port colors:"}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Data type"}),(0,s.jsx)(n.th,{children:"Port color"}),(0,s.jsx)(n.th,{children:"Port icon example"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Data"}),(0,s.jsx)(n.td,{children:"Red"}),(0,s.jsx)(n.td,{children:(0,s.jsx)(l.A,{name:"Circle",size:"16","aria-label":"Red data port",style:{color:"#dc2626",fill:"#dc2626"}})})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"DataFrame"}),(0,s.jsx)(n.td,{children:"Pink"}),(0,s.jsx)(n.td,{children:(0,s.jsx)(l.A,{name:"Circle",size:"16","aria-label":"Pink dataframe port",style:{color:"#ec4899",fill:"#ec4899"}})})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Embeddings"}),(0,s.jsx)(n.td,{children:"Emerald"}),(0,s.jsx)(n.td,{children:(0,s.jsx)(l.A,{name:"Circle",size:"16","aria-label":"Emerald embeddings port",style:{color:"#10b981",fill:"#10b981"}})})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"LanguageModel"}),(0,s.jsx)(n.td,{children:"Fuchsia"}),(0,s.jsx)(n.td,{children:(0,s.jsx)(l.A,{name:"Circle",size:"16","aria-label":"Fuchsia language model port",style:{color:"#c026d3",fill:"#c026d3"}})})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Memory"}),(0,s.jsx)(n.td,{children:"Orange"}),(0,s.jsx)(n.td,{children:(0,s.jsx)(l.A,{name:"Circle",size:"16","aria-label":"Orange memory port",style:{color:"#f97316",fill:"#f97316"}})})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Message"}),(0,s.jsx)(n.td,{children:"Indigo"}),(0,s.jsx)(n.td,{children:(0,s.jsx)(l.A,{name:"Circle",size:"16","aria-label":"Indigo message port",style:{color:"#4f46e5",fill:"#4f46e5"}})})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Tool"}),(0,s.jsx)(n.td,{children:"Cyan"}),(0,s.jsx)(n.td,{children:(0,s.jsx)(l.A,{name:"Circle",size:"16","aria-label":"Cyan tool port",style:{color:"#06b6d4",fill:"#06b6d4"}})})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Unknown or multiple types"}),(0,s.jsx)(n.td,{children:"Gray"}),(0,s.jsx)(n.td,{children:(0,s.jsx)(l.A,{name:"Circle",size:"16","aria-label":"Gray unknown port",style:{color:"#9CA3AF",fill:"#9CA3AF"}})})]})]})]}),"\n",(0,s.jsx)(n.h2,{id:"component-code",children:"Component code"}),"\n",(0,s.jsxs)(n.p,{children:["You can edit components in the ",(0,s.jsx)(n.a,{href:"/concepts-overview#workspace",children:"workspace"})," and in code. When editing a flow, select a component, and then click ",(0,s.jsx)(l.A,{name:"Code","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Code"})," to see and edit the component's underlying Python code."]}),"\n",(0,s.jsx)(n.p,{children:"All components have underlying code that determines how you configure them and what actions they can perform.\nIn the context of creating and running flows, component code does the following:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Determines what configuration options to show in the visual editor."}),"\n",(0,s.jsx)(n.li,{children:"Validates inputs based on the component's defined input types."}),"\n",(0,s.jsx)(n.li,{children:"Processes data using the configured parameters, methods, and functions."}),"\n",(0,s.jsx)(n.li,{children:"Passes results to the next component in the flow."}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["All components inherit from a base ",(0,s.jsx)(n.code,{children:"Component"})," class that defines the component's interface and behavior.\nFor example, the ",(0,s.jsxs)(n.a,{href:"https://github.com/langflow-ai/langflow/blob/main/src/backend/base/langflow/components/langchain_utilities/recursive_character.py",children:[(0,s.jsx)(n.strong,{children:"Recursive Character Text Splitter"})," component"]})," is a child of the ",(0,s.jsx)(n.a,{href:"https://github.com/langflow-ai/langflow/blob/main/src/backend/base/langflow/base/textsplitters/model.py",children:(0,s.jsx)(n.code,{children:"LCTextSplitterComponent"})})," class."]}),"\n",(0,s.jsxs)(n.p,{children:["Each component's code includes definitions for inputs and outputs, which are represented in the workspace as ",(0,s.jsx)(n.a,{href:"#component-ports",children:"component ports"}),".\nFor example, the ",(0,s.jsx)(n.code,{children:"RecursiveCharacterTextSplitter"})," has four inputs. Each input definition specifies the input type, such as ",(0,s.jsx)(n.code,{children:"IntInput"}),", as well as the encoded name, display name, description, and other parameters for that specific input.\nThese values determine the component settings, such as display names and tooltips in the visual editor."]}),"\n",(0,s.jsx)(h.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:" inputs ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" [",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" IntInput(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"chunk_size"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Chunk Size"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" info",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"The maximum length of each chunk."',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" value",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"1000",props:{style:{color:"#79C0FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" IntInput(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"chunk_overlap"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Chunk Overlap"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" info",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"The amount of overlap between chunks."',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" value",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"200",props:{style:{color:"#79C0FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" DataInput(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"data_input"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Input"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" info",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"The texts to split."',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" input_types",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"[",props:{style:{color:"#C9D1D9"}}},{content:'"Document"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"Data"',props:{style:{color:"#A5D6FF"}}},{content:"],",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" MessageTextInput(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"separators"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Separators"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" info",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"'The characters to split on.",props:{style:{color:"#A5D6FF"}}},{content:"\\n",props:{style:{color:"#79C0FF"}}},{content:'If left empty defaults to ["',props:{style:{color:"#A5D6FF"}}},{content:"\\\\",props:{style:{color:"#79C0FF"}}},{content:"n",props:{style:{color:"#A5D6FF"}}},{content:"\\\\",props:{style:{color:"#79C0FF"}}},{content:'n", "',props:{style:{color:"#A5D6FF"}}},{content:"\\\\",props:{style:{color:"#79C0FF"}}},{content:'n", " ", ""].\'',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" is_list",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"True",props:{style:{color:"#79C0FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ]",props:{style:{color:"#C9D1D9"}}}]}],lang:"python"},annotations:[]}]}),"\n",(0,s.jsxs)(n.p,{children:["Additionally, components have methods or functions that handle their functionality.\nFor example, the ",(0,s.jsx)(n.code,{children:"RecursiveCharacterTextSplitter"})," has two methods:"]}),"\n",(0,s.jsx)(h.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:" def ",props:{style:{color:"#FF7B72"}}},{content:"get_data_input",props:{style:{color:"#D2A8FF"}}},{content:"(self) -> Any:",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" return ",props:{style:{color:"#FF7B72"}}},{content:"self",props:{style:{color:"#79C0FF"}}},{content:".data_input",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" def ",props:{style:{color:"#FF7B72"}}},{content:"build_text_splitter",props:{style:{color:"#D2A8FF"}}},{content:"(self) -> TextSplitter:",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" if not ",props:{style:{color:"#FF7B72"}}},{content:"self",props:{style:{color:"#79C0FF"}}},{content:".separators:",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" separators: list[",props:{style:{color:"#C9D1D9"}}},{content:"str",props:{style:{color:"#79C0FF"}}},{content:"] ",props:{style:{color:"#C9D1D9"}}},{content:"| ",props:{style:{color:"#FF7B72"}}},{content:"None ",props:{style:{color:"#79C0FF"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:"None",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" else",props:{style:{color:"#FF7B72"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" # check if the separators list has escaped characters",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:" # if there are escaped characters, unescape them",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:" separators ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" [unescape_string(x) ",props:{style:{color:"#C9D1D9"}}},{content:"for",props:{style:{color:"#FF7B72"}}},{content:" x ",props:{style:{color:"#C9D1D9"}}},{content:"in ",props:{style:{color:"#FF7B72"}}},{content:"self",props:{style:{color:"#79C0FF"}}},{content:".separators]",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" return",props:{style:{color:"#FF7B72"}}},{content:" RecursiveCharacterTextSplitter(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" separators",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"separators,",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" chunk_size",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"self",props:{style:{color:"#79C0FF"}}},{content:".chunk_size,",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" chunk_overlap",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"self",props:{style:{color:"#79C0FF"}}},{content:".chunk_overlap,",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" )",props:{style:{color:"#C9D1D9"}}}]}],lang:"python"},annotations:[]}]}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.code,{children:"get_data_input"})," method retrieves the text to be split from the component's input, which makes the data available to the class.\nThe ",(0,s.jsx)(n.code,{children:"build_text_splitter"})," method creates a ",(0,s.jsx)(n.code,{children:"RecursiveCharacterTextSplitter"})," object by calling its parent class's ",(0,s.jsx)(n.code,{children:"build"})," method. Then, the text is split with the created splitter and passed to the next component."]}),"\n",(0,s.jsx)(n.h2,{id:"component-versions",children:"Component versions"}),"\n",(0,s.jsx)(n.p,{children:"Component versions and states are stored in an internal Langflow database. When you add a component to a flow, you create a detached copy of the component based on the information in the Langflow database.\nThese copies are detached from the primary Langflow database, and they don't synchronize with any updates that can occur when you upgrade your Langflow version."}),"\n",(0,s.jsxs)(n.p,{children:["In other words, an individual instance of a component retains the version number and state from the moment you add it to a specific flow. For example, if a component is at version 1.0 when you add it to a flow, it remains at version 1.0 ",(0,s.jsx)(n.em,{children:"in that flow"})," unless you update it."]}),"\n",(0,s.jsx)(n.h3,{id:"update-component-versions",children:"Update component versions"}),"\n",(0,s.jsx)(n.p,{children:"When editing a flow in the workspace, Langflow notifies you if a component's workspace version is behind the database version so you can update the component's workspace version:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Update ready"}),": This notification means the component update contains no breaking changes."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Update available"}),": This notification means the component update might contain breaking changes."]}),"\n",(0,s.jsx)(n.p,{children:"Breaking changes modify component inputs and outputs, causing the components to be disconnected and break the flow. After updating the component, you might need to edit the component settings or reconnect component ports."}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:"There are two ways to update components:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Click ",(0,s.jsx)(n.strong,{children:"Update"})," to update a single component. This is recommended for updates without breaking changes."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Click ",(0,s.jsx)(n.strong,{children:"Review"})," to view all available updates and create a snapshot before updating. This is recommended for updates with breaking changes."]}),"\n",(0,s.jsxs)(n.p,{children:["To save a snapshot of your flow before updating the components, enable ",(0,s.jsx)(n.strong,{children:"Create backup flow before updating"}),". Backup flows are stored in the same project folder as the original flow with the suffix ",(0,s.jsx)(n.code,{children:"(backup)"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["To update specific components, select the components you want to update, and then click ",(0,s.jsx)(n.strong,{children:"Update Components"}),"."]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:"Components are updated to the latest available version, based on the version of Langflow you are running."}),"\n",(0,s.jsx)(n.h2,{id:"group-components",children:"Group components"}),"\n",(0,s.jsxs)(n.p,{children:["Multiple components can be grouped into a single component for reuse. This is useful for organizing large flows by combining related components together, such as a RAG ",(0,s.jsx)(n.strong,{children:"Agent"})," component and it's associated tools or vector store components."]}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Hold ",(0,s.jsx)("kbd",{children:"Shift"}),", and then click and drag to highlight all components you want to merge. Components must be completely within the selection area to be merged."]}),"\n",(0,s.jsxs)(n.p,{children:["Alternatively, to select components for merging one by one, hold ",(0,s.jsx)("kbd",{children:"Ctrl"})," on Windows or ",(0,s.jsx)("kbd",{children:"Cmd"})," on Mac, and then click each component to add them to the group."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Release the mouse and keyboard, and then click ",(0,s.jsx)(n.strong,{children:"Group"})," to merge the components into a single, group component."]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:"Grouped components are configured and managed as a single component, including the component name, code, and settings."}),"\n",(0,s.jsxs)(n.p,{children:["To ungroup the components, click the component in the workspace to expose the component's header menu, click ",(0,s.jsx)(l.A,{name:"Ellipsis","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Show More"}),", and then select ",(0,s.jsx)(n.strong,{children:"Ungroup"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["If you want to reuse this grouping in other flows, click the component in the workspace to expose the component's header menu, click ",(0,s.jsx)(l.A,{name:"Ellipsis","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Show More"}),", and then select ",(0,s.jsx)(n.strong,{children:"Save"})," to save the component to the ",(0,s.jsx)(l.A,{name:"Component","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Core components"})," menu as a custom component."]}),"\n",(0,s.jsx)(n.h2,{id:"legacy-components",children:"Legacy components"}),"\n","\n",(0,s.jsx)(i.Ay,{})]})}function x(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(g,{...e})}):g(e)}function y(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}},36813:(e,n,o)=>{o.d(n,{Ay:()=>i,RM:()=>c});var t=o(74848),s=o(28453),r=o(17886);const c=[];function l(e){const n={a:"a",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(n.p,{children:["Legacy components are longer supported and can be removed in a future release.\nYou can continue to use them in existing flows, but it is recommended that you replace them with supported components as soon as possible.\nSuggested replacements are included in the ",(0,t.jsx)(n.strong,{children:"Legacy"})," banner on components in your flows.\nThey are also given in release notes and Langflow documentation whenever possible."]}),"\n",(0,t.jsxs)(n.p,{children:["If you aren't sure how to replace a legacy component, ",(0,t.jsx)(r.A,{name:"Search","aria-hidden":"true"})," ",(0,t.jsx)(n.strong,{children:"Search"})," for components by provider, service, or component name.\nThe component may have been deprecated in favor of a completely new component, a similar component, or a new version of the same component in a different category."]}),"\n",(0,t.jsxs)(n.p,{children:["If there is no obvious replacement, consider whether another component can be adapted to your use case.\nFor example, many ",(0,t.jsx)(r.A,{name:"Component","aria-hidden":"true"})," ",(0,t.jsx)(n.strong,{children:"Core components"})," provide generic functionality that can support multiple providers and use cases, such as the ",(0,t.jsxs)(n.a,{href:"/components-data#api-request",children:[(0,t.jsx)(n.strong,{children:"API Request"})," component"]}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["If neither of these options are viable, you could use the legacy component's code to create your own custom component, or ",(0,t.jsx)(n.a,{href:"/contributing-github-issues",children:"start a discussion"})," about the legacy component."]}),"\n",(0,t.jsxs)(n.p,{children:["To discourage use of legacy components in new flows, these components are hidden by default.\nIn the visual editor, you can click ",(0,t.jsx)(r.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,t.jsx)(n.strong,{children:"Component settings"})," to toggle the ",(0,t.jsx)(n.strong,{children:"Legacy"})," filter."]})]})}function i(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(l,{...e})}):l(e)}},58876:(e,n,o)=>{o.d(n,{A:()=>t});const t=o.p+"assets/images/agent-component-4c496697124cfebd3883ee9ade19ca5c.png"},64599:(e,n,o)=>{o.d(n,{A:()=>t});const t=o.p+"assets/images/select-output-f7d64629d278098e3fba32fe79f79ed6.png"}}]); \ No newline at end of file diff --git a/assets/js/709203b3.f23e33bf.js b/assets/js/709203b3.f23e33bf.js new file mode 100644 index 0000000000..49576e9d30 --- /dev/null +++ b/assets/js/709203b3.f23e33bf.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[7253],{17886:(e,n,o)=>{o.d(n,{A:()=>r});o(96540);var t=o(64058),s=o(74848);function r({name:e,...n}){const o=t[e];return o?(0,s.jsx)(o,{...n}):null}},17901:(e,n,o)=>{o.d(n,{A:()=>t});const t=o.p+"assets/images/prompt-component-with-multiple-inputs-6e43783422ff57a873929aa2c97f43f0.png"},27389:(e,n,o)=>{o.d(n,{A:()=>t});const t=o.p+"assets/images/prompt-component-4917278161834031f30525642b4fd87e.png"},32662:(e,n,o)=>{o.r(n),o.d(n,{CH:()=>h,assets:()=>d,chCodeConfig:()=>u,contentTitle:()=>p,default:()=>x,frontMatter:()=>a,metadata:()=>t,toc:()=>m});const t=JSON.parse('{"id":"Concepts/concepts-components","title":"Components overview","description":"Components are the building blocks of your flows.","source":"@site/docs/Concepts/concepts-components.mdx","sourceDirName":"Concepts","slug":"/concepts-components","permalink":"/concepts-components","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Components overview","slug":"/concepts-components"},"sidebar":"docs","previous":{"title":"Render","permalink":"/deployment-render"},"next":{"title":"Input / Output","permalink":"/components-io"}}');var s=o(74848),r=o(28453),c=o(24754),l=o(17886),i=o(36813);const a={title:"Components overview",slug:"/concepts-components"},p=void 0,d={},h={annotations:c.hk,Code:c.Cy},u={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},m=[{value:"Add a component to a flow",id:"component-menus",level:2},{value:"Configure a component",id:"configure-a-component",level:3},{value:"Component header menus",id:"component-header-menus",level:3},{value:"Rename a component",id:"rename-a-component",level:3},{value:"Run a component",id:"run-a-component",level:3},{value:"Inspect component output and logs",id:"inspect-component-output-and-logs",level:3},{value:"Freeze a component",id:"freeze-a-component",level:3},{value:"Component ports",id:"component-ports",level:2},{value:"Dynamic ports",id:"dynamic-ports",level:3},{value:"Output type selection",id:"output-type-selection",level:3},{value:"Port colors",id:"port-colors",level:3},{value:"Component code",id:"component-code",level:2},{value:"Component versions",id:"component-versions",level:2},{value:"Update component versions",id:"update-component-versions",level:3},{value:"Group components",id:"group-components",level:2},{value:"Legacy components",id:"legacy-components",level:2},...i.RM];function g(e){const n={a:"a",admonition:"admonition",code:"code",em:"em",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,r.R)(),...e.components};return h||y("CH",!1),h.Code||y("CH.Code",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n","\n",(0,s.jsx)(n.p,{children:"Components are the building blocks of your flows.\nLike classes in an application, each component is designed for a specific use case or integration."}),"\n",(0,s.jsxs)(n.admonition,{type:"tip",children:[(0,s.jsx)(n.p,{children:"Langflow provides keyboard shortcuts for the workspace."}),(0,s.jsxs)(n.p,{children:["In the Langflow header, click your profile icon, select ",(0,s.jsx)(n.strong,{children:"Settings"}),", and then click ",(0,s.jsx)(n.strong,{children:"Shortcuts"})," to view the available shortcuts."]})]}),"\n",(0,s.jsx)(n.h2,{id:"component-menus",children:"Add a component to a flow"}),"\n",(0,s.jsxs)(n.p,{children:["To add a component to a flow, drag the component from the ",(0,s.jsx)(l.A,{name:"Component","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Core components"})," or ",(0,s.jsx)(l.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Bundles"})," menu into the ",(0,s.jsx)(n.a,{href:"/concepts-overview#workspace",children:"workspace"}),"."]}),"\n",(0,s.jsx)(n.p,{children:"Components are grouped by type or provider, and some components are hidden by default:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(l.A,{name:"Component","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Core components"}),": Langflow's base components are grouped by purpose, such as ",(0,s.jsx)(n.strong,{children:"Inputs and Outputs"})," or ",(0,s.jsx)(n.strong,{children:"Data"}),".\nThese components either provide generic functionality, like loops and parsing, or they provide single components that support multiple third-party integrations."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(l.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Bundles"}),": Bundles contain one or more components that support specific third-party integrations, and they are grouped by service provider."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Legacy"}),": These components are hidden by default.\nFor more information, see ",(0,s.jsx)(n.a,{href:"#legacy-components",children:"Legacy components"}),"."]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"configure-a-component",children:"Configure a component"}),"\n",(0,s.jsx)(n.p,{children:"After adding a component to a flow, configure the component's parameters and connect it to the other components in your flows."}),"\n",(0,s.jsxs)(n.p,{children:["Each component has inputs, outputs, parameters, and controls related to the component's purpose.\nBy default, components show only required and common options.\nTo access additional settings and controls, including meta settings, use the ",(0,s.jsx)(n.a,{href:"#component-header-menus",children:"component's header menu"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"component-header-menus",children:"Component header menus"}),"\n",(0,s.jsx)(n.p,{children:"To access a component's header menu, click the component in your workspace."}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"Agent component",src:o(58876).A+"",width:"1948",height:"3344"})}),"\n",(0,s.jsx)(n.p,{children:"A few options are available directly on the header menu.\nFor example:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Code"}),": Modify component settings by directly editing the component's Python code."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Controls"}),": Adjust all component parameters, including optional settings that are hidden by default."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Tool Mode"}),": Enable this option when combining a component with an ",(0,s.jsx)(n.strong,{children:"Agent"})," component."]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["For all other options, including ",(0,s.jsx)(n.strong,{children:"Delete"})," and ",(0,s.jsx)(n.strong,{children:"Duplicate"})," controls, click ",(0,s.jsx)(l.A,{name:"Ellipsis","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Show More"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"rename-a-component",children:"Rename a component"}),"\n",(0,s.jsxs)(n.p,{children:["To modify a component's name or description, click the component in the workspace, and then click ",(0,s.jsx)(l.A,{name:"PencilLine","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Edit"}),".\nComponent descriptions accept Markdown syntax."]}),"\n",(0,s.jsx)(n.h3,{id:"run-a-component",children:"Run a component"}),"\n",(0,s.jsxs)(n.p,{children:["To run a single component, click ",(0,s.jsx)(l.A,{name:"Play","aria-label":"Play button"})," ",(0,s.jsx)(n.strong,{children:"Run component"}),".\nA ",(0,s.jsx)(n.strong,{children:"Last Run"})," value indicates that the component ran successfully."]}),"\n",(0,s.jsxs)(n.p,{children:["Running a single component is different from running an entire flow. In a single component run, the ",(0,s.jsx)(n.code,{children:"build_vertex"})," function is called, which builds and runs only the single component with direct inputs provided through the visual editor (the ",(0,s.jsx)(n.code,{children:"inputs_dict"})," parameter). The ",(0,s.jsx)(n.code,{children:"VertexBuildResult"})," data is passed to the ",(0,s.jsx)(n.code,{children:"build_and_run"})," method that calls the component's ",(0,s.jsx)(n.code,{children:"build"})," method and runs it. Unlike running an entire flow, running a single component doesn't automatically execute its upstream dependencies."]}),"\n",(0,s.jsx)(n.h3,{id:"inspect-component-output-and-logs",children:"Inspect component output and logs"}),"\n",(0,s.jsxs)(n.p,{children:["To view the output and logs for a single component, click ",(0,s.jsx)(l.A,{name:"TextSearch","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Inspect"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"freeze-a-component",children:"Freeze a component"}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsx)(n.p,{children:"Freezing a component also freezes all components upstream of the selected component."})}),"\n",(0,s.jsxs)(n.p,{children:["Use the freeze option if you expect consistent output from a component ",(0,s.jsx)(n.em,{children:"and all upstream components"}),", and you only need to run those components once."]}),"\n",(0,s.jsx)(n.p,{children:"Freezing a component prevents that component and all upstream components from re-running, and it preserves the last output state for those components.\nAny future flow runs use the preserved output."}),"\n",(0,s.jsxs)(n.p,{children:["To freeze a component, click the component in the workspace to expose the component's header menu, click ",(0,s.jsx)(l.A,{name:"Ellipsis","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Show More"}),", and then select ",(0,s.jsx)(n.strong,{children:"Freeze"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"component-ports",children:"Component ports"}),"\n",(0,s.jsxs)(n.p,{children:["Around the border of each component, there are circular port icons like ",(0,s.jsx)(l.A,{name:"Circle",size:"16","aria-label":"Indigo message port",style:{color:"#4f46e5",fill:"#4f46e5"}}),".\nThese indicate a component ",(0,s.jsx)(n.em,{children:"connection point"})," or ",(0,s.jsx)(n.em,{children:"port"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["Ports either accept input or produce output of a specific data type.\nYou can infer the data type from the field the port is attached to or from the ",(0,s.jsx)(n.a,{href:"#port-colors",children:"port's color"}),".\nFor example, the ",(0,s.jsx)(n.strong,{children:"System Message"})," field accepts ",(0,s.jsx)(n.a,{href:"/data-types#message",children:"message data"}),", as illustrated by the blue port icon: ",(0,s.jsx)(l.A,{name:"Circle",size:"16","aria-label":"Indigo message port",style:{color:"#4f46e5",fill:"#4f46e5"}}),"."]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"Prompt Template component with multiple inputs",src:o(27389).A+"",width:"2600",height:"3020"})}),"\n",(0,s.jsxs)(n.p,{children:["When building flows, connect output ports to input ports of the same type (color) to transfer that type of data between two components.\nFor information about the programmatic representation of each data type, see ",(0,s.jsx)(n.a,{href:"/data-types",children:"Langflow data types"}),"."]}),"\n",(0,s.jsx)(n.admonition,{type:"tip",children:(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["In the workspace, hover over a port to see connection details for that port.\nClick a port to ",(0,s.jsx)(l.A,{name:"Search","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Search"})," for compatible components."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["If two components have incompatible data types, you can use a processing component like the ",(0,s.jsxs)(n.a,{href:"/components-processing#type-convert",children:[(0,s.jsx)(n.strong,{children:"Type Convert"})," component"]})," to convert the data between components."]}),"\n"]}),"\n"]})}),"\n",(0,s.jsx)(n.h3,{id:"dynamic-ports",children:"Dynamic ports"}),"\n",(0,s.jsxs)(n.p,{children:["Some components have ports that are dynamically added or removed.\nFor example, the ",(0,s.jsx)(n.strong,{children:"Prompt Template"})," component accepts ",(0,s.jsx)(n.a,{href:"/components-prompts#define-variables-in-prompts",children:"inputs wrapped in curly braces"}),", and new ports are opened when a value wrapped in curly braces is detected in the ",(0,s.jsx)(n.strong,{children:"Template"})," field."]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"Prompt Template component with multiple inputs",src:o(17901).A+"",width:"2104",height:"2928"})}),"\n",(0,s.jsx)(n.h3,{id:"output-type-selection",children:"Output type selection"}),"\n",(0,s.jsx)(n.p,{children:"All components produce output that is either sent to another component in the flow or returned as the final flow result."}),"\n",(0,s.jsx)(n.p,{children:"Some components can produce multiple types of output:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["If the component emits all types at once, the component has multiple output ports in the visual editor. In component code, this is represented by ",(0,s.jsx)(n.code,{children:"group_outputs=True"})]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["If the component emits only one type, you must select the output type by clicking the output label near the output port, and then selecting the desired output type. In component code, this is represented by ",(0,s.jsx)(n.code,{children:"group_outputs=False"})," or omitting the ",(0,s.jsx)(n.code,{children:"group_outputs"})," parameter."]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["For example, a language model component can output ",(0,s.jsx)(n.em,{children:"either"})," a ",(0,s.jsx)(n.strong,{children:"Model Response"})," or ",(0,s.jsx)(n.strong,{children:"Language Model"}),".\nThe ",(0,s.jsx)(n.strong,{children:"Model Response"})," output produces ",(0,s.jsx)(n.a,{href:"/data-types#message",children:(0,s.jsx)(n.code,{children:"Message"})})," data that can be passed to another component's ",(0,s.jsx)(n.code,{children:"Message"})," port.\nThe ",(0,s.jsx)(n.strong,{children:"Language Model"})," output must be connected to a component with a ",(0,s.jsx)(n.strong,{children:"Language Model"})," input, such as the ",(0,s.jsxs)(n.a,{href:"/components-processing#structured-output",children:[(0,s.jsx)(n.strong,{children:"Structured Output"})," component"]}),", that uses the attached LLM to power the receiving component's reasoning."]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"Output type selection in the Language Model component",src:o(64599).A+"",width:"280",height:"446"})}),"\n",(0,s.jsx)(n.h3,{id:"port-colors",children:"Port colors"}),"\n",(0,s.jsxs)(n.p,{children:["Component port colors indicate the data type ingested or emitted by the port.\nFor example, a ",(0,s.jsx)(n.strong,{children:"Message"})," port either accepts or emits ",(0,s.jsx)(n.code,{children:"Message"})," data."]}),"\n",(0,s.jsx)(n.p,{children:"The following table lists the component data types and their corresponding port colors:"}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Data type"}),(0,s.jsx)(n.th,{children:"Port color"}),(0,s.jsx)(n.th,{children:"Port icon example"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Data"}),(0,s.jsx)(n.td,{children:"Red"}),(0,s.jsx)(n.td,{children:(0,s.jsx)(l.A,{name:"Circle",size:"16","aria-label":"Red data port",style:{color:"#dc2626",fill:"#dc2626"}})})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"DataFrame"}),(0,s.jsx)(n.td,{children:"Pink"}),(0,s.jsx)(n.td,{children:(0,s.jsx)(l.A,{name:"Circle",size:"16","aria-label":"Pink dataframe port",style:{color:"#ec4899",fill:"#ec4899"}})})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Embeddings"}),(0,s.jsx)(n.td,{children:"Emerald"}),(0,s.jsx)(n.td,{children:(0,s.jsx)(l.A,{name:"Circle",size:"16","aria-label":"Emerald embeddings port",style:{color:"#10b981",fill:"#10b981"}})})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"LanguageModel"}),(0,s.jsx)(n.td,{children:"Fuchsia"}),(0,s.jsx)(n.td,{children:(0,s.jsx)(l.A,{name:"Circle",size:"16","aria-label":"Fuchsia language model port",style:{color:"#c026d3",fill:"#c026d3"}})})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Memory"}),(0,s.jsx)(n.td,{children:"Orange"}),(0,s.jsx)(n.td,{children:(0,s.jsx)(l.A,{name:"Circle",size:"16","aria-label":"Orange memory port",style:{color:"#f97316",fill:"#f97316"}})})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Message"}),(0,s.jsx)(n.td,{children:"Indigo"}),(0,s.jsx)(n.td,{children:(0,s.jsx)(l.A,{name:"Circle",size:"16","aria-label":"Indigo message port",style:{color:"#4f46e5",fill:"#4f46e5"}})})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Tool"}),(0,s.jsx)(n.td,{children:"Cyan"}),(0,s.jsx)(n.td,{children:(0,s.jsx)(l.A,{name:"Circle",size:"16","aria-label":"Cyan tool port",style:{color:"#06b6d4",fill:"#06b6d4"}})})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Unknown or multiple types"}),(0,s.jsx)(n.td,{children:"Gray"}),(0,s.jsx)(n.td,{children:(0,s.jsx)(l.A,{name:"Circle",size:"16","aria-label":"Gray unknown port",style:{color:"#9CA3AF",fill:"#9CA3AF"}})})]})]})]}),"\n",(0,s.jsx)(n.h2,{id:"component-code",children:"Component code"}),"\n",(0,s.jsxs)(n.p,{children:["You can edit components in the ",(0,s.jsx)(n.a,{href:"/concepts-overview#workspace",children:"workspace"})," and in code. When editing a flow, select a component, and then click ",(0,s.jsx)(l.A,{name:"Code","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Code"})," to see and edit the component's underlying Python code."]}),"\n",(0,s.jsx)(n.p,{children:"All components have underlying code that determines how you configure them and what actions they can perform.\nIn the context of creating and running flows, component code does the following:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Determines what configuration options to show in the visual editor."}),"\n",(0,s.jsx)(n.li,{children:"Validates inputs based on the component's defined input types."}),"\n",(0,s.jsx)(n.li,{children:"Processes data using the configured parameters, methods, and functions."}),"\n",(0,s.jsx)(n.li,{children:"Passes results to the next component in the flow."}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["All components inherit from a base ",(0,s.jsx)(n.code,{children:"Component"})," class that defines the component's interface and behavior.\nFor example, the ",(0,s.jsxs)(n.a,{href:"https://github.com/langflow-ai/langflow/blob/main/src/backend/base/langflow/components/langchain_utilities/recursive_character.py",children:[(0,s.jsx)(n.strong,{children:"Recursive Character Text Splitter"})," component"]})," is a child of the ",(0,s.jsx)(n.a,{href:"https://github.com/langflow-ai/langflow/blob/main/src/backend/base/langflow/base/textsplitters/model.py",children:(0,s.jsx)(n.code,{children:"LCTextSplitterComponent"})})," class."]}),"\n",(0,s.jsxs)(n.p,{children:["Each component's code includes definitions for inputs and outputs, which are represented in the workspace as ",(0,s.jsx)(n.a,{href:"#component-ports",children:"component ports"}),".\nFor example, the ",(0,s.jsx)(n.code,{children:"RecursiveCharacterTextSplitter"})," has four inputs. Each input definition specifies the input type, such as ",(0,s.jsx)(n.code,{children:"IntInput"}),", as well as the encoded name, display name, description, and other parameters for that specific input.\nThese values determine the component settings, such as display names and tooltips in the visual editor."]}),"\n",(0,s.jsx)(h.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:" inputs ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" [",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" IntInput(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"chunk_size"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Chunk Size"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" info",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"The maximum length of each chunk."',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" value",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"1000",props:{style:{color:"#79C0FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" IntInput(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"chunk_overlap"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Chunk Overlap"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" info",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"The amount of overlap between chunks."',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" value",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"200",props:{style:{color:"#79C0FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" DataInput(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"data_input"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Input"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" info",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"The texts to split."',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" input_types",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"[",props:{style:{color:"#C9D1D9"}}},{content:'"Document"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"Data"',props:{style:{color:"#A5D6FF"}}},{content:"],",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" MessageTextInput(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"separators"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Separators"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" info",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"'The characters to split on.",props:{style:{color:"#A5D6FF"}}},{content:"\\n",props:{style:{color:"#79C0FF"}}},{content:'If left empty defaults to ["',props:{style:{color:"#A5D6FF"}}},{content:"\\\\",props:{style:{color:"#79C0FF"}}},{content:"n",props:{style:{color:"#A5D6FF"}}},{content:"\\\\",props:{style:{color:"#79C0FF"}}},{content:'n", "',props:{style:{color:"#A5D6FF"}}},{content:"\\\\",props:{style:{color:"#79C0FF"}}},{content:'n", " ", ""].\'',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" is_list",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"True",props:{style:{color:"#79C0FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ]",props:{style:{color:"#C9D1D9"}}}]}],lang:"python"},annotations:[]}]}),"\n",(0,s.jsxs)(n.p,{children:["Additionally, components have methods or functions that handle their functionality.\nFor example, the ",(0,s.jsx)(n.code,{children:"RecursiveCharacterTextSplitter"})," has two methods:"]}),"\n",(0,s.jsx)(h.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:" def ",props:{style:{color:"#FF7B72"}}},{content:"get_data_input",props:{style:{color:"#D2A8FF"}}},{content:"(self) -> Any:",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" return ",props:{style:{color:"#FF7B72"}}},{content:"self",props:{style:{color:"#79C0FF"}}},{content:".data_input",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" def ",props:{style:{color:"#FF7B72"}}},{content:"build_text_splitter",props:{style:{color:"#D2A8FF"}}},{content:"(self) -> TextSplitter:",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" if not ",props:{style:{color:"#FF7B72"}}},{content:"self",props:{style:{color:"#79C0FF"}}},{content:".separators:",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" separators: list[",props:{style:{color:"#C9D1D9"}}},{content:"str",props:{style:{color:"#79C0FF"}}},{content:"] ",props:{style:{color:"#C9D1D9"}}},{content:"| ",props:{style:{color:"#FF7B72"}}},{content:"None ",props:{style:{color:"#79C0FF"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:"None",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" else",props:{style:{color:"#FF7B72"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" # check if the separators list has escaped characters",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:" # if there are escaped characters, unescape them",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:" separators ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" [unescape_string(x) ",props:{style:{color:"#C9D1D9"}}},{content:"for",props:{style:{color:"#FF7B72"}}},{content:" x ",props:{style:{color:"#C9D1D9"}}},{content:"in ",props:{style:{color:"#FF7B72"}}},{content:"self",props:{style:{color:"#79C0FF"}}},{content:".separators]",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" return",props:{style:{color:"#FF7B72"}}},{content:" RecursiveCharacterTextSplitter(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" separators",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"separators,",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" chunk_size",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"self",props:{style:{color:"#79C0FF"}}},{content:".chunk_size,",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" chunk_overlap",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"self",props:{style:{color:"#79C0FF"}}},{content:".chunk_overlap,",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" )",props:{style:{color:"#C9D1D9"}}}]}],lang:"python"},annotations:[]}]}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.code,{children:"get_data_input"})," method retrieves the text to be split from the component's input, which makes the data available to the class.\nThe ",(0,s.jsx)(n.code,{children:"build_text_splitter"})," method creates a ",(0,s.jsx)(n.code,{children:"RecursiveCharacterTextSplitter"})," object by calling its parent class's ",(0,s.jsx)(n.code,{children:"build"})," method. Then, the text is split with the created splitter and passed to the next component."]}),"\n",(0,s.jsx)(n.h2,{id:"component-versions",children:"Component versions"}),"\n",(0,s.jsx)(n.p,{children:"Component versions and states are stored in an internal Langflow database. When you add a component to a flow, you create a detached copy of the component based on the information in the Langflow database.\nThese copies are detached from the primary Langflow database, and they don't synchronize with any updates that can occur when you upgrade your Langflow version."}),"\n",(0,s.jsxs)(n.p,{children:["In other words, an individual instance of a component retains the version number and state from the moment you add it to a specific flow. For example, if a component is at version 1.0 when you add it to a flow, it remains at version 1.0 ",(0,s.jsx)(n.em,{children:"in that flow"})," unless you update it."]}),"\n",(0,s.jsx)(n.h3,{id:"update-component-versions",children:"Update component versions"}),"\n",(0,s.jsx)(n.p,{children:"When editing a flow in the workspace, Langflow notifies you if a component's workspace version is behind the database version so you can update the component's workspace version:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Update ready"}),": This notification means the component update contains no breaking changes."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Update available"}),": This notification means the component update might contain breaking changes."]}),"\n",(0,s.jsx)(n.p,{children:"Breaking changes modify component inputs and outputs, causing the components to be disconnected and break the flow. After updating the component, you might need to edit the component settings or reconnect component ports."}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:"There are two ways to update components:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Click ",(0,s.jsx)(n.strong,{children:"Update"})," to update a single component. This is recommended for updates without breaking changes."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Click ",(0,s.jsx)(n.strong,{children:"Review"})," to view all available updates and create a snapshot before updating. This is recommended for updates with breaking changes."]}),"\n",(0,s.jsxs)(n.p,{children:["To save a snapshot of your flow before updating the components, enable ",(0,s.jsx)(n.strong,{children:"Create backup flow before updating"}),". Backup flows are stored in the same project folder as the original flow with the suffix ",(0,s.jsx)(n.code,{children:"(backup)"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["To update specific components, select the components you want to update, and then click ",(0,s.jsx)(n.strong,{children:"Update Components"}),"."]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:"Components are updated to the latest available version, based on the version of Langflow you are running."}),"\n",(0,s.jsx)(n.h2,{id:"group-components",children:"Group components"}),"\n",(0,s.jsxs)(n.p,{children:["Multiple components can be grouped into a single component for reuse. This is useful for organizing large flows by combining related components together, such as a RAG ",(0,s.jsx)(n.strong,{children:"Agent"})," component and it's associated tools or vector store components."]}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Hold ",(0,s.jsx)("kbd",{children:"Shift"}),", and then click and drag to highlight all components you want to merge. Components must be completely within the selection area to be merged."]}),"\n",(0,s.jsxs)(n.p,{children:["Alternatively, to select components for merging one by one, hold ",(0,s.jsx)("kbd",{children:"Ctrl"})," on Windows or ",(0,s.jsx)("kbd",{children:"Cmd"})," on Mac, and then click each component to add them to the group."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Release the mouse and keyboard, and then click ",(0,s.jsx)(n.strong,{children:"Group"})," to merge the components into a single, group component."]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:"Grouped components are configured and managed as a single component, including the component name, code, and settings."}),"\n",(0,s.jsxs)(n.p,{children:["To ungroup the components, click the component in the workspace to expose the component's header menu, click ",(0,s.jsx)(l.A,{name:"Ellipsis","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Show More"}),", and then select ",(0,s.jsx)(n.strong,{children:"Ungroup"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["If you want to reuse this grouping in other flows, click the component in the workspace to expose the component's header menu, click ",(0,s.jsx)(l.A,{name:"Ellipsis","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Show More"}),", and then select ",(0,s.jsx)(n.strong,{children:"Save"})," to save the component to the ",(0,s.jsx)(l.A,{name:"Component","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Core components"})," menu as a custom component."]}),"\n",(0,s.jsx)(n.h2,{id:"legacy-components",children:"Legacy components"}),"\n","\n",(0,s.jsx)(i.Ay,{})]})}function x(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(g,{...e})}):g(e)}function y(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}},36813:(e,n,o)=>{o.d(n,{Ay:()=>i,RM:()=>c});var t=o(74848),s=o(28453),r=o(17886);const c=[];function l(e){const n={a:"a",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(n.p,{children:["Legacy components are longer supported and can be removed in a future release.\nYou can continue to use them in existing flows, but it is recommended that you replace them with supported components as soon as possible.\nSuggested replacements are included in the ",(0,t.jsx)(n.strong,{children:"Legacy"})," banner on components in your flows.\nThey are also given in release notes and Langflow documentation whenever possible."]}),"\n",(0,t.jsxs)(n.p,{children:["If you aren't sure how to replace a legacy component, ",(0,t.jsx)(r.A,{name:"Search","aria-hidden":"true"})," ",(0,t.jsx)(n.strong,{children:"Search"})," for components by provider, service, or component name.\nThe component may have been deprecated in favor of a completely new component, a similar component, or a new version of the same component in a different category."]}),"\n",(0,t.jsxs)(n.p,{children:["If there is no obvious replacement, consider whether another component can be adapted to your use case.\nFor example, many ",(0,t.jsx)(r.A,{name:"Component","aria-hidden":"true"})," ",(0,t.jsx)(n.strong,{children:"Core components"})," provide generic functionality that can support multiple providers and use cases, such as the ",(0,t.jsxs)(n.a,{href:"/components-data#api-request",children:[(0,t.jsx)(n.strong,{children:"API Request"})," component"]}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["If neither of these options are viable, you could use the legacy component's code to create your own custom component, or ",(0,t.jsx)(n.a,{href:"/contributing-github-issues",children:"start a discussion"})," about the legacy component."]}),"\n",(0,t.jsxs)(n.p,{children:["To discourage use of legacy components in new flows, these components are hidden by default.\nIn the visual editor, you can click ",(0,t.jsx)(r.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,t.jsx)(n.strong,{children:"Component settings"})," to toggle the ",(0,t.jsx)(n.strong,{children:"Legacy"})," filter."]})]})}function i(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(l,{...e})}):l(e)}},58876:(e,n,o)=>{o.d(n,{A:()=>t});const t=o.p+"assets/images/agent-component-4c496697124cfebd3883ee9ade19ca5c.png"},64599:(e,n,o)=>{o.d(n,{A:()=>t});const t=o.p+"assets/images/select-output-f7d64629d278098e3fba32fe79f79ed6.png"}}]); \ No newline at end of file diff --git a/assets/js/7819cc1c.2eef9d55.js b/assets/js/7819cc1c.2eef9d55.js deleted file mode 100644 index 678a672798..0000000000 --- a/assets/js/7819cc1c.2eef9d55.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[6006],{9898:(e,t,n)=>{n.d(t,{A:()=>s});const s=n.p+"assets/images/component-llm-router-1b417082a0208a70065bc177a78fab67.png"},11470:(e,t,n)=>{n.d(t,{A:()=>v});var s=n(96540),r=n(18215),o=n(23104),a=n(56347),i=n(205),c=n(57485),l=n(31682),d=n(70679);function h(e){return s.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,s.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function p(e){const{values:t,children:n}=e;return(0,s.useMemo)(()=>{const e=t??function(e){return h(e).map(({props:{value:e,label:t,attributes:n,default:s}})=>({value:e,label:t,attributes:n,default:s}))}(n);return function(e){const t=(0,l.XI)(e,(e,t)=>e.value===t.value);if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map(e=>e.value).join(", ")}" found in . Every value needs to be unique.`)}(e),e},[t,n])}function u({value:e,tabValues:t}){return t.some(t=>t.value===e)}function x({queryString:e=!1,groupId:t}){const n=(0,a.W6)(),r=function({queryString:e=!1,groupId:t}){if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!t)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:e,groupId:t});return[(0,c.aZ)(r),(0,s.useCallback)(e=>{if(!r)return;const t=new URLSearchParams(n.location.search);t.set(r,e),n.replace({...n.location,search:t.toString()})},[r,n])]}function m(e){const{defaultValue:t,queryString:n=!1,groupId:r}=e,o=p(e),[a,c]=(0,s.useState)(()=>function({defaultValue:e,tabValues:t}){if(0===t.length)throw new Error("Docusaurus error: the component requires at least one children component");if(e){if(!u({value:e,tabValues:t}))throw new Error(`Docusaurus error: The has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${t.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}const n=t.find(e=>e.default)??t[0];if(!n)throw new Error("Unexpected error: 0 tabValues");return n.value}({defaultValue:t,tabValues:o})),[l,h]=x({queryString:n,groupId:r}),[m,j]=function({groupId:e}){const t=function(e){return e?`docusaurus.tab.${e}`:null}(e),[n,r]=(0,d.Dv)(t);return[n,(0,s.useCallback)(e=>{t&&r.set(e)},[t,r])]}({groupId:r}),g=(()=>{const e=l??m;return u({value:e,tabValues:o})?e:null})();(0,i.A)(()=>{g&&c(g)},[g]);return{selectedValue:a,selectValue:(0,s.useCallback)(e=>{if(!u({value:e,tabValues:o}))throw new Error(`Can't select invalid tab value=${e}`);c(e),h(e),j(e)},[h,j,o]),tabValues:o}}var j=n(92303);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=n(74848);function y({className:e,block:t,selectedValue:n,selectValue:s,tabValues:a}){const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,o.a_)(),l=e=>{const t=e.currentTarget,r=i.indexOf(t),o=a[r].value;o!==n&&(c(t),s(o))},d=e=>{let t=null;switch(e.key){case"Enter":l(e);break;case"ArrowRight":{const n=i.indexOf(e.currentTarget)+1;t=i[n]??i[0];break}case"ArrowLeft":{const n=i.indexOf(e.currentTarget)-1;t=i[n]??i[i.length-1];break}}t?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.A)("tabs",{"tabs--block":t},e),children:a.map(({value:e,label:t,attributes:s})=>(0,f.jsx)("li",{role:"tab",tabIndex:n===e?0:-1,"aria-selected":n===e,ref:e=>{i.push(e)},onKeyDown:d,onClick:l,...s,className:(0,r.A)("tabs__item",g.tabItem,s?.className,{"tabs__item--active":n===e}),children:t??e},e))})}function b({lazy:e,children:t,selectedValue:n}){const o=(Array.isArray(t)?t:[t]).filter(Boolean);if(e){const e=o.find(e=>e.props.value===n);return e?(0,s.cloneElement)(e,{className:(0,r.A)("margin-top--md",e.props.className)}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:o.map((e,t)=>(0,s.cloneElement)(e,{key:t,hidden:e.props.value!==n}))})}function D(e){const t=m(e);return(0,f.jsxs)("div",{className:(0,r.A)("tabs-container",g.tabList),children:[(0,f.jsx)(y,{...t,...e}),(0,f.jsx)(b,{...t,...e})]})}function v(e){const t=(0,j.A)();return(0,f.jsx)(D,{...e,children:h(e.children)},String(t))}},13533:(e,t,n)=>{n.d(t,{A:()=>s});const s=n.p+"assets/images/component-dataframe-operations-031488ccf4e3d3378f8842f0ea10682c.png"},17886:(e,t,n)=>{n.d(t,{A:()=>o});n(96540);var s=n(64058),r=n(74848);function o({name:e,...t}){const n=s[e];return n?(0,r.jsx)(n,{...t}):null}},19365:(e,t,n)=>{n.d(t,{A:()=>a});n(96540);var s=n(18215);const r={tabItem:"tabItem_Ymn6"};var o=n(74848);function a({children:e,hidden:t,className:n}){return(0,o.jsx)("div",{role:"tabpanel",className:(0,s.A)(r.tabItem,n),hidden:t,children:e})}},31929:(e,t,n)=>{n.d(t,{Ay:()=>c,RM:()=>a});var s=n(74848),r=n(28453),o=n(17886);const a=[];function i(e){const t={a:"a",p:"p",strong:"strong",...(0,r.R)(),...e.components};return(0,s.jsxs)(t.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,s.jsx)(o.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,s.jsx)(t.strong,{children:"Controls"})," in the ",(0,s.jsx)(t.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function c(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(i,{...e})}):i(e)}},36813:(e,t,n)=>{n.d(t,{Ay:()=>c,RM:()=>a});var s=n(74848),r=n(28453),o=n(17886);const a=[];function i(e){const t={a:"a",p:"p",strong:"strong",...(0,r.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(t.p,{children:["Legacy components are longer supported and can be removed in a future release.\nYou can continue to use them in existing flows, but it is recommended that you replace them with supported components as soon as possible.\nSuggested replacements are included in the ",(0,s.jsx)(t.strong,{children:"Legacy"})," banner on components in your flows.\nThey are also given in release notes and Langflow documentation whenever possible."]}),"\n",(0,s.jsxs)(t.p,{children:["If you aren't sure how to replace a legacy component, ",(0,s.jsx)(o.A,{name:"Search","aria-hidden":"true"})," ",(0,s.jsx)(t.strong,{children:"Search"})," for components by provider, service, or component name.\nThe component may have been deprecated in favor of a completely new component, a similar component, or a new version of the same component in a different category."]}),"\n",(0,s.jsxs)(t.p,{children:["If there is no obvious replacement, consider whether another component can be adapted to your use case.\nFor example, many ",(0,s.jsx)(o.A,{name:"Component","aria-hidden":"true"})," ",(0,s.jsx)(t.strong,{children:"Core components"})," provide generic functionality that can support multiple providers and use cases, such as the ",(0,s.jsxs)(t.a,{href:"/components-data#api-request",children:[(0,s.jsx)(t.strong,{children:"API Request"})," component"]}),"."]}),"\n",(0,s.jsxs)(t.p,{children:["If neither of these options are viable, you could use the legacy component's code to create your own custom component, or ",(0,s.jsx)(t.a,{href:"/contributing-github-issues",children:"start a discussion"})," about the legacy component."]}),"\n",(0,s.jsxs)(t.p,{children:["To discourage use of legacy components in new flows, these components are hidden by default.\nIn the visual editor, you can click ",(0,s.jsx)(o.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,s.jsx)(t.strong,{children:"Component settings"})," to toggle the ",(0,s.jsx)(t.strong,{children:"Legacy"})," filter."]})]})}function c(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(i,{...e})}):i(e)}},40966:(e,t,n)=>{n.r(t),n.d(t,{CH:()=>m,assets:()=>x,chCodeConfig:()=>j,contentTitle:()=>u,default:()=>y,frontMatter:()=>p,metadata:()=>s,toc:()=>g});const s=JSON.parse('{"id":"Components/components-processing","title":"Processing components","description":"Processing components process and transform data within a flow.","source":"@site/docs/Components/components-processing.mdx","sourceDirName":"Components","slug":"/components-processing","permalink":"/components-processing","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Processing components","slug":"/components-processing"},"sidebar":"docs","previous":{"title":"Data","permalink":"/components-data"},"next":{"title":"Prompt Template","permalink":"/components-prompts"}}');var r=n(74848),o=n(28453),a=n(24754),i=n(17886),c=n(11470),l=n(19365),d=n(31929),h=n(36813);const p={title:"Processing components",slug:"/components-processing"},u=void 0,x={},m={annotations:a.hk,Code:a.Cy},j={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},g=[{value:"Prompt Template",id:"prompt-template",level:2},{value:"Batch Run",id:"batch-run",level:2},{value:"Use the Batch Run component in a flow",id:"use-the-batch-run-component-in-a-flow",level:3},{value:"Batch Run parameters",id:"batch-run-parameters",level:3},...d.RM,{value:"Data Operations",id:"data-operations",level:2},{value:"Use the Data Operations component in a flow",id:"use-the-data-operations-component-in-a-flow",level:3},{value:"Data Operations parameters",id:"data-operations-parameters",level:3},{value:"Available data operations",id:"available-data-operations",level:4},{value:"DataFrame Operations",id:"dataframe-operations",level:2},{value:"Use the DataFrame Operations component in a flow",id:"use-the-dataframe-operations-component-in-a-flow",level:3},{value:"DataFrame Operations parameters",id:"dataframe-operations-parameters",level:3},{value:"LLM Router",id:"llm-router",level:2},{value:"LLM Router parameters",id:"llm-router-parameters",level:3},...d.RM,{value:"LLM Router outputs",id:"llm-router-outputs",level:3},{value:"Parser",id:"parser",level:2},{value:"Parsing modes",id:"parsing-modes",level:3},...d.RM,...d.RM,{value:"Test and troubleshoot parsed text",id:"test-and-troubleshoot-parsed-text",level:3},{value:"Python Interpreter",id:"python-interpreter",level:2},{value:"Use the Python Interpreter in a flow",id:"use-the-python-interpreter-in-a-flow",level:3},{value:"Python Interpreter parameters",id:"python-interpreter-parameters",level:3},{value:"Save File",id:"save-file",level:2},{value:"Smart Function",id:"smart-function",level:2},{value:"Smart Function parameters",id:"smart-function-parameters",level:3},...d.RM,{value:"Split Text",id:"split-text",level:2},{value:"Split Text parameters",id:"split-text-parameters",level:3},...d.RM,{value:"Tokenization errors due to chunk size",id:"chunk-size",level:3},{value:"Other text splitters",id:"other-text-splitters",level:3},{value:"Structured Output",id:"structured-output",level:2},{value:"Use the Structured Output component in a flow",id:"use-the-structured-output-component-in-a-flow",level:3},{value:"Structured Output parameters",id:"structured-output-parameters",level:3},...d.RM,{value:"Output Schema options",id:"output-schema-options",level:4},{value:"Type Convert",id:"type-convert",level:2},{value:"Use the Type Convert component in a flow",id:"use-the-type-convert-component-in-a-flow",level:3},{value:"Type Convert parameters",id:"type-convert-parameters",level:3},{value:"Legacy Processing components",id:"legacy-processing-components",level:2},...h.RM];function f(e){const t={a:"a",admonition:"admonition",code:"code",em:"em",h2:"h2",h3:"h3",h4:"h4",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,o.R)(),...e.components},{Details:s}=t;return m||b("CH",!1),m.Code||b("CH.Code",!0),s||b("Details",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n","\n",(0,r.jsx)(t.p,{children:"Processing components process and transform data within a flow.\nThey have many uses, including:"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:["Feed instructions and context to your LLMs and agents with the ",(0,r.jsxs)(t.a,{href:"#prompt-template",children:[(0,r.jsx)(t.strong,{children:"Prompt Template"})," component"]}),"."]}),"\n",(0,r.jsxs)(t.li,{children:["Extract content from larger chunks of data with a ",(0,r.jsxs)(t.a,{href:"#parser",children:[(0,r.jsx)(t.strong,{children:"Parser"})," component"]}),"."]}),"\n",(0,r.jsxs)(t.li,{children:["Filter data with natural language with the ",(0,r.jsxs)(t.a,{href:"#smart-function",children:[(0,r.jsx)(t.strong,{children:"Smart Function"})," component"]}),"."]}),"\n",(0,r.jsxs)(t.li,{children:["Save data to your local machine with the ",(0,r.jsxs)(t.a,{href:"#save-file",children:[(0,r.jsx)(t.strong,{children:"Save File"})," component"]}),"."]}),"\n",(0,r.jsxs)(t.li,{children:["Transform data into a different data type with the ",(0,r.jsxs)(t.a,{href:"#type-convert",children:[(0,r.jsx)(t.strong,{children:"Type Convert"})," component"]})," to pass it between incompatible components."]}),"\n"]}),"\n",(0,r.jsx)(t.h2,{id:"prompt-template",children:"Prompt Template"}),"\n",(0,r.jsxs)(t.p,{children:["See ",(0,r.jsxs)(t.a,{href:"/components-prompts",children:[(0,r.jsx)(t.strong,{children:"Prompt Template"})," component"]}),"."]}),"\n",(0,r.jsx)(t.h2,{id:"batch-run",children:"Batch Run"}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Batch Run"})," component runs a language model over ",(0,r.jsx)(t.em,{children:"each row of one text column"})," in a ",(0,r.jsx)(t.a,{href:"/data-types#dataframe",children:(0,r.jsx)(t.code,{children:"DataFrame"})}),", and then returns a new ",(0,r.jsx)(t.code,{children:"DataFrame"})," with the original text and an LLM response.\nThe output contains the following columns:"]}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.code,{children:"text_input"}),": The original text from the input ",(0,r.jsx)(t.code,{children:"DataFrame"})]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.code,{children:"model_response"}),": The model's response for each input"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.code,{children:"batch_index"}),": The 0-indexed processing order for all rows in the ",(0,r.jsx)(t.code,{children:"DataFrame"})]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.code,{children:"metadata"})," (optional): Additional information about the processing"]}),"\n"]}),"\n",(0,r.jsx)(t.h3,{id:"use-the-batch-run-component-in-a-flow",children:"Use the Batch Run component in a flow"}),"\n",(0,r.jsxs)(t.p,{children:["If you pass the ",(0,r.jsx)(t.strong,{children:"Batch Run"})," output to a ",(0,r.jsxs)(t.a,{href:"/components-processing#parser",children:[(0,r.jsx)(t.strong,{children:"Parser"})," component"]}),", you can use variables in the parsing template to reference these keys, such as ",(0,r.jsx)(t.code,{children:"{text_input}"})," and ",(0,r.jsx)(t.code,{children:"{model_response}"}),".\nThis is demonstrated in the following example."]}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.img,{alt:"A batch run component connected to OpenAI and a Parser",src:n(88103).A+"",width:"4000",height:"2728"})}),"\n",(0,r.jsxs)(t.ol,{children:["\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Connect any language model component to a ",(0,r.jsx)(t.strong,{children:"Batch Run"})," component's ",(0,r.jsx)(t.strong,{children:"Language model"})," port."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Connect ",(0,r.jsx)(t.code,{children:"DataFrame"})," output from another component to the ",(0,r.jsx)(t.strong,{children:"Batch Run"})," component's ",(0,r.jsx)(t.strong,{children:"DataFrame"})," input.\nFor example, you could connect a ",(0,r.jsx)(t.strong,{children:"File"})," component with a CSV file."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["In the ",(0,r.jsx)(t.strong,{children:"Batch Run"})," component's ",(0,r.jsx)(t.strong,{children:"Column Name"})," field, enter the name of the column in the incoming ",(0,r.jsx)(t.code,{children:"DataFrame"})," that contains the text to process.\nFor example, if you want to extract text from a ",(0,r.jsx)(t.code,{children:"name"})," column in a CSV file, enter ",(0,r.jsx)(t.code,{children:"name"})," in the ",(0,r.jsx)(t.strong,{children:"Column Name"})," field."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Connect the ",(0,r.jsx)(t.strong,{children:"Batch Run"})," component's ",(0,r.jsx)(t.strong,{children:"Batch Results"})," output to a ",(0,r.jsx)(t.strong,{children:"Parser"})," component's ",(0,r.jsx)(t.strong,{children:"DataFrame"})," input."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Optional: In the ",(0,r.jsx)(t.strong,{children:"Batch Run"})," ",(0,r.jsx)(t.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),", click ",(0,r.jsx)(i.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Controls"}),", enable the ",(0,r.jsx)(t.strong,{children:"System Message"})," parameter, click ",(0,r.jsx)(t.strong,{children:"Close"}),", and then enter an instruction for how you want the LLM to process each cell extracted from the file.\nFor example, ",(0,r.jsx)(t.code,{children:"Create a business card for each name."})]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["In the ",(0,r.jsx)(t.strong,{children:"Parser"})," component's ",(0,r.jsx)(t.strong,{children:"Template"})," field, enter a template for processing the ",(0,r.jsx)(t.strong,{children:"Batch Run"})," component's new ",(0,r.jsx)(t.code,{children:"DataFrame"})," columns (",(0,r.jsx)(t.code,{children:"text_input"}),", ",(0,r.jsx)(t.code,{children:"model_response"}),", and ",(0,r.jsx)(t.code,{children:"batch_index"}),"):"]}),"\n",(0,r.jsxs)(t.p,{children:["For example, this template uses three columns from the resulting, post-batch ",(0,r.jsx)(t.code,{children:"DataFrame"}),":"]}),"\n",(0,r.jsx)(m.Code,{codeConfig:j,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"record_number: {batch_index}, name: {text_input}, summary: {model_response}",props:{}}]}],lang:"text"},annotations:[]}]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["To test the processing, click the ",(0,r.jsx)(t.strong,{children:"Parser"})," component, click ",(0,r.jsx)(i.A,{name:"Play","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Run component"}),", and then click ",(0,r.jsx)(i.A,{name:"TextSearch","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Inspect output"})," to view the final ",(0,r.jsx)(t.code,{children:"DataFrame"}),"."]}),"\n",(0,r.jsxs)(t.p,{children:["You can also connect a ",(0,r.jsx)(t.strong,{children:"Chat Output"})," component to the ",(0,r.jsx)(t.strong,{children:"Parser"})," component if you want to see the output in the ",(0,r.jsx)(t.strong,{children:"Playground"}),"."]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(t.h3,{id:"batch-run-parameters",children:"Batch Run parameters"}),"\n",(0,r.jsx)(d.Ay,{}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Name"}),(0,r.jsx)(t.th,{children:"Type"}),(0,r.jsx)(t.th,{children:"Description"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"model"}),(0,r.jsx)(t.td,{children:"HandleInput"}),(0,r.jsx)(t.td,{children:"Input parameter. Connect the 'Language Model' output from a language model component. Required."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"system_message"}),(0,r.jsx)(t.td,{children:"MultilineInput"}),(0,r.jsx)(t.td,{children:"Input parameter. A multi-line system instruction for all rows in the DataFrame."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"df"}),(0,r.jsx)(t.td,{children:"DataFrameInput"}),(0,r.jsx)(t.td,{children:"Input parameter. The DataFrame whose column is treated as text messages, as specified by 'column_name'. Required."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"column_name"}),(0,r.jsx)(t.td,{children:"MessageTextInput"}),(0,r.jsx)(t.td,{children:"Input parameter. The name of the DataFrame column to treat as text messages. If empty, all columns are formatted in TOML."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"output_column_name"}),(0,r.jsx)(t.td,{children:"MessageTextInput"}),(0,r.jsxs)(t.td,{children:["Input parameter. Name of the column where the model's response is stored. Default=",(0,r.jsx)(t.code,{children:"model_response"}),"."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"enable_metadata"}),(0,r.jsx)(t.td,{children:"BoolInput"}),(0,r.jsx)(t.td,{children:"Input parameter. If True, add metadata to the output DataFrame."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"batch_results"}),(0,r.jsx)(t.td,{children:"DataFrame"}),(0,r.jsx)(t.td,{children:"Output parameter. A DataFrame with all original columns plus the model's response column."})]})]})]}),"\n",(0,r.jsx)(t.h2,{id:"data-operations",children:"Data Operations"}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Data Operations"})," component performs operations on ",(0,r.jsx)(t.a,{href:"/data-types#data",children:(0,r.jsx)(t.code,{children:"Data"})})," objects, including extracting, filtering, and editing keys and values in the ",(0,r.jsx)(t.code,{children:"Data"}),".\nFor all options, see ",(0,r.jsx)(t.a,{href:"#available-data-operations",children:"Available data operations"}),".\nThe output is a new ",(0,r.jsx)(t.code,{children:"Data"})," object containing the modified data after running the selected operation."]}),"\n",(0,r.jsx)(t.h3,{id:"use-the-data-operations-component-in-a-flow",children:"Use the Data Operations component in a flow"}),"\n",(0,r.jsxs)(t.p,{children:["The following example demonstrates how to use a ",(0,r.jsx)(t.strong,{children:"Data Operations"})," component in a flow using data from a webhook payload:"]}),"\n",(0,r.jsxs)(t.ol,{children:["\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Create a flow with a ",(0,r.jsx)(t.strong,{children:"Webhook"})," component and a ",(0,r.jsx)(t.strong,{children:"Data Operations"})," component, and then connect the ",(0,r.jsx)(t.strong,{children:"Webhook"})," component's output to the ",(0,r.jsx)(t.strong,{children:"Data Operations"})," component's ",(0,r.jsx)(t.strong,{children:"Data"})," input."]}),"\n",(0,r.jsxs)(t.p,{children:["All operations in the ",(0,r.jsx)(t.strong,{children:"Data Operations"})," component require at least one ",(0,r.jsx)(t.code,{children:"Data"})," input from another component.\nIf the preceding component doesn't produce ",(0,r.jsx)(t.code,{children:"Data"})," output, you can use another component, such as the ",(0,r.jsx)(t.strong,{children:"Type Convert"})," component, to reformat the data before passing it to the ",(0,r.jsx)(t.strong,{children:"Data Operations"})," component.\nAlternatively, you could consider using a component that is designed to process the original data type, such as the ",(0,r.jsx)(t.strong,{children:"Parser"})," or ",(0,r.jsx)(t.strong,{children:"DataFrame Operations"})," components."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["In the ",(0,r.jsx)(t.strong,{children:"Operations"})," field, select the operation you want to perform on the incoming ",(0,r.jsx)(t.code,{children:"Data"}),".\nFor this example, select the ",(0,r.jsx)(t.strong,{children:"Select Keys"})," operation."]}),"\n",(0,r.jsx)(t.admonition,{type:"tip",children:(0,r.jsxs)(t.p,{children:["You can select only one operation.\nIf you need to perform multiple operations on the data, you can chain multiple ",(0,r.jsx)(t.strong,{children:"Data Operations"})," components together to execute each operation in sequence.\nFor more complex multi-step operations, consider using a component like the ",(0,r.jsx)(t.strong,{children:"Smart Function"})," component."]})}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Under ",(0,r.jsx)(t.strong,{children:"Select Keys"}),", add keys for ",(0,r.jsx)(t.code,{children:"name"}),", ",(0,r.jsx)(t.code,{children:"username"}),", and ",(0,r.jsx)(t.code,{children:"email"}),".\nClick ",(0,r.jsx)(i.A,{name:"Plus","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Add more"})," to add a field for each key."]}),"\n",(0,r.jsxs)(t.p,{children:["For this example, assume that the webhook will receive consistent payloads that always contain ",(0,r.jsx)(t.code,{children:"name"}),", ",(0,r.jsx)(t.code,{children:"username"}),", and ",(0,r.jsx)(t.code,{children:"email"})," keys.\nThe ",(0,r.jsx)(t.strong,{children:"Select Keys"})," operation extracts the value of these keys from each incoming payload."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Optional: If you want to view the output in the ",(0,r.jsx)(t.strong,{children:"Playground"}),", connect the ",(0,r.jsx)(t.strong,{children:"Data Operations"})," component's output to a ",(0,r.jsx)(t.strong,{children:"Chat Output"})," component."]}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.img,{alt:"A flow with Webhook, Data Operations, and Chat Output components",src:n(46445).A+"",width:"4000",height:"1920"})}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["To test the flow, send the following request to your flow's webhook endpoint.\nFor more information about the webhook endpoint, see ",(0,r.jsx)(t.a,{href:"/webhook",children:"Trigger flows with webhooks"}),"."]}),"\n",(0,r.jsx)(m.Code,{codeConfig:j,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:'POST "http://',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_SERVER_URL",props:{style:{color:"#C9D1D9"}}},{content:"/api/v1/webhook/",props:{style:{color:"#A5D6FF"}}},{content:"$FLOW_ID",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:"-H ",props:{style:{color:"#C9D1D9"}}},{content:'"Content-Type: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:"-H ",props:{style:{color:"#C9D1D9"}}},{content:'"x-api-key: ',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:"-d ",props:{style:{color:"#C9D1D9"}}},{content:"'{",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "id": 1,',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "name": "Leanne Graham",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "username": "Bret",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "email": "Sincere@april.biz",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "address": {',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "street": "Main Street",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "suite": "Apt. 556",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "city": "Springfield",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "zipcode": "92998-3874",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "geo": {',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "lat": "-37.3159",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "lng": "81.1496"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" }",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" },",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "phone": "1-770-736-8031 x56442",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "website": "hildegard.org",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "company": {',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "name": "Acme-Corp",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "catchPhrase": "Multi-layered client-server neural-net",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "bs": "harness real-time e-markets"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" }",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"}'",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["To view the ",(0,r.jsx)(t.code,{children:"Data"})," resulting from the ",(0,r.jsx)(t.strong,{children:"Select Keys"})," operation, do one of the following:"]}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:["If you attached a ",(0,r.jsx)(t.strong,{children:"Chat Output"})," component, open the ",(0,r.jsx)(t.strong,{children:"Playground"})," to see the result as a chat message."]}),"\n",(0,r.jsxs)(t.li,{children:["Click ",(0,r.jsx)(i.A,{name:"TextSearch","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Inspect output"})," on the ",(0,r.jsx)(t.strong,{children:"Data Operations"})," component."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(t.h3,{id:"data-operations-parameters",children:"Data Operations parameters"}),"\n",(0,r.jsxs)(t.p,{children:["Many parameters are conditional based on the selected ",(0,r.jsx)(t.strong,{children:"Operation"})," (",(0,r.jsx)(t.code,{children:"operation"}),")."]}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Name"}),(0,r.jsx)(t.th,{children:"Display Name"}),(0,r.jsx)(t.th,{children:"Info"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"data"}),(0,r.jsx)(t.td,{children:"Data"}),(0,r.jsxs)(t.td,{children:["Input parameter. The ",(0,r.jsx)(t.code,{children:"Data"})," object to operate on."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"operation"}),(0,r.jsx)(t.td,{children:"Operation"}),(0,r.jsxs)(t.td,{children:["Input parameter. The operation to perform on the data. See ",(0,r.jsx)(t.a,{href:"#available-data-operations",children:"Available data operations"})]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"select_keys_input"}),(0,r.jsx)(t.td,{children:"Select Keys"}),(0,r.jsx)(t.td,{children:"Input parameter. A list of keys to select from the data."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"filter_key"}),(0,r.jsx)(t.td,{children:"Filter Key"}),(0,r.jsx)(t.td,{children:"Input parameter. The key to filter by."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"operator"}),(0,r.jsx)(t.td,{children:"Comparison Operator"}),(0,r.jsx)(t.td,{children:"Input parameter. The operator to apply for comparing values."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"filter_values"}),(0,r.jsx)(t.td,{children:"Filter Values"}),(0,r.jsx)(t.td,{children:"Input parameter. A list of values to filter by."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"append_update_data"}),(0,r.jsx)(t.td,{children:"Append or Update"}),(0,r.jsx)(t.td,{children:"Input parameter. The data to append or update the existing data with."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"remove_keys_input"}),(0,r.jsx)(t.td,{children:"Remove Keys"}),(0,r.jsx)(t.td,{children:"Input parameter. A list of keys to remove from the data."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"rename_keys_input"}),(0,r.jsx)(t.td,{children:"Rename Keys"}),(0,r.jsx)(t.td,{children:"Input parameter. A list of keys to rename in the data."})]})]})]}),"\n",(0,r.jsx)(t.h4,{id:"available-data-operations",children:"Available data operations"}),"\n",(0,r.jsxs)(t.p,{children:["Options for the ",(0,r.jsx)(t.code,{children:"operations"})," input parameter are as follows.\nAll operations act on an incoming ",(0,r.jsx)(t.code,{children:"Data"})," object."]}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Name"}),(0,r.jsx)(t.th,{children:"Required Inputs"}),(0,r.jsx)(t.th,{children:"Process"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Select Keys"}),(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"select_keys_input"})}),(0,r.jsx)(t.td,{children:"Selects specific keys from the data."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Literal Eval"}),(0,r.jsx)(t.td,{children:"None"}),(0,r.jsx)(t.td,{children:"Evaluates string values as Python literals."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Combine"}),(0,r.jsx)(t.td,{children:"None"}),(0,r.jsx)(t.td,{children:"Combines multiple data objects into one."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Filter Values"}),(0,r.jsxs)(t.td,{children:[(0,r.jsx)(t.code,{children:"filter_key"}),", ",(0,r.jsx)(t.code,{children:"filter_values"}),", ",(0,r.jsx)(t.code,{children:"operator"})]}),(0,r.jsx)(t.td,{children:"Filters data based on key-value pair."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Append or Update"}),(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"append_update_data"})}),(0,r.jsx)(t.td,{children:"Adds or updates key-value pairs."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Remove Keys"}),(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"remove_keys_input"})}),(0,r.jsx)(t.td,{children:"Removes specified keys from the data."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Rename Keys"}),(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"rename_keys_input"})}),(0,r.jsx)(t.td,{children:"Renames keys in the data."})]})]})]}),"\n",(0,r.jsx)(t.h2,{id:"dataframe-operations",children:"DataFrame Operations"}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"DataFrame Operations"})," component performs operations on ",(0,r.jsx)(t.a,{href:"/data-types#dataframe",children:(0,r.jsx)(t.code,{children:"DataFrame"})})," (table) rows and columns, including schema changes, record changes, sorting, and filtering.\nFor all options, see ",(0,r.jsx)(t.a,{href:"#dataframe-operations-parameters",children:"DataFrame Operations parameters"}),"."]}),"\n",(0,r.jsxs)(t.p,{children:["The output is a new ",(0,r.jsx)(t.code,{children:"DataFrame"})," containing the modified data after running the selected operation."]}),"\n",(0,r.jsx)(t.h3,{id:"use-the-dataframe-operations-component-in-a-flow",children:"Use the DataFrame Operations component in a flow"}),"\n",(0,r.jsxs)(t.p,{children:["The following steps explain how to configure a ",(0,r.jsx)(t.strong,{children:"DataFrame Operations"})," component in a flow.\nYou can follow along with an example or use your own flow.\nThe only requirement is that the preceding component must create ",(0,r.jsx)(t.code,{children:"DataFrame"})," output that you can pass to the ",(0,r.jsx)(t.strong,{children:"DataFrame Operations"})," component."]}),"\n",(0,r.jsxs)(t.ol,{children:["\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsx)(t.p,{children:"Create a new flow or use an existing flow."}),"\n",(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"Example: API response extraction flow"}),(0,r.jsxs)(t.p,{children:["The following example flow uses five components to extract ",(0,r.jsx)(t.code,{children:"Data"})," from an API response, transform it to a ",(0,r.jsx)(t.code,{children:"DataFrame"}),", and then perform further processing on the tabular data using a ",(0,r.jsx)(t.strong,{children:"DataFrame Operations"})," component.\nThe sixth component, ",(0,r.jsx)(t.strong,{children:"Chat Output"}),", is optional in this example.\nIt only serves as a convenient way for you to view the final output in the ",(0,r.jsx)(t.strong,{children:"Playground"}),", rather than inspecting the component logs."]}),(0,r.jsx)(t.p,{children:(0,r.jsx)(t.img,{alt:"A flow that ingests an API response, extracts it to a DataFrame with a Smart Function component, and the processes it through a DataFrame Operations component",src:n(13533).A+"",width:"4000",height:"2120"})}),(0,r.jsxs)(t.p,{children:["If you want to use this example to test the ",(0,r.jsx)(t.strong,{children:"DataFrame Operations"})," component, do the following:"]}),(0,r.jsxs)(t.ol,{children:["\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsx)(t.p,{children:"Create a flow with the following components:"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsx)(t.li,{children:(0,r.jsx)(t.strong,{children:"API Request"})}),"\n",(0,r.jsx)(t.li,{children:(0,r.jsx)(t.strong,{children:"Language Model"})}),"\n",(0,r.jsx)(t.li,{children:(0,r.jsx)(t.strong,{children:"Smart Function"})}),"\n",(0,r.jsx)(t.li,{children:(0,r.jsx)(t.strong,{children:"Type Convert"})}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Configure the ",(0,r.jsxs)(t.a,{href:"#smart-function",children:[(0,r.jsx)(t.strong,{children:"Smart Function"})," component"]})," and its dependencies:"]}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"API Request"}),": Configure the ",(0,r.jsxs)(t.a,{href:"/components-data#api-request",children:[(0,r.jsx)(t.strong,{children:"API Request"})," component"]})," to get JSON data from an endpoint of your choice, and then connect the ",(0,r.jsx)(t.strong,{children:"API Response"})," output to the ",(0,r.jsx)(t.strong,{children:"Smart Function"})," component's ",(0,r.jsx)(t.strong,{children:"Data"})," input."]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"Language Model"}),": Select your preferred provider and model, and then enter a valid API key.\nChange the output to ",(0,r.jsx)(t.strong,{children:"Language Model"}),", and then connect the ",(0,r.jsx)(t.code,{children:"LanguageModel"})," output to the ",(0,r.jsx)(t.strong,{children:"Smart Function"})," component's ",(0,r.jsx)(t.strong,{children:"Language Model"})," input."]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"Smart Function"}),": In the ",(0,r.jsx)(t.strong,{children:"Instructions"})," field, enter natural language instructions to extract data from the API response.\nYour instructions depend on the response content and desired outcome.\nFor example, if the response contains a large ",(0,r.jsx)(t.code,{children:"result"})," field, you might provide instructions like ",(0,r.jsx)(t.code,{children:"explode the result field out into a Data object"}),"."]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Convert the ",(0,r.jsx)(t.strong,{children:"Smart Function"})," component's ",(0,r.jsx)(t.code,{children:"Data"})," output to ",(0,r.jsx)(t.code,{children:"DataFrame"}),":"]}),"\n",(0,r.jsxs)(t.ol,{children:["\n",(0,r.jsxs)(t.li,{children:["Connect the ",(0,r.jsx)(t.strong,{children:"Filtered Data"})," output to the ",(0,r.jsx)(t.strong,{children:"Type Convert"})," component's ",(0,r.jsx)(t.strong,{children:"Data"})," input."]}),"\n",(0,r.jsxs)(t.li,{children:["Set the ",(0,r.jsx)(t.strong,{children:"Type Convert"})," component's ",(0,r.jsx)(t.strong,{children:"Output Type"})," to ",(0,r.jsx)(t.strong,{children:"DataFrame"}),"."]}),"\n"]}),"\n"]}),"\n"]}),(0,r.jsxs)(t.p,{children:["Now the flow is ready for you to add the ",(0,r.jsx)(t.strong,{children:"DataFrame Operations"})," component."]})]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Add a ",(0,r.jsx)(t.strong,{children:"DataFrame Operations"})," component to the flow, and then connect ",(0,r.jsx)(t.code,{children:"DataFrame"})," output from another component to the ",(0,r.jsx)(t.strong,{children:"DataFrame"})," input."]}),"\n",(0,r.jsxs)(t.p,{children:["All operations in the ",(0,r.jsx)(t.strong,{children:"DataFrame Operations"})," component require at least one ",(0,r.jsx)(t.code,{children:"DataFrame"})," input from another component.\nIf a component doesn't produce ",(0,r.jsx)(t.code,{children:"DataFrame"})," output, you can use another component, such as the ",(0,r.jsx)(t.strong,{children:"Type Convert"})," component, to reformat the data before passing it to the ",(0,r.jsx)(t.strong,{children:"DataFrame Operations"})," component.\nAlternatively, you could consider using a component that is designed to process the original data type, such as the ",(0,r.jsx)(t.strong,{children:"Parser"})," or ",(0,r.jsx)(t.strong,{children:"Data Operations"})," components."]}),"\n",(0,r.jsxs)(t.p,{children:["If you are following along with the example flow, connect the ",(0,r.jsx)(t.strong,{children:"Type Convert"})," component's ",(0,r.jsx)(t.strong,{children:"DataFrame Output"})," port to the ",(0,r.jsx)(t.strong,{children:"DataFrame"})," input."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["In the ",(0,r.jsx)(t.strong,{children:"Operations"})," field, select the operation you want to perform on the incoming ",(0,r.jsx)(t.code,{children:"DataFrame"}),".\nFor example, the ",(0,r.jsx)(t.strong,{children:"Filter"})," operation filters the rows based on a specified column and value."]}),"\n",(0,r.jsx)(t.admonition,{type:"tip",children:(0,r.jsxs)(t.p,{children:["You can select only one operation.\nIf you need to perform multiple operations on the data, you can chain multiple ",(0,r.jsx)(t.strong,{children:"DataFrame Operations"})," components together to execute each operation in sequence.\nFor more complex multi-step operations, like dramatic schema changes or pivots, consider using an LLM-powered component, like the ",(0,r.jsx)(t.strong,{children:"Structured Output"})," or ",(0,r.jsx)(t.strong,{children:"Smart Function"})," component, as a replacement or preparation for the ",(0,r.jsx)(t.strong,{children:"DataFrame Operations"})," component."]})}),"\n",(0,r.jsxs)(t.p,{children:["If you're following along with the example flow, select any operation that you want to apply to the data that was extracted by the ",(0,r.jsx)(t.strong,{children:"Smart Function"})," component.\nTo view the contents of the incoming ",(0,r.jsx)(t.code,{children:"DataFrame"}),", click ",(0,r.jsx)(i.A,{name:"Play","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Run component"})," on the ",(0,r.jsx)(t.strong,{children:"Type Convert"})," component, and then ",(0,r.jsx)(i.A,{name:"TextSearch","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Inspect output"}),".\nIf the ",(0,r.jsx)(t.code,{children:"DataFrame"})," seems malformed, click ",(0,r.jsx)(i.A,{name:"TextSearch","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Inspect output"})," on each upstream component to determine where the error occurs, and then modify your flow's configuration as needed.\nFor example, if the ",(0,r.jsx)(t.strong,{children:"Smart Function"})," component didn't extract the expected fields, modify your instructions or verify that the given fields are present in the ",(0,r.jsx)(t.strong,{children:"API Response"})," output."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Configure the operation's parameters.\nThe specific parameters depend on the selected operation.\nFor example, if you select the ",(0,r.jsx)(t.strong,{children:"Filter"})," operation, you must define a filter condition using the ",(0,r.jsx)(t.strong,{children:"Column Name"}),", ",(0,r.jsx)(t.strong,{children:"Filter Value"}),", and ",(0,r.jsx)(t.strong,{children:"Filter Operator"})," parameters.\nFor more information, see ",(0,r.jsx)(t.a,{href:"#dataframe-operations-parameters",children:"DataFrame Operations parameters"})]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["To test the flow, click ",(0,r.jsx)(i.A,{name:"Play","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Run component"})," on the ",(0,r.jsx)(t.strong,{children:"DataFrame Operations"})," component, and then click ",(0,r.jsx)(i.A,{name:"TextSearch","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Inspect output"})," to view the new ",(0,r.jsx)(t.code,{children:"DataFrame"})," created from the ",(0,r.jsx)(t.strong,{children:"Filter"})," operation."]}),"\n",(0,r.jsxs)(t.p,{children:["If you want to view the output in the ",(0,r.jsx)(t.strong,{children:"Playground"}),", connect the ",(0,r.jsx)(t.strong,{children:"DataFrame Operations"})," component's output to a ",(0,r.jsx)(t.strong,{children:"Chat Output"})," component, rerun the ",(0,r.jsx)(t.strong,{children:"DataFrame Operations"})," component, and then click ",(0,r.jsx)(t.strong,{children:"Playground"}),"."]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(t.p,{children:["For another example, see ",(0,r.jsx)(t.a,{href:"/components-logic#conditional-looping",children:"Conditional looping"}),"."]}),"\n",(0,r.jsx)(t.h3,{id:"dataframe-operations-parameters",children:"DataFrame Operations parameters"}),"\n",(0,r.jsxs)(t.p,{children:["Most ",(0,r.jsx)(t.strong,{children:"DataFrame Operations"})," parameters are conditional because they only apply to specific operations."]}),"\n",(0,r.jsxs)(t.p,{children:["The only permanent parameters are ",(0,r.jsx)(t.strong,{children:"DataFrame"})," (",(0,r.jsx)(t.code,{children:"df"}),"), which is the ",(0,r.jsx)(t.code,{children:"DataFrame"})," input, and ",(0,r.jsx)(t.strong,{children:"Operation"})," (",(0,r.jsx)(t.code,{children:"operation"}),"), which is the operation to perform on the ",(0,r.jsx)(t.code,{children:"DataFrame"}),".\nOnce you select an operation, the conditional parameters for that operation appear on the ",(0,r.jsx)(t.strong,{children:"DataFrame Operations"})," component."]}),"\n",(0,r.jsxs)(c.A,{children:[(0,r.jsxs)(l.A,{value:"addcolumn",label:"Add Column",default:!0,children:[(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Add Column"})," operation allows you to add a new column to the ",(0,r.jsx)(t.code,{children:"DataFrame"})," with a constant value."]}),(0,r.jsxs)(t.p,{children:["The parameters are ",(0,r.jsx)(t.strong,{children:"New Column Name"})," (",(0,r.jsx)(t.code,{children:"new_column_name"}),") and ",(0,r.jsx)(t.strong,{children:"New Column Value"})," (",(0,r.jsx)(t.code,{children:"new_column_value"}),")."]})]}),(0,r.jsx)(l.A,{value:"dropcolumn",label:"Drop Column",children:(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Drop Column"})," operation allows you to remove a column from the ",(0,r.jsx)(t.code,{children:"DataFrame"}),", specified by ",(0,r.jsx)(t.strong,{children:"Column Name"})," (",(0,r.jsx)(t.code,{children:"column_name"}),")."]})}),(0,r.jsxs)(l.A,{value:"filter",label:"Filter",children:[(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Filter"})," operation allows you to filter the ",(0,r.jsx)(t.code,{children:"DataFrame"})," based on a specified condition.\nThe output is a ",(0,r.jsx)(t.code,{children:"DataFrame"})," containing only the rows that matched the filter condition."]}),(0,r.jsx)(t.p,{children:"Provide the following parameters:"}),(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"Column Name"})," (",(0,r.jsx)(t.code,{children:"column_name"}),"): The name of the column to filter on."]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"Filter Value"})," (",(0,r.jsx)(t.code,{children:"filter_value"}),"): The value to filter on."]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"Filter Operator"})," (",(0,r.jsx)(t.code,{children:"filter_operator"}),"): The operator to use for filtering, one of ",(0,r.jsx)(t.code,{children:"equals"})," (default), ",(0,r.jsx)(t.code,{children:"not equals"}),", ",(0,r.jsx)(t.code,{children:"contains"}),", ",(0,r.jsx)(t.code,{children:"starts with"}),", ",(0,r.jsx)(t.code,{children:"ends with"}),", ",(0,r.jsx)(t.code,{children:"greater than"}),", or ",(0,r.jsx)(t.code,{children:"less than"}),"."]}),"\n"]})]}),(0,r.jsxs)(l.A,{value:"head",label:"Head",children:[(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Head"})," operation allows you to retrieve the first ",(0,r.jsx)(t.code,{children:"n"})," rows of the ",(0,r.jsx)(t.code,{children:"DataFrame"}),", where ",(0,r.jsx)(t.code,{children:"n"})," is set in ",(0,r.jsx)(t.strong,{children:"Number of Rows"})," (",(0,r.jsx)(t.code,{children:"num_rows"}),").\nThe default is ",(0,r.jsx)(t.code,{children:"5"}),"."]}),(0,r.jsxs)(t.p,{children:["The output is a ",(0,r.jsx)(t.code,{children:"DataFrame"})," containing only the selected rows."]})]}),(0,r.jsxs)(l.A,{value:"renamecolumn",label:"Rename Column",children:[(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Rename Column"})," operation allows you to rename an existing column in the ",(0,r.jsx)(t.code,{children:"DataFrame"}),"."]}),(0,r.jsxs)(t.p,{children:["The parameters are ",(0,r.jsx)(t.strong,{children:"Column Name"})," (",(0,r.jsx)(t.code,{children:"column_name"}),"), which is the current name, and ",(0,r.jsx)(t.strong,{children:"New Column Name"})," (",(0,r.jsx)(t.code,{children:"new_column_name"}),")."]})]}),(0,r.jsxs)(l.A,{value:"replacevalue",label:"Replace Value",children:[(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Replace Value"})," operation allows you to replace values in a specific column of the ",(0,r.jsx)(t.code,{children:"DataFrame"}),".\nThis operation replaces a target value with a new value.\nAll cells matching the target value are replaced with the new value in the new ",(0,r.jsx)(t.code,{children:"DataFrame"})," output."]}),(0,r.jsx)(t.p,{children:"Provide the following parameters:"}),(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"Column Name"})," (",(0,r.jsx)(t.code,{children:"column_name"}),"): The name of the column to modify."]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"Value to Replace"})," (",(0,r.jsx)(t.code,{children:"replace_value"}),"): The value that you want to replace."]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"Replacement Value"})," (",(0,r.jsx)(t.code,{children:"replacement_value"}),"): The new value to use."]}),"\n"]})]}),(0,r.jsxs)(l.A,{value:"selectcolumns",label:"Select Columns",children:[(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Select Columns"})," operation allows you to select one or more specific columns from the ",(0,r.jsx)(t.code,{children:"DataFrame"}),"."]}),(0,r.jsxs)(t.p,{children:["Provide a list of column names in ",(0,r.jsx)(t.strong,{children:"Columns to Select"})," (",(0,r.jsx)(t.code,{children:"columns_to_select"}),").\nIn the visual editor, click ",(0,r.jsx)(i.A,{name:"Plus","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Add More"})," to add multiple fields, and then enter one column name in each field."]}),(0,r.jsxs)(t.p,{children:["The output is a ",(0,r.jsx)(t.code,{children:"DataFrame"})," containing only the specified columns."]})]}),(0,r.jsxs)(l.A,{value:"sort",label:"Sort",children:[(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Sort"})," operation allows you to sort the ",(0,r.jsx)(t.code,{children:"DataFrame"})," on a specific column in ascending or descending order."]}),(0,r.jsx)(t.p,{children:"Provide the following parameters:"}),(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"Column Name"})," (",(0,r.jsx)(t.code,{children:"column_name"}),"): The name of the column to sort on."]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"Sort Ascending"})," (",(0,r.jsx)(t.code,{children:"ascending"}),"): Whether to sort in ascending or descending order. If enabled (true), sorts in ascending order; if disabled (false), sorts in descending order. Default: Enabled (true)"]}),"\n"]})]}),(0,r.jsxs)(l.A,{value:"tail",label:"Tail",children:[(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Tail"})," operation allows you to retrieve the last ",(0,r.jsx)(t.code,{children:"n"})," rows of the ",(0,r.jsx)(t.code,{children:"DataFrame"}),", where ",(0,r.jsx)(t.code,{children:"n"})," is set in ",(0,r.jsx)(t.strong,{children:"Number of Rows"})," (",(0,r.jsx)(t.code,{children:"num_rows"}),").\nThe default is ",(0,r.jsx)(t.code,{children:"5"}),"."]}),(0,r.jsxs)(t.p,{children:["The output is a ",(0,r.jsx)(t.code,{children:"DataFrame"})," containing only the selected rows."]})]}),(0,r.jsxs)(l.A,{value:"dropduplicates",label:"Drop Duplicates",children:[(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Drop Duplicates"})," operation removes rows from the ",(0,r.jsx)(t.code,{children:"DataFrame"})," by identifying all duplicate values within a single column."]}),(0,r.jsxs)(t.p,{children:["The only parameter is the ",(0,r.jsx)(t.strong,{children:"Column Name"})," (",(0,r.jsx)(t.code,{children:"column_name"}),")."]}),(0,r.jsxs)(t.p,{children:["When the flow runs, all rows with duplicate values in the given column are removed.\nThe output is a ",(0,r.jsx)(t.code,{children:"DataFrame"})," containing all columns from the original ",(0,r.jsx)(t.code,{children:"DataFrame"}),", but only rows with non-duplicate values."]})]})]}),"\n",(0,r.jsx)(t.h2,{id:"llm-router",children:"LLM Router"}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"LLM Router"})," component routes requests to the most appropriate LLM based on ",(0,r.jsx)(t.a,{href:"https://openrouter.ai/docs/quickstart",children:"OpenRouter"})," model specifications."]}),"\n",(0,r.jsxs)(t.p,{children:["To use the component in a flow, you connect multiple language model components to the ",(0,r.jsx)(t.strong,{children:"LLM Router"})," components.\nOne model is the judge LLM that analyzes input messages to understand the evaluation context, selects the most appropriate model from the other attached LLMs, and then routes the input to the selected model.\nThe selected model processes the input, and then returns the generated response."]}),"\n",(0,r.jsx)(t.p,{children:"The following example flow has three language model components.\nOne is the judge LLM, and the other two are in the LLM pool for request routing.\nThe input and output components create a seamless chat interaction where you send a message and receive a response without any user awareness of the underlying routing."}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.img,{alt:"LLM Router component",src:n(9898).A+"",width:"3316",height:"2492"})}),"\n",(0,r.jsx)(t.h3,{id:"llm-router-parameters",children:"LLM Router parameters"}),"\n",(0,r.jsx)(d.Ay,{}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Name"}),(0,r.jsx)(t.th,{children:"Display Name"}),(0,r.jsx)(t.th,{children:"Info"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"models"})}),(0,r.jsx)(t.td,{children:(0,r.jsx)(t.strong,{children:"Language Models"})}),(0,r.jsxs)(t.td,{children:["Input parameter. Connect ",(0,r.jsx)(t.a,{href:"/data-types#languagemodel",children:(0,r.jsx)(t.code,{children:"LanguageModel"})})," output from multiple ",(0,r.jsx)(t.a,{href:"/components-models",children:"language model components"})," to create a pool of models. The ",(0,r.jsx)(t.code,{children:"judge_llm"})," selects models from this pool when routing requests. The first model you connect is the default model if there is a problem with model selection or routing."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"input_value"})}),(0,r.jsx)(t.td,{children:(0,r.jsx)(t.strong,{children:"Input"})}),(0,r.jsx)(t.td,{children:"Input parameter. The incoming query to be routed to the model selected by the judge LLM."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"judge_llm"})}),(0,r.jsx)(t.td,{children:(0,r.jsx)(t.strong,{children:"Judge LLM"})}),(0,r.jsxs)(t.td,{children:["Input parameter. Connect ",(0,r.jsx)(t.code,{children:"LanguageModel"})," output from ",(0,r.jsx)(t.em,{children:"one"})," ",(0,r.jsx)(t.strong,{children:"Language Model"})," component to serve as the judge LLM for request routing."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"optimization"})}),(0,r.jsx)(t.td,{children:(0,r.jsx)(t.strong,{children:"Optimization"})}),(0,r.jsxs)(t.td,{children:["Input parameter. Set a preferred characteristic for model selection by the judge LLM. The options are ",(0,r.jsx)(t.code,{children:"quality"})," (highest response quality), ",(0,r.jsx)(t.code,{children:"speed"})," (fastest response time), ",(0,r.jsx)(t.code,{children:"cost"})," (most cost-effective model), or ",(0,r.jsx)(t.code,{children:"balanced"})," (equal weight for quality, speed, and cost). Default: ",(0,r.jsx)(t.code,{children:"balanced"})]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"use_openrouter_specs"})}),(0,r.jsx)(t.td,{children:(0,r.jsx)(t.strong,{children:"Use OpenRouter Specs"})}),(0,r.jsx)(t.td,{children:"Input parameter. Whether to fetch model specifications from the OpenRouter API."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"If false, only the model name is provided to the judge LLM. Default: Enabled (true)"}),(0,r.jsx)(t.td,{}),(0,r.jsx)(t.td,{})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"timeout"})}),(0,r.jsx)(t.td,{children:(0,r.jsx)(t.strong,{children:"API Timeout"})}),(0,r.jsxs)(t.td,{children:["Input parameter. Set a timeout duration in seconds for API requests made by the router. Default: ",(0,r.jsx)(t.code,{children:"10"})]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"fallback_to_first"})}),(0,r.jsx)(t.td,{children:(0,r.jsx)(t.strong,{children:"Fallback to First Model"})}),(0,r.jsxs)(t.td,{children:["Input parameter. Whether to use the first LLM in ",(0,r.jsx)(t.code,{children:"models"})," as a backup if routing fails to reach the selected model. Default: Enabled (true)"]})]})]})]}),"\n",(0,r.jsx)(t.h3,{id:"llm-router-outputs",children:"LLM Router outputs"}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"LLM Router"})," component provides three output options.\nYou can set the desired output type near the component's output port."]}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.strong,{children:"Output"}),": A ",(0,r.jsx)(t.code,{children:"Message"})," containing the response to the original query as generated by the selected LLM.\nUse this output for regular chat interactions."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.strong,{children:"Selected Model Info"}),": A ",(0,r.jsx)(t.code,{children:"Data"})," object containing information about the selected model, such as its name and version."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.strong,{children:"Routing Decision"}),": A ",(0,r.jsx)(t.code,{children:"Message"})," containing the judge model's reasoning for selecting a particular model, including input query length and number of models considered.\nFor example:"]}),"\n",(0,r.jsx)(m.Code,{codeConfig:j,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"Model Selection Decision:",props:{}}]},{tokens:[{content:"- Selected Model Index: 0",props:{}}]},{tokens:[{content:"- Selected Langflow Model Name: gpt-4o-mini",props:{}}]},{tokens:[{content:"- Selected API Model ID (if resolved): openai/gpt-4o-mini",props:{}}]},{tokens:[{content:"- Optimization Preference: cost",props:{}}]},{tokens:[{content:"- Input Query Length: 27 characters (~5 tokens)",props:{}}]},{tokens:[{content:"- Number of Models Considered: 2",props:{}}]},{tokens:[{content:"- Specifications Source: OpenRouter API",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,r.jsx)(t.p,{children:"This is useful for debugging if you feel the judge model isn't selecting the best model."}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(t.h2,{id:"parser",children:"Parser"}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Parser"})," component extracts text from structured data (",(0,r.jsx)(t.code,{children:"DataFrame"})," or ",(0,r.jsx)(t.code,{children:"Data"}),") using a template or direct stringification.\nThe output is a ",(0,r.jsx)(t.code,{children:"Message"})," containing the parsed text."]}),"\n",(0,r.jsxs)(t.p,{children:["This is a versatile component for data extraction and manipulation in your flows.\nFor examples of ",(0,r.jsx)(t.strong,{children:"Parser"})," components in flows, see the following:"]}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsx)(t.li,{children:(0,r.jsxs)(t.a,{href:"#batch-run",children:[(0,r.jsx)(t.strong,{children:"Batch Run"})," component example"]})}),"\n",(0,r.jsx)(t.li,{children:(0,r.jsxs)(t.a,{href:"#structured-output",children:[(0,r.jsx)(t.strong,{children:"Structured Output"})," component example"]})}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"Financial Report Parser"})," template"]}),"\n",(0,r.jsx)(t.li,{children:(0,r.jsx)(t.a,{href:"/webhook",children:"Trigger flows with webhooks"})}),"\n",(0,r.jsx)(t.li,{children:(0,r.jsx)(t.a,{href:"/chat-with-rag",children:"Create a vector RAG chatbot"})}),"\n"]}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.img,{alt:"A flow that uses a Parser component to extract text from a Structured Output component.",src:n(96218).A+"",width:"4000",height:"2202"})}),"\n",(0,r.jsx)(t.h3,{id:"parsing-modes",children:"Parsing modes"}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Parser"})," component has two modes: ",(0,r.jsx)(t.strong,{children:"Parser"})," and ",(0,r.jsx)(t.strong,{children:"Stringify"}),"."]}),"\n",(0,r.jsxs)(c.A,{children:[(0,r.jsxs)(l.A,{value:"template",label:"Parser (template) mode",default:!0,children:[(0,r.jsxs)(t.p,{children:["In ",(0,r.jsx)(t.strong,{children:"Parser"})," mode, you create a template for text output that can include literal strings and variables for extracted keys."]}),(0,r.jsxs)(t.p,{children:["Use curly braces to define variables anywhere in the template.\nVariables must match keys in the ",(0,r.jsx)(t.code,{children:"DataFrame"})," or ",(0,r.jsx)(t.code,{children:"Data"})," input, such as column names.\nFor example, ",(0,r.jsx)(t.code,{children:"{name}"})," extracts the value of a ",(0,r.jsx)(t.code,{children:"name"})," key.\nFor more information about the content and structure of ",(0,r.jsx)(t.code,{children:"DataFrame"})," and ",(0,r.jsx)(t.code,{children:"Data"})," objects, see ",(0,r.jsx)(t.a,{href:"/data-types",children:"Langflow data types"}),"."]}),(0,r.jsxs)(t.p,{children:["When the flow runs, the ",(0,r.jsx)(t.strong,{children:"Parser"})," component iterates over the input, producing a ",(0,r.jsx)(t.code,{children:"Message"})," for each parsed item.\nFor example, parsing a ",(0,r.jsx)(t.code,{children:"DataFrame"})," creates a ",(0,r.jsx)(t.code,{children:"Message"})," for each row, populated with the unique values from that row."]}),(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"Employee summary template"}),(0,r.jsx)(t.p,{children:"This example template extracts employee data into a natural language summary about an employee's hire date and current role:"}),(0,r.jsx)(m.Code,{codeConfig:j,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"{employee_first_name} {employee_last_name} was hired on {start_date}.",props:{}}]},{tokens:[{content:"Their current position is {job_title} ({grade}).",props:{}}]}],lang:"text"},annotations:[]}]}),(0,r.jsxs)(t.p,{children:["The resulting ",(0,r.jsx)(t.code,{children:"Message"})," output replaces the variables with the corresponding extracted values.\nFor example:"]}),(0,r.jsx)(m.Code,{codeConfig:j,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"Renlo Kai was hired on 11-July-2017.",props:{}}]},{tokens:[{content:"Their current position is Software Engineer (Principal).",props:{}}]}],lang:"text"},annotations:[]}]})]}),(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"Employee profile template"}),(0,r.jsx)(t.p,{children:"This example template uses Markdown syntax and extracted employee data to create an employee profile:"}),(0,r.jsx)(m.Code,{codeConfig:j,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"# Employee Profile",props:{}}]},{tokens:[{content:"## Personal Information",props:{}}]},{tokens:[{content:"- **Name:** {name}",props:{}}]},{tokens:[{content:"- **ID:** {id}",props:{}}]},{tokens:[{content:"- **Email:** {email}",props:{}}]}],lang:"text"},annotations:[]}]}),(0,r.jsxs)(t.p,{children:["When the flow runs, the ",(0,r.jsx)(t.strong,{children:"Parser"})," component iterates over each row of the ",(0,r.jsx)(t.code,{children:"DataFrame"}),", populating the template's variables with the appropriate extracted values.\nThe resulting text for each row is output as a ",(0,r.jsx)(t.a,{href:"/data-types#message",children:(0,r.jsx)(t.code,{children:"Message"})}),"."]})]}),(0,r.jsxs)(t.p,{children:["The following parameters are available in ",(0,r.jsx)(t.strong,{children:"Parser"})," mode."]}),(0,r.jsx)(d.Ay,{}),(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Name"}),(0,r.jsx)(t.th,{children:"Display Name"}),(0,r.jsx)(t.th,{children:"Info"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"input_data"}),(0,r.jsx)(t.td,{children:"Data or DataFrame"}),(0,r.jsxs)(t.td,{children:["Input parameter. The ",(0,r.jsx)(t.code,{children:"Data"})," or ",(0,r.jsx)(t.code,{children:"DataFrame"})," input to parse."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"pattern"}),(0,r.jsx)(t.td,{children:"Template"}),(0,r.jsxs)(t.td,{children:["Input parameter. The formatting template using plaintext and variables for keys (",(0,r.jsx)(t.code,{children:"{KEY_NAME}"}),"). See the preceding examples for more information."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"sep"}),(0,r.jsx)(t.td,{children:"Separator"}),(0,r.jsxs)(t.td,{children:["Input parameter. A string defining the separator for rows or lines. Default: ",(0,r.jsx)(t.code,{children:"\\n"})," (new line)."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"clean_data"}),(0,r.jsx)(t.td,{children:"Clean Data"}),(0,r.jsxs)(t.td,{children:["Whether to remove empty rows and lines in each cell or key of the ",(0,r.jsx)(t.code,{children:"DataFrame"})," or ",(0,r.jsx)(t.code,{children:"Data"})," input. Default: Enabled (true)"]})]})]})]})]}),(0,r.jsxs)(l.A,{value:"stringify",label:"Stringify mode",children:[(0,r.jsxs)(t.p,{children:["Use ",(0,r.jsx)(t.strong,{children:"Stringify"})," mode to convert the entire input directly to text.\nThis mode doesn't support templates or key selection."]}),(0,r.jsxs)(t.p,{children:["The following parameters are available in ",(0,r.jsx)(t.strong,{children:"Stringify"})," mode."]}),(0,r.jsx)(d.Ay,{}),(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Name"}),(0,r.jsx)(t.th,{children:"Display Name"}),(0,r.jsx)(t.th,{children:"Info"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"input_data"}),(0,r.jsx)(t.td,{children:"Data or DataFrame"}),(0,r.jsxs)(t.td,{children:["Input parameter. The ",(0,r.jsx)(t.code,{children:"Data"})," or ",(0,r.jsx)(t.code,{children:"DataFrame"})," input to parse."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"sep"}),(0,r.jsx)(t.td,{children:"Separator"}),(0,r.jsxs)(t.td,{children:["Input parameter. A string defining the separator for rows or lines. Default: ",(0,r.jsx)(t.code,{children:"\\n"})," (new line)."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"clean_data"}),(0,r.jsx)(t.td,{children:"Clean Data"}),(0,r.jsxs)(t.td,{children:["Whether to remove empty rows and lines in each cell or key of the ",(0,r.jsx)(t.code,{children:"DataFrame"})," or ",(0,r.jsx)(t.code,{children:"Data"})," input. Default: Enabled (true)"]})]})]})]})]})]}),"\n",(0,r.jsx)(t.h3,{id:"test-and-troubleshoot-parsed-text",children:"Test and troubleshoot parsed text"}),"\n",(0,r.jsxs)(t.p,{children:["To test the ",(0,r.jsx)(t.strong,{children:"Parser"})," component, click ",(0,r.jsx)(i.A,{name:"Play","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Run component"}),", and then click ",(0,r.jsx)(i.A,{name:"TextSearch","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Inspect output"})," to see the ",(0,r.jsx)(t.code,{children:"Message"})," output with the parsed text.\nYou can also connect a ",(0,r.jsx)(t.strong,{children:"Chat Output"})," component if you want to view the output in the ",(0,r.jsx)(t.strong,{children:"Playground"}),"."]}),"\n",(0,r.jsxs)(t.p,{children:["If the ",(0,r.jsx)(t.code,{children:"Message"})," output from the ",(0,r.jsx)(t.strong,{children:"Parser"})," component has empty or unexpected values, there might be a mapping error between the input and the parsing mode, the input has empty values, or the input isn't suitable for plaintext extraction."]}),"\n",(0,r.jsxs)(t.p,{children:["For example, assume you use the following template to parse a ",(0,r.jsx)(t.code,{children:"DataFrame"}),":"]}),"\n",(0,r.jsx)(m.Code,{codeConfig:j,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"{employee_first_name} {employee_last_name} is a {job_title} ({grade}).",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,r.jsxs)(t.p,{children:["The following ",(0,r.jsx)(t.code,{children:"Message"})," could result from parsing a row where ",(0,r.jsx)(t.code,{children:"employee_first_name"})," was empty and ",(0,r.jsx)(t.code,{children:"grade"})," was ",(0,r.jsx)(t.code,{children:"null"}),":"]}),"\n",(0,r.jsx)(m.Code,{codeConfig:j,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:" Smith is a Software Engineer (null).",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,r.jsx)(t.p,{children:"To troubleshoot missing or unexpected values, you can do the following:"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Make sure the variables in your template map to keys in the incoming ",(0,r.jsx)(t.code,{children:"Data"})," or ",(0,r.jsx)(t.code,{children:"DataFrame"}),".\nTo see the data being passed directly to the ",(0,r.jsx)(t.strong,{children:"Parser"})," component, click ",(0,r.jsx)(i.A,{name:"TextSearch","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Inspect output"})," on the component that is sending data to the ",(0,r.jsx)(t.strong,{children:"Parser"})," component."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsx)(t.p,{children:"Check the source data for missing or incorrect values.\nThere are several ways you can address these inconsistencies:"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsx)(t.li,{children:"Rectify the source data directly."}),"\n",(0,r.jsxs)(t.li,{children:["Use other components to amend or filter anomalies before passing the data to the ",(0,r.jsx)(t.strong,{children:"Parser"})," component.\nThere are many components you can use for this depending on your goal, such as the ",(0,r.jsx)(t.strong,{children:"Data Operations"}),", ",(0,r.jsx)(t.strong,{children:"Structured Output"}),", and ",(0,r.jsx)(t.strong,{children:"Smart Function"})," components."]}),"\n",(0,r.jsxs)(t.li,{children:["Enable the ",(0,r.jsx)(t.strong,{children:"Parser"})," component's ",(0,r.jsx)(t.strong,{children:"Clean Data"})," parameter to skip empty rows or lines."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(t.h2,{id:"python-interpreter",children:"Python Interpreter"}),"\n",(0,r.jsx)(t.p,{children:"This component allows you to execute Python code with imported packages."}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Python Interpreter"})," component can only import packages that are already installed in your Langflow environment.\nIf you encounter an ",(0,r.jsx)(t.code,{children:"ImportError"})," when trying to use a package, you need to install it first."]}),"\n",(0,r.jsxs)(t.p,{children:["To install custom packages, see ",(0,r.jsx)(t.a,{href:"/install-custom-dependencies",children:"Install custom dependencies"}),"."]}),"\n",(0,r.jsx)(t.h3,{id:"use-the-python-interpreter-in-a-flow",children:"Use the Python Interpreter in a flow"}),"\n",(0,r.jsxs)(t.ol,{children:["\n",(0,r.jsxs)(t.li,{children:["To use this component in a flow, in the ",(0,r.jsx)(t.strong,{children:"Global Imports"})," field, add the packages you want to import as a comma-separated list, such as ",(0,r.jsx)(t.code,{children:"math,pandas"}),".\nAt least one import is required."]}),"\n",(0,r.jsxs)(t.li,{children:["In the ",(0,r.jsx)(t.strong,{children:"Python Code"})," field, enter the Python code you want to execute. Use ",(0,r.jsx)(t.code,{children:"print()"})," to see the output."]}),"\n",(0,r.jsxs)(t.li,{children:["Optional: Enable ",(0,r.jsx)(t.strong,{children:"Tool Mode"}),", and then connect the ",(0,r.jsx)(t.strong,{children:"Python Interpreter"})," component to an ",(0,r.jsx)(t.strong,{children:"Agent"})," component as a tool.\nFor example, connect a ",(0,r.jsx)(t.strong,{children:"Python Interpreter"})," component and a ",(0,r.jsxs)(t.a,{href:"/components-helpers#calculator",children:[(0,r.jsx)(t.strong,{children:"Calculator"})," component"]})," as tools for an ",(0,r.jsx)(t.strong,{children:"Agent"})," component, and then test how it chooses different tools to solve math problems.\n",(0,r.jsx)(t.img,{alt:"Python Interpreter and Calculator components connected to an Agent component",src:n(99e3).A+"",width:"3988",height:"2928"})]}),"\n",(0,r.jsxs)(t.li,{children:["Ask the agent an easier math question.\nThe ",(0,r.jsx)(t.strong,{children:"Calculator"})," tool can add, subtract, multiple, divide, or perform exponentiation.\nThe agent executes the ",(0,r.jsx)(t.code,{children:"evaluate_expression"})," tool to correctly answer the question."]}),"\n"]}),"\n",(0,r.jsx)(t.p,{children:"Result:"}),"\n",(0,r.jsx)(m.Code,{codeConfig:j,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"Executed evaluate_expression",props:{}}]},{tokens:[{content:"Input:",props:{}}]},{tokens:[{content:"{",props:{}}]},{tokens:[{content:' "expression": "2+5"',props:{}}]},{tokens:[{content:"}",props:{}}]},{tokens:[{content:"Output:",props:{}}]},{tokens:[{content:"{",props:{}}]},{tokens:[{content:' "result": "7"',props:{}}]},{tokens:[{content:"}",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,r.jsxs)(t.ol,{start:"5",children:["\n",(0,r.jsxs)(t.li,{children:["Give the agent complete Python code.\nThis example creates a Pandas DataFrame table with the imported ",(0,r.jsx)(t.code,{children:"pandas"})," packages, and returns the square root of the mean squares."]}),"\n"]}),"\n",(0,r.jsx)(m.Code,{codeConfig:j,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"import",props:{style:{color:"#FF7B72"}}},{content:" pandas ",props:{style:{color:"#C9D1D9"}}},{content:"as",props:{style:{color:"#FF7B72"}}},{content:" pd",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"import",props:{style:{color:"#FF7B72"}}},{content:" math",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"# Create a simple DataFrame",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:"df ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" pd.DataFrame({",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" 'numbers'",props:{style:{color:"#A5D6FF"}}},{content:": [",props:{style:{color:"#C9D1D9"}}},{content:"1",props:{style:{color:"#79C0FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"2",props:{style:{color:"#79C0FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"3",props:{style:{color:"#79C0FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"4",props:{style:{color:"#79C0FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"5",props:{style:{color:"#79C0FF"}}},{content:"],",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" 'squares'",props:{style:{color:"#A5D6FF"}}},{content:": [x",props:{style:{color:"#C9D1D9"}}},{content:"**",props:{style:{color:"#FF7B72"}}},{content:"2 ",props:{style:{color:"#79C0FF"}}},{content:"for",props:{style:{color:"#FF7B72"}}},{content:" x ",props:{style:{color:"#C9D1D9"}}},{content:"in ",props:{style:{color:"#FF7B72"}}},{content:"range",props:{style:{color:"#79C0FF"}}},{content:"(",props:{style:{color:"#C9D1D9"}}},{content:"1",props:{style:{color:"#79C0FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"6",props:{style:{color:"#79C0FF"}}},{content:")]",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"})",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"# Calculate the square root of the mean",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:"result ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" math.sqrt(df[",props:{style:{color:"#C9D1D9"}}},{content:"'squares'",props:{style:{color:"#A5D6FF"}}},{content:"].mean())",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"print",props:{style:{color:"#79C0FF"}}},{content:"(",props:{style:{color:"#C9D1D9"}}},{content:"f",props:{style:{color:"#FF7B72"}}},{content:'"Square root of mean squares: ',props:{style:{color:"#A5D6FF"}}},{content:"{",props:{style:{color:"#79C0FF"}}},{content:"result",props:{style:{color:"#C9D1D9"}}},{content:"}",props:{style:{color:"#79C0FF"}}},{content:'"',props:{style:{color:"#A5D6FF"}}},{content:")",props:{style:{color:"#C9D1D9"}}}]}],lang:"python"},annotations:[]}]}),"\n",(0,r.jsxs)(t.p,{children:["The agent correctly chooses the ",(0,r.jsx)(t.code,{children:"run_python_repl"})," tool to solve the problem."]}),"\n",(0,r.jsx)(t.p,{children:"Result:"}),"\n",(0,r.jsx)(m.Code,{codeConfig:j,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"Executed run_python_repl",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"Input:",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"{",props:{}}]},{tokens:[{content:" \"python_code\": \"import pandas as pd\\nimport math\\n\\n# Create a simple DataFrame\\ndf = pd.DataFrame({\\n 'numbers': [1, 2, 3, 4, 5],\\n 'squares': [x**2 for x in range(1, 6)]\\n})\\n\\n# Calculate the square root of the mean\\nresult = math.sqrt(df['squares'].mean())\\nprint(f\\\"Square root of mean squares: {result}\\\")\"",props:{}}]},{tokens:[{content:"}",props:{}}]},{tokens:[{content:"Output:",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"{",props:{}}]},{tokens:[{content:' "result": "Square root of mean squares: 3.3166247903554"',props:{}}]},{tokens:[{content:"}",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,r.jsxs)(t.p,{children:["If you don't include the package imports in the chat, the agent can still create the table using ",(0,r.jsx)(t.code,{children:"pd.DataFrame"}),", because the ",(0,r.jsx)(t.code,{children:"pandas"})," package is imported globally by the ",(0,r.jsx)(t.strong,{children:"Python Interpreter"})," component in the ",(0,r.jsx)(t.strong,{children:"Global Imports"})," field."]}),"\n",(0,r.jsx)(t.h3,{id:"python-interpreter-parameters",children:"Python Interpreter parameters"}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Name"}),(0,r.jsx)(t.th,{children:"Type"}),(0,r.jsx)(t.th,{children:"Description"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"global_imports"}),(0,r.jsx)(t.td,{children:"String"}),(0,r.jsxs)(t.td,{children:["Input parameter. A comma-separated list of modules to import globally, such as ",(0,r.jsx)(t.code,{children:"math,pandas,numpy"}),"."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"python_code"}),(0,r.jsx)(t.td,{children:"Code"}),(0,r.jsx)(t.td,{children:"Input parameter. The Python code to execute. Only modules specified in Global Imports can be used."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"results"}),(0,r.jsx)(t.td,{children:"Data"}),(0,r.jsx)(t.td,{children:"Output parameter. The output of the executed Python code, including any printed results or errors."})]})]})]}),"\n",(0,r.jsx)(t.h2,{id:"save-file",children:"Save File"}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Save File"})," component creates a file containing data produced by another component.\nSeveral file formats are supported, and you can store files in ",(0,r.jsx)(t.a,{href:"/memory",children:"Langflow storage"})," or the local file system."]}),"\n",(0,r.jsxs)(t.p,{children:["To configure the ",(0,r.jsx)(t.strong,{children:"Save File"})," component and use it in a flow, do the following:"]}),"\n",(0,r.jsxs)(t.ol,{children:["\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Connect ",(0,r.jsx)(t.a,{href:"/data-types#dataframe",children:(0,r.jsx)(t.code,{children:"DataFrame"})}),", ",(0,r.jsx)(t.a,{href:"/data-types#data",children:(0,r.jsx)(t.code,{children:"Data"})}),", or ",(0,r.jsx)(t.a,{href:"/data-types#message",children:(0,r.jsx)(t.code,{children:"Message"})})," output from another component to the ",(0,r.jsx)(t.strong,{children:"Save File"})," component's ",(0,r.jsx)(t.strong,{children:"Input"})," port."]}),"\n",(0,r.jsxs)(t.p,{children:["You can connect the same output to multiple ",(0,r.jsx)(t.strong,{children:"Save File"})," components if you want to create multiple files, save the data in different file formats, or save files to multiple locations."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["In ",(0,r.jsx)(t.strong,{children:"File Name"}),", enter a file name and an optional path."]}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"File Name"})," parameter controls where the file is saved.\nIt can contain a file name or an entire file path:"]}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.strong,{children:"Default location"}),": If you only provide a file name, then the file is stored in the Langflow data directory. For example,",(0,r.jsx)(t.code,{children:"~/Library/Caches/langflow/data"})," on macOS."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.strong,{children:"Subdirectory"}),": To store files in subdirectories, add the path to the ",(0,r.jsx)(t.strong,{children:"File Name"})," parameter.\nIf a given subdirectory doesn't already exist, Langflow automatically creates it.\nFor example, ",(0,r.jsx)(t.code,{children:"files/my_file"})," creates ",(0,r.jsx)(t.code,{children:"my_file"})," in ",(0,r.jsx)(t.code,{children:"/data/files"}),", and it creates the ",(0,r.jsx)(t.code,{children:"files"})," subdirectory if it doesn't already exist."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.strong,{children:"Absolute or relative path"}),": To store files elsewhere in your environment or local file storage, provide the absolute or relative path to the desired location.\nFor example, ",(0,r.jsx)(t.code,{children:"~/Desktop/my_file"})," saves ",(0,r.jsx)(t.code,{children:"my_file"})," to the desktop."]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(t.p,{children:["Don't include an extension in the file name.\nIf you do, the extension is treated as part of the file name; it has no impact on the ",(0,r.jsx)(t.strong,{children:"File Format"})," parameter."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["In the ",(0,r.jsx)(t.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),", click ",(0,r.jsx)(i.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Controls"}),", select the desired file format, and then click ",(0,r.jsx)(t.strong,{children:"Close"}),"."]}),"\n",(0,r.jsxs)(t.p,{children:["The available ",(0,r.jsx)(t.strong,{children:"File Format"})," options depend on the input data type:"]}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.code,{children:"DataFrame"})," can be saved to CSV (default), Excel (requires ",(0,r.jsx)(t.code,{children:"openpyxl"})," ",(0,r.jsx)(t.a,{href:"/install-custom-dependencies",children:"custom dependency"}),"), JSON (fallback default), or Markdown."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.code,{children:"Data"})," can be saved to CSV, Excel (requires ",(0,r.jsx)(t.code,{children:"openpyxl"})," ",(0,r.jsx)(t.a,{href:"/install-custom-dependencies",children:"custom dependency"}),"), JSON (default), or Markdown."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.code,{children:"Message"})," can be saved to TXT, JSON (default), or Markdown."]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(t.admonition,{title:"Overwrites allowed",type:"important",children:(0,r.jsxs)(t.p,{children:["If you have multiple ",(0,r.jsx)(t.strong,{children:"Save File"})," components, in one or more flows, with the same file name, path, and extension, the file contains the data from the most recent run only.\nLangflow doesn't block overwrites if a matching file already exists.\nTo avoid unintended overwrites, use unique file names and paths."]})}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["To test the ",(0,r.jsx)(t.strong,{children:"Save File"})," component, click ",(0,r.jsx)(i.A,{name:"Play","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Run component"}),", and then click ",(0,r.jsx)(i.A,{name:"TextSearch","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Inspect output"})," to get the filepath where the file was saved."]}),"\n",(0,r.jsxs)(t.p,{children:["The component's literal output is a ",(0,r.jsx)(t.code,{children:"Message"})," containing the original data type, the file name and extension, and the absolute filepath to the file based on the ",(0,r.jsx)(t.strong,{children:"File Name"})," parameter.\nFor example:"]}),"\n",(0,r.jsx)(m.Code,{codeConfig:j,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"DataFrame saved successfully as 'my_file.csv' at /Users/user.name/Library/Caches/langflow/data/my_file.csv",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,r.jsxs)(t.p,{children:["If the ",(0,r.jsx)(t.strong,{children:"File Name"})," contains a subdirectory or other non-default path, this is reflected in the ",(0,r.jsx)(t.code,{children:"Message"})," output.\nFor example, a CSV file with the file name ",(0,r.jsx)(t.code,{children:"~/Desktop/my_file"})," could produce the following output:"]}),"\n",(0,r.jsx)(m.Code,{codeConfig:j,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"DataFrame saved successfully as '/Users/user.name/Desktop/my_file.csv' at /Users/user.name/Desktop/my_file.csv",props:{}}]}],lang:"text"},annotations:[]}]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsx)(t.p,{children:"Optional: If you want to use the saved file in a flow, you must use an API call or another component to retrieve the file from the given filepath."}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(t.h2,{id:"smart-function",children:"Smart Function"}),"\n",(0,r.jsxs)(t.p,{children:["In Langflow version 1.5, this component was renamed from ",(0,r.jsx)(t.strong,{children:"Lambda Filter"})," to ",(0,r.jsx)(t.strong,{children:"Smart Function"}),"."]}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Smart Function"})," component uses an LLM to generate a Lambda function to filter or transform structured data based on natural language instructions.\nYou must connect this component to a ",(0,r.jsx)(t.a,{href:"/components-models",children:"language model component"}),", which is used to generate a function based on the natural language instructions you provide in the ",(0,r.jsx)(t.strong,{children:"Instructions"})," parameter.\nThe LLM runs the function against the data input, and then outputs the results as ",(0,r.jsx)(t.a,{href:"/data-types#data",children:(0,r.jsx)(t.code,{children:"Data"})}),"."]}),"\n",(0,r.jsxs)(t.admonition,{type:"tip",children:[(0,r.jsxs)(t.p,{children:["Provide brief, clear instructions, focusing on the desired outcome or specific actions, such as ",(0,r.jsx)(t.code,{children:"Filter the data to only include items where the 'status' is 'active'"}),".\nOne sentence or less is preferred because end punctuation, like periods, can cause errors or unexpected behavior."]}),(0,r.jsxs)(t.p,{children:["If you need to provide more details instructions that aren't directly relevant to the Lambda function, you can input them in the ",(0,r.jsx)(t.strong,{children:"Language Model"})," component's ",(0,r.jsx)(t.strong,{children:"Input"})," field or through a ",(0,r.jsx)(t.strong,{children:"Prompt Template"})," component."]})]}),"\n",(0,r.jsxs)(t.p,{children:["The following example uses the ",(0,r.jsx)(t.strong,{children:"API Request"})," endpoint to pass JSON data from the ",(0,r.jsx)(t.code,{children:"https://jsonplaceholder.typicode.com/users"})," endpoint to the ",(0,r.jsx)(t.strong,{children:"Smart Function"})," component.\nThen, the ",(0,r.jsx)(t.strong,{children:"Smart Function"})," component passes the data and the instruction ",(0,r.jsx)(t.code,{children:"extract emails"})," to the attached ",(0,r.jsx)(t.strong,{children:"Language Model"})," component.\nFrom there, the LLM generates a filter function that extracts email addresses from the JSON data, returning the filtered data as chat output."]}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.img,{alt:"A small flow using a Smart Function component to extract data from an API response.",src:n(66539).A+"",width:"4000",height:"1796"})}),"\n",(0,r.jsx)(t.h3,{id:"smart-function-parameters",children:"Smart Function parameters"}),"\n",(0,r.jsx)(d.Ay,{}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Name"}),(0,r.jsx)(t.th,{children:"Display Name"}),(0,r.jsx)(t.th,{children:"Info"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"data"}),(0,r.jsx)(t.td,{children:"Data"}),(0,r.jsx)(t.td,{children:"Input parameter. The structured data to filter or transform using a Lambda function."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"llm"}),(0,r.jsx)(t.td,{children:"Language Model"}),(0,r.jsxs)(t.td,{children:["Input parameter. Connect ",(0,r.jsx)(t.a,{href:"/data-types#languagemodel",children:(0,r.jsx)(t.code,{children:"LanguageModel"})})," output from a ",(0,r.jsx)(t.strong,{children:"Language Model"})," component."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"filter_instruction"}),(0,r.jsx)(t.td,{children:"Instructions"}),(0,r.jsx)(t.td,{children:"Input parameter. The natural language instructions for how to filter or transform the data. The LLM uses these instructions to create a Lambda function."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"sample_size"}),(0,r.jsx)(t.td,{children:"Sample Size"}),(0,r.jsxs)(t.td,{children:["Input parameter. For large datasets, the number of characters to sample from the dataset head and tail. Only applied if the dataset meets or exceeds ",(0,r.jsx)(t.code,{children:"max_size"}),". Default: ",(0,r.jsx)(t.code,{children:"1000"}),"."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"max_size"}),(0,r.jsx)(t.td,{children:"Max Size"}),(0,r.jsxs)(t.td,{children:["Input parameter. The number of characters for the dataset to be considered large, which triggers sampling by the ",(0,r.jsx)(t.code,{children:"sample_size"})," value. Default: ",(0,r.jsx)(t.code,{children:"30000"}),"."]})]})]})]}),"\n",(0,r.jsx)(t.h2,{id:"split-text",children:"Split Text"}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Split Text"})," component splits data into chunks based on parameters like chunk size and separator.\nIt is often used to chunk data to be tokenized and embedded into vector databases.\nFor examples, see ",(0,r.jsx)(t.a,{href:"/components-embedding-models#use-embedding-model-components-in-a-flow",children:"Use embedding model components in a flow"})," and ",(0,r.jsx)(t.a,{href:"/chat-with-rag",children:"Create a Vector RAG chatbot"}),"."]}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.img,{alt:"An embedding generation flow that uses a Split Text component to chunk data.",src:n(49823).A+"",width:"4000",height:"2766"})}),"\n",(0,r.jsxs)(t.p,{children:["The component accepts ",(0,r.jsx)(t.code,{children:"Message"}),", ",(0,r.jsx)(t.code,{children:"Data"}),", or ",(0,r.jsx)(t.code,{children:"DataFrame"}),", and then outputs either ",(0,r.jsx)(t.strong,{children:"Chunks"})," or ",(0,r.jsx)(t.strong,{children:"DataFrame"}),".\nThe ",(0,r.jsx)(t.strong,{children:"Chunks"})," output returns a list of ",(0,r.jsx)(t.a,{href:"/data-types#data",children:(0,r.jsx)(t.code,{children:"Data"})})," objects containing individual text chunks.\nThe ",(0,r.jsx)(t.strong,{children:"DataFrame"})," output returns the list of chunks as a structured ",(0,r.jsx)(t.a,{href:"/data-types#dataframe",children:(0,r.jsx)(t.code,{children:"DataFrame"})})," with additional ",(0,r.jsx)(t.code,{children:"text"})," and ",(0,r.jsx)(t.code,{children:"metadata"})," columns."]}),"\n",(0,r.jsx)(t.h3,{id:"split-text-parameters",children:"Split Text parameters"}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Split Text"})," component's parameters control how the text is split into chunks, specifically the ",(0,r.jsx)(t.code,{children:"chunk_size"}),", ",(0,r.jsx)(t.code,{children:"chunk_overlap"}),", and ",(0,r.jsx)(t.code,{children:"separator"})," parameters."]}),"\n",(0,r.jsxs)(t.p,{children:["To test the chunking behavior, add a ",(0,r.jsx)(t.strong,{children:"Text Input"})," or ",(0,r.jsx)(t.strong,{children:"File"})," component with some sample data to chunk, click ",(0,r.jsx)(i.A,{name:"Play","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Run component"})," on the ",(0,r.jsx)(t.strong,{children:"Split Text"})," component, and then click ",(0,r.jsx)(i.A,{name:"TextSearch","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Inspect output"})," to view the list of chunks and their metadata. The ",(0,r.jsx)(t.strong,{children:"text"})," column contains the actual text chunks created from your chunking settings.\nIf the chunks aren't split as you expect, adjust the parameters, rerun the component, and then inspect the new output."]}),"\n",(0,r.jsx)(d.Ay,{}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Name"}),(0,r.jsx)(t.th,{children:"Display Name"}),(0,r.jsx)(t.th,{children:"Info"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"data_inputs"}),(0,r.jsx)(t.td,{children:"Input"}),(0,r.jsxs)(t.td,{children:["Input parameter. The data to split. Input must be in ",(0,r.jsx)(t.code,{children:"Message"}),", ",(0,r.jsx)(t.code,{children:"Data"}),", or ",(0,r.jsx)(t.code,{children:"DataFrame"})," format."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"chunk_overlap"}),(0,r.jsx)(t.td,{children:"Chunk Overlap"}),(0,r.jsxs)(t.td,{children:["Input parameter. The number of characters to overlap between chunks. This helps maintain context across chunks. When a separator is encountered, the overlap is applied at the point of the separator so that the subsequent chunk contains the last ",(0,r.jsx)(t.em,{children:"n"})," characters of the preceding chunk. Default: ",(0,r.jsx)(t.code,{children:"200"}),"."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"chunk_size"}),(0,r.jsx)(t.td,{children:"Chunk Size"}),(0,r.jsxs)(t.td,{children:["Input parameter. The target length for each chunk after splitting. The data is first split by separator, and then chunks smaller than the ",(0,r.jsx)(t.code,{children:"chunk_size"})," are merged up to this limit. However, if the initial separator split produces any chunks larger than the ",(0,r.jsx)(t.code,{children:"chunk_size"}),", those chunks are neither further subdivided nor combined with any smaller chunks; these chunks will be output as-is even though they exceed the ",(0,r.jsx)(t.code,{children:"chunk_size"}),". Default: ",(0,r.jsx)(t.code,{children:"1000"}),". See ",(0,r.jsx)(t.a,{href:"#chunk-size",children:"Tokenization errors due to chunk size"})," for important considerations."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"separator"}),(0,r.jsx)(t.td,{children:"Separator"}),(0,r.jsxs)(t.td,{children:["Input parameter. A string defining a character to split on, such as ",(0,r.jsx)(t.code,{children:"\\n"})," to split on new line characters, ",(0,r.jsx)(t.code,{children:"\\n\\n"})," to split at paragraph breaks, or ",(0,r.jsx)(t.code,{children:"},"})," to split at the end of JSON objects. You can directly provide the separator string, or pass a separator string from another component as ",(0,r.jsx)(t.code,{children:"Message"})," input."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"text_key"}),(0,r.jsx)(t.td,{children:"Text Key"}),(0,r.jsxs)(t.td,{children:["Input parameter. The key to use for the text column that is extracted from the input and then split. Default: ",(0,r.jsx)(t.code,{children:"text"}),"."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"keep_separator"}),(0,r.jsx)(t.td,{children:"Keep Separator"}),(0,r.jsxs)(t.td,{children:["Input parameter. Select how to handle separators in output chunks. If False, separators are omitted from output chunks. Options include ",(0,r.jsx)(t.code,{children:"False"})," (remove separators), ",(0,r.jsx)(t.code,{children:"True"})," (keep separators in chunks without preference for placement), ",(0,r.jsx)(t.code,{children:"Start"})," (place separators at the beginning of chunks), or ",(0,r.jsx)(t.code,{children:"End"})," (place separators at the end of chunks). Default: ",(0,r.jsx)(t.code,{children:"False"}),"."]})]})]})]}),"\n",(0,r.jsx)(t.h3,{id:"chunk-size",children:"Tokenization errors due to chunk size"}),"\n",(0,r.jsxs)(t.p,{children:["When using ",(0,r.jsx)(t.strong,{children:"Split Text"})," with embedding models (especially NVIDIA models like ",(0,r.jsx)(t.code,{children:"nvidia/nv-embed-v1"}),"), you may need to use smaller chunk sizes (",(0,r.jsx)(t.code,{children:"500"})," or less) even though the model supports larger token limits.\nThe ",(0,r.jsx)(t.strong,{children:"Split Text"})," component doesn't always enforce the exact chunk size you set, and individual chunks may exceed your specified limit.\nIf you encounter tokenization errors, modify your text splitting strategy by reducing the chunk size, changing the overlap length, or using a more common separator.\nThen, test your configuration by running the flow and inspecting the component's output."]}),"\n",(0,r.jsx)(t.h3,{id:"other-text-splitters",children:"Other text splitters"}),"\n",(0,r.jsxs)(t.p,{children:["See ",(0,r.jsx)(t.a,{href:"/bundles-langchain#text-splitters",children:"LangChain text splitter components"}),"."]}),"\n",(0,r.jsx)(t.h2,{id:"structured-output",children:"Structured Output"}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Structured Output"})," component uses an LLM to transform any input into structured data (",(0,r.jsx)(t.code,{children:"Data"})," or ",(0,r.jsx)(t.code,{children:"DataFrame"}),") using natural language formatting instructions and an output schema definition.\nFor example, you can extract specific details from documents, like email messages or scientific papers."]}),"\n",(0,r.jsx)(t.h3,{id:"use-the-structured-output-component-in-a-flow",children:"Use the Structured Output component in a flow"}),"\n",(0,r.jsxs)(t.p,{children:["To use the ",(0,r.jsx)(t.strong,{children:"Structured Output"})," component in a flow, do the following:"]}),"\n",(0,r.jsxs)(t.ol,{children:["\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Provide an ",(0,r.jsx)(t.strong,{children:"Input Message"}),", which is the source material from which you want to extract structured data.\nThis can come from practically any component, but it is typically a ",(0,r.jsx)(t.strong,{children:"Chat Input"}),", ",(0,r.jsx)(t.strong,{children:"File"}),", or other component that provides some unstructured or semi-structured input."]}),"\n",(0,r.jsx)(t.admonition,{type:"tip",children:(0,r.jsxs)(t.p,{children:["Not all source material has to become structured output.\nThe power of the ",(0,r.jsx)(t.strong,{children:"Structured Output"})," component is that you can specify the information you want to extract, even if that data isn't explicitly labeled or an exact keyword match.\nThen, the LLM can use your instructions to analyze the source material, extract the relevant data, and format it according to your specifications.\nAny irrelevant source material isn't included in the structured output."]})}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Define ",(0,r.jsx)(t.strong,{children:"Format Instructions"})," and an ",(0,r.jsx)(t.strong,{children:"Output Schema"})," to specify the data to extract from the source material and how to structure it in the final ",(0,r.jsx)(t.code,{children:"Data"})," or ",(0,r.jsx)(t.code,{children:"DataFrame"})," output."]}),"\n",(0,r.jsx)(t.p,{children:"The instructions are a prompt that tell the LLM what data to extract, how to format it, how to handle exceptions, and any other instructions relevant to preparing the structured data."}),"\n",(0,r.jsxs)(t.p,{children:["The schema is a table that defines the fields (keys) and data types to organize the data extracted by the LLM into a structured ",(0,r.jsx)(t.code,{children:"Data"})," or ",(0,r.jsx)(t.code,{children:"DataFrame"})," object.\nFor more information, see ",(0,r.jsx)(t.a,{href:"#output-schema-options",children:"Output Schema options"})]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Attach a ",(0,r.jsx)(t.a,{href:"/components-models",children:"language model component"})," that is set to emit ",(0,r.jsx)(t.a,{href:"/data-types#languagemodel",children:(0,r.jsx)(t.code,{children:"LanguageModel"})})," output."]}),"\n",(0,r.jsxs)(t.p,{children:["The LLM uses the ",(0,r.jsx)(t.strong,{children:"Input Message"})," and ",(0,r.jsx)(t.strong,{children:"Format Instructions"})," from the ",(0,r.jsx)(t.strong,{children:"Structured Output"})," component to extract specific pieces of data from the input text.\nThe output schema is applied to the model's response to produce the final ",(0,r.jsx)(t.code,{children:"Data"})," or ",(0,r.jsx)(t.code,{children:"DataFrame"})," structured object."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Optional: Typically, the structured output is passed to downstream components that use the extracted data for other processes, such as the ",(0,r.jsx)(t.strong,{children:"Parser"})," or ",(0,r.jsx)(t.strong,{children:"Data Operations"})," components."]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.img,{alt:"A basic flow with Structured Output, Language Model, Type Convert, and Chat Input and Output components.",src:n(82798).A+"",width:"4000",height:"1724"})}),"\n",(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"Structured Output example: Financial Report Parser template"}),(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Financial Report Parser"})," template provides an example of how the ",(0,r.jsx)(t.strong,{children:"Structured Output"})," component can be used to extract structured data from unstructured text."]}),(0,r.jsxs)(t.p,{children:["The template's ",(0,r.jsx)(t.strong,{children:"Structured Output"})," component has the following configuration:"]}),(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Input Message"})," comes from a ",(0,r.jsx)(t.strong,{children:"Chat Input"})," component that is preloaded with quotes from sample financial reports"]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Format Instructions"})," are as follows:"]}),"\n",(0,r.jsx)(m.Code,{codeConfig:j,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"You are an AI that extracts structured JSON objects from unstructured text.",props:{}}]},{tokens:[{content:"Use a predefined schema with expected types (str, int, float, bool, dict).",props:{}}]},{tokens:[{content:"Extract ALL relevant instances that match the schema - if multiple patterns exist, capture them all.",props:{}}]},{tokens:[{content:"Fill missing or ambiguous values with defaults: null for missing values.",props:{}}]},{tokens:[{content:"Remove exact duplicates but keep variations that have different field values.",props:{}}]},{tokens:[{content:"Always return valid JSON in the expected format, never throw errors.",props:{}}]},{tokens:[{content:"If multiple objects can be extracted, return them all in the structured format.",props:{}}]}],lang:"text"},annotations:[]}]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Output Schema"})," includes keys for ",(0,r.jsx)(t.code,{children:"EBITDA"}),", ",(0,r.jsx)(t.code,{children:"NET_INCOME"}),", and ",(0,r.jsx)(t.code,{children:"GROSS_PROFIT"}),"."]}),"\n"]}),"\n"]}),(0,r.jsxs)(t.p,{children:["The structured ",(0,r.jsx)(t.code,{children:"Data"})," object is passed to a ",(0,r.jsx)(t.strong,{children:"Parser"})," component that produces a text string by mapping the schema keys to variables in the parsing template:"]}),(0,r.jsx)(m.Code,{codeConfig:j,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"EBITDA: {EBITDA} , Net Income: {NET_INCOME} , GROSS_PROFIT: {GROSS_PROFIT}",props:{}}]}],lang:"text"},annotations:[]}]}),(0,r.jsxs)(t.p,{children:["When printed to the ",(0,r.jsx)(t.strong,{children:"Playground"}),", the resulting ",(0,r.jsx)(t.code,{children:"Message"})," replaces the variables with the actual values extracted by the ",(0,r.jsx)(t.strong,{children:"Structured Output"})," component. For example:"]}),(0,r.jsx)(m.Code,{codeConfig:j,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"EBITDA: 900 million , Net Income: 500 million , GROSS_PROFIT: 1.2 billion",props:{}}]}],lang:"text"},annotations:[]}]})]}),"\n",(0,r.jsx)(t.h3,{id:"structured-output-parameters",children:"Structured Output parameters"}),"\n",(0,r.jsx)(d.Ay,{}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Name"}),(0,r.jsx)(t.th,{children:"Type"}),(0,r.jsx)(t.th,{children:"Description"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsxs)(t.td,{children:["Language Model (",(0,r.jsx)(t.code,{children:"llm"}),")"]}),(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"LanguageModel"})}),(0,r.jsxs)(t.td,{children:["Input parameter. The ",(0,r.jsx)(t.a,{href:"/data-types#languagemodel",children:(0,r.jsx)(t.code,{children:"LanguageModel"})})," output from a ",(0,r.jsx)(t.strong,{children:"Language Model"})," component that defines the LLM to use to analyze, extract, and prepare the structured output."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsxs)(t.td,{children:["Input Message (",(0,r.jsx)(t.code,{children:"input_value"}),")"]}),(0,r.jsx)(t.td,{children:"String"}),(0,r.jsx)(t.td,{children:"Input parameter. The input message containing source material for extraction."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsxs)(t.td,{children:["Format Instructions (",(0,r.jsx)(t.code,{children:"system_prompt"}),")"]}),(0,r.jsx)(t.td,{children:"String"}),(0,r.jsx)(t.td,{children:"Input parameter. The instructions to the language model for extracting and formatting the output."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsxs)(t.td,{children:["Schema Name (",(0,r.jsx)(t.code,{children:"schema_name"}),")"]}),(0,r.jsx)(t.td,{children:"String"}),(0,r.jsxs)(t.td,{children:["Input parameter. An optional title for the ",(0,r.jsx)(t.strong,{children:"Output Schema"}),"."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsxs)(t.td,{children:["Output Schema (",(0,r.jsx)(t.code,{children:"output_schema"}),")"]}),(0,r.jsx)(t.td,{children:"Table"}),(0,r.jsxs)(t.td,{children:["Input parameter. A table describing the schema of the desired structured output, ultimately determining the content of the ",(0,r.jsx)(t.code,{children:"Data"})," or ",(0,r.jsx)(t.code,{children:"DataFrame"})," output. See ",(0,r.jsx)(t.a,{href:"#output-schema-options",children:"Output Schema options"}),"."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsxs)(t.td,{children:["Structured Output (",(0,r.jsx)(t.code,{children:"structured_output"}),")"]}),(0,r.jsxs)(t.td,{children:[(0,r.jsx)(t.code,{children:"Data"})," or ",(0,r.jsx)(t.code,{children:"DataFrame"})]}),(0,r.jsxs)(t.td,{children:["Output parameter. The final structured output produced by the component. Near the component's output port, you can select the output data type as either ",(0,r.jsx)(t.strong,{children:"Structured Output Data"})," or ",(0,r.jsx)(t.strong,{children:"Structured Output DataFrame"}),". The specific content and structure of the output depends on the input parameters."]})]})]})]}),"\n",(0,r.jsx)(t.h4,{id:"output-schema-options",children:"Output Schema options"}),"\n",(0,r.jsxs)(t.p,{children:["After the LLM extracts the relevant data from the ",(0,r.jsx)(t.strong,{children:"Input Message"})," and ",(0,r.jsx)(t.strong,{children:"Format Instructions"}),", the data is organized according to the ",(0,r.jsx)(t.strong,{children:"Output Schema"}),"."]}),"\n",(0,r.jsxs)(t.p,{children:["The schema is a table that defines the fields (keys) and data types for the final ",(0,r.jsx)(t.code,{children:"Data"})," or ",(0,r.jsx)(t.code,{children:"DataFrame"})," output from the ",(0,r.jsx)(t.strong,{children:"Structured Output"})," component."]}),"\n",(0,r.jsxs)(t.p,{children:["The default schema is a single ",(0,r.jsx)(t.code,{children:"field"})," string."]}),"\n",(0,r.jsxs)(t.p,{children:["To add a key to the schema, click ",(0,r.jsx)(i.A,{name:"Plus","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Add a new row"}),", and then edit each column to define the schema:"]}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.strong,{children:"Name"}),": The name of the output field. Typically a specific key for which you want to extract a value."]}),"\n",(0,r.jsxs)(t.p,{children:["You can reference these keys as variables in downstream components, such as a ",(0,r.jsx)(t.strong,{children:"Parser"})," component's template.\nFor example, the schema key ",(0,r.jsx)(t.code,{children:"NET_INCOME"})," could be referenced by the variable ",(0,r.jsx)(t.code,{children:"{NET_INCOME}"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.strong,{children:"Description"}),": An optional metadata description of the field's contents and purpose."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.strong,{children:"Type"}),": The data type of the value stored in the field.\nSupported types are ",(0,r.jsx)(t.code,{children:"str"})," (default), ",(0,r.jsx)(t.code,{children:"int"}),", ",(0,r.jsx)(t.code,{children:"float"}),", ",(0,r.jsx)(t.code,{children:"bool"}),", and ",(0,r.jsx)(t.code,{children:"dict"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.strong,{children:"As List"}),": Enable this setting if you want the field to contain a list of values rather than a single value."]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(t.p,{children:["For simple schemas, you might only extract a few ",(0,r.jsx)(t.code,{children:"string"})," or ",(0,r.jsx)(t.code,{children:"int"})," fields.\nFor more complex schemas with lists and dictionaries, it might help to refer to the ",(0,r.jsx)(t.code,{children:"Data"})," and ",(0,r.jsx)(t.code,{children:"DataFrame"})," structures and attributes, as described in ",(0,r.jsx)(t.a,{href:"/data-types",children:"Langflow data types"}),".\nYou can also emit a rough ",(0,r.jsx)(t.code,{children:"Data"})," or ",(0,r.jsx)(t.code,{children:"DataFrame"}),", and then use downstream components for further refinement, such as a ",(0,r.jsx)(t.strong,{children:"Data Operations"})," component."]}),"\n",(0,r.jsx)(t.h2,{id:"type-convert",children:"Type Convert"}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Type Convert"})," component converts data from one type to another.\nIt supports ",(0,r.jsx)(t.code,{children:"Data"}),", ",(0,r.jsx)(t.code,{children:"DataFrame"}),", and ",(0,r.jsx)(t.code,{children:"Message"})," data types."]}),"\n",(0,r.jsxs)(c.A,{children:[(0,r.jsxs)(l.A,{value:"data",label:"Data",default:!0,children:[(0,r.jsxs)(t.p,{children:["A ",(0,r.jsx)(t.code,{children:"Data"})," object is a structured object that contains a primary ",(0,r.jsx)(t.code,{children:"text"})," key and other key-value pairs:"]}),(0,r.jsx)(m.Code,{codeConfig:j,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:'"data"',props:{style:{color:"#A5D6FF"}}},{content:": {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "text"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"User Profile"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "name"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"Charlie Lastname"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "age"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"28",props:{style:{color:"#79C0FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "email"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"charlie.lastname@example.com"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"},",props:{style:{color:"#C9D1D9"}}}]}],lang:"json"},annotations:[]}]}),(0,r.jsxs)(t.p,{children:["The larger context associated with a component's ",(0,r.jsx)(t.code,{children:"data"})," dictionary also identifies which key is the primary ",(0,r.jsx)(t.code,{children:"text_key"}),", and it can provide an optional default value if the primary key isn't specified.\nFor example:"]}),(0,r.jsx)(m.Code,{codeConfig:j,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"{",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "text_key"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"text"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "data"',props:{style:{color:"#7EE787"}}},{content:": {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "text"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"User Profile"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "name"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"Charlie Lastname"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "age"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"28",props:{style:{color:"#79C0FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "email"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"charlie.lastname@example.com"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" },",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "default_value"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'""',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]}],lang:"json"},annotations:[]}]})]}),(0,r.jsxs)(l.A,{value:"dataframe",label:"DataFrame",children:[(0,r.jsxs)(t.p,{children:["A ",(0,r.jsx)(t.code,{children:"DataFrame"})," is an array that represents a tabular data structure with rows and columns."]}),(0,r.jsxs)(t.p,{children:["It consists of a list (array) of dictionary objects, where each dictionary represents a row.\nEach key in the dictionaries corresponds to a column name.\nFor example, the following ",(0,r.jsx)(t.code,{children:"DataFrame"})," contains two rows with columns for ",(0,r.jsx)(t.code,{children:"name"}),", ",(0,r.jsx)(t.code,{children:"age"}),", and ",(0,r.jsx)(t.code,{children:"email"}),":"]}),(0,r.jsx)(m.Code,{codeConfig:j,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"[",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "name"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"Charlie Lastname"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "age"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"28",props:{style:{color:"#79C0FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "email"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"charlie.lastname@example.com"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" },",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "name"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"Bobby Othername"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "age"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"25",props:{style:{color:"#79C0FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "email"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"bobby.othername@example.com"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" }",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"]",props:{style:{color:"#C9D1D9"}}}]}],lang:"json"},annotations:[]}]})]}),(0,r.jsx)(l.A,{value:"message",label:"Message",children:(0,r.jsxs)(t.p,{children:["A ",(0,r.jsx)(t.code,{children:"Message"})," is primarily for passing a ",(0,r.jsx)(t.code,{children:"text"})," string, such as",(0,r.jsx)(t.code,{children:'"Name: Charlie Lastname, Age: 28, Email: charlie.lastname@example.com"'}),".\nHowever, the entire ",(0,r.jsx)(t.code,{children:"Message"})," object can include metadata about the message, particularly when used as chat input or output."]})})]}),"\n",(0,r.jsxs)(t.p,{children:["For more information, see ",(0,r.jsx)(t.a,{href:"/data-types",children:"Langflow data types"}),"."]}),"\n",(0,r.jsx)(t.h3,{id:"use-the-type-convert-component-in-a-flow",children:"Use the Type Convert component in a flow"}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Type Convert"})," component is typically used to transform data into a format required by a downstream component.\nFor example, if a component outputs a ",(0,r.jsx)(t.code,{children:"Message"}),", but the following component requires ",(0,r.jsx)(t.code,{children:"Data"}),", then you can use the ",(0,r.jsx)(t.strong,{children:"Type Convert"})," component to reformat the ",(0,r.jsx)(t.code,{children:"Message"})," as ",(0,r.jsx)(t.code,{children:"Data"})," before passing it to the downstream component."]}),"\n",(0,r.jsxs)(t.p,{children:["The following example uses the ",(0,r.jsx)(t.strong,{children:"Type Convert"})," component to convert the ",(0,r.jsx)(t.code,{children:"DataFrame"})," output from a ",(0,r.jsx)(t.strong,{children:"Web Search"})," component into ",(0,r.jsx)(t.code,{children:"Message"})," data that is passed as text input for an LLM:"]}),"\n",(0,r.jsxs)(t.ol,{children:["\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Create a flow based on the ",(0,r.jsx)(t.strong,{children:"Basic prompting"})," template."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Add a ",(0,r.jsx)(t.strong,{children:"Web Search"})," component to the flow, and then enter a search query, such as ",(0,r.jsx)(t.code,{children:"environmental news"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["In the ",(0,r.jsx)(t.strong,{children:"Prompt Template"})," component, replace the contents of the ",(0,r.jsx)(t.strong,{children:"Template"})," field with the following text:"]}),"\n",(0,r.jsx)(m.Code,{codeConfig:j,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"Answer the user's question using the {context}",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,r.jsxs)(t.p,{children:["The curly braces define a ",(0,r.jsx)(t.a,{href:"/components-prompts#define-variables-in-prompts",children:"prompt variable"})," that becomes an input field on the ",(0,r.jsx)(t.strong,{children:"Prompt Template"})," component.\nIn this example, you will use the ",(0,r.jsx)(t.strong,{children:"context"})," field to pass the search results into the template, as explained in the next steps."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Add a ",(0,r.jsx)(t.strong,{children:"Type Convert"})," component to the flow, and then set the ",(0,r.jsx)(t.strong,{children:"Output Type"})," to ",(0,r.jsx)(t.strong,{children:"Message"}),"."]}),"\n",(0,r.jsxs)(t.p,{children:["Because the ",(0,r.jsx)(t.strong,{children:"Web Search"})," component's ",(0,r.jsx)(t.code,{children:"DataFrame"})," output is incompatible with the ",(0,r.jsx)(t.strong,{children:"context"})," variable's ",(0,r.jsx)(t.code,{children:"Message"})," input, you must use the ",(0,r.jsx)(t.strong,{children:"Type Convert"})," component to change the ",(0,r.jsx)(t.code,{children:"DataFrame"})," to a ",(0,r.jsx)(t.code,{children:"Message"})," in order to pass the search results to the ",(0,r.jsx)(t.strong,{children:"Prompt Template"})," component."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsx)(t.p,{children:"Connect the additional components to the rest of the flow:"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:["Connect the ",(0,r.jsx)(t.strong,{children:"Web Search"})," component's output to the ",(0,r.jsx)(t.strong,{children:"Type Convert"})," component's input."]}),"\n",(0,r.jsxs)(t.li,{children:["Connect the ",(0,r.jsx)(t.strong,{children:"Type Convert"})," component's output to the ",(0,r.jsx)(t.strong,{children:"Prompt Template"})," component's ",(0,r.jsx)(t.strong,{children:"context"})," input."]}),"\n"]}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.img,{alt:"Convert web search output to text input",src:n(42547).A+"",width:"4000",height:"1826"})}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["In the ",(0,r.jsx)(t.strong,{children:"Language Model"})," component, add your OpenAI API key."]}),"\n",(0,r.jsxs)(t.p,{children:["If you want to use a different provider or model, edit the ",(0,r.jsx)(t.strong,{children:"Model Provider"}),", ",(0,r.jsx)(t.strong,{children:"Model Name"}),", and ",(0,r.jsx)(t.strong,{children:"API Key"})," fields accordingly."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Click ",(0,r.jsx)(t.strong,{children:"Playground"}),", and then ask something relevant to your search query, such as ",(0,r.jsx)(t.code,{children:"latest news"})," or ",(0,r.jsx)(t.code,{children:"what's the latest research on the environment?"}),"."]}),"\n",(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"Result"}),(0,r.jsx)(t.p,{children:"The LLM uses the search results context, your chat message, and it's built-in training data to respond to your question.\nFor example:"}),(0,r.jsx)(m.Code,{codeConfig:j,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"Here are some of the latest news articles related to the environment:",props:{}}]},{tokens:[{content:"Ozone Pollution and Global Warming: A recent study highlights that ozone pollution is a significant global environmental concern, threatening human health and crop production while exacerbating global warming. Read more",props:{}}]},{tokens:[{content:"...",props:{}}]}],lang:"text"},annotations:[]}]})]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(t.h3,{id:"type-convert-parameters",children:"Type Convert parameters"}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Name"}),(0,r.jsx)(t.th,{children:"Display Name"}),(0,r.jsx)(t.th,{children:"Info"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"input_data"}),(0,r.jsx)(t.td,{children:"Input Data"}),(0,r.jsxs)(t.td,{children:["Input parameter. The data to convert. Accepts ",(0,r.jsx)(t.code,{children:"Data"}),", ",(0,r.jsx)(t.code,{children:"DataFrame"}),", or ",(0,r.jsx)(t.code,{children:"Message"})," input."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"output_type"}),(0,r.jsx)(t.td,{children:"Output Type"}),(0,r.jsxs)(t.td,{children:["Input parameter. The desired output type, as one of ",(0,r.jsx)(t.strong,{children:"Data"}),", ",(0,r.jsx)(t.strong,{children:"DataFrame"})," or ",(0,r.jsx)(t.strong,{children:"Message"}),"."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"output"}),(0,r.jsx)(t.td,{children:"Output"}),(0,r.jsxs)(t.td,{children:["Output parameter. The converted data in the specified format. The output port changes depending on the selected ",(0,r.jsx)(t.strong,{children:"Output Type"}),"."]})]})]})]}),"\n",(0,r.jsx)(t.h2,{id:"legacy-processing-components",children:"Legacy Processing components"}),"\n","\n",(0,r.jsx)(h.Ay,{}),"\n",(0,r.jsx)(t.p,{children:"The following Processing components are in legacy status:"}),"\n",(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"Alter Metadata"}),(0,r.jsxs)(t.p,{children:["Replace this legacy component with the ",(0,r.jsxs)(t.a,{href:"#data-operations",children:[(0,r.jsx)(t.strong,{children:"Data Operations"})," component"]}),"."]}),(0,r.jsxs)(t.p,{children:["This component modifies metadata of input objects. It can add new metadata, update existing metadata, and remove specified metadata fields. The component works with both ",(0,r.jsx)(t.code,{children:"Message"})," and ",(0,r.jsx)(t.code,{children:"Data"})," objects, and can also create a new ",(0,r.jsx)(t.code,{children:"Data"})," object from user-provided text."]}),(0,r.jsx)(t.p,{children:"It accepts the following parameters:"}),(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Name"}),(0,r.jsx)(t.th,{children:"Display Name"}),(0,r.jsx)(t.th,{children:"Info"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"input_value"}),(0,r.jsx)(t.td,{children:"Input"}),(0,r.jsx)(t.td,{children:"Input parameter. Objects to which Metadata should be added."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"text_in"}),(0,r.jsx)(t.td,{children:"User Text"}),(0,r.jsxs)(t.td,{children:["Input parameter. Text input; the value is contained in the 'text' attribute of the ",(0,r.jsx)(t.code,{children:"Data"})," object. Empty text entries are ignored."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"metadata"}),(0,r.jsx)(t.td,{children:"Metadata"}),(0,r.jsx)(t.td,{children:"Input parameter. Metadata to add to each object."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"remove_fields"}),(0,r.jsx)(t.td,{children:"Fields to Remove"}),(0,r.jsx)(t.td,{children:"Input parameter. Metadata fields to remove."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"data"}),(0,r.jsx)(t.td,{children:"Data"}),(0,r.jsx)(t.td,{children:"Output parameter. List of Input objects, each with added metadata."})]})]})]})]}),"\n",(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"Combine Data"}),(0,r.jsxs)(t.p,{children:["Replace this legacy component with the ",(0,r.jsxs)(t.a,{href:"#data-operations",children:[(0,r.jsx)(t.strong,{children:"Data Operations"})," component"]})," or the ",(0,r.jsxs)(t.a,{href:"/components-logic#loop",children:[(0,r.jsx)(t.strong,{children:"Loop"})," component"]}),"."]}),(0,r.jsxs)(t.p,{children:["This component combines multiple data sources into a single unified ",(0,r.jsx)(t.code,{children:"Data"})," object."]}),(0,r.jsxs)(t.p,{children:["The component iterates through a list of ",(0,r.jsx)(t.code,{children:"Data"})," objects, merging them into a single ",(0,r.jsx)(t.code,{children:"Data"})," object (",(0,r.jsx)(t.code,{children:"merged_data"}),").\nIf the input list is empty, it returns an empty data object.\nIf there's only one input data object, it returns that object unchanged."]}),(0,r.jsx)(t.p,{children:"The merging process uses the addition operator to combine data objects."})]}),"\n",(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"Combine Text"}),(0,r.jsxs)(t.p,{children:["Replace this legacy component with the ",(0,r.jsxs)(t.a,{href:"#data-operations",children:[(0,r.jsx)(t.strong,{children:"Data Operations"})," component"]}),"."]}),(0,r.jsxs)(t.p,{children:["This component concatenates two text inputs into a single text chunk using a specified delimiter, outputting a ",(0,r.jsx)(t.code,{children:"Message"})," object with the combined text."]})]}),"\n",(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"Create Data"}),(0,r.jsxs)(t.p,{children:["Replace this legacy component with the ",(0,r.jsxs)(t.a,{href:"#data-operations",children:[(0,r.jsx)(t.strong,{children:"Data Operations"})," component"]}),"."]}),(0,r.jsxs)(t.p,{children:["This component dynamically creates a ",(0,r.jsx)(t.code,{children:"Data"})," object with a specified number of fields and a text key."]}),(0,r.jsx)(t.p,{children:"It accepts the following parameters:"}),(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Name"}),(0,r.jsx)(t.th,{children:"Display Name"}),(0,r.jsx)(t.th,{children:"Info"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"number_of_fields"}),(0,r.jsx)(t.td,{children:"Number of Fields"}),(0,r.jsx)(t.td,{children:"Input parameter. The number of fields to be added to the record."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"text_key"}),(0,r.jsx)(t.td,{children:"Text Key"}),(0,r.jsx)(t.td,{children:"Input parameter. Key that identifies the field to be used as the text content."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"text_key_validator"}),(0,r.jsx)(t.td,{children:"Text Key Validator"}),(0,r.jsxs)(t.td,{children:["Input parameter. If enabled, checks if the given ",(0,r.jsx)(t.code,{children:"Text Key"})," is present in the given ",(0,r.jsx)(t.code,{children:"Data"}),"."]})]})]})]})]}),"\n",(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"Extract Key"}),(0,r.jsxs)(t.p,{children:["Replace this legacy component with the ",(0,r.jsxs)(t.a,{href:"#data-operations",children:[(0,r.jsx)(t.strong,{children:"Data Operations"})," component"]}),"."]}),(0,r.jsxs)(t.p,{children:["This component extracts a specific key from a ",(0,r.jsx)(t.code,{children:"Data"})," object and returns the value associated with that key."]})]}),"\n",(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"Data to DataFrame/Data to Message"}),(0,r.jsxs)(t.p,{children:["Replace these legacy components with newer Processing components, such as the ",(0,r.jsxs)(t.a,{href:"#data-operations",children:[(0,r.jsx)(t.strong,{children:"Data Operations"})," component"]})," and ",(0,r.jsxs)(t.a,{href:"#type-convert",children:[(0,r.jsx)(t.strong,{children:"Type Convert"})," component"]}),"."]}),(0,r.jsxs)(t.p,{children:["These components converted one or more ",(0,r.jsx)(t.code,{children:"Data"})," objects into a ",(0,r.jsx)(t.code,{children:"DataFrame"})," or ",(0,r.jsx)(t.code,{children:"Message"})," object."]}),(0,r.jsxs)(t.p,{children:["For the ",(0,r.jsx)(t.strong,{children:"Data to DataFrame"})," component, each ",(0,r.jsx)(t.code,{children:"Data"})," object corresponds to one row in the resulting ",(0,r.jsx)(t.code,{children:"DataFrame"}),".\nFields from the ",(0,r.jsx)(t.code,{children:".data"})," attribute become columns, and the ",(0,r.jsx)(t.code,{children:".text"})," field (if present) is placed in a ",(0,r.jsx)(t.code,{children:"text"})," column."]})]}),"\n",(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"Filter Data"}),(0,r.jsxs)(t.p,{children:["Replace this legacy component with the ",(0,r.jsxs)(t.a,{href:"#data-operations",children:[(0,r.jsx)(t.strong,{children:"Data Operations"})," component"]}),"."]}),(0,r.jsxs)(t.p,{children:["This component filters a ",(0,r.jsx)(t.code,{children:"Data"})," object based on a list of keys (",(0,r.jsx)(t.code,{children:"filter_criteria"}),"), returning a new ",(0,r.jsx)(t.code,{children:"Data"})," object (",(0,r.jsx)(t.code,{children:"filtered_data"}),") that contains only the key-value pairs that match the filter criteria."]})]}),"\n",(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"Filter Values"}),(0,r.jsxs)(t.p,{children:["Replace this legacy component with the ",(0,r.jsxs)(t.a,{href:"#data-operations",children:[(0,r.jsx)(t.strong,{children:"Data Operations"})," component"]}),"."]}),(0,r.jsx)(t.p,{children:"The Filter values component filters a list of data items based on a specified key, filter value, and comparison operator."}),(0,r.jsx)(t.p,{children:"It accepts the following parameters:"}),(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Name"}),(0,r.jsx)(t.th,{children:"Display Name"}),(0,r.jsx)(t.th,{children:"Info"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"input_data"}),(0,r.jsx)(t.td,{children:"Input data"}),(0,r.jsx)(t.td,{children:"Input parameter. The list of data items to filter."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"filter_key"}),(0,r.jsx)(t.td,{children:"Filter Key"}),(0,r.jsx)(t.td,{children:"Input parameter. The key to filter on."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"filter_value"}),(0,r.jsx)(t.td,{children:"Filter Value"}),(0,r.jsx)(t.td,{children:"Input parameter. The value to filter by."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"operator"}),(0,r.jsx)(t.td,{children:"Comparison Operator"}),(0,r.jsx)(t.td,{children:"Input parameter. The operator to apply for comparing the values."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"filtered_data"}),(0,r.jsx)(t.td,{children:"Filtered data"}),(0,r.jsx)(t.td,{children:"Output parameter. The resulting list of filtered data items."})]})]})]})]}),"\n",(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"JSON Cleaner"}),(0,r.jsxs)(t.p,{children:["Replace this legacy component with the ",(0,r.jsxs)(t.a,{href:"#parser",children:[(0,r.jsx)(t.strong,{children:"Parser"})," component"]}),"."]}),(0,r.jsx)(t.p,{children:"This component cleans JSON strings to ensure they are fully compliant with the JSON specification."}),(0,r.jsx)(t.p,{children:"It accepts the following parameters:"}),(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Name"}),(0,r.jsx)(t.th,{children:"Display Name"}),(0,r.jsx)(t.th,{children:"Info"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"json_str"}),(0,r.jsx)(t.td,{children:"JSON String"}),(0,r.jsx)(t.td,{children:"Input parameter. The JSON string to be cleaned. This can be a raw, potentially malformed JSON string produced by language models or other sources that may not fully comply with JSON specifications."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"remove_control_chars"}),(0,r.jsx)(t.td,{children:"Remove Control Characters"}),(0,r.jsx)(t.td,{children:"Input parameter. If set to True, this option removes control characters (ASCII characters 0-31 and 127) from the JSON string. This can help eliminate invisible characters that might cause parsing issues or make the JSON invalid."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"normalize_unicode"}),(0,r.jsx)(t.td,{children:"Normalize Unicode"}),(0,r.jsx)(t.td,{children:"Input parameter. When enabled, this option normalizes Unicode characters in the JSON string to their canonical composition form (NFC). This ensures consistent representation of Unicode characters across different systems and prevents potential issues with character encoding."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"validate_json"}),(0,r.jsx)(t.td,{children:"Validate JSON"}),(0,r.jsx)(t.td,{children:"Input parameter. If set to True, this option attempts to parse the JSON string to ensure it is well-formed before applying the final repair operation. It raises a ValueError if the JSON is invalid, allowing for early detection of major structural issues in the JSON."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"output"}),(0,r.jsx)(t.td,{children:"Cleaned JSON String"}),(0,r.jsx)(t.td,{children:"Output parameter. The resulting cleaned, repaired, and validated JSON string that fully complies with the JSON specification."})]})]})]})]}),"\n",(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"Message to Data"}),(0,r.jsxs)(t.p,{children:["Replace this legacy component with the ",(0,r.jsxs)(t.a,{href:"#type-convert",children:[(0,r.jsx)(t.strong,{children:"Type Convert"})," component"]}),"."]}),(0,r.jsxs)(t.p,{children:["This component converts ",(0,r.jsx)(t.code,{children:"Message"})," objects to ",(0,r.jsx)(t.code,{children:"Data"})," objects."]})]}),"\n",(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"Parse DataFrame"}),(0,r.jsxs)(t.p,{children:["Replace this legacy component with the ",(0,r.jsxs)(t.a,{href:"#dataframe-operations",children:[(0,r.jsx)(t.strong,{children:"DataFrame Operations"})," component"]})," or ",(0,r.jsxs)(t.a,{href:"#parser",children:[(0,r.jsx)(t.strong,{children:"Parser"})," component"]}),"."]}),(0,r.jsxs)(t.p,{children:["This component converts ",(0,r.jsx)(t.code,{children:"DataFrame"})," objects into plain text using templates."]}),(0,r.jsx)(t.p,{children:"It accepts the following parameters:"}),(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Name"}),(0,r.jsx)(t.th,{children:"Display Name"}),(0,r.jsx)(t.th,{children:"Info"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"df"}),(0,r.jsx)(t.td,{children:"DataFrame"}),(0,r.jsx)(t.td,{children:"Input parameter. The DataFrame to convert to text rows."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"template"}),(0,r.jsx)(t.td,{children:"Template"}),(0,r.jsxs)(t.td,{children:["Input parameter. Template for formatting (use ",(0,r.jsx)(t.code,{children:"{column_name}"})," placeholders)."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"sep"}),(0,r.jsx)(t.td,{children:"Separator"}),(0,r.jsx)(t.td,{children:"Input parameter. String to join rows in output."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"text"}),(0,r.jsx)(t.td,{children:"Text"}),(0,r.jsx)(t.td,{children:"Output parameter. All rows combined into single text."})]})]})]})]}),"\n",(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"Parse JSON"}),(0,r.jsxs)(t.p,{children:["Replace this legacy component with the ",(0,r.jsxs)(t.a,{href:"#parser",children:[(0,r.jsx)(t.strong,{children:"Parser"})," component"]}),"."]}),(0,r.jsxs)(t.p,{children:["This component converts and extracts JSON fields in ",(0,r.jsx)(t.code,{children:"Message"})," and ",(0,r.jsx)(t.code,{children:"Data"})," objects using JQ queries, then returns ",(0,r.jsx)(t.code,{children:"filtered_data"}),", which is a list of ",(0,r.jsx)(t.code,{children:"Data"})," objects."]})]}),"\n",(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"Regex Extractor"}),(0,r.jsxs)(t.p,{children:["Replace this legacy component with the ",(0,r.jsxs)(t.a,{href:"#parser",children:[(0,r.jsx)(t.strong,{children:"Parser"})," component"]}),"."]}),(0,r.jsx)(t.p,{children:"This component extracts patterns in text using regular expressions. It can be used to find and extract specific patterns or information in text."})]}),"\n",(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"Select Data"}),(0,r.jsxs)(t.p,{children:["Replace this legacy component with the ",(0,r.jsxs)(t.a,{href:"#data-operations",children:[(0,r.jsx)(t.strong,{children:"Data Operations"})," component"]}),"."]}),(0,r.jsxs)(t.p,{children:["This component selects a single ",(0,r.jsx)(t.code,{children:"Data"})," object from a list."]}),(0,r.jsx)(t.p,{children:"It accepts the following parameters:"}),(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Name"}),(0,r.jsx)(t.th,{children:"Display Name"}),(0,r.jsx)(t.th,{children:"Info"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"data_list"}),(0,r.jsx)(t.td,{children:"Data List"}),(0,r.jsx)(t.td,{children:"Input parameter. List of data to select from"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"data_index"}),(0,r.jsx)(t.td,{children:"Data Index"}),(0,r.jsx)(t.td,{children:"Input parameter. Index of the data to select"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"selected_data"}),(0,r.jsx)(t.td,{children:"Selected Data"}),(0,r.jsxs)(t.td,{children:["Output parameter. The selected ",(0,r.jsx)(t.code,{children:"Data"})," object."]})]})]})]})]}),"\n",(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"Update Data"}),(0,r.jsxs)(t.p,{children:["Replace this legacy component with the ",(0,r.jsxs)(t.a,{href:"#data-operations",children:[(0,r.jsx)(t.strong,{children:"Data Operations"})," component"]}),"."]}),(0,r.jsx)(t.p,{children:"This component dynamically updates or appends data with specified fields."}),(0,r.jsx)(t.p,{children:"It accepts the following parameters:"}),(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Name"}),(0,r.jsx)(t.th,{children:"Display Name"}),(0,r.jsx)(t.th,{children:"Info"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"old_data"}),(0,r.jsx)(t.td,{children:"Data"}),(0,r.jsx)(t.td,{children:"Input parameter. The records to update."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"number_of_fields"}),(0,r.jsx)(t.td,{children:"Number of Fields"}),(0,r.jsx)(t.td,{children:"Input parameter. The number of fields to add. The maximum is 15."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"text_key"}),(0,r.jsx)(t.td,{children:"Text Key"}),(0,r.jsx)(t.td,{children:"Input parameter. The key for text content."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"text_key_validator"}),(0,r.jsx)(t.td,{children:"Text Key Validator"}),(0,r.jsx)(t.td,{children:"Input parameter. Validates the text key presence."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"data"}),(0,r.jsx)(t.td,{children:"Data"}),(0,r.jsx)(t.td,{children:"Output parameter. The updated Data objects."})]})]})]})]})]})}function y(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(f,{...e})}):f(e)}function b(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}},42547:(e,t,n)=>{n.d(t,{A:()=>s});const s=n.p+"assets/images/component-type-convert-and-web-search-1eef7b9a7c1a243f4a08d9717728d0e1.png"},46445:(e,t,n)=>{n.d(t,{A:()=>s});const s=n.p+"assets/images/component-data-operations-select-key-80bade862d29f2851b01ee26413d495f.png"},49823:(e,t,n)=>{n.d(t,{A:()=>s});const s=n.p+"assets/images/component-split-text-fec2b1abb28e0852c8a172bbeb164b2c.png"},66539:(e,t,n)=>{n.d(t,{A:()=>s});const s=n.p+"assets/images/component-lambda-filter-76cd345c52fa41a59dcfac0205dc3068.png"},82798:(e,t,n)=>{n.d(t,{A:()=>s});const s=n.p+"assets/images/component-structured-output-23458b0d29eed6d092b557c7aaf6ab2c.png"},88103:(e,t,n)=>{n.d(t,{A:()=>s});const s=n.p+"assets/images/component-batch-run-19c94fbb0646b2731b37013b84dff1f6.png"},96218:(e,t,n)=>{n.d(t,{A:()=>s});const s=n.p+"assets/images/component-parser-1d1d72593f02991e5b14b6b1c112a744.png"},99e3:(e,t,n)=>{n.d(t,{A:()=>s});const s=n.p+"assets/images/component-python-interpreter-1ef9e7dec643a216fd5e83c2139d09c9.png"}}]); \ No newline at end of file diff --git a/assets/js/7819cc1c.c707c276.js b/assets/js/7819cc1c.c707c276.js new file mode 100644 index 0000000000..6a14bdea4b --- /dev/null +++ b/assets/js/7819cc1c.c707c276.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[6006],{9898:(e,t,n)=>{n.d(t,{A:()=>s});const s=n.p+"assets/images/component-llm-router-1b417082a0208a70065bc177a78fab67.png"},11470:(e,t,n)=>{n.d(t,{A:()=>v});var s=n(96540),r=n(18215),o=n(23104),a=n(56347),i=n(205),c=n(57485),l=n(31682),d=n(70679);function h(e){return s.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,s.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function p(e){const{values:t,children:n}=e;return(0,s.useMemo)(()=>{const e=t??function(e){return h(e).map(({props:{value:e,label:t,attributes:n,default:s}})=>({value:e,label:t,attributes:n,default:s}))}(n);return function(e){const t=(0,l.XI)(e,(e,t)=>e.value===t.value);if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map(e=>e.value).join(", ")}" found in . Every value needs to be unique.`)}(e),e},[t,n])}function u({value:e,tabValues:t}){return t.some(t=>t.value===e)}function x({queryString:e=!1,groupId:t}){const n=(0,a.W6)(),r=function({queryString:e=!1,groupId:t}){if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!t)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:e,groupId:t});return[(0,c.aZ)(r),(0,s.useCallback)(e=>{if(!r)return;const t=new URLSearchParams(n.location.search);t.set(r,e),n.replace({...n.location,search:t.toString()})},[r,n])]}function m(e){const{defaultValue:t,queryString:n=!1,groupId:r}=e,o=p(e),[a,c]=(0,s.useState)(()=>function({defaultValue:e,tabValues:t}){if(0===t.length)throw new Error("Docusaurus error: the component requires at least one children component");if(e){if(!u({value:e,tabValues:t}))throw new Error(`Docusaurus error: The has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${t.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}const n=t.find(e=>e.default)??t[0];if(!n)throw new Error("Unexpected error: 0 tabValues");return n.value}({defaultValue:t,tabValues:o})),[l,h]=x({queryString:n,groupId:r}),[m,j]=function({groupId:e}){const t=function(e){return e?`docusaurus.tab.${e}`:null}(e),[n,r]=(0,d.Dv)(t);return[n,(0,s.useCallback)(e=>{t&&r.set(e)},[t,r])]}({groupId:r}),g=(()=>{const e=l??m;return u({value:e,tabValues:o})?e:null})();(0,i.A)(()=>{g&&c(g)},[g]);return{selectedValue:a,selectValue:(0,s.useCallback)(e=>{if(!u({value:e,tabValues:o}))throw new Error(`Can't select invalid tab value=${e}`);c(e),h(e),j(e)},[h,j,o]),tabValues:o}}var j=n(92303);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=n(74848);function y({className:e,block:t,selectedValue:n,selectValue:s,tabValues:a}){const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,o.a_)(),l=e=>{const t=e.currentTarget,r=i.indexOf(t),o=a[r].value;o!==n&&(c(t),s(o))},d=e=>{let t=null;switch(e.key){case"Enter":l(e);break;case"ArrowRight":{const n=i.indexOf(e.currentTarget)+1;t=i[n]??i[0];break}case"ArrowLeft":{const n=i.indexOf(e.currentTarget)-1;t=i[n]??i[i.length-1];break}}t?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.A)("tabs",{"tabs--block":t},e),children:a.map(({value:e,label:t,attributes:s})=>(0,f.jsx)("li",{role:"tab",tabIndex:n===e?0:-1,"aria-selected":n===e,ref:e=>{i.push(e)},onKeyDown:d,onClick:l,...s,className:(0,r.A)("tabs__item",g.tabItem,s?.className,{"tabs__item--active":n===e}),children:t??e},e))})}function b({lazy:e,children:t,selectedValue:n}){const o=(Array.isArray(t)?t:[t]).filter(Boolean);if(e){const e=o.find(e=>e.props.value===n);return e?(0,s.cloneElement)(e,{className:(0,r.A)("margin-top--md",e.props.className)}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:o.map((e,t)=>(0,s.cloneElement)(e,{key:t,hidden:e.props.value!==n}))})}function D(e){const t=m(e);return(0,f.jsxs)("div",{className:(0,r.A)("tabs-container",g.tabList),children:[(0,f.jsx)(y,{...t,...e}),(0,f.jsx)(b,{...t,...e})]})}function v(e){const t=(0,j.A)();return(0,f.jsx)(D,{...e,children:h(e.children)},String(t))}},13533:(e,t,n)=>{n.d(t,{A:()=>s});const s=n.p+"assets/images/component-dataframe-operations-031488ccf4e3d3378f8842f0ea10682c.png"},17886:(e,t,n)=>{n.d(t,{A:()=>o});n(96540);var s=n(64058),r=n(74848);function o({name:e,...t}){const n=s[e];return n?(0,r.jsx)(n,{...t}):null}},19365:(e,t,n)=>{n.d(t,{A:()=>a});n(96540);var s=n(18215);const r={tabItem:"tabItem_Ymn6"};var o=n(74848);function a({children:e,hidden:t,className:n}){return(0,o.jsx)("div",{role:"tabpanel",className:(0,s.A)(r.tabItem,n),hidden:t,children:e})}},31929:(e,t,n)=>{n.d(t,{Ay:()=>c,RM:()=>a});var s=n(74848),r=n(28453),o=n(17886);const a=[];function i(e){const t={a:"a",p:"p",strong:"strong",...(0,r.R)(),...e.components};return(0,s.jsxs)(t.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,s.jsx)(o.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,s.jsx)(t.strong,{children:"Controls"})," in the ",(0,s.jsx)(t.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function c(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(i,{...e})}):i(e)}},36813:(e,t,n)=>{n.d(t,{Ay:()=>c,RM:()=>a});var s=n(74848),r=n(28453),o=n(17886);const a=[];function i(e){const t={a:"a",p:"p",strong:"strong",...(0,r.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(t.p,{children:["Legacy components are longer supported and can be removed in a future release.\nYou can continue to use them in existing flows, but it is recommended that you replace them with supported components as soon as possible.\nSuggested replacements are included in the ",(0,s.jsx)(t.strong,{children:"Legacy"})," banner on components in your flows.\nThey are also given in release notes and Langflow documentation whenever possible."]}),"\n",(0,s.jsxs)(t.p,{children:["If you aren't sure how to replace a legacy component, ",(0,s.jsx)(o.A,{name:"Search","aria-hidden":"true"})," ",(0,s.jsx)(t.strong,{children:"Search"})," for components by provider, service, or component name.\nThe component may have been deprecated in favor of a completely new component, a similar component, or a new version of the same component in a different category."]}),"\n",(0,s.jsxs)(t.p,{children:["If there is no obvious replacement, consider whether another component can be adapted to your use case.\nFor example, many ",(0,s.jsx)(o.A,{name:"Component","aria-hidden":"true"})," ",(0,s.jsx)(t.strong,{children:"Core components"})," provide generic functionality that can support multiple providers and use cases, such as the ",(0,s.jsxs)(t.a,{href:"/components-data#api-request",children:[(0,s.jsx)(t.strong,{children:"API Request"})," component"]}),"."]}),"\n",(0,s.jsxs)(t.p,{children:["If neither of these options are viable, you could use the legacy component's code to create your own custom component, or ",(0,s.jsx)(t.a,{href:"/contributing-github-issues",children:"start a discussion"})," about the legacy component."]}),"\n",(0,s.jsxs)(t.p,{children:["To discourage use of legacy components in new flows, these components are hidden by default.\nIn the visual editor, you can click ",(0,s.jsx)(o.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,s.jsx)(t.strong,{children:"Component settings"})," to toggle the ",(0,s.jsx)(t.strong,{children:"Legacy"})," filter."]})]})}function c(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(i,{...e})}):i(e)}},40966:(e,t,n)=>{n.r(t),n.d(t,{CH:()=>j,assets:()=>m,chCodeConfig:()=>g,contentTitle:()=>x,default:()=>b,frontMatter:()=>u,metadata:()=>s,toc:()=>f});const s=JSON.parse('{"id":"Components/components-processing","title":"Processing components","description":"Processing components process and transform data within a flow.","source":"@site/docs/Components/components-processing.mdx","sourceDirName":"Components","slug":"/components-processing","permalink":"/components-processing","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Processing components","slug":"/components-processing"},"sidebar":"docs","previous":{"title":"Data","permalink":"/components-data"},"next":{"title":"Prompt Template","permalink":"/components-prompts"}}');var r=n(74848),o=n(28453),a=n(24754),i=n(17886),c=n(11470),l=n(19365),d=n(31929),h=n(72736),p=n(36813);const u={title:"Processing components",slug:"/components-processing"},x=void 0,m={},j={annotations:a.hk,Code:a.Cy},g={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},f=[{value:"Prompt Template",id:"prompt-template",level:2},{value:"Batch Run",id:"batch-run",level:2},{value:"Use the Batch Run component in a flow",id:"use-the-batch-run-component-in-a-flow",level:3},{value:"Batch Run parameters",id:"batch-run-parameters",level:3},...d.RM,{value:"Data Operations",id:"data-operations",level:2},{value:"Use the Data Operations component in a flow",id:"use-the-data-operations-component-in-a-flow",level:3},{value:"Data Operations parameters",id:"data-operations-parameters",level:3},{value:"Available data operations",id:"available-data-operations",level:4},{value:"DataFrame Operations",id:"dataframe-operations",level:2},{value:"Use the DataFrame Operations component in a flow",id:"use-the-dataframe-operations-component-in-a-flow",level:3},{value:"DataFrame Operations parameters",id:"dataframe-operations-parameters",level:3},{value:"LLM Router",id:"llm-router",level:2},{value:"LLM Router parameters",id:"llm-router-parameters",level:3},...d.RM,{value:"LLM Router outputs",id:"llm-router-outputs",level:3},{value:"Parser",id:"parser",level:2},{value:"Parsing modes",id:"parsing-modes",level:3},...h.RM,...d.RM,...d.RM,{value:"Test and troubleshoot parsed text",id:"test-and-troubleshoot-parsed-text",level:3},{value:"Python Interpreter",id:"python-interpreter",level:2},{value:"Use the Python Interpreter in a flow",id:"use-the-python-interpreter-in-a-flow",level:3},{value:"Python Interpreter parameters",id:"python-interpreter-parameters",level:3},{value:"Save File",id:"save-file",level:2},{value:"Smart Function",id:"smart-function",level:2},{value:"Smart Function parameters",id:"smart-function-parameters",level:3},...d.RM,{value:"Split Text",id:"split-text",level:2},{value:"Split Text parameters",id:"split-text-parameters",level:3},...d.RM,{value:"Tokenization errors due to chunk size",id:"chunk-size",level:3},{value:"Other text splitters",id:"other-text-splitters",level:3},{value:"Structured Output",id:"structured-output",level:2},{value:"Use the Structured Output component in a flow",id:"use-the-structured-output-component-in-a-flow",level:3},{value:"Structured Output parameters",id:"structured-output-parameters",level:3},...d.RM,{value:"Output Schema options",id:"output-schema-options",level:4},{value:"Type Convert",id:"type-convert",level:2},{value:"Use the Type Convert component in a flow",id:"use-the-type-convert-component-in-a-flow",level:3},{value:"Type Convert parameters",id:"type-convert-parameters",level:3},{value:"Legacy Processing components",id:"legacy-processing-components",level:2},...p.RM];function y(e){const t={a:"a",admonition:"admonition",code:"code",em:"em",h2:"h2",h3:"h3",h4:"h4",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,o.R)(),...e.components},{Details:s}=t;return j||D("CH",!1),j.Code||D("CH.Code",!0),s||D("Details",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n","\n",(0,r.jsx)(t.p,{children:"Processing components process and transform data within a flow.\nThey have many uses, including:"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:["Feed instructions and context to your LLMs and agents with the ",(0,r.jsxs)(t.a,{href:"#prompt-template",children:[(0,r.jsx)(t.strong,{children:"Prompt Template"})," component"]}),"."]}),"\n",(0,r.jsxs)(t.li,{children:["Extract content from larger chunks of data with a ",(0,r.jsxs)(t.a,{href:"#parser",children:[(0,r.jsx)(t.strong,{children:"Parser"})," component"]}),"."]}),"\n",(0,r.jsxs)(t.li,{children:["Filter data with natural language with the ",(0,r.jsxs)(t.a,{href:"#smart-function",children:[(0,r.jsx)(t.strong,{children:"Smart Function"})," component"]}),"."]}),"\n",(0,r.jsxs)(t.li,{children:["Save data to your local machine with the ",(0,r.jsxs)(t.a,{href:"#save-file",children:[(0,r.jsx)(t.strong,{children:"Save File"})," component"]}),"."]}),"\n",(0,r.jsxs)(t.li,{children:["Transform data into a different data type with the ",(0,r.jsxs)(t.a,{href:"#type-convert",children:[(0,r.jsx)(t.strong,{children:"Type Convert"})," component"]})," to pass it between incompatible components."]}),"\n"]}),"\n",(0,r.jsx)(t.h2,{id:"prompt-template",children:"Prompt Template"}),"\n",(0,r.jsxs)(t.p,{children:["See ",(0,r.jsxs)(t.a,{href:"/components-prompts",children:[(0,r.jsx)(t.strong,{children:"Prompt Template"})," component"]}),"."]}),"\n",(0,r.jsx)(t.h2,{id:"batch-run",children:"Batch Run"}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Batch Run"})," component runs a language model over ",(0,r.jsx)(t.em,{children:"each row of one text column"})," in a ",(0,r.jsx)(t.a,{href:"/data-types#dataframe",children:(0,r.jsx)(t.code,{children:"DataFrame"})}),", and then returns a new ",(0,r.jsx)(t.code,{children:"DataFrame"})," with the original text and an LLM response.\nThe output contains the following columns:"]}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.code,{children:"text_input"}),": The original text from the input ",(0,r.jsx)(t.code,{children:"DataFrame"})]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.code,{children:"model_response"}),": The model's response for each input"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.code,{children:"batch_index"}),": The 0-indexed processing order for all rows in the ",(0,r.jsx)(t.code,{children:"DataFrame"})]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.code,{children:"metadata"})," (optional): Additional information about the processing"]}),"\n"]}),"\n",(0,r.jsx)(t.h3,{id:"use-the-batch-run-component-in-a-flow",children:"Use the Batch Run component in a flow"}),"\n",(0,r.jsxs)(t.p,{children:["If you pass the ",(0,r.jsx)(t.strong,{children:"Batch Run"})," output to a ",(0,r.jsxs)(t.a,{href:"/components-processing#parser",children:[(0,r.jsx)(t.strong,{children:"Parser"})," component"]}),", you can use variables in the parsing template to reference these keys, such as ",(0,r.jsx)(t.code,{children:"{text_input}"})," and ",(0,r.jsx)(t.code,{children:"{model_response}"}),".\nThis is demonstrated in the following example."]}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.img,{alt:"A batch run component connected to OpenAI and a Parser",src:n(88103).A+"",width:"4000",height:"2728"})}),"\n",(0,r.jsxs)(t.ol,{children:["\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Connect any language model component to a ",(0,r.jsx)(t.strong,{children:"Batch Run"})," component's ",(0,r.jsx)(t.strong,{children:"Language model"})," port."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Connect ",(0,r.jsx)(t.code,{children:"DataFrame"})," output from another component to the ",(0,r.jsx)(t.strong,{children:"Batch Run"})," component's ",(0,r.jsx)(t.strong,{children:"DataFrame"})," input.\nFor example, you could connect a ",(0,r.jsx)(t.strong,{children:"File"})," component with a CSV file."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["In the ",(0,r.jsx)(t.strong,{children:"Batch Run"})," component's ",(0,r.jsx)(t.strong,{children:"Column Name"})," field, enter the name of the column in the incoming ",(0,r.jsx)(t.code,{children:"DataFrame"})," that contains the text to process.\nFor example, if you want to extract text from a ",(0,r.jsx)(t.code,{children:"name"})," column in a CSV file, enter ",(0,r.jsx)(t.code,{children:"name"})," in the ",(0,r.jsx)(t.strong,{children:"Column Name"})," field."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Connect the ",(0,r.jsx)(t.strong,{children:"Batch Run"})," component's ",(0,r.jsx)(t.strong,{children:"Batch Results"})," output to a ",(0,r.jsx)(t.strong,{children:"Parser"})," component's ",(0,r.jsx)(t.strong,{children:"DataFrame"})," input."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Optional: In the ",(0,r.jsx)(t.strong,{children:"Batch Run"})," ",(0,r.jsx)(t.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),", click ",(0,r.jsx)(i.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Controls"}),", enable the ",(0,r.jsx)(t.strong,{children:"System Message"})," parameter, click ",(0,r.jsx)(t.strong,{children:"Close"}),", and then enter an instruction for how you want the LLM to process each cell extracted from the file.\nFor example, ",(0,r.jsx)(t.code,{children:"Create a business card for each name."})]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["In the ",(0,r.jsx)(t.strong,{children:"Parser"})," component's ",(0,r.jsx)(t.strong,{children:"Template"})," field, enter a template for processing the ",(0,r.jsx)(t.strong,{children:"Batch Run"})," component's new ",(0,r.jsx)(t.code,{children:"DataFrame"})," columns (",(0,r.jsx)(t.code,{children:"text_input"}),", ",(0,r.jsx)(t.code,{children:"model_response"}),", and ",(0,r.jsx)(t.code,{children:"batch_index"}),"):"]}),"\n",(0,r.jsxs)(t.p,{children:["For example, this template uses three columns from the resulting, post-batch ",(0,r.jsx)(t.code,{children:"DataFrame"}),":"]}),"\n",(0,r.jsx)(j.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"record_number: {batch_index}, name: {text_input}, summary: {model_response}",props:{}}]}],lang:"text"},annotations:[]}]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["To test the processing, click the ",(0,r.jsx)(t.strong,{children:"Parser"})," component, click ",(0,r.jsx)(i.A,{name:"Play","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Run component"}),", and then click ",(0,r.jsx)(i.A,{name:"TextSearch","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Inspect output"})," to view the final ",(0,r.jsx)(t.code,{children:"DataFrame"}),"."]}),"\n",(0,r.jsxs)(t.p,{children:["You can also connect a ",(0,r.jsx)(t.strong,{children:"Chat Output"})," component to the ",(0,r.jsx)(t.strong,{children:"Parser"})," component if you want to see the output in the ",(0,r.jsx)(t.strong,{children:"Playground"}),"."]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(t.h3,{id:"batch-run-parameters",children:"Batch Run parameters"}),"\n",(0,r.jsx)(d.Ay,{}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Name"}),(0,r.jsx)(t.th,{children:"Type"}),(0,r.jsx)(t.th,{children:"Description"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"model"}),(0,r.jsx)(t.td,{children:"HandleInput"}),(0,r.jsx)(t.td,{children:"Input parameter. Connect the 'Language Model' output from a language model component. Required."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"system_message"}),(0,r.jsx)(t.td,{children:"MultilineInput"}),(0,r.jsx)(t.td,{children:"Input parameter. A multi-line system instruction for all rows in the DataFrame."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"df"}),(0,r.jsx)(t.td,{children:"DataFrameInput"}),(0,r.jsx)(t.td,{children:"Input parameter. The DataFrame whose column is treated as text messages, as specified by 'column_name'. Required."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"column_name"}),(0,r.jsx)(t.td,{children:"MessageTextInput"}),(0,r.jsx)(t.td,{children:"Input parameter. The name of the DataFrame column to treat as text messages. If empty, all columns are formatted in TOML."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"output_column_name"}),(0,r.jsx)(t.td,{children:"MessageTextInput"}),(0,r.jsxs)(t.td,{children:["Input parameter. Name of the column where the model's response is stored. Default=",(0,r.jsx)(t.code,{children:"model_response"}),"."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"enable_metadata"}),(0,r.jsx)(t.td,{children:"BoolInput"}),(0,r.jsxs)(t.td,{children:["Input parameter. If ",(0,r.jsx)(t.code,{children:"True"}),", add metadata to the output DataFrame."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"batch_results"}),(0,r.jsx)(t.td,{children:"DataFrame"}),(0,r.jsx)(t.td,{children:"Output parameter. A DataFrame with all original columns plus the model's response column."})]})]})]}),"\n",(0,r.jsx)(t.h2,{id:"data-operations",children:"Data Operations"}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Data Operations"})," component performs operations on ",(0,r.jsx)(t.a,{href:"/data-types#data",children:(0,r.jsx)(t.code,{children:"Data"})})," objects, including extracting, filtering, and editing keys and values in the ",(0,r.jsx)(t.code,{children:"Data"}),".\nFor all options, see ",(0,r.jsx)(t.a,{href:"#available-data-operations",children:"Available data operations"}),".\nThe output is a new ",(0,r.jsx)(t.code,{children:"Data"})," object containing the modified data after running the selected operation."]}),"\n",(0,r.jsx)(t.h3,{id:"use-the-data-operations-component-in-a-flow",children:"Use the Data Operations component in a flow"}),"\n",(0,r.jsxs)(t.p,{children:["The following example demonstrates how to use a ",(0,r.jsx)(t.strong,{children:"Data Operations"})," component in a flow using data from a webhook payload:"]}),"\n",(0,r.jsxs)(t.ol,{children:["\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Create a flow with a ",(0,r.jsx)(t.strong,{children:"Webhook"})," component and a ",(0,r.jsx)(t.strong,{children:"Data Operations"})," component, and then connect the ",(0,r.jsx)(t.strong,{children:"Webhook"})," component's output to the ",(0,r.jsx)(t.strong,{children:"Data Operations"})," component's ",(0,r.jsx)(t.strong,{children:"Data"})," input."]}),"\n",(0,r.jsxs)(t.p,{children:["All operations in the ",(0,r.jsx)(t.strong,{children:"Data Operations"})," component require at least one ",(0,r.jsx)(t.code,{children:"Data"})," input from another component.\nIf the preceding component doesn't produce ",(0,r.jsx)(t.code,{children:"Data"})," output, you can use another component, such as the ",(0,r.jsx)(t.strong,{children:"Type Convert"})," component, to reformat the data before passing it to the ",(0,r.jsx)(t.strong,{children:"Data Operations"})," component.\nAlternatively, you could consider using a component that is designed to process the original data type, such as the ",(0,r.jsx)(t.strong,{children:"Parser"})," or ",(0,r.jsx)(t.strong,{children:"DataFrame Operations"})," components."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["In the ",(0,r.jsx)(t.strong,{children:"Operations"})," field, select the operation you want to perform on the incoming ",(0,r.jsx)(t.code,{children:"Data"}),".\nFor this example, select the ",(0,r.jsx)(t.strong,{children:"Select Keys"})," operation."]}),"\n",(0,r.jsx)(t.admonition,{type:"tip",children:(0,r.jsxs)(t.p,{children:["You can select only one operation.\nIf you need to perform multiple operations on the data, you can chain multiple ",(0,r.jsx)(t.strong,{children:"Data Operations"})," components together to execute each operation in sequence.\nFor more complex multi-step operations, consider using a component like the ",(0,r.jsx)(t.strong,{children:"Smart Function"})," component."]})}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Under ",(0,r.jsx)(t.strong,{children:"Select Keys"}),", add keys for ",(0,r.jsx)(t.code,{children:"name"}),", ",(0,r.jsx)(t.code,{children:"username"}),", and ",(0,r.jsx)(t.code,{children:"email"}),".\nClick ",(0,r.jsx)(i.A,{name:"Plus","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Add more"})," to add a field for each key."]}),"\n",(0,r.jsxs)(t.p,{children:["For this example, assume that the webhook will receive consistent payloads that always contain ",(0,r.jsx)(t.code,{children:"name"}),", ",(0,r.jsx)(t.code,{children:"username"}),", and ",(0,r.jsx)(t.code,{children:"email"})," keys.\nThe ",(0,r.jsx)(t.strong,{children:"Select Keys"})," operation extracts the value of these keys from each incoming payload."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Optional: If you want to view the output in the ",(0,r.jsx)(t.strong,{children:"Playground"}),", connect the ",(0,r.jsx)(t.strong,{children:"Data Operations"})," component's output to a ",(0,r.jsx)(t.strong,{children:"Chat Output"})," component."]}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.img,{alt:"A flow with Webhook, Data Operations, and Chat Output components",src:n(46445).A+"",width:"4000",height:"1920"})}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["To test the flow, send the following request to your flow's webhook endpoint.\nFor more information about the webhook endpoint, see ",(0,r.jsx)(t.a,{href:"/webhook",children:"Trigger flows with webhooks"}),"."]}),"\n",(0,r.jsx)(j.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:'POST "http://',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_SERVER_URL",props:{style:{color:"#C9D1D9"}}},{content:"/api/v1/webhook/",props:{style:{color:"#A5D6FF"}}},{content:"$FLOW_ID",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:"-H ",props:{style:{color:"#C9D1D9"}}},{content:'"Content-Type: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:"-H ",props:{style:{color:"#C9D1D9"}}},{content:'"x-api-key: ',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:"-d ",props:{style:{color:"#C9D1D9"}}},{content:"'{",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "id": 1,',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "name": "Leanne Graham",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "username": "Bret",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "email": "Sincere@april.biz",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "address": {',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "street": "Main Street",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "suite": "Apt. 556",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "city": "Springfield",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "zipcode": "92998-3874",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "geo": {',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "lat": "-37.3159",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "lng": "81.1496"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" }",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" },",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "phone": "1-770-736-8031 x56442",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "website": "hildegard.org",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "company": {',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "name": "Acme-Corp",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "catchPhrase": "Multi-layered client-server neural-net",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "bs": "harness real-time e-markets"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" }",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"}'",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["To view the ",(0,r.jsx)(t.code,{children:"Data"})," resulting from the ",(0,r.jsx)(t.strong,{children:"Select Keys"})," operation, do one of the following:"]}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:["If you attached a ",(0,r.jsx)(t.strong,{children:"Chat Output"})," component, open the ",(0,r.jsx)(t.strong,{children:"Playground"})," to see the result as a chat message."]}),"\n",(0,r.jsxs)(t.li,{children:["Click ",(0,r.jsx)(i.A,{name:"TextSearch","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Inspect output"})," on the ",(0,r.jsx)(t.strong,{children:"Data Operations"})," component."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(t.h3,{id:"data-operations-parameters",children:"Data Operations parameters"}),"\n",(0,r.jsxs)(t.p,{children:["Many parameters are conditional based on the selected ",(0,r.jsx)(t.strong,{children:"Operation"})," (",(0,r.jsx)(t.code,{children:"operation"}),")."]}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Name"}),(0,r.jsx)(t.th,{children:"Display Name"}),(0,r.jsx)(t.th,{children:"Info"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"data"}),(0,r.jsx)(t.td,{children:"Data"}),(0,r.jsxs)(t.td,{children:["Input parameter. The ",(0,r.jsx)(t.code,{children:"Data"})," object to operate on."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"operation"}),(0,r.jsx)(t.td,{children:"Operation"}),(0,r.jsxs)(t.td,{children:["Input parameter. The operation to perform on the data. See ",(0,r.jsx)(t.a,{href:"#available-data-operations",children:"Available data operations"})]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"select_keys_input"}),(0,r.jsx)(t.td,{children:"Select Keys"}),(0,r.jsx)(t.td,{children:"Input parameter. A list of keys to select from the data."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"filter_key"}),(0,r.jsx)(t.td,{children:"Filter Key"}),(0,r.jsx)(t.td,{children:"Input parameter. The key to filter by."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"operator"}),(0,r.jsx)(t.td,{children:"Comparison Operator"}),(0,r.jsx)(t.td,{children:"Input parameter. The operator to apply for comparing values."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"filter_values"}),(0,r.jsx)(t.td,{children:"Filter Values"}),(0,r.jsx)(t.td,{children:"Input parameter. A list of values to filter by."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"append_update_data"}),(0,r.jsx)(t.td,{children:"Append or Update"}),(0,r.jsx)(t.td,{children:"Input parameter. The data to append or update the existing data with."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"remove_keys_input"}),(0,r.jsx)(t.td,{children:"Remove Keys"}),(0,r.jsx)(t.td,{children:"Input parameter. A list of keys to remove from the data."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"rename_keys_input"}),(0,r.jsx)(t.td,{children:"Rename Keys"}),(0,r.jsx)(t.td,{children:"Input parameter. A list of keys to rename in the data."})]})]})]}),"\n",(0,r.jsx)(t.h4,{id:"available-data-operations",children:"Available data operations"}),"\n",(0,r.jsxs)(t.p,{children:["Options for the ",(0,r.jsx)(t.code,{children:"operations"})," input parameter are as follows.\nAll operations act on an incoming ",(0,r.jsx)(t.code,{children:"Data"})," object."]}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Name"}),(0,r.jsx)(t.th,{children:"Required Inputs"}),(0,r.jsx)(t.th,{children:"Process"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Select Keys"}),(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"select_keys_input"})}),(0,r.jsx)(t.td,{children:"Selects specific keys from the data."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Literal Eval"}),(0,r.jsx)(t.td,{children:"None"}),(0,r.jsx)(t.td,{children:"Evaluates string values as Python literals."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Combine"}),(0,r.jsx)(t.td,{children:"None"}),(0,r.jsx)(t.td,{children:"Combines multiple data objects into one."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Filter Values"}),(0,r.jsxs)(t.td,{children:[(0,r.jsx)(t.code,{children:"filter_key"}),", ",(0,r.jsx)(t.code,{children:"filter_values"}),", ",(0,r.jsx)(t.code,{children:"operator"})]}),(0,r.jsx)(t.td,{children:"Filters data based on key-value pair."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Append or Update"}),(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"append_update_data"})}),(0,r.jsx)(t.td,{children:"Adds or updates key-value pairs."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Remove Keys"}),(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"remove_keys_input"})}),(0,r.jsx)(t.td,{children:"Removes specified keys from the data."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Rename Keys"}),(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"rename_keys_input"})}),(0,r.jsx)(t.td,{children:"Renames keys in the data."})]})]})]}),"\n",(0,r.jsx)(t.h2,{id:"dataframe-operations",children:"DataFrame Operations"}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"DataFrame Operations"})," component performs operations on ",(0,r.jsx)(t.a,{href:"/data-types#dataframe",children:(0,r.jsx)(t.code,{children:"DataFrame"})})," (table) rows and columns, including schema changes, record changes, sorting, and filtering.\nFor all options, see ",(0,r.jsx)(t.a,{href:"#dataframe-operations-parameters",children:"DataFrame Operations parameters"}),"."]}),"\n",(0,r.jsxs)(t.p,{children:["The output is a new ",(0,r.jsx)(t.code,{children:"DataFrame"})," containing the modified data after running the selected operation."]}),"\n",(0,r.jsx)(t.h3,{id:"use-the-dataframe-operations-component-in-a-flow",children:"Use the DataFrame Operations component in a flow"}),"\n",(0,r.jsxs)(t.p,{children:["The following steps explain how to configure a ",(0,r.jsx)(t.strong,{children:"DataFrame Operations"})," component in a flow.\nYou can follow along with an example or use your own flow.\nThe only requirement is that the preceding component must create ",(0,r.jsx)(t.code,{children:"DataFrame"})," output that you can pass to the ",(0,r.jsx)(t.strong,{children:"DataFrame Operations"})," component."]}),"\n",(0,r.jsxs)(t.ol,{children:["\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsx)(t.p,{children:"Create a new flow or use an existing flow."}),"\n",(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"Example: API response extraction flow"}),(0,r.jsxs)(t.p,{children:["The following example flow uses five components to extract ",(0,r.jsx)(t.code,{children:"Data"})," from an API response, transform it to a ",(0,r.jsx)(t.code,{children:"DataFrame"}),", and then perform further processing on the tabular data using a ",(0,r.jsx)(t.strong,{children:"DataFrame Operations"})," component.\nThe sixth component, ",(0,r.jsx)(t.strong,{children:"Chat Output"}),", is optional in this example.\nIt only serves as a convenient way for you to view the final output in the ",(0,r.jsx)(t.strong,{children:"Playground"}),", rather than inspecting the component logs."]}),(0,r.jsx)(t.p,{children:(0,r.jsx)(t.img,{alt:"A flow that ingests an API response, extracts it to a DataFrame with a Smart Function component, and the processes it through a DataFrame Operations component",src:n(13533).A+"",width:"4000",height:"2120"})}),(0,r.jsxs)(t.p,{children:["If you want to use this example to test the ",(0,r.jsx)(t.strong,{children:"DataFrame Operations"})," component, do the following:"]}),(0,r.jsxs)(t.ol,{children:["\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsx)(t.p,{children:"Create a flow with the following components:"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsx)(t.li,{children:(0,r.jsx)(t.strong,{children:"API Request"})}),"\n",(0,r.jsx)(t.li,{children:(0,r.jsx)(t.strong,{children:"Language Model"})}),"\n",(0,r.jsx)(t.li,{children:(0,r.jsx)(t.strong,{children:"Smart Function"})}),"\n",(0,r.jsx)(t.li,{children:(0,r.jsx)(t.strong,{children:"Type Convert"})}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Configure the ",(0,r.jsxs)(t.a,{href:"#smart-function",children:[(0,r.jsx)(t.strong,{children:"Smart Function"})," component"]})," and its dependencies:"]}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"API Request"}),": Configure the ",(0,r.jsxs)(t.a,{href:"/components-data#api-request",children:[(0,r.jsx)(t.strong,{children:"API Request"})," component"]})," to get JSON data from an endpoint of your choice, and then connect the ",(0,r.jsx)(t.strong,{children:"API Response"})," output to the ",(0,r.jsx)(t.strong,{children:"Smart Function"})," component's ",(0,r.jsx)(t.strong,{children:"Data"})," input."]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"Language Model"}),": Select your preferred provider and model, and then enter a valid API key.\nChange the output to ",(0,r.jsx)(t.strong,{children:"Language Model"}),", and then connect the ",(0,r.jsx)(t.code,{children:"LanguageModel"})," output to the ",(0,r.jsx)(t.strong,{children:"Smart Function"})," component's ",(0,r.jsx)(t.strong,{children:"Language Model"})," input."]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"Smart Function"}),": In the ",(0,r.jsx)(t.strong,{children:"Instructions"})," field, enter natural language instructions to extract data from the API response.\nYour instructions depend on the response content and desired outcome.\nFor example, if the response contains a large ",(0,r.jsx)(t.code,{children:"result"})," field, you might provide instructions like ",(0,r.jsx)(t.code,{children:"explode the result field out into a Data object"}),"."]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Convert the ",(0,r.jsx)(t.strong,{children:"Smart Function"})," component's ",(0,r.jsx)(t.code,{children:"Data"})," output to ",(0,r.jsx)(t.code,{children:"DataFrame"}),":"]}),"\n",(0,r.jsxs)(t.ol,{children:["\n",(0,r.jsxs)(t.li,{children:["Connect the ",(0,r.jsx)(t.strong,{children:"Filtered Data"})," output to the ",(0,r.jsx)(t.strong,{children:"Type Convert"})," component's ",(0,r.jsx)(t.strong,{children:"Data"})," input."]}),"\n",(0,r.jsxs)(t.li,{children:["Set the ",(0,r.jsx)(t.strong,{children:"Type Convert"})," component's ",(0,r.jsx)(t.strong,{children:"Output Type"})," to ",(0,r.jsx)(t.strong,{children:"DataFrame"}),"."]}),"\n"]}),"\n"]}),"\n"]}),(0,r.jsxs)(t.p,{children:["Now the flow is ready for you to add the ",(0,r.jsx)(t.strong,{children:"DataFrame Operations"})," component."]})]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Add a ",(0,r.jsx)(t.strong,{children:"DataFrame Operations"})," component to the flow, and then connect ",(0,r.jsx)(t.code,{children:"DataFrame"})," output from another component to the ",(0,r.jsx)(t.strong,{children:"DataFrame"})," input."]}),"\n",(0,r.jsxs)(t.p,{children:["All operations in the ",(0,r.jsx)(t.strong,{children:"DataFrame Operations"})," component require at least one ",(0,r.jsx)(t.code,{children:"DataFrame"})," input from another component.\nIf a component doesn't produce ",(0,r.jsx)(t.code,{children:"DataFrame"})," output, you can use another component, such as the ",(0,r.jsx)(t.strong,{children:"Type Convert"})," component, to reformat the data before passing it to the ",(0,r.jsx)(t.strong,{children:"DataFrame Operations"})," component.\nAlternatively, you could consider using a component that is designed to process the original data type, such as the ",(0,r.jsx)(t.strong,{children:"Parser"})," or ",(0,r.jsx)(t.strong,{children:"Data Operations"})," components."]}),"\n",(0,r.jsxs)(t.p,{children:["If you are following along with the example flow, connect the ",(0,r.jsx)(t.strong,{children:"Type Convert"})," component's ",(0,r.jsx)(t.strong,{children:"DataFrame Output"})," port to the ",(0,r.jsx)(t.strong,{children:"DataFrame"})," input."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["In the ",(0,r.jsx)(t.strong,{children:"Operations"})," field, select the operation you want to perform on the incoming ",(0,r.jsx)(t.code,{children:"DataFrame"}),".\nFor example, the ",(0,r.jsx)(t.strong,{children:"Filter"})," operation filters the rows based on a specified column and value."]}),"\n",(0,r.jsx)(t.admonition,{type:"tip",children:(0,r.jsxs)(t.p,{children:["You can select only one operation.\nIf you need to perform multiple operations on the data, you can chain multiple ",(0,r.jsx)(t.strong,{children:"DataFrame Operations"})," components together to execute each operation in sequence.\nFor more complex multi-step operations, like dramatic schema changes or pivots, consider using an LLM-powered component, like the ",(0,r.jsx)(t.strong,{children:"Structured Output"})," or ",(0,r.jsx)(t.strong,{children:"Smart Function"})," component, as a replacement or preparation for the ",(0,r.jsx)(t.strong,{children:"DataFrame Operations"})," component."]})}),"\n",(0,r.jsxs)(t.p,{children:["If you're following along with the example flow, select any operation that you want to apply to the data that was extracted by the ",(0,r.jsx)(t.strong,{children:"Smart Function"})," component.\nTo view the contents of the incoming ",(0,r.jsx)(t.code,{children:"DataFrame"}),", click ",(0,r.jsx)(i.A,{name:"Play","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Run component"})," on the ",(0,r.jsx)(t.strong,{children:"Type Convert"})," component, and then ",(0,r.jsx)(i.A,{name:"TextSearch","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Inspect output"}),".\nIf the ",(0,r.jsx)(t.code,{children:"DataFrame"})," seems malformed, click ",(0,r.jsx)(i.A,{name:"TextSearch","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Inspect output"})," on each upstream component to determine where the error occurs, and then modify your flow's configuration as needed.\nFor example, if the ",(0,r.jsx)(t.strong,{children:"Smart Function"})," component didn't extract the expected fields, modify your instructions or verify that the given fields are present in the ",(0,r.jsx)(t.strong,{children:"API Response"})," output."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Configure the operation's parameters.\nThe specific parameters depend on the selected operation.\nFor example, if you select the ",(0,r.jsx)(t.strong,{children:"Filter"})," operation, you must define a filter condition using the ",(0,r.jsx)(t.strong,{children:"Column Name"}),", ",(0,r.jsx)(t.strong,{children:"Filter Value"}),", and ",(0,r.jsx)(t.strong,{children:"Filter Operator"})," parameters.\nFor more information, see ",(0,r.jsx)(t.a,{href:"#dataframe-operations-parameters",children:"DataFrame Operations parameters"})]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["To test the flow, click ",(0,r.jsx)(i.A,{name:"Play","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Run component"})," on the ",(0,r.jsx)(t.strong,{children:"DataFrame Operations"})," component, and then click ",(0,r.jsx)(i.A,{name:"TextSearch","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Inspect output"})," to view the new ",(0,r.jsx)(t.code,{children:"DataFrame"})," created from the ",(0,r.jsx)(t.strong,{children:"Filter"})," operation."]}),"\n",(0,r.jsxs)(t.p,{children:["If you want to view the output in the ",(0,r.jsx)(t.strong,{children:"Playground"}),", connect the ",(0,r.jsx)(t.strong,{children:"DataFrame Operations"})," component's output to a ",(0,r.jsx)(t.strong,{children:"Chat Output"})," component, rerun the ",(0,r.jsx)(t.strong,{children:"DataFrame Operations"})," component, and then click ",(0,r.jsx)(t.strong,{children:"Playground"}),"."]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(t.p,{children:["For another example, see ",(0,r.jsx)(t.a,{href:"/components-logic#conditional-looping",children:"Conditional looping"}),"."]}),"\n",(0,r.jsx)(t.h3,{id:"dataframe-operations-parameters",children:"DataFrame Operations parameters"}),"\n",(0,r.jsxs)(t.p,{children:["Most ",(0,r.jsx)(t.strong,{children:"DataFrame Operations"})," parameters are conditional because they only apply to specific operations."]}),"\n",(0,r.jsxs)(t.p,{children:["The only permanent parameters are ",(0,r.jsx)(t.strong,{children:"DataFrame"})," (",(0,r.jsx)(t.code,{children:"df"}),"), which is the ",(0,r.jsx)(t.code,{children:"DataFrame"})," input, and ",(0,r.jsx)(t.strong,{children:"Operation"})," (",(0,r.jsx)(t.code,{children:"operation"}),"), which is the operation to perform on the ",(0,r.jsx)(t.code,{children:"DataFrame"}),".\nOnce you select an operation, the conditional parameters for that operation appear on the ",(0,r.jsx)(t.strong,{children:"DataFrame Operations"})," component."]}),"\n",(0,r.jsxs)(c.A,{children:[(0,r.jsxs)(l.A,{value:"addcolumn",label:"Add Column",default:!0,children:[(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Add Column"})," operation allows you to add a new column to the ",(0,r.jsx)(t.code,{children:"DataFrame"})," with a constant value."]}),(0,r.jsxs)(t.p,{children:["The parameters are ",(0,r.jsx)(t.strong,{children:"New Column Name"})," (",(0,r.jsx)(t.code,{children:"new_column_name"}),") and ",(0,r.jsx)(t.strong,{children:"New Column Value"})," (",(0,r.jsx)(t.code,{children:"new_column_value"}),")."]})]}),(0,r.jsx)(l.A,{value:"dropcolumn",label:"Drop Column",children:(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Drop Column"})," operation allows you to remove a column from the ",(0,r.jsx)(t.code,{children:"DataFrame"}),", specified by ",(0,r.jsx)(t.strong,{children:"Column Name"})," (",(0,r.jsx)(t.code,{children:"column_name"}),")."]})}),(0,r.jsxs)(l.A,{value:"filter",label:"Filter",children:[(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Filter"})," operation allows you to filter the ",(0,r.jsx)(t.code,{children:"DataFrame"})," based on a specified condition.\nThe output is a ",(0,r.jsx)(t.code,{children:"DataFrame"})," containing only the rows that matched the filter condition."]}),(0,r.jsx)(t.p,{children:"Provide the following parameters:"}),(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"Column Name"})," (",(0,r.jsx)(t.code,{children:"column_name"}),"): The name of the column to filter on."]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"Filter Value"})," (",(0,r.jsx)(t.code,{children:"filter_value"}),"): The value to filter on."]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"Filter Operator"})," (",(0,r.jsx)(t.code,{children:"filter_operator"}),"): The operator to use for filtering, one of ",(0,r.jsx)(t.code,{children:"equals"})," (default), ",(0,r.jsx)(t.code,{children:"not equals"}),", ",(0,r.jsx)(t.code,{children:"contains"}),", ",(0,r.jsx)(t.code,{children:"starts with"}),", ",(0,r.jsx)(t.code,{children:"ends with"}),", ",(0,r.jsx)(t.code,{children:"greater than"}),", or ",(0,r.jsx)(t.code,{children:"less than"}),"."]}),"\n"]})]}),(0,r.jsxs)(l.A,{value:"head",label:"Head",children:[(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Head"})," operation allows you to retrieve the first ",(0,r.jsx)(t.code,{children:"n"})," rows of the ",(0,r.jsx)(t.code,{children:"DataFrame"}),", where ",(0,r.jsx)(t.code,{children:"n"})," is set in ",(0,r.jsx)(t.strong,{children:"Number of Rows"})," (",(0,r.jsx)(t.code,{children:"num_rows"}),").\nThe default is ",(0,r.jsx)(t.code,{children:"5"}),"."]}),(0,r.jsxs)(t.p,{children:["The output is a ",(0,r.jsx)(t.code,{children:"DataFrame"})," containing only the selected rows."]})]}),(0,r.jsxs)(l.A,{value:"renamecolumn",label:"Rename Column",children:[(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Rename Column"})," operation allows you to rename an existing column in the ",(0,r.jsx)(t.code,{children:"DataFrame"}),"."]}),(0,r.jsxs)(t.p,{children:["The parameters are ",(0,r.jsx)(t.strong,{children:"Column Name"})," (",(0,r.jsx)(t.code,{children:"column_name"}),"), which is the current name, and ",(0,r.jsx)(t.strong,{children:"New Column Name"})," (",(0,r.jsx)(t.code,{children:"new_column_name"}),")."]})]}),(0,r.jsxs)(l.A,{value:"replacevalue",label:"Replace Value",children:[(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Replace Value"})," operation allows you to replace values in a specific column of the ",(0,r.jsx)(t.code,{children:"DataFrame"}),".\nThis operation replaces a target value with a new value.\nAll cells matching the target value are replaced with the new value in the new ",(0,r.jsx)(t.code,{children:"DataFrame"})," output."]}),(0,r.jsx)(t.p,{children:"Provide the following parameters:"}),(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"Column Name"})," (",(0,r.jsx)(t.code,{children:"column_name"}),"): The name of the column to modify."]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"Value to Replace"})," (",(0,r.jsx)(t.code,{children:"replace_value"}),"): The value that you want to replace."]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"Replacement Value"})," (",(0,r.jsx)(t.code,{children:"replacement_value"}),"): The new value to use."]}),"\n"]})]}),(0,r.jsxs)(l.A,{value:"selectcolumns",label:"Select Columns",children:[(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Select Columns"})," operation allows you to select one or more specific columns from the ",(0,r.jsx)(t.code,{children:"DataFrame"}),"."]}),(0,r.jsxs)(t.p,{children:["Provide a list of column names in ",(0,r.jsx)(t.strong,{children:"Columns to Select"})," (",(0,r.jsx)(t.code,{children:"columns_to_select"}),").\nIn the visual editor, click ",(0,r.jsx)(i.A,{name:"Plus","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Add More"})," to add multiple fields, and then enter one column name in each field."]}),(0,r.jsxs)(t.p,{children:["The output is a ",(0,r.jsx)(t.code,{children:"DataFrame"})," containing only the specified columns."]})]}),(0,r.jsxs)(l.A,{value:"sort",label:"Sort",children:[(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Sort"})," operation allows you to sort the ",(0,r.jsx)(t.code,{children:"DataFrame"})," on a specific column in ascending or descending order."]}),(0,r.jsx)(t.p,{children:"Provide the following parameters:"}),(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"Column Name"})," (",(0,r.jsx)(t.code,{children:"column_name"}),"): The name of the column to sort on."]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"Sort Ascending"})," (",(0,r.jsx)(t.code,{children:"ascending"}),"): Whether to sort in ascending or descending order. If enabled (",(0,r.jsx)(t.code,{children:"true"}),"), sorts in ascending order; if disabled (",(0,r.jsx)(t.code,{children:"false"}),"), sorts in descending order. Default: Enabled (",(0,r.jsx)(t.code,{children:"true"}),")"]}),"\n"]})]}),(0,r.jsxs)(l.A,{value:"tail",label:"Tail",children:[(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Tail"})," operation allows you to retrieve the last ",(0,r.jsx)(t.code,{children:"n"})," rows of the ",(0,r.jsx)(t.code,{children:"DataFrame"}),", where ",(0,r.jsx)(t.code,{children:"n"})," is set in ",(0,r.jsx)(t.strong,{children:"Number of Rows"})," (",(0,r.jsx)(t.code,{children:"num_rows"}),").\nThe default is ",(0,r.jsx)(t.code,{children:"5"}),"."]}),(0,r.jsxs)(t.p,{children:["The output is a ",(0,r.jsx)(t.code,{children:"DataFrame"})," containing only the selected rows."]})]}),(0,r.jsxs)(l.A,{value:"dropduplicates",label:"Drop Duplicates",children:[(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Drop Duplicates"})," operation removes rows from the ",(0,r.jsx)(t.code,{children:"DataFrame"})," by identifying all duplicate values within a single column."]}),(0,r.jsxs)(t.p,{children:["The only parameter is the ",(0,r.jsx)(t.strong,{children:"Column Name"})," (",(0,r.jsx)(t.code,{children:"column_name"}),")."]}),(0,r.jsxs)(t.p,{children:["When the flow runs, all rows with duplicate values in the given column are removed.\nThe output is a ",(0,r.jsx)(t.code,{children:"DataFrame"})," containing all columns from the original ",(0,r.jsx)(t.code,{children:"DataFrame"}),", but only rows with non-duplicate values."]})]})]}),"\n",(0,r.jsx)(t.h2,{id:"llm-router",children:"LLM Router"}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"LLM Router"})," component routes requests to the most appropriate LLM based on ",(0,r.jsx)(t.a,{href:"https://openrouter.ai/docs/quickstart",children:"OpenRouter"})," model specifications."]}),"\n",(0,r.jsxs)(t.p,{children:["To use the component in a flow, you connect multiple language model components to the ",(0,r.jsx)(t.strong,{children:"LLM Router"})," components.\nOne model is the judge LLM that analyzes input messages to understand the evaluation context, selects the most appropriate model from the other attached LLMs, and then routes the input to the selected model.\nThe selected model processes the input, and then returns the generated response."]}),"\n",(0,r.jsx)(t.p,{children:"The following example flow has three language model components.\nOne is the judge LLM, and the other two are in the LLM pool for request routing.\nThe input and output components create a seamless chat interaction where you send a message and receive a response without any user awareness of the underlying routing."}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.img,{alt:"LLM Router component",src:n(9898).A+"",width:"3316",height:"2492"})}),"\n",(0,r.jsx)(t.h3,{id:"llm-router-parameters",children:"LLM Router parameters"}),"\n",(0,r.jsx)(d.Ay,{}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Name"}),(0,r.jsx)(t.th,{children:"Display Name"}),(0,r.jsx)(t.th,{children:"Info"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"models"})}),(0,r.jsx)(t.td,{children:(0,r.jsx)(t.strong,{children:"Language Models"})}),(0,r.jsxs)(t.td,{children:["Input parameter. Connect ",(0,r.jsx)(t.a,{href:"/data-types#languagemodel",children:(0,r.jsx)(t.code,{children:"LanguageModel"})})," output from multiple ",(0,r.jsx)(t.a,{href:"/components-models",children:"language model components"})," to create a pool of models. The ",(0,r.jsx)(t.code,{children:"judge_llm"})," selects models from this pool when routing requests. The first model you connect is the default model if there is a problem with model selection or routing."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"input_value"})}),(0,r.jsx)(t.td,{children:(0,r.jsx)(t.strong,{children:"Input"})}),(0,r.jsx)(t.td,{children:"Input parameter. The incoming query to be routed to the model selected by the judge LLM."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"judge_llm"})}),(0,r.jsx)(t.td,{children:(0,r.jsx)(t.strong,{children:"Judge LLM"})}),(0,r.jsxs)(t.td,{children:["Input parameter. Connect ",(0,r.jsx)(t.code,{children:"LanguageModel"})," output from ",(0,r.jsx)(t.em,{children:"one"})," ",(0,r.jsx)(t.strong,{children:"Language Model"})," component to serve as the judge LLM for request routing."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"optimization"})}),(0,r.jsx)(t.td,{children:(0,r.jsx)(t.strong,{children:"Optimization"})}),(0,r.jsxs)(t.td,{children:["Input parameter. Set a preferred characteristic for model selection by the judge LLM. The options are ",(0,r.jsx)(t.code,{children:"quality"})," (highest response quality), ",(0,r.jsx)(t.code,{children:"speed"})," (fastest response time), ",(0,r.jsx)(t.code,{children:"cost"})," (most cost-effective model), or ",(0,r.jsx)(t.code,{children:"balanced"})," (equal weight for quality, speed, and cost). Default: ",(0,r.jsx)(t.code,{children:"balanced"})]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"use_openrouter_specs"})}),(0,r.jsx)(t.td,{children:(0,r.jsx)(t.strong,{children:"Use OpenRouter Specs"})}),(0,r.jsx)(t.td,{children:"Input parameter. Whether to fetch model specifications from the OpenRouter API."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsxs)(t.td,{children:["If ",(0,r.jsx)(t.code,{children:"false"}),", only the model name is provided to the judge LLM. Default: Enabled (",(0,r.jsx)(t.code,{children:"true"}),")"]}),(0,r.jsx)(t.td,{}),(0,r.jsx)(t.td,{})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"timeout"})}),(0,r.jsx)(t.td,{children:(0,r.jsx)(t.strong,{children:"API Timeout"})}),(0,r.jsxs)(t.td,{children:["Input parameter. Set a timeout duration in seconds for API requests made by the router. Default: ",(0,r.jsx)(t.code,{children:"10"})]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"fallback_to_first"})}),(0,r.jsx)(t.td,{children:(0,r.jsx)(t.strong,{children:"Fallback to First Model"})}),(0,r.jsxs)(t.td,{children:["Input parameter. Whether to use the first LLM in ",(0,r.jsx)(t.code,{children:"models"})," as a backup if routing fails to reach the selected model. Default: Enabled (",(0,r.jsx)(t.code,{children:"true"}),")"]})]})]})]}),"\n",(0,r.jsx)(t.h3,{id:"llm-router-outputs",children:"LLM Router outputs"}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"LLM Router"})," component provides three output options.\nYou can set the desired output type near the component's output port."]}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.strong,{children:"Output"}),": A ",(0,r.jsx)(t.code,{children:"Message"})," containing the response to the original query as generated by the selected LLM.\nUse this output for regular chat interactions."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.strong,{children:"Selected Model Info"}),": A ",(0,r.jsx)(t.code,{children:"Data"})," object containing information about the selected model, such as its name and version."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.strong,{children:"Routing Decision"}),": A ",(0,r.jsx)(t.code,{children:"Message"})," containing the judge model's reasoning for selecting a particular model, including input query length and number of models considered.\nFor example:"]}),"\n",(0,r.jsx)(j.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"Model Selection Decision:",props:{}}]},{tokens:[{content:"- Selected Model Index: 0",props:{}}]},{tokens:[{content:"- Selected Langflow Model Name: gpt-4o-mini",props:{}}]},{tokens:[{content:"- Selected API Model ID (if resolved): openai/gpt-4o-mini",props:{}}]},{tokens:[{content:"- Optimization Preference: cost",props:{}}]},{tokens:[{content:"- Input Query Length: 27 characters (~5 tokens)",props:{}}]},{tokens:[{content:"- Number of Models Considered: 2",props:{}}]},{tokens:[{content:"- Specifications Source: OpenRouter API",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,r.jsx)(t.p,{children:"This is useful for debugging if you feel the judge model isn't selecting the best model."}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(t.h2,{id:"parser",children:"Parser"}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Parser"})," component extracts text from structured data (",(0,r.jsx)(t.code,{children:"DataFrame"})," or ",(0,r.jsx)(t.code,{children:"Data"}),") using a template or direct stringification.\nThe output is a ",(0,r.jsx)(t.code,{children:"Message"})," containing the parsed text."]}),"\n",(0,r.jsxs)(t.p,{children:["This is a versatile component for data extraction and manipulation in your flows.\nFor examples of ",(0,r.jsx)(t.strong,{children:"Parser"})," components in flows, see the following:"]}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsx)(t.li,{children:(0,r.jsxs)(t.a,{href:"#batch-run",children:[(0,r.jsx)(t.strong,{children:"Batch Run"})," component example"]})}),"\n",(0,r.jsx)(t.li,{children:(0,r.jsxs)(t.a,{href:"#structured-output",children:[(0,r.jsx)(t.strong,{children:"Structured Output"})," component example"]})}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"Financial Report Parser"})," template"]}),"\n",(0,r.jsx)(t.li,{children:(0,r.jsx)(t.a,{href:"/webhook",children:"Trigger flows with webhooks"})}),"\n",(0,r.jsx)(t.li,{children:(0,r.jsx)(t.a,{href:"/chat-with-rag",children:"Create a vector RAG chatbot"})}),"\n"]}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.img,{alt:"A flow that uses a Parser component to extract text from a Structured Output component.",src:n(96218).A+"",width:"4000",height:"2202"})}),"\n",(0,r.jsx)(t.h3,{id:"parsing-modes",children:"Parsing modes"}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Parser"})," component has two modes: ",(0,r.jsx)(t.strong,{children:"Parser"})," and ",(0,r.jsx)(t.strong,{children:"Stringify"}),"."]}),"\n",(0,r.jsxs)(c.A,{children:[(0,r.jsxs)(l.A,{value:"template",label:"Parser (template) mode",default:!0,children:[(0,r.jsxs)(t.p,{children:["In ",(0,r.jsx)(t.strong,{children:"Parser"})," mode, you create a template for text output that can include literal strings and variables for extracted keys."]}),(0,r.jsxs)(t.p,{children:["Use curly braces to define variables anywhere in the template.\nVariables must match keys in the ",(0,r.jsx)(t.code,{children:"DataFrame"})," or ",(0,r.jsx)(t.code,{children:"Data"})," input, such as column names.\nFor example, ",(0,r.jsx)(t.code,{children:"{name}"})," extracts the value of a ",(0,r.jsx)(t.code,{children:"name"})," key.\nFor more information about the content and structure of ",(0,r.jsx)(t.code,{children:"DataFrame"})," and ",(0,r.jsx)(t.code,{children:"Data"})," objects, see ",(0,r.jsx)(t.a,{href:"/data-types",children:"Langflow data types"}),"."]}),(0,r.jsx)(h.Ay,{}),(0,r.jsxs)(t.p,{children:["When the flow runs, the ",(0,r.jsx)(t.strong,{children:"Parser"})," component iterates over the input, producing a ",(0,r.jsx)(t.code,{children:"Message"})," for each parsed item.\nFor example, parsing a ",(0,r.jsx)(t.code,{children:"DataFrame"})," creates a ",(0,r.jsx)(t.code,{children:"Message"})," for each row, populated with the unique values from that row."]}),(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"Employee summary template"}),(0,r.jsx)(t.p,{children:"This example template extracts employee data into a natural language summary about an employee's hire date and current role:"}),(0,r.jsx)(j.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"{employee_first_name} {employee_last_name} was hired on {start_date}.",props:{}}]},{tokens:[{content:"Their current position is {job_title} ({grade}).",props:{}}]}],lang:"text"},annotations:[]}]}),(0,r.jsxs)(t.p,{children:["The resulting ",(0,r.jsx)(t.code,{children:"Message"})," output replaces the variables with the corresponding extracted values.\nFor example:"]}),(0,r.jsx)(j.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"Renlo Kai was hired on 11-July-2017.",props:{}}]},{tokens:[{content:"Their current position is Software Engineer (Principal).",props:{}}]}],lang:"text"},annotations:[]}]})]}),(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"Employee profile template"}),(0,r.jsx)(t.p,{children:"This example template uses Markdown syntax and extracted employee data to create an employee profile:"}),(0,r.jsx)(j.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"# Employee Profile",props:{}}]},{tokens:[{content:"## Personal Information",props:{}}]},{tokens:[{content:"- **Name:** {name}",props:{}}]},{tokens:[{content:"- **ID:** {id}",props:{}}]},{tokens:[{content:"- **Email:** {email}",props:{}}]}],lang:"text"},annotations:[]}]}),(0,r.jsxs)(t.p,{children:["When the flow runs, the ",(0,r.jsx)(t.strong,{children:"Parser"})," component iterates over each row of the ",(0,r.jsx)(t.code,{children:"DataFrame"}),", populating the template's variables with the appropriate extracted values.\nThe resulting text for each row is output as a ",(0,r.jsx)(t.a,{href:"/data-types#message",children:(0,r.jsx)(t.code,{children:"Message"})}),"."]})]}),(0,r.jsxs)(t.p,{children:["The following parameters are available in ",(0,r.jsx)(t.strong,{children:"Parser"})," mode."]}),(0,r.jsx)(d.Ay,{}),(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Name"}),(0,r.jsx)(t.th,{children:"Display Name"}),(0,r.jsx)(t.th,{children:"Info"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"input_data"}),(0,r.jsx)(t.td,{children:"Data or DataFrame"}),(0,r.jsxs)(t.td,{children:["Input parameter. The ",(0,r.jsx)(t.code,{children:"Data"})," or ",(0,r.jsx)(t.code,{children:"DataFrame"})," input to parse."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"pattern"}),(0,r.jsx)(t.td,{children:"Template"}),(0,r.jsxs)(t.td,{children:["Input parameter. The formatting template using plaintext and variables for keys (",(0,r.jsx)(t.code,{children:"{KEY_NAME}"}),"). See the preceding examples for more information."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"sep"}),(0,r.jsx)(t.td,{children:"Separator"}),(0,r.jsxs)(t.td,{children:["Input parameter. A string defining the separator for rows or lines. Default: ",(0,r.jsx)(t.code,{children:"\\n"})," (new line)."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"clean_data"}),(0,r.jsx)(t.td,{children:"Clean Data"}),(0,r.jsxs)(t.td,{children:["Whether to remove empty rows and lines in each cell or key of the ",(0,r.jsx)(t.code,{children:"DataFrame"})," or ",(0,r.jsx)(t.code,{children:"Data"})," input. Default: Enabled (",(0,r.jsx)(t.code,{children:"true"}),")"]})]})]})]})]}),(0,r.jsxs)(l.A,{value:"stringify",label:"Stringify mode",children:[(0,r.jsxs)(t.p,{children:["Use ",(0,r.jsx)(t.strong,{children:"Stringify"})," mode to convert the entire input directly to text.\nThis mode doesn't support templates or key selection."]}),(0,r.jsxs)(t.p,{children:["The following parameters are available in ",(0,r.jsx)(t.strong,{children:"Stringify"})," mode."]}),(0,r.jsx)(d.Ay,{}),(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Name"}),(0,r.jsx)(t.th,{children:"Display Name"}),(0,r.jsx)(t.th,{children:"Info"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"input_data"}),(0,r.jsx)(t.td,{children:"Data or DataFrame"}),(0,r.jsxs)(t.td,{children:["Input parameter. The ",(0,r.jsx)(t.code,{children:"Data"})," or ",(0,r.jsx)(t.code,{children:"DataFrame"})," input to parse."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"sep"}),(0,r.jsx)(t.td,{children:"Separator"}),(0,r.jsxs)(t.td,{children:["Input parameter. A string defining the separator for rows or lines. Default: ",(0,r.jsx)(t.code,{children:"\\n"})," (new line)."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"clean_data"}),(0,r.jsx)(t.td,{children:"Clean Data"}),(0,r.jsxs)(t.td,{children:["Whether to remove empty rows and lines in each cell or key of the ",(0,r.jsx)(t.code,{children:"DataFrame"})," or ",(0,r.jsx)(t.code,{children:"Data"})," input. Default: Enabled (",(0,r.jsx)(t.code,{children:"true"}),")"]})]})]})]})]})]}),"\n",(0,r.jsx)(t.h3,{id:"test-and-troubleshoot-parsed-text",children:"Test and troubleshoot parsed text"}),"\n",(0,r.jsxs)(t.p,{children:["To test the ",(0,r.jsx)(t.strong,{children:"Parser"})," component, click ",(0,r.jsx)(i.A,{name:"Play","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Run component"}),", and then click ",(0,r.jsx)(i.A,{name:"TextSearch","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Inspect output"})," to see the ",(0,r.jsx)(t.code,{children:"Message"})," output with the parsed text.\nYou can also connect a ",(0,r.jsx)(t.strong,{children:"Chat Output"})," component if you want to view the output in the ",(0,r.jsx)(t.strong,{children:"Playground"}),"."]}),"\n",(0,r.jsxs)(t.p,{children:["If the ",(0,r.jsx)(t.code,{children:"Message"})," output from the ",(0,r.jsx)(t.strong,{children:"Parser"})," component has empty or unexpected values, there might be a mapping error between the input and the parsing mode, the input has empty values, or the input isn't suitable for plaintext extraction."]}),"\n",(0,r.jsxs)(t.p,{children:["For example, assume you use the following template to parse a ",(0,r.jsx)(t.code,{children:"DataFrame"}),":"]}),"\n",(0,r.jsx)(j.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"{employee_first_name} {employee_last_name} is a {job_title} ({grade}).",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,r.jsxs)(t.p,{children:["The following ",(0,r.jsx)(t.code,{children:"Message"})," could result from parsing a row where ",(0,r.jsx)(t.code,{children:"employee_first_name"})," was empty and ",(0,r.jsx)(t.code,{children:"grade"})," was ",(0,r.jsx)(t.code,{children:"null"}),":"]}),"\n",(0,r.jsx)(j.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:" Smith is a Software Engineer (null).",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,r.jsx)(t.p,{children:"To troubleshoot missing or unexpected values, you can do the following:"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Make sure the variables in your template map to keys in the incoming ",(0,r.jsx)(t.code,{children:"Data"})," or ",(0,r.jsx)(t.code,{children:"DataFrame"}),".\nTo see the data being passed directly to the ",(0,r.jsx)(t.strong,{children:"Parser"})," component, click ",(0,r.jsx)(i.A,{name:"TextSearch","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Inspect output"})," on the component that is sending data to the ",(0,r.jsx)(t.strong,{children:"Parser"})," component."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsx)(t.p,{children:"Check the source data for missing or incorrect values.\nThere are several ways you can address these inconsistencies:"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsx)(t.li,{children:"Rectify the source data directly."}),"\n",(0,r.jsxs)(t.li,{children:["Use other components to amend or filter anomalies before passing the data to the ",(0,r.jsx)(t.strong,{children:"Parser"})," component.\nThere are many components you can use for this depending on your goal, such as the ",(0,r.jsx)(t.strong,{children:"Data Operations"}),", ",(0,r.jsx)(t.strong,{children:"Structured Output"}),", and ",(0,r.jsx)(t.strong,{children:"Smart Function"})," components."]}),"\n",(0,r.jsxs)(t.li,{children:["Enable the ",(0,r.jsx)(t.strong,{children:"Parser"})," component's ",(0,r.jsx)(t.strong,{children:"Clean Data"})," parameter to skip empty rows or lines."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(t.h2,{id:"python-interpreter",children:"Python Interpreter"}),"\n",(0,r.jsx)(t.p,{children:"This component allows you to execute Python code with imported packages."}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Python Interpreter"})," component can only import packages that are already installed in your Langflow environment.\nIf you encounter an ",(0,r.jsx)(t.code,{children:"ImportError"})," when trying to use a package, you need to install it first."]}),"\n",(0,r.jsxs)(t.p,{children:["To install custom packages, see ",(0,r.jsx)(t.a,{href:"/install-custom-dependencies",children:"Install custom dependencies"}),"."]}),"\n",(0,r.jsx)(t.h3,{id:"use-the-python-interpreter-in-a-flow",children:"Use the Python Interpreter in a flow"}),"\n",(0,r.jsxs)(t.ol,{children:["\n",(0,r.jsxs)(t.li,{children:["To use this component in a flow, in the ",(0,r.jsx)(t.strong,{children:"Global Imports"})," field, add the packages you want to import as a comma-separated list, such as ",(0,r.jsx)(t.code,{children:"math,pandas"}),".\nAt least one import is required."]}),"\n",(0,r.jsxs)(t.li,{children:["In the ",(0,r.jsx)(t.strong,{children:"Python Code"})," field, enter the Python code you want to execute. Use ",(0,r.jsx)(t.code,{children:"print()"})," to see the output."]}),"\n",(0,r.jsxs)(t.li,{children:["Optional: Enable ",(0,r.jsx)(t.strong,{children:"Tool Mode"}),", and then connect the ",(0,r.jsx)(t.strong,{children:"Python Interpreter"})," component to an ",(0,r.jsx)(t.strong,{children:"Agent"})," component as a tool.\nFor example, connect a ",(0,r.jsx)(t.strong,{children:"Python Interpreter"})," component and a ",(0,r.jsxs)(t.a,{href:"/components-helpers#calculator",children:[(0,r.jsx)(t.strong,{children:"Calculator"})," component"]})," as tools for an ",(0,r.jsx)(t.strong,{children:"Agent"})," component, and then test how it chooses different tools to solve math problems.\n",(0,r.jsx)(t.img,{alt:"Python Interpreter and Calculator components connected to an Agent component",src:n(99e3).A+"",width:"3988",height:"2928"})]}),"\n",(0,r.jsxs)(t.li,{children:["Ask the agent an easier math question.\nThe ",(0,r.jsx)(t.strong,{children:"Calculator"})," tool can add, subtract, multiple, divide, or perform exponentiation.\nThe agent executes the ",(0,r.jsx)(t.code,{children:"evaluate_expression"})," tool to correctly answer the question."]}),"\n"]}),"\n",(0,r.jsx)(t.p,{children:"Result:"}),"\n",(0,r.jsx)(j.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"Executed evaluate_expression",props:{}}]},{tokens:[{content:"Input:",props:{}}]},{tokens:[{content:"{",props:{}}]},{tokens:[{content:' "expression": "2+5"',props:{}}]},{tokens:[{content:"}",props:{}}]},{tokens:[{content:"Output:",props:{}}]},{tokens:[{content:"{",props:{}}]},{tokens:[{content:' "result": "7"',props:{}}]},{tokens:[{content:"}",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,r.jsxs)(t.ol,{start:"5",children:["\n",(0,r.jsxs)(t.li,{children:["Give the agent complete Python code.\nThis example creates a Pandas DataFrame table with the imported ",(0,r.jsx)(t.code,{children:"pandas"})," packages, and returns the square root of the mean squares."]}),"\n"]}),"\n",(0,r.jsx)(j.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"import",props:{style:{color:"#FF7B72"}}},{content:" pandas ",props:{style:{color:"#C9D1D9"}}},{content:"as",props:{style:{color:"#FF7B72"}}},{content:" pd",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"import",props:{style:{color:"#FF7B72"}}},{content:" math",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"# Create a simple DataFrame",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:"df ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" pd.DataFrame({",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" 'numbers'",props:{style:{color:"#A5D6FF"}}},{content:": [",props:{style:{color:"#C9D1D9"}}},{content:"1",props:{style:{color:"#79C0FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"2",props:{style:{color:"#79C0FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"3",props:{style:{color:"#79C0FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"4",props:{style:{color:"#79C0FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"5",props:{style:{color:"#79C0FF"}}},{content:"],",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" 'squares'",props:{style:{color:"#A5D6FF"}}},{content:": [x",props:{style:{color:"#C9D1D9"}}},{content:"**",props:{style:{color:"#FF7B72"}}},{content:"2 ",props:{style:{color:"#79C0FF"}}},{content:"for",props:{style:{color:"#FF7B72"}}},{content:" x ",props:{style:{color:"#C9D1D9"}}},{content:"in ",props:{style:{color:"#FF7B72"}}},{content:"range",props:{style:{color:"#79C0FF"}}},{content:"(",props:{style:{color:"#C9D1D9"}}},{content:"1",props:{style:{color:"#79C0FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"6",props:{style:{color:"#79C0FF"}}},{content:")]",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"})",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"# Calculate the square root of the mean",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:"result ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" math.sqrt(df[",props:{style:{color:"#C9D1D9"}}},{content:"'squares'",props:{style:{color:"#A5D6FF"}}},{content:"].mean())",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"print",props:{style:{color:"#79C0FF"}}},{content:"(",props:{style:{color:"#C9D1D9"}}},{content:"f",props:{style:{color:"#FF7B72"}}},{content:'"Square root of mean squares: ',props:{style:{color:"#A5D6FF"}}},{content:"{",props:{style:{color:"#79C0FF"}}},{content:"result",props:{style:{color:"#C9D1D9"}}},{content:"}",props:{style:{color:"#79C0FF"}}},{content:'"',props:{style:{color:"#A5D6FF"}}},{content:")",props:{style:{color:"#C9D1D9"}}}]}],lang:"python"},annotations:[]}]}),"\n",(0,r.jsxs)(t.p,{children:["The agent correctly chooses the ",(0,r.jsx)(t.code,{children:"run_python_repl"})," tool to solve the problem."]}),"\n",(0,r.jsx)(t.p,{children:"Result:"}),"\n",(0,r.jsx)(j.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"Executed run_python_repl",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"Input:",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"{",props:{}}]},{tokens:[{content:" \"python_code\": \"import pandas as pd\\nimport math\\n\\n# Create a simple DataFrame\\ndf = pd.DataFrame({\\n 'numbers': [1, 2, 3, 4, 5],\\n 'squares': [x**2 for x in range(1, 6)]\\n})\\n\\n# Calculate the square root of the mean\\nresult = math.sqrt(df['squares'].mean())\\nprint(f\\\"Square root of mean squares: {result}\\\")\"",props:{}}]},{tokens:[{content:"}",props:{}}]},{tokens:[{content:"Output:",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"{",props:{}}]},{tokens:[{content:' "result": "Square root of mean squares: 3.3166247903554"',props:{}}]},{tokens:[{content:"}",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,r.jsxs)(t.p,{children:["If you don't include the package imports in the chat, the agent can still create the table using ",(0,r.jsx)(t.code,{children:"pd.DataFrame"}),", because the ",(0,r.jsx)(t.code,{children:"pandas"})," package is imported globally by the ",(0,r.jsx)(t.strong,{children:"Python Interpreter"})," component in the ",(0,r.jsx)(t.strong,{children:"Global Imports"})," field."]}),"\n",(0,r.jsx)(t.h3,{id:"python-interpreter-parameters",children:"Python Interpreter parameters"}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Name"}),(0,r.jsx)(t.th,{children:"Type"}),(0,r.jsx)(t.th,{children:"Description"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"global_imports"}),(0,r.jsx)(t.td,{children:"String"}),(0,r.jsxs)(t.td,{children:["Input parameter. A comma-separated list of modules to import globally, such as ",(0,r.jsx)(t.code,{children:"math,pandas,numpy"}),"."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"python_code"}),(0,r.jsx)(t.td,{children:"Code"}),(0,r.jsx)(t.td,{children:"Input parameter. The Python code to execute. Only modules specified in Global Imports can be used."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"results"}),(0,r.jsx)(t.td,{children:"Data"}),(0,r.jsx)(t.td,{children:"Output parameter. The output of the executed Python code, including any printed results or errors."})]})]})]}),"\n",(0,r.jsx)(t.h2,{id:"save-file",children:"Save File"}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Save File"})," component creates a file containing data produced by another component.\nSeveral file formats are supported, and you can store files in ",(0,r.jsx)(t.a,{href:"/memory",children:"Langflow storage"})," or the local file system."]}),"\n",(0,r.jsxs)(t.p,{children:["To configure the ",(0,r.jsx)(t.strong,{children:"Save File"})," component and use it in a flow, do the following:"]}),"\n",(0,r.jsxs)(t.ol,{children:["\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Connect ",(0,r.jsx)(t.a,{href:"/data-types#dataframe",children:(0,r.jsx)(t.code,{children:"DataFrame"})}),", ",(0,r.jsx)(t.a,{href:"/data-types#data",children:(0,r.jsx)(t.code,{children:"Data"})}),", or ",(0,r.jsx)(t.a,{href:"/data-types#message",children:(0,r.jsx)(t.code,{children:"Message"})})," output from another component to the ",(0,r.jsx)(t.strong,{children:"Save File"})," component's ",(0,r.jsx)(t.strong,{children:"Input"})," port."]}),"\n",(0,r.jsxs)(t.p,{children:["You can connect the same output to multiple ",(0,r.jsx)(t.strong,{children:"Save File"})," components if you want to create multiple files, save the data in different file formats, or save files to multiple locations."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["In ",(0,r.jsx)(t.strong,{children:"File Name"}),", enter a file name and an optional path."]}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"File Name"})," parameter controls where the file is saved.\nIt can contain a file name or an entire file path:"]}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.strong,{children:"Default location"}),": If you only provide a file name, then the file is stored in the Langflow data directory. For example,",(0,r.jsx)(t.code,{children:"~/Library/Caches/langflow/data"})," on macOS."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.strong,{children:"Subdirectory"}),": To store files in subdirectories, add the path to the ",(0,r.jsx)(t.strong,{children:"File Name"})," parameter.\nIf a given subdirectory doesn't already exist, Langflow automatically creates it.\nFor example, ",(0,r.jsx)(t.code,{children:"files/my_file"})," creates ",(0,r.jsx)(t.code,{children:"my_file"})," in ",(0,r.jsx)(t.code,{children:"/data/files"}),", and it creates the ",(0,r.jsx)(t.code,{children:"files"})," subdirectory if it doesn't already exist."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.strong,{children:"Absolute or relative path"}),": To store files elsewhere in your environment or local file storage, provide the absolute or relative path to the desired location.\nFor example, ",(0,r.jsx)(t.code,{children:"~/Desktop/my_file"})," saves ",(0,r.jsx)(t.code,{children:"my_file"})," to the desktop."]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(t.p,{children:["Don't include an extension in the file name.\nIf you do, the extension is treated as part of the file name; it has no impact on the ",(0,r.jsx)(t.strong,{children:"File Format"})," parameter."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["In the ",(0,r.jsx)(t.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),", click ",(0,r.jsx)(i.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Controls"}),", select the desired file format, and then click ",(0,r.jsx)(t.strong,{children:"Close"}),"."]}),"\n",(0,r.jsxs)(t.p,{children:["The available ",(0,r.jsx)(t.strong,{children:"File Format"})," options depend on the input data type:"]}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.code,{children:"DataFrame"})," can be saved to CSV (default), Excel (requires ",(0,r.jsx)(t.code,{children:"openpyxl"})," ",(0,r.jsx)(t.a,{href:"/install-custom-dependencies",children:"custom dependency"}),"), JSON (fallback default), or Markdown."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.code,{children:"Data"})," can be saved to CSV, Excel (requires ",(0,r.jsx)(t.code,{children:"openpyxl"})," ",(0,r.jsx)(t.a,{href:"/install-custom-dependencies",children:"custom dependency"}),"), JSON (default), or Markdown."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.code,{children:"Message"})," can be saved to TXT, JSON (default), or Markdown."]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(t.admonition,{title:"Overwrites allowed",type:"warning",children:(0,r.jsxs)(t.p,{children:["If you have multiple ",(0,r.jsx)(t.strong,{children:"Save File"})," components, in one or more flows, with the same file name, path, and extension, the file contains the data from the most recent run only.\nLangflow doesn't block overwrites if a matching file already exists.\nTo avoid unintended overwrites, use unique file names and paths."]})}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["To test the ",(0,r.jsx)(t.strong,{children:"Save File"})," component, click ",(0,r.jsx)(i.A,{name:"Play","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Run component"}),", and then click ",(0,r.jsx)(i.A,{name:"TextSearch","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Inspect output"})," to get the filepath where the file was saved."]}),"\n",(0,r.jsxs)(t.p,{children:["The component's literal output is a ",(0,r.jsx)(t.code,{children:"Message"})," containing the original data type, the file name and extension, and the absolute filepath to the file based on the ",(0,r.jsx)(t.strong,{children:"File Name"})," parameter.\nFor example:"]}),"\n",(0,r.jsx)(j.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"DataFrame saved successfully as 'my_file.csv' at /Users/user.name/Library/Caches/langflow/data/my_file.csv",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,r.jsxs)(t.p,{children:["If the ",(0,r.jsx)(t.strong,{children:"File Name"})," contains a subdirectory or other non-default path, this is reflected in the ",(0,r.jsx)(t.code,{children:"Message"})," output.\nFor example, a CSV file with the file name ",(0,r.jsx)(t.code,{children:"~/Desktop/my_file"})," could produce the following output:"]}),"\n",(0,r.jsx)(j.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"DataFrame saved successfully as '/Users/user.name/Desktop/my_file.csv' at /Users/user.name/Desktop/my_file.csv",props:{}}]}],lang:"text"},annotations:[]}]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsx)(t.p,{children:"Optional: If you want to use the saved file in a flow, you must use an API call or another component to retrieve the file from the given filepath."}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(t.h2,{id:"smart-function",children:"Smart Function"}),"\n",(0,r.jsxs)(t.p,{children:["In Langflow version 1.5, this component was renamed from ",(0,r.jsx)(t.strong,{children:"Lambda Filter"})," to ",(0,r.jsx)(t.strong,{children:"Smart Function"}),"."]}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Smart Function"})," component uses an LLM to generate a Lambda function to filter or transform structured data based on natural language instructions.\nYou must connect this component to a ",(0,r.jsx)(t.a,{href:"/components-models",children:"language model component"}),", which is used to generate a function based on the natural language instructions you provide in the ",(0,r.jsx)(t.strong,{children:"Instructions"})," parameter.\nThe LLM runs the function against the data input, and then outputs the results as ",(0,r.jsx)(t.a,{href:"/data-types#data",children:(0,r.jsx)(t.code,{children:"Data"})}),"."]}),"\n",(0,r.jsxs)(t.admonition,{type:"tip",children:[(0,r.jsxs)(t.p,{children:["Provide brief, clear instructions, focusing on the desired outcome or specific actions, such as ",(0,r.jsx)(t.code,{children:"Filter the data to only include items where the 'status' is 'active'"}),".\nOne sentence or less is preferred because end punctuation, like periods, can cause errors or unexpected behavior."]}),(0,r.jsxs)(t.p,{children:["If you need to provide more details instructions that aren't directly relevant to the Lambda function, you can input them in the ",(0,r.jsx)(t.strong,{children:"Language Model"})," component's ",(0,r.jsx)(t.strong,{children:"Input"})," field or through a ",(0,r.jsx)(t.strong,{children:"Prompt Template"})," component."]})]}),"\n",(0,r.jsxs)(t.p,{children:["The following example uses the ",(0,r.jsx)(t.strong,{children:"API Request"})," endpoint to pass JSON data from the ",(0,r.jsx)(t.code,{children:"https://jsonplaceholder.typicode.com/users"})," endpoint to the ",(0,r.jsx)(t.strong,{children:"Smart Function"})," component.\nThen, the ",(0,r.jsx)(t.strong,{children:"Smart Function"})," component passes the data and the instruction ",(0,r.jsx)(t.code,{children:"extract emails"})," to the attached ",(0,r.jsx)(t.strong,{children:"Language Model"})," component.\nFrom there, the LLM generates a filter function that extracts email addresses from the JSON data, returning the filtered data as chat output."]}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.img,{alt:"A small flow using a Smart Function component to extract data from an API response.",src:n(66539).A+"",width:"4000",height:"1796"})}),"\n",(0,r.jsx)(t.h3,{id:"smart-function-parameters",children:"Smart Function parameters"}),"\n",(0,r.jsx)(d.Ay,{}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Name"}),(0,r.jsx)(t.th,{children:"Display Name"}),(0,r.jsx)(t.th,{children:"Info"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"data"}),(0,r.jsx)(t.td,{children:"Data"}),(0,r.jsx)(t.td,{children:"Input parameter. The structured data to filter or transform using a Lambda function."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"llm"}),(0,r.jsx)(t.td,{children:"Language Model"}),(0,r.jsxs)(t.td,{children:["Input parameter. Connect ",(0,r.jsx)(t.a,{href:"/data-types#languagemodel",children:(0,r.jsx)(t.code,{children:"LanguageModel"})})," output from a ",(0,r.jsx)(t.strong,{children:"Language Model"})," component."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"filter_instruction"}),(0,r.jsx)(t.td,{children:"Instructions"}),(0,r.jsx)(t.td,{children:"Input parameter. The natural language instructions for how to filter or transform the data. The LLM uses these instructions to create a Lambda function."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"sample_size"}),(0,r.jsx)(t.td,{children:"Sample Size"}),(0,r.jsxs)(t.td,{children:["Input parameter. For large datasets, the number of characters to sample from the dataset head and tail. Only applied if the dataset meets or exceeds ",(0,r.jsx)(t.code,{children:"max_size"}),". Default: ",(0,r.jsx)(t.code,{children:"1000"}),"."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"max_size"}),(0,r.jsx)(t.td,{children:"Max Size"}),(0,r.jsxs)(t.td,{children:["Input parameter. The number of characters for the dataset to be considered large, which triggers sampling by the ",(0,r.jsx)(t.code,{children:"sample_size"})," value. Default: ",(0,r.jsx)(t.code,{children:"30000"}),"."]})]})]})]}),"\n",(0,r.jsx)(t.h2,{id:"split-text",children:"Split Text"}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Split Text"})," component splits data into chunks based on parameters like chunk size and separator.\nIt is often used to chunk data to be tokenized and embedded into vector databases.\nFor examples, see ",(0,r.jsx)(t.a,{href:"/components-embedding-models#use-embedding-model-components-in-a-flow",children:"Use embedding model components in a flow"})," and ",(0,r.jsx)(t.a,{href:"/chat-with-rag",children:"Create a Vector RAG chatbot"}),"."]}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.img,{alt:"An embedding generation flow that uses a Split Text component to chunk data.",src:n(49823).A+"",width:"4000",height:"2766"})}),"\n",(0,r.jsxs)(t.p,{children:["The component accepts ",(0,r.jsx)(t.code,{children:"Message"}),", ",(0,r.jsx)(t.code,{children:"Data"}),", or ",(0,r.jsx)(t.code,{children:"DataFrame"}),", and then outputs either ",(0,r.jsx)(t.strong,{children:"Chunks"})," or ",(0,r.jsx)(t.strong,{children:"DataFrame"}),".\nThe ",(0,r.jsx)(t.strong,{children:"Chunks"})," output returns a list of ",(0,r.jsx)(t.a,{href:"/data-types#data",children:(0,r.jsx)(t.code,{children:"Data"})})," objects containing individual text chunks.\nThe ",(0,r.jsx)(t.strong,{children:"DataFrame"})," output returns the list of chunks as a structured ",(0,r.jsx)(t.a,{href:"/data-types#dataframe",children:(0,r.jsx)(t.code,{children:"DataFrame"})})," with additional ",(0,r.jsx)(t.code,{children:"text"})," and ",(0,r.jsx)(t.code,{children:"metadata"})," columns."]}),"\n",(0,r.jsx)(t.h3,{id:"split-text-parameters",children:"Split Text parameters"}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Split Text"})," component's parameters control how the text is split into chunks, specifically the ",(0,r.jsx)(t.code,{children:"chunk_size"}),", ",(0,r.jsx)(t.code,{children:"chunk_overlap"}),", and ",(0,r.jsx)(t.code,{children:"separator"})," parameters."]}),"\n",(0,r.jsxs)(t.p,{children:["To test the chunking behavior, add a ",(0,r.jsx)(t.strong,{children:"Text Input"})," or ",(0,r.jsx)(t.strong,{children:"File"})," component with some sample data to chunk, click ",(0,r.jsx)(i.A,{name:"Play","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Run component"})," on the ",(0,r.jsx)(t.strong,{children:"Split Text"})," component, and then click ",(0,r.jsx)(i.A,{name:"TextSearch","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Inspect output"})," to view the list of chunks and their metadata. The ",(0,r.jsx)(t.strong,{children:"text"})," column contains the actual text chunks created from your chunking settings.\nIf the chunks aren't split as you expect, adjust the parameters, rerun the component, and then inspect the new output."]}),"\n",(0,r.jsx)(d.Ay,{}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Name"}),(0,r.jsx)(t.th,{children:"Display Name"}),(0,r.jsx)(t.th,{children:"Info"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"data_inputs"}),(0,r.jsx)(t.td,{children:"Input"}),(0,r.jsxs)(t.td,{children:["Input parameter. The data to split. Input must be in ",(0,r.jsx)(t.code,{children:"Message"}),", ",(0,r.jsx)(t.code,{children:"Data"}),", or ",(0,r.jsx)(t.code,{children:"DataFrame"})," format."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"chunk_overlap"}),(0,r.jsx)(t.td,{children:"Chunk Overlap"}),(0,r.jsxs)(t.td,{children:["Input parameter. The number of characters to overlap between chunks. This helps maintain context across chunks. When a separator is encountered, the overlap is applied at the point of the separator so that the subsequent chunk contains the last ",(0,r.jsx)(t.em,{children:"n"})," characters of the preceding chunk. Default: ",(0,r.jsx)(t.code,{children:"200"}),"."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"chunk_size"}),(0,r.jsx)(t.td,{children:"Chunk Size"}),(0,r.jsxs)(t.td,{children:["Input parameter. The target length for each chunk after splitting. The data is first split by separator, and then chunks smaller than the ",(0,r.jsx)(t.code,{children:"chunk_size"})," are merged up to this limit. However, if the initial separator split produces any chunks larger than the ",(0,r.jsx)(t.code,{children:"chunk_size"}),", those chunks are neither further subdivided nor combined with any smaller chunks; these chunks will be output as-is even though they exceed the ",(0,r.jsx)(t.code,{children:"chunk_size"}),". Default: ",(0,r.jsx)(t.code,{children:"1000"}),". See ",(0,r.jsx)(t.a,{href:"#chunk-size",children:"Tokenization errors due to chunk size"})," for important considerations."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"separator"}),(0,r.jsx)(t.td,{children:"Separator"}),(0,r.jsxs)(t.td,{children:["Input parameter. A string defining a character to split on, such as ",(0,r.jsx)(t.code,{children:"\\n"})," to split on new line characters, ",(0,r.jsx)(t.code,{children:"\\n\\n"})," to split at paragraph breaks, or ",(0,r.jsx)(t.code,{children:"},"})," to split at the end of JSON objects. You can directly provide the separator string, or pass a separator string from another component as ",(0,r.jsx)(t.code,{children:"Message"})," input."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"text_key"}),(0,r.jsx)(t.td,{children:"Text Key"}),(0,r.jsxs)(t.td,{children:["Input parameter. The key to use for the text column that is extracted from the input and then split. Default: ",(0,r.jsx)(t.code,{children:"text"}),"."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"keep_separator"}),(0,r.jsx)(t.td,{children:"Keep Separator"}),(0,r.jsxs)(t.td,{children:["Input parameter. Select how to handle separators in output chunks. If ",(0,r.jsx)(t.code,{children:"False"}),", separators are omitted from output chunks. Options include ",(0,r.jsx)(t.code,{children:"False"})," (remove separators), ",(0,r.jsx)(t.code,{children:"True"})," (keep separators in chunks without preference for placement), ",(0,r.jsx)(t.code,{children:"Start"})," (place separators at the beginning of chunks), or ",(0,r.jsx)(t.code,{children:"End"})," (place separators at the end of chunks). Default: ",(0,r.jsx)(t.code,{children:"False"}),"."]})]})]})]}),"\n",(0,r.jsx)(t.h3,{id:"chunk-size",children:"Tokenization errors due to chunk size"}),"\n",(0,r.jsxs)(t.p,{children:["When using ",(0,r.jsx)(t.strong,{children:"Split Text"})," with embedding models (especially NVIDIA models like ",(0,r.jsx)(t.code,{children:"nvidia/nv-embed-v1"}),"), you may need to use smaller chunk sizes (",(0,r.jsx)(t.code,{children:"500"})," or less) even though the model supports larger token limits.\nThe ",(0,r.jsx)(t.strong,{children:"Split Text"})," component doesn't always enforce the exact chunk size you set, and individual chunks may exceed your specified limit.\nIf you encounter tokenization errors, modify your text splitting strategy by reducing the chunk size, changing the overlap length, or using a more common separator.\nThen, test your configuration by running the flow and inspecting the component's output."]}),"\n",(0,r.jsx)(t.h3,{id:"other-text-splitters",children:"Other text splitters"}),"\n",(0,r.jsxs)(t.p,{children:["See ",(0,r.jsx)(t.a,{href:"/bundles-langchain#text-splitters",children:"LangChain text splitter components"}),"."]}),"\n",(0,r.jsx)(t.h2,{id:"structured-output",children:"Structured Output"}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Structured Output"})," component uses an LLM to transform any input into structured data (",(0,r.jsx)(t.code,{children:"Data"})," or ",(0,r.jsx)(t.code,{children:"DataFrame"}),") using natural language formatting instructions and an output schema definition.\nFor example, you can extract specific details from documents, like email messages or scientific papers."]}),"\n",(0,r.jsx)(t.h3,{id:"use-the-structured-output-component-in-a-flow",children:"Use the Structured Output component in a flow"}),"\n",(0,r.jsxs)(t.p,{children:["To use the ",(0,r.jsx)(t.strong,{children:"Structured Output"})," component in a flow, do the following:"]}),"\n",(0,r.jsxs)(t.ol,{children:["\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Provide an ",(0,r.jsx)(t.strong,{children:"Input Message"}),", which is the source material from which you want to extract structured data.\nThis can come from practically any component, but it is typically a ",(0,r.jsx)(t.strong,{children:"Chat Input"}),", ",(0,r.jsx)(t.strong,{children:"File"}),", or other component that provides some unstructured or semi-structured input."]}),"\n",(0,r.jsx)(t.admonition,{type:"tip",children:(0,r.jsxs)(t.p,{children:["Not all source material has to become structured output.\nThe power of the ",(0,r.jsx)(t.strong,{children:"Structured Output"})," component is that you can specify the information you want to extract, even if that data isn't explicitly labeled or an exact keyword match.\nThen, the LLM can use your instructions to analyze the source material, extract the relevant data, and format it according to your specifications.\nAny irrelevant source material isn't included in the structured output."]})}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Define ",(0,r.jsx)(t.strong,{children:"Format Instructions"})," and an ",(0,r.jsx)(t.strong,{children:"Output Schema"})," to specify the data to extract from the source material and how to structure it in the final ",(0,r.jsx)(t.code,{children:"Data"})," or ",(0,r.jsx)(t.code,{children:"DataFrame"})," output."]}),"\n",(0,r.jsx)(t.p,{children:"The instructions are a prompt that tell the LLM what data to extract, how to format it, how to handle exceptions, and any other instructions relevant to preparing the structured data."}),"\n",(0,r.jsxs)(t.p,{children:["The schema is a table that defines the fields (keys) and data types to organize the data extracted by the LLM into a structured ",(0,r.jsx)(t.code,{children:"Data"})," or ",(0,r.jsx)(t.code,{children:"DataFrame"})," object.\nFor more information, see ",(0,r.jsx)(t.a,{href:"#output-schema-options",children:"Output Schema options"})]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Attach a ",(0,r.jsx)(t.a,{href:"/components-models",children:"language model component"})," that is set to emit ",(0,r.jsx)(t.a,{href:"/data-types#languagemodel",children:(0,r.jsx)(t.code,{children:"LanguageModel"})})," output."]}),"\n",(0,r.jsxs)(t.p,{children:["The LLM uses the ",(0,r.jsx)(t.strong,{children:"Input Message"})," and ",(0,r.jsx)(t.strong,{children:"Format Instructions"})," from the ",(0,r.jsx)(t.strong,{children:"Structured Output"})," component to extract specific pieces of data from the input text.\nThe output schema is applied to the model's response to produce the final ",(0,r.jsx)(t.code,{children:"Data"})," or ",(0,r.jsx)(t.code,{children:"DataFrame"})," structured object."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Optional: Typically, the structured output is passed to downstream components that use the extracted data for other processes, such as the ",(0,r.jsx)(t.strong,{children:"Parser"})," or ",(0,r.jsx)(t.strong,{children:"Data Operations"})," components."]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.img,{alt:"A basic flow with Structured Output, Language Model, Type Convert, and Chat Input and Output components.",src:n(82798).A+"",width:"4000",height:"1724"})}),"\n",(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"Structured Output example: Financial Report Parser template"}),(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Financial Report Parser"})," template provides an example of how the ",(0,r.jsx)(t.strong,{children:"Structured Output"})," component can be used to extract structured data from unstructured text."]}),(0,r.jsxs)(t.p,{children:["The template's ",(0,r.jsx)(t.strong,{children:"Structured Output"})," component has the following configuration:"]}),(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Input Message"})," comes from a ",(0,r.jsx)(t.strong,{children:"Chat Input"})," component that is preloaded with quotes from sample financial reports"]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Format Instructions"})," are as follows:"]}),"\n",(0,r.jsx)(j.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"You are an AI that extracts structured JSON objects from unstructured text.",props:{}}]},{tokens:[{content:"Use a predefined schema with expected types (str, int, float, bool, dict).",props:{}}]},{tokens:[{content:"Extract ALL relevant instances that match the schema - if multiple patterns exist, capture them all.",props:{}}]},{tokens:[{content:"Fill missing or ambiguous values with defaults: null for missing values.",props:{}}]},{tokens:[{content:"Remove exact duplicates but keep variations that have different field values.",props:{}}]},{tokens:[{content:"Always return valid JSON in the expected format, never throw errors.",props:{}}]},{tokens:[{content:"If multiple objects can be extracted, return them all in the structured format.",props:{}}]}],lang:"text"},annotations:[]}]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Output Schema"})," includes keys for ",(0,r.jsx)(t.code,{children:"EBITDA"}),", ",(0,r.jsx)(t.code,{children:"NET_INCOME"}),", and ",(0,r.jsx)(t.code,{children:"GROSS_PROFIT"}),"."]}),"\n"]}),"\n"]}),(0,r.jsxs)(t.p,{children:["The structured ",(0,r.jsx)(t.code,{children:"Data"})," object is passed to a ",(0,r.jsx)(t.strong,{children:"Parser"})," component that produces a text string by mapping the schema keys to variables in the parsing template:"]}),(0,r.jsx)(j.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"EBITDA: {EBITDA} , Net Income: {NET_INCOME} , GROSS_PROFIT: {GROSS_PROFIT}",props:{}}]}],lang:"text"},annotations:[]}]}),(0,r.jsxs)(t.p,{children:["When printed to the ",(0,r.jsx)(t.strong,{children:"Playground"}),", the resulting ",(0,r.jsx)(t.code,{children:"Message"})," replaces the variables with the actual values extracted by the ",(0,r.jsx)(t.strong,{children:"Structured Output"})," component. For example:"]}),(0,r.jsx)(j.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"EBITDA: 900 million , Net Income: 500 million , GROSS_PROFIT: 1.2 billion",props:{}}]}],lang:"text"},annotations:[]}]})]}),"\n",(0,r.jsx)(t.h3,{id:"structured-output-parameters",children:"Structured Output parameters"}),"\n",(0,r.jsx)(d.Ay,{}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Name"}),(0,r.jsx)(t.th,{children:"Type"}),(0,r.jsx)(t.th,{children:"Description"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsxs)(t.td,{children:["Language Model (",(0,r.jsx)(t.code,{children:"llm"}),")"]}),(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"LanguageModel"})}),(0,r.jsxs)(t.td,{children:["Input parameter. The ",(0,r.jsx)(t.a,{href:"/data-types#languagemodel",children:(0,r.jsx)(t.code,{children:"LanguageModel"})})," output from a ",(0,r.jsx)(t.strong,{children:"Language Model"})," component that defines the LLM to use to analyze, extract, and prepare the structured output."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsxs)(t.td,{children:["Input Message (",(0,r.jsx)(t.code,{children:"input_value"}),")"]}),(0,r.jsx)(t.td,{children:"String"}),(0,r.jsx)(t.td,{children:"Input parameter. The input message containing source material for extraction."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsxs)(t.td,{children:["Format Instructions (",(0,r.jsx)(t.code,{children:"system_prompt"}),")"]}),(0,r.jsx)(t.td,{children:"String"}),(0,r.jsx)(t.td,{children:"Input parameter. The instructions to the language model for extracting and formatting the output."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsxs)(t.td,{children:["Schema Name (",(0,r.jsx)(t.code,{children:"schema_name"}),")"]}),(0,r.jsx)(t.td,{children:"String"}),(0,r.jsxs)(t.td,{children:["Input parameter. An optional title for the ",(0,r.jsx)(t.strong,{children:"Output Schema"}),"."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsxs)(t.td,{children:["Output Schema (",(0,r.jsx)(t.code,{children:"output_schema"}),")"]}),(0,r.jsx)(t.td,{children:"Table"}),(0,r.jsxs)(t.td,{children:["Input parameter. A table describing the schema of the desired structured output, ultimately determining the content of the ",(0,r.jsx)(t.code,{children:"Data"})," or ",(0,r.jsx)(t.code,{children:"DataFrame"})," output. See ",(0,r.jsx)(t.a,{href:"#output-schema-options",children:"Output Schema options"}),"."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsxs)(t.td,{children:["Structured Output (",(0,r.jsx)(t.code,{children:"structured_output"}),")"]}),(0,r.jsxs)(t.td,{children:[(0,r.jsx)(t.code,{children:"Data"})," or ",(0,r.jsx)(t.code,{children:"DataFrame"})]}),(0,r.jsxs)(t.td,{children:["Output parameter. The final structured output produced by the component. Near the component's output port, you can select the output data type as either ",(0,r.jsx)(t.strong,{children:"Structured Output Data"})," or ",(0,r.jsx)(t.strong,{children:"Structured Output DataFrame"}),". The specific content and structure of the output depends on the input parameters."]})]})]})]}),"\n",(0,r.jsx)(t.h4,{id:"output-schema-options",children:"Output Schema options"}),"\n",(0,r.jsxs)(t.p,{children:["After the LLM extracts the relevant data from the ",(0,r.jsx)(t.strong,{children:"Input Message"})," and ",(0,r.jsx)(t.strong,{children:"Format Instructions"}),", the data is organized according to the ",(0,r.jsx)(t.strong,{children:"Output Schema"}),"."]}),"\n",(0,r.jsxs)(t.p,{children:["The schema is a table that defines the fields (keys) and data types for the final ",(0,r.jsx)(t.code,{children:"Data"})," or ",(0,r.jsx)(t.code,{children:"DataFrame"})," output from the ",(0,r.jsx)(t.strong,{children:"Structured Output"})," component."]}),"\n",(0,r.jsxs)(t.p,{children:["The default schema is a single ",(0,r.jsx)(t.code,{children:"field"})," string."]}),"\n",(0,r.jsxs)(t.p,{children:["To add a key to the schema, click ",(0,r.jsx)(i.A,{name:"Plus","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Add a new row"}),", and then edit each column to define the schema:"]}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.strong,{children:"Name"}),": The name of the output field. Typically a specific key for which you want to extract a value."]}),"\n",(0,r.jsxs)(t.p,{children:["You can reference these keys as variables in downstream components, such as a ",(0,r.jsx)(t.strong,{children:"Parser"})," component's template.\nFor example, the schema key ",(0,r.jsx)(t.code,{children:"NET_INCOME"})," could be referenced by the variable ",(0,r.jsx)(t.code,{children:"{NET_INCOME}"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.strong,{children:"Description"}),": An optional metadata description of the field's contents and purpose."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.strong,{children:"Type"}),": The data type of the value stored in the field.\nSupported types are ",(0,r.jsx)(t.code,{children:"str"})," (default), ",(0,r.jsx)(t.code,{children:"int"}),", ",(0,r.jsx)(t.code,{children:"float"}),", ",(0,r.jsx)(t.code,{children:"bool"}),", and ",(0,r.jsx)(t.code,{children:"dict"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.strong,{children:"As List"}),": Enable this setting if you want the field to contain a list of values rather than a single value."]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(t.p,{children:["For simple schemas, you might only extract a few ",(0,r.jsx)(t.code,{children:"string"})," or ",(0,r.jsx)(t.code,{children:"int"})," fields.\nFor more complex schemas with lists and dictionaries, it might help to refer to the ",(0,r.jsx)(t.code,{children:"Data"})," and ",(0,r.jsx)(t.code,{children:"DataFrame"})," structures and attributes, as described in ",(0,r.jsx)(t.a,{href:"/data-types",children:"Langflow data types"}),".\nYou can also emit a rough ",(0,r.jsx)(t.code,{children:"Data"})," or ",(0,r.jsx)(t.code,{children:"DataFrame"}),", and then use downstream components for further refinement, such as a ",(0,r.jsx)(t.strong,{children:"Data Operations"})," component."]}),"\n",(0,r.jsx)(t.h2,{id:"type-convert",children:"Type Convert"}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Type Convert"})," component converts data from one type to another.\nIt supports ",(0,r.jsx)(t.code,{children:"Data"}),", ",(0,r.jsx)(t.code,{children:"DataFrame"}),", and ",(0,r.jsx)(t.code,{children:"Message"})," data types."]}),"\n",(0,r.jsxs)(c.A,{children:[(0,r.jsxs)(l.A,{value:"data",label:"Data",default:!0,children:[(0,r.jsxs)(t.p,{children:["A ",(0,r.jsx)(t.code,{children:"Data"})," object is a structured object that contains a primary ",(0,r.jsx)(t.code,{children:"text"})," key and other key-value pairs:"]}),(0,r.jsx)(j.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:'"data"',props:{style:{color:"#A5D6FF"}}},{content:": {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "text"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"User Profile"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "name"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"Charlie Lastname"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "age"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"28",props:{style:{color:"#79C0FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "email"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"charlie.lastname@example.com"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"},",props:{style:{color:"#C9D1D9"}}}]}],lang:"json"},annotations:[]}]}),(0,r.jsxs)(t.p,{children:["The larger context associated with a component's ",(0,r.jsx)(t.code,{children:"data"})," dictionary also identifies which key is the primary ",(0,r.jsx)(t.code,{children:"text_key"}),", and it can provide an optional default value if the primary key isn't specified.\nFor example:"]}),(0,r.jsx)(j.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"{",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "text_key"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"text"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "data"',props:{style:{color:"#7EE787"}}},{content:": {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "text"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"User Profile"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "name"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"Charlie Lastname"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "age"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"28",props:{style:{color:"#79C0FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "email"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"charlie.lastname@example.com"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" },",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "default_value"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'""',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]}],lang:"json"},annotations:[]}]})]}),(0,r.jsxs)(l.A,{value:"dataframe",label:"DataFrame",children:[(0,r.jsxs)(t.p,{children:["A ",(0,r.jsx)(t.code,{children:"DataFrame"})," is an array that represents a tabular data structure with rows and columns."]}),(0,r.jsxs)(t.p,{children:["It consists of a list (array) of dictionary objects, where each dictionary represents a row.\nEach key in the dictionaries corresponds to a column name.\nFor example, the following ",(0,r.jsx)(t.code,{children:"DataFrame"})," contains two rows with columns for ",(0,r.jsx)(t.code,{children:"name"}),", ",(0,r.jsx)(t.code,{children:"age"}),", and ",(0,r.jsx)(t.code,{children:"email"}),":"]}),(0,r.jsx)(j.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"[",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "name"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"Charlie Lastname"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "age"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"28",props:{style:{color:"#79C0FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "email"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"charlie.lastname@example.com"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" },",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "name"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"Bobby Othername"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "age"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"25",props:{style:{color:"#79C0FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "email"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"bobby.othername@example.com"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" }",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"]",props:{style:{color:"#C9D1D9"}}}]}],lang:"json"},annotations:[]}]})]}),(0,r.jsx)(l.A,{value:"message",label:"Message",children:(0,r.jsxs)(t.p,{children:["A ",(0,r.jsx)(t.code,{children:"Message"})," is primarily for passing a ",(0,r.jsx)(t.code,{children:"text"})," string, such as",(0,r.jsx)(t.code,{children:'"Name: Charlie Lastname, Age: 28, Email: charlie.lastname@example.com"'}),".\nHowever, the entire ",(0,r.jsx)(t.code,{children:"Message"})," object can include metadata about the message, particularly when used as chat input or output."]})})]}),"\n",(0,r.jsxs)(t.p,{children:["For more information, see ",(0,r.jsx)(t.a,{href:"/data-types",children:"Langflow data types"}),"."]}),"\n",(0,r.jsx)(t.h3,{id:"use-the-type-convert-component-in-a-flow",children:"Use the Type Convert component in a flow"}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Type Convert"})," component is typically used to transform data into a format required by a downstream component.\nFor example, if a component outputs a ",(0,r.jsx)(t.code,{children:"Message"}),", but the following component requires ",(0,r.jsx)(t.code,{children:"Data"}),", then you can use the ",(0,r.jsx)(t.strong,{children:"Type Convert"})," component to reformat the ",(0,r.jsx)(t.code,{children:"Message"})," as ",(0,r.jsx)(t.code,{children:"Data"})," before passing it to the downstream component."]}),"\n",(0,r.jsxs)(t.p,{children:["The following example uses the ",(0,r.jsx)(t.strong,{children:"Type Convert"})," component to convert the ",(0,r.jsx)(t.code,{children:"DataFrame"})," output from a ",(0,r.jsx)(t.strong,{children:"Web Search"})," component into ",(0,r.jsx)(t.code,{children:"Message"})," data that is passed as text input for an LLM:"]}),"\n",(0,r.jsxs)(t.ol,{children:["\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Create a flow based on the ",(0,r.jsx)(t.strong,{children:"Basic prompting"})," template."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Add a ",(0,r.jsx)(t.strong,{children:"Web Search"})," component to the flow, and then enter a search query, such as ",(0,r.jsx)(t.code,{children:"environmental news"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["In the ",(0,r.jsx)(t.strong,{children:"Prompt Template"})," component, replace the contents of the ",(0,r.jsx)(t.strong,{children:"Template"})," field with the following text:"]}),"\n",(0,r.jsx)(j.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"Answer the user's question using the {context}",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,r.jsxs)(t.p,{children:["The curly braces define a ",(0,r.jsx)(t.a,{href:"/components-prompts#define-variables-in-prompts",children:"prompt variable"})," that becomes an input field on the ",(0,r.jsx)(t.strong,{children:"Prompt Template"})," component.\nIn this example, you will use the ",(0,r.jsx)(t.strong,{children:"context"})," field to pass the search results into the template, as explained in the next steps."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Add a ",(0,r.jsx)(t.strong,{children:"Type Convert"})," component to the flow, and then set the ",(0,r.jsx)(t.strong,{children:"Output Type"})," to ",(0,r.jsx)(t.strong,{children:"Message"}),"."]}),"\n",(0,r.jsxs)(t.p,{children:["Because the ",(0,r.jsx)(t.strong,{children:"Web Search"})," component's ",(0,r.jsx)(t.code,{children:"DataFrame"})," output is incompatible with the ",(0,r.jsx)(t.strong,{children:"context"})," variable's ",(0,r.jsx)(t.code,{children:"Message"})," input, you must use the ",(0,r.jsx)(t.strong,{children:"Type Convert"})," component to change the ",(0,r.jsx)(t.code,{children:"DataFrame"})," to a ",(0,r.jsx)(t.code,{children:"Message"})," in order to pass the search results to the ",(0,r.jsx)(t.strong,{children:"Prompt Template"})," component."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsx)(t.p,{children:"Connect the additional components to the rest of the flow:"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:["Connect the ",(0,r.jsx)(t.strong,{children:"Web Search"})," component's output to the ",(0,r.jsx)(t.strong,{children:"Type Convert"})," component's input."]}),"\n",(0,r.jsxs)(t.li,{children:["Connect the ",(0,r.jsx)(t.strong,{children:"Type Convert"})," component's output to the ",(0,r.jsx)(t.strong,{children:"Prompt Template"})," component's ",(0,r.jsx)(t.strong,{children:"context"})," input."]}),"\n"]}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.img,{alt:"Convert web search output to text input",src:n(42547).A+"",width:"4000",height:"1826"})}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["In the ",(0,r.jsx)(t.strong,{children:"Language Model"})," component, add your OpenAI API key."]}),"\n",(0,r.jsxs)(t.p,{children:["If you want to use a different provider or model, edit the ",(0,r.jsx)(t.strong,{children:"Model Provider"}),", ",(0,r.jsx)(t.strong,{children:"Model Name"}),", and ",(0,r.jsx)(t.strong,{children:"API Key"})," fields accordingly."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Click ",(0,r.jsx)(t.strong,{children:"Playground"}),", and then ask something relevant to your search query, such as ",(0,r.jsx)(t.code,{children:"latest news"})," or ",(0,r.jsx)(t.code,{children:"what's the latest research on the environment?"}),"."]}),"\n",(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"Result"}),(0,r.jsx)(t.p,{children:"The LLM uses the search results context, your chat message, and it's built-in training data to respond to your question.\nFor example:"}),(0,r.jsx)(j.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"Here are some of the latest news articles related to the environment:",props:{}}]},{tokens:[{content:"Ozone Pollution and Global Warming: A recent study highlights that ozone pollution is a significant global environmental concern, threatening human health and crop production while exacerbating global warming. Read more",props:{}}]},{tokens:[{content:"...",props:{}}]}],lang:"text"},annotations:[]}]})]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(t.h3,{id:"type-convert-parameters",children:"Type Convert parameters"}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Name"}),(0,r.jsx)(t.th,{children:"Display Name"}),(0,r.jsx)(t.th,{children:"Info"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"input_data"}),(0,r.jsx)(t.td,{children:"Input Data"}),(0,r.jsxs)(t.td,{children:["Input parameter. The data to convert. Accepts ",(0,r.jsx)(t.code,{children:"Data"}),", ",(0,r.jsx)(t.code,{children:"DataFrame"}),", or ",(0,r.jsx)(t.code,{children:"Message"})," input."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"output_type"}),(0,r.jsx)(t.td,{children:"Output Type"}),(0,r.jsxs)(t.td,{children:["Input parameter. The desired output type, as one of ",(0,r.jsx)(t.strong,{children:"Data"}),", ",(0,r.jsx)(t.strong,{children:"DataFrame"})," or ",(0,r.jsx)(t.strong,{children:"Message"}),"."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"output"}),(0,r.jsx)(t.td,{children:"Output"}),(0,r.jsxs)(t.td,{children:["Output parameter. The converted data in the specified format. The output port changes depending on the selected ",(0,r.jsx)(t.strong,{children:"Output Type"}),"."]})]})]})]}),"\n",(0,r.jsx)(t.h2,{id:"legacy-processing-components",children:"Legacy Processing components"}),"\n","\n",(0,r.jsx)(p.Ay,{}),"\n",(0,r.jsx)(t.p,{children:"The following Processing components are in legacy status:"}),"\n",(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"Alter Metadata"}),(0,r.jsxs)(t.p,{children:["Replace this legacy component with the ",(0,r.jsxs)(t.a,{href:"#data-operations",children:[(0,r.jsx)(t.strong,{children:"Data Operations"})," component"]}),"."]}),(0,r.jsxs)(t.p,{children:["This component modifies metadata of input objects. It can add new metadata, update existing metadata, and remove specified metadata fields. The component works with both ",(0,r.jsx)(t.code,{children:"Message"})," and ",(0,r.jsx)(t.code,{children:"Data"})," objects, and can also create a new ",(0,r.jsx)(t.code,{children:"Data"})," object from user-provided text."]}),(0,r.jsx)(t.p,{children:"It accepts the following parameters:"}),(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Name"}),(0,r.jsx)(t.th,{children:"Display Name"}),(0,r.jsx)(t.th,{children:"Info"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"input_value"}),(0,r.jsx)(t.td,{children:"Input"}),(0,r.jsx)(t.td,{children:"Input parameter. Objects to which Metadata should be added."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"text_in"}),(0,r.jsx)(t.td,{children:"User Text"}),(0,r.jsxs)(t.td,{children:["Input parameter. Text input; the value is contained in the 'text' attribute of the ",(0,r.jsx)(t.code,{children:"Data"})," object. Empty text entries are ignored."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"metadata"}),(0,r.jsx)(t.td,{children:"Metadata"}),(0,r.jsx)(t.td,{children:"Input parameter. Metadata to add to each object."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"remove_fields"}),(0,r.jsx)(t.td,{children:"Fields to Remove"}),(0,r.jsx)(t.td,{children:"Input parameter. Metadata fields to remove."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"data"}),(0,r.jsx)(t.td,{children:"Data"}),(0,r.jsx)(t.td,{children:"Output parameter. List of Input objects, each with added metadata."})]})]})]})]}),"\n",(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"Combine Data"}),(0,r.jsxs)(t.p,{children:["Replace this legacy component with the ",(0,r.jsxs)(t.a,{href:"#data-operations",children:[(0,r.jsx)(t.strong,{children:"Data Operations"})," component"]})," or the ",(0,r.jsxs)(t.a,{href:"/components-logic#loop",children:[(0,r.jsx)(t.strong,{children:"Loop"})," component"]}),"."]}),(0,r.jsxs)(t.p,{children:["This component combines multiple data sources into a single unified ",(0,r.jsx)(t.code,{children:"Data"})," object."]}),(0,r.jsxs)(t.p,{children:["The component iterates through a list of ",(0,r.jsx)(t.code,{children:"Data"})," objects, merging them into a single ",(0,r.jsx)(t.code,{children:"Data"})," object (",(0,r.jsx)(t.code,{children:"merged_data"}),").\nIf the input list is empty, it returns an empty data object.\nIf there's only one input data object, it returns that object unchanged."]}),(0,r.jsx)(t.p,{children:"The merging process uses the addition operator to combine data objects."})]}),"\n",(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"Combine Text"}),(0,r.jsxs)(t.p,{children:["Replace this legacy component with the ",(0,r.jsxs)(t.a,{href:"#data-operations",children:[(0,r.jsx)(t.strong,{children:"Data Operations"})," component"]}),"."]}),(0,r.jsxs)(t.p,{children:["This component concatenates two text inputs into a single text chunk using a specified delimiter, outputting a ",(0,r.jsx)(t.code,{children:"Message"})," object with the combined text."]})]}),"\n",(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"Create Data"}),(0,r.jsxs)(t.p,{children:["Replace this legacy component with the ",(0,r.jsxs)(t.a,{href:"#data-operations",children:[(0,r.jsx)(t.strong,{children:"Data Operations"})," component"]}),"."]}),(0,r.jsxs)(t.p,{children:["This component dynamically creates a ",(0,r.jsx)(t.code,{children:"Data"})," object with a specified number of fields and a text key."]}),(0,r.jsx)(t.p,{children:"It accepts the following parameters:"}),(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Name"}),(0,r.jsx)(t.th,{children:"Display Name"}),(0,r.jsx)(t.th,{children:"Info"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"number_of_fields"}),(0,r.jsx)(t.td,{children:"Number of Fields"}),(0,r.jsx)(t.td,{children:"Input parameter. The number of fields to be added to the record."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"text_key"}),(0,r.jsx)(t.td,{children:"Text Key"}),(0,r.jsx)(t.td,{children:"Input parameter. Key that identifies the field to be used as the text content."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"text_key_validator"}),(0,r.jsx)(t.td,{children:"Text Key Validator"}),(0,r.jsxs)(t.td,{children:["Input parameter. If enabled, checks if the given ",(0,r.jsx)(t.code,{children:"Text Key"})," is present in the given ",(0,r.jsx)(t.code,{children:"Data"}),"."]})]})]})]})]}),"\n",(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"Extract Key"}),(0,r.jsxs)(t.p,{children:["Replace this legacy component with the ",(0,r.jsxs)(t.a,{href:"#data-operations",children:[(0,r.jsx)(t.strong,{children:"Data Operations"})," component"]}),"."]}),(0,r.jsxs)(t.p,{children:["This component extracts a specific key from a ",(0,r.jsx)(t.code,{children:"Data"})," object and returns the value associated with that key."]})]}),"\n",(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"Data to DataFrame/Data to Message"}),(0,r.jsxs)(t.p,{children:["Replace these legacy components with newer Processing components, such as the ",(0,r.jsxs)(t.a,{href:"#data-operations",children:[(0,r.jsx)(t.strong,{children:"Data Operations"})," component"]})," and ",(0,r.jsxs)(t.a,{href:"#type-convert",children:[(0,r.jsx)(t.strong,{children:"Type Convert"})," component"]}),"."]}),(0,r.jsxs)(t.p,{children:["These components converted one or more ",(0,r.jsx)(t.code,{children:"Data"})," objects into a ",(0,r.jsx)(t.code,{children:"DataFrame"})," or ",(0,r.jsx)(t.code,{children:"Message"})," object."]}),(0,r.jsxs)(t.p,{children:["For the ",(0,r.jsx)(t.strong,{children:"Data to DataFrame"})," component, each ",(0,r.jsx)(t.code,{children:"Data"})," object corresponds to one row in the resulting ",(0,r.jsx)(t.code,{children:"DataFrame"}),".\nFields from the ",(0,r.jsx)(t.code,{children:".data"})," attribute become columns, and the ",(0,r.jsx)(t.code,{children:".text"})," field (if present) is placed in a ",(0,r.jsx)(t.code,{children:"text"})," column."]})]}),"\n",(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"Filter Data"}),(0,r.jsxs)(t.p,{children:["Replace this legacy component with the ",(0,r.jsxs)(t.a,{href:"#data-operations",children:[(0,r.jsx)(t.strong,{children:"Data Operations"})," component"]}),"."]}),(0,r.jsxs)(t.p,{children:["This component filters a ",(0,r.jsx)(t.code,{children:"Data"})," object based on a list of keys (",(0,r.jsx)(t.code,{children:"filter_criteria"}),"), returning a new ",(0,r.jsx)(t.code,{children:"Data"})," object (",(0,r.jsx)(t.code,{children:"filtered_data"}),") that contains only the key-value pairs that match the filter criteria."]})]}),"\n",(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"Filter Values"}),(0,r.jsxs)(t.p,{children:["Replace this legacy component with the ",(0,r.jsxs)(t.a,{href:"#data-operations",children:[(0,r.jsx)(t.strong,{children:"Data Operations"})," component"]}),"."]}),(0,r.jsx)(t.p,{children:"The Filter values component filters a list of data items based on a specified key, filter value, and comparison operator."}),(0,r.jsx)(t.p,{children:"It accepts the following parameters:"}),(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Name"}),(0,r.jsx)(t.th,{children:"Display Name"}),(0,r.jsx)(t.th,{children:"Info"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"input_data"}),(0,r.jsx)(t.td,{children:"Input data"}),(0,r.jsx)(t.td,{children:"Input parameter. The list of data items to filter."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"filter_key"}),(0,r.jsx)(t.td,{children:"Filter Key"}),(0,r.jsx)(t.td,{children:"Input parameter. The key to filter on."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"filter_value"}),(0,r.jsx)(t.td,{children:"Filter Value"}),(0,r.jsx)(t.td,{children:"Input parameter. The value to filter by."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"operator"}),(0,r.jsx)(t.td,{children:"Comparison Operator"}),(0,r.jsx)(t.td,{children:"Input parameter. The operator to apply for comparing the values."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"filtered_data"}),(0,r.jsx)(t.td,{children:"Filtered data"}),(0,r.jsx)(t.td,{children:"Output parameter. The resulting list of filtered data items."})]})]})]})]}),"\n",(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"JSON Cleaner"}),(0,r.jsxs)(t.p,{children:["Replace this legacy component with the ",(0,r.jsxs)(t.a,{href:"#parser",children:[(0,r.jsx)(t.strong,{children:"Parser"})," component"]}),"."]}),(0,r.jsx)(t.p,{children:"This component cleans JSON strings to ensure they are fully compliant with the JSON specification."}),(0,r.jsx)(t.p,{children:"It accepts the following parameters:"}),(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Name"}),(0,r.jsx)(t.th,{children:"Display Name"}),(0,r.jsx)(t.th,{children:"Info"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"json_str"}),(0,r.jsx)(t.td,{children:"JSON String"}),(0,r.jsx)(t.td,{children:"Input parameter. The JSON string to be cleaned. This can be a raw, potentially malformed JSON string produced by language models or other sources that may not fully comply with JSON specifications."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"remove_control_chars"}),(0,r.jsx)(t.td,{children:"Remove Control Characters"}),(0,r.jsxs)(t.td,{children:["Input parameter. If set to ",(0,r.jsx)(t.code,{children:"True"}),", this option removes control characters (ASCII characters 0-31 and 127) from the JSON string. This can help eliminate invisible characters that might cause parsing issues or make the JSON invalid."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"normalize_unicode"}),(0,r.jsx)(t.td,{children:"Normalize Unicode"}),(0,r.jsx)(t.td,{children:"Input parameter. When enabled, this option normalizes Unicode characters in the JSON string to their canonical composition form (NFC). This ensures consistent representation of Unicode characters across different systems and prevents potential issues with character encoding."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"validate_json"}),(0,r.jsx)(t.td,{children:"Validate JSON"}),(0,r.jsxs)(t.td,{children:["Input parameter. If set to ",(0,r.jsx)(t.code,{children:"True"}),", this option attempts to parse the JSON string to ensure it is well-formed before applying the final repair operation. It raises a ValueError if the JSON is invalid, allowing for early detection of major structural issues in the JSON."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"output"}),(0,r.jsx)(t.td,{children:"Cleaned JSON String"}),(0,r.jsx)(t.td,{children:"Output parameter. The resulting cleaned, repaired, and validated JSON string that fully complies with the JSON specification."})]})]})]})]}),"\n",(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"Message to Data"}),(0,r.jsxs)(t.p,{children:["Replace this legacy component with the ",(0,r.jsxs)(t.a,{href:"#type-convert",children:[(0,r.jsx)(t.strong,{children:"Type Convert"})," component"]}),"."]}),(0,r.jsxs)(t.p,{children:["This component converts ",(0,r.jsx)(t.code,{children:"Message"})," objects to ",(0,r.jsx)(t.code,{children:"Data"})," objects."]})]}),"\n",(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"Parse DataFrame"}),(0,r.jsxs)(t.p,{children:["Replace this legacy component with the ",(0,r.jsxs)(t.a,{href:"#dataframe-operations",children:[(0,r.jsx)(t.strong,{children:"DataFrame Operations"})," component"]})," or ",(0,r.jsxs)(t.a,{href:"#parser",children:[(0,r.jsx)(t.strong,{children:"Parser"})," component"]}),"."]}),(0,r.jsxs)(t.p,{children:["This component converts ",(0,r.jsx)(t.code,{children:"DataFrame"})," objects into plain text using templates."]}),(0,r.jsx)(t.p,{children:"It accepts the following parameters:"}),(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Name"}),(0,r.jsx)(t.th,{children:"Display Name"}),(0,r.jsx)(t.th,{children:"Info"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"df"}),(0,r.jsx)(t.td,{children:"DataFrame"}),(0,r.jsx)(t.td,{children:"Input parameter. The DataFrame to convert to text rows."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"template"}),(0,r.jsx)(t.td,{children:"Template"}),(0,r.jsxs)(t.td,{children:["Input parameter. Template for formatting (use ",(0,r.jsx)(t.code,{children:"{column_name}"})," placeholders)."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"sep"}),(0,r.jsx)(t.td,{children:"Separator"}),(0,r.jsx)(t.td,{children:"Input parameter. String to join rows in output."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"text"}),(0,r.jsx)(t.td,{children:"Text"}),(0,r.jsx)(t.td,{children:"Output parameter. All rows combined into single text."})]})]})]})]}),"\n",(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"Parse JSON"}),(0,r.jsxs)(t.p,{children:["Replace this legacy component with the ",(0,r.jsxs)(t.a,{href:"#parser",children:[(0,r.jsx)(t.strong,{children:"Parser"})," component"]}),"."]}),(0,r.jsxs)(t.p,{children:["This component converts and extracts JSON fields in ",(0,r.jsx)(t.code,{children:"Message"})," and ",(0,r.jsx)(t.code,{children:"Data"})," objects using JQ queries, then returns ",(0,r.jsx)(t.code,{children:"filtered_data"}),", which is a list of ",(0,r.jsx)(t.code,{children:"Data"})," objects."]})]}),"\n",(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"Regex Extractor"}),(0,r.jsxs)(t.p,{children:["Replace this legacy component with the ",(0,r.jsxs)(t.a,{href:"#parser",children:[(0,r.jsx)(t.strong,{children:"Parser"})," component"]}),"."]}),(0,r.jsx)(t.p,{children:"This component extracts patterns in text using regular expressions. It can be used to find and extract specific patterns or information in text."})]}),"\n",(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"Select Data"}),(0,r.jsxs)(t.p,{children:["Replace this legacy component with the ",(0,r.jsxs)(t.a,{href:"#data-operations",children:[(0,r.jsx)(t.strong,{children:"Data Operations"})," component"]}),"."]}),(0,r.jsxs)(t.p,{children:["This component selects a single ",(0,r.jsx)(t.code,{children:"Data"})," object from a list."]}),(0,r.jsx)(t.p,{children:"It accepts the following parameters:"}),(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Name"}),(0,r.jsx)(t.th,{children:"Display Name"}),(0,r.jsx)(t.th,{children:"Info"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"data_list"}),(0,r.jsx)(t.td,{children:"Data List"}),(0,r.jsx)(t.td,{children:"Input parameter. List of data to select from"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"data_index"}),(0,r.jsx)(t.td,{children:"Data Index"}),(0,r.jsx)(t.td,{children:"Input parameter. Index of the data to select"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"selected_data"}),(0,r.jsx)(t.td,{children:"Selected Data"}),(0,r.jsxs)(t.td,{children:["Output parameter. The selected ",(0,r.jsx)(t.code,{children:"Data"})," object."]})]})]})]})]}),"\n",(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"Update Data"}),(0,r.jsxs)(t.p,{children:["Replace this legacy component with the ",(0,r.jsxs)(t.a,{href:"#data-operations",children:[(0,r.jsx)(t.strong,{children:"Data Operations"})," component"]}),"."]}),(0,r.jsx)(t.p,{children:"This component dynamically updates or appends data with specified fields."}),(0,r.jsx)(t.p,{children:"It accepts the following parameters:"}),(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Name"}),(0,r.jsx)(t.th,{children:"Display Name"}),(0,r.jsx)(t.th,{children:"Info"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"old_data"}),(0,r.jsx)(t.td,{children:"Data"}),(0,r.jsx)(t.td,{children:"Input parameter. The records to update."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"number_of_fields"}),(0,r.jsx)(t.td,{children:"Number of Fields"}),(0,r.jsx)(t.td,{children:"Input parameter. The number of fields to add. The maximum is 15."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"text_key"}),(0,r.jsx)(t.td,{children:"Text Key"}),(0,r.jsx)(t.td,{children:"Input parameter. The key for text content."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"text_key_validator"}),(0,r.jsx)(t.td,{children:"Text Key Validator"}),(0,r.jsx)(t.td,{children:"Input parameter. Validates the text key presence."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"data"}),(0,r.jsx)(t.td,{children:"Data"}),(0,r.jsx)(t.td,{children:"Output parameter. The updated Data objects."})]})]})]})]})]})}function b(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(y,{...e})}):y(e)}function D(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}},42547:(e,t,n)=>{n.d(t,{A:()=>s});const s=n.p+"assets/images/component-type-convert-and-web-search-1eef7b9a7c1a243f4a08d9717728d0e1.png"},46445:(e,t,n)=>{n.d(t,{A:()=>s});const s=n.p+"assets/images/component-data-operations-select-key-80bade862d29f2851b01ee26413d495f.png"},49823:(e,t,n)=>{n.d(t,{A:()=>s});const s=n.p+"assets/images/component-split-text-fec2b1abb28e0852c8a172bbeb164b2c.png"},66539:(e,t,n)=>{n.d(t,{A:()=>s});const s=n.p+"assets/images/component-lambda-filter-76cd345c52fa41a59dcfac0205dc3068.png"},72736:(e,t,n)=>{n.d(t,{Ay:()=>i,RM:()=>o});var s=n(74848),r=n(28453);const o=[];function a(e){const t={code:"code",p:"p",...(0,r.R)(),...e.components};return(0,s.jsxs)(t.p,{children:["If your template includes literal text and variables, you can use double curly braces to escape literal curly braces in the template and prevent interpretation of that text as a variable.\nFor example: ",(0,s.jsx)(t.code,{children:"This is a template with {{literal text in curly braces}} and a {variable}"}),"."]})}function i(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(a,{...e})}):a(e)}},82798:(e,t,n)=>{n.d(t,{A:()=>s});const s=n.p+"assets/images/component-structured-output-23458b0d29eed6d092b557c7aaf6ab2c.png"},88103:(e,t,n)=>{n.d(t,{A:()=>s});const s=n.p+"assets/images/component-batch-run-19c94fbb0646b2731b37013b84dff1f6.png"},96218:(e,t,n)=>{n.d(t,{A:()=>s});const s=n.p+"assets/images/component-parser-1d1d72593f02991e5b14b6b1c112a744.png"},99e3:(e,t,n)=>{n.d(t,{A:()=>s});const s=n.p+"assets/images/component-python-interpreter-1ef9e7dec643a216fd5e83c2139d09c9.png"}}]); \ No newline at end of file diff --git a/assets/js/7996108c.60506144.js b/assets/js/7996108c.60506144.js new file mode 100644 index 0000000000..21e0737a7f --- /dev/null +++ b/assets/js/7996108c.60506144.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[7118],{14506:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>u,contentTitle:()=>p,default:()=>f,frontMatter:()=>h,metadata:()=>s,toc:()=>m});const s=JSON.parse('{"id":"Components/bundles-faiss","title":"FAISS","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/bundles-faiss.mdx","sourceDirName":"Components","slug":"/bundles-faiss","permalink":"/bundles-faiss","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"FAISS","slug":"/bundles-faiss"},"sidebar":"docs","previous":{"title":"Exa","permalink":"/bundles-exa"},"next":{"title":"Glean","permalink":"/bundles-glean"}}');var r=n(74848),o=n(28453),a=n(17886),i=n(31929),c=n(80223),d=n(90465),l=n(50005);const h={title:"FAISS",slug:"/bundles-faiss"},p=void 0,u={},m=[{value:"FAISS vector store",id:"faiss-vector-store",level:2},...l.RM,...d.RM,{value:"FAISS vector store parameters",id:"faiss-vector-store-parameters",level:3},...i.RM,...c.RM];function x(e){const t={a:"a",code:"code",h2:"h2",h3:"h3",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,o.R)(),...e.components},{Details:n}=t;return n||function(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(t.p,{children:[(0,r.jsx)(a.A,{name:"Blocks","aria-hidden":"true"})," ",(0,r.jsx)(t.a,{href:"/components-bundle-components",children:(0,r.jsx)(t.strong,{children:"Bundles"})})," contain custom components that support specific third-party integrations with Langflow."]}),"\n",(0,r.jsxs)(t.p,{children:["This page describes the components that are available in the ",(0,r.jsx)(t.strong,{children:"FAISS"})," bundle."]}),"\n",(0,r.jsx)(t.h2,{id:"faiss-vector-store",children:"FAISS vector store"}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"FAISS"})," component provides access to the Facebook AI Similarity Search (FAISS) library through an instance of ",(0,r.jsx)(t.code,{children:"FAISS"})," vector store."]}),"\n",(0,r.jsxs)(n,{children:[(0,r.jsx)("summary",{children:"About vector store instances"}),(0,r.jsx)(l.Ay,{})]}),"\n",(0,r.jsx)(d.Ay,{}),"\n",(0,r.jsx)(t.h3,{id:"faiss-vector-store-parameters",children:"FAISS vector store parameters"}),"\n",(0,r.jsx)(t.p,{children:"You can inspect a vector store component's parameters to learn more about the inputs it accepts, the features it supports, and how to configure it."}),"\n",(0,r.jsx)(i.Ay,{}),"\n",(0,r.jsx)(c.Ay,{}),"\n",(0,r.jsxs)(t.p,{children:["For information about accepted values and functionality, see the ",(0,r.jsx)(t.a,{href:"https://faiss.ai/index.html",children:"FAISS documentation"})," or inspect ",(0,r.jsx)(t.a,{href:"/concepts-components#component-code",children:"component code"}),"."]}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Name"}),(0,r.jsx)(t.th,{children:"Type"}),(0,r.jsx)(t.th,{children:"Description"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"index_name"}),(0,r.jsx)(t.td,{children:"String"}),(0,r.jsx)(t.td,{children:'Input parameter. The name of the FAISS index. Default: "langflow_index".'})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"persist_directory"}),(0,r.jsx)(t.td,{children:"String"}),(0,r.jsx)(t.td,{children:"Input parameter. Path to save the FAISS index. It is relative to where Langflow is running."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"search_query"}),(0,r.jsx)(t.td,{children:"String"}),(0,r.jsx)(t.td,{children:"Input parameter. The query to search for in the vector store."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"ingest_data"}),(0,r.jsx)(t.td,{children:"Data"}),(0,r.jsx)(t.td,{children:"Input parameter. The list of data to ingest into the vector store."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"allow_dangerous_deserialization"}),(0,r.jsx)(t.td,{children:"Boolean"}),(0,r.jsxs)(t.td,{children:["Input parameter. Set to ",(0,r.jsx)(t.code,{children:"True"})," to allow loading pickle files from untrusted sources. Default: ",(0,r.jsx)(t.code,{children:"True"}),"."]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"embedding"}),(0,r.jsx)(t.td,{children:"Embeddings"}),(0,r.jsx)(t.td,{children:"Input parameter. The embedding function to use for the vector store."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"number_of_results"}),(0,r.jsx)(t.td,{children:"Integer"}),(0,r.jsx)(t.td,{children:"Input parameter. Number of results to return from the search. Default: 4."})]})]})]})]})}function f(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(x,{...e})}):x(e)}},17886:(e,t,n)=>{n.d(t,{A:()=>o});n(96540);var s=n(64058),r=n(74848);function o({name:e,...t}){const n=s[e];return n?(0,r.jsx)(n,{...t}):null}},31929:(e,t,n)=>{n.d(t,{Ay:()=>c,RM:()=>a});var s=n(74848),r=n(28453),o=n(17886);const a=[];function i(e){const t={a:"a",p:"p",strong:"strong",...(0,r.R)(),...e.components};return(0,s.jsxs)(t.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,s.jsx)(o.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,s.jsx)(t.strong,{children:"Controls"})," in the ",(0,s.jsx)(t.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function c(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(i,{...e})}):i(e)}},50005:(e,t,n)=>{n.d(t,{Ay:()=>i,RM:()=>o});var s=n(74848),r=n(28453);const o=[];function a(e){const t={a:"a",code:"code",p:"p",...(0,r.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(t.p,{children:["Because Langflow is based on LangChain, vector store components use an instance of ",(0,s.jsx)(t.a,{href:"https://python.langchain.com/docs/integrations/vectorstores/",children:"LangChain vector store"})," to drive the underlying read and write functions.\nThese instances are provider-specific and configured according to the component's parameters, such as the connection string, index name, and schema."]}),"\n",(0,s.jsxs)(t.p,{children:["In component code, this is often instantiated as ",(0,s.jsx)(t.code,{children:"vector_store"}),", but some vector store components use a different name, such as the provider name."]}),"\n",(0,s.jsx)(t.p,{children:"Some LangChain classes don't expose all possible options as component parameters.\nDepending on the provider, these options might use default values or allow modification through environment variables, if they are supported in Langflow.\nFor information about specific options, see the LangChain API reference and vector store provider's documentation."})]})}function i(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(a,{...e})}):a(e)}},80223:(e,t,n)=>{n.d(t,{Ay:()=>i,RM:()=>o});var s=n(74848),r=n(28453);const o=[];function a(e){const t={p:"p",strong:"strong",...(0,r.R)(),...e.components};return(0,s.jsxs)(t.p,{children:["Some parameters are conditional, and they are only available after you set other parameters or select specific options for other parameters.\nConditional parameters may not be visible on the ",(0,s.jsx)(t.strong,{children:"Controls"})," pane until you set the required dependencies."]})}function i(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(a,{...e})}):a(e)}},90465:(e,t,n)=>{n.d(t,{Ay:()=>i,RM:()=>o});var s=n(74848),r=n(28453);const o=[];function a(e){const t={a:"a",code:"code",p:"p",...(0,r.R)(),...e.components};return(0,s.jsxs)(t.p,{children:["If you use a vector store component to query your vector database, it produces search results that you can pass to downstream components in your flow as a list of ",(0,s.jsx)(t.a,{href:"/data-types#data",children:(0,s.jsx)(t.code,{children:"Data"})})," objects or a tabular ",(0,s.jsx)(t.a,{href:"/data-types#dataframe",children:(0,s.jsx)(t.code,{children:"DataFrame"})}),".\nIf both types are supported, you can set the format near the vector store component's output port in the visual editor."]})}function i(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(a,{...e})}):a(e)}}}]); \ No newline at end of file diff --git a/assets/js/7996108c.aa51d493.js b/assets/js/7996108c.aa51d493.js deleted file mode 100644 index 526e89404b..0000000000 --- a/assets/js/7996108c.aa51d493.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[7118],{14506:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>u,contentTitle:()=>p,default:()=>f,frontMatter:()=>h,metadata:()=>s,toc:()=>m});const s=JSON.parse('{"id":"Components/bundles-faiss","title":"FAISS","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/bundles-faiss.mdx","sourceDirName":"Components","slug":"/bundles-faiss","permalink":"/bundles-faiss","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"FAISS","slug":"/bundles-faiss"},"sidebar":"docs","previous":{"title":"Exa","permalink":"/bundles-exa"},"next":{"title":"Glean","permalink":"/bundles-glean"}}');var r=n(74848),o=n(28453),a=n(17886),i=n(31929),c=n(80223),d=n(90465),l=n(50005);const h={title:"FAISS",slug:"/bundles-faiss"},p=void 0,u={},m=[{value:"FAISS vector store",id:"faiss-vector-store",level:2},...l.RM,...d.RM,{value:"FAISS vector store parameters",id:"faiss-vector-store-parameters",level:3},...i.RM,...c.RM];function x(e){const t={a:"a",code:"code",h2:"h2",h3:"h3",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,o.R)(),...e.components},{Details:n}=t;return n||function(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(t.p,{children:[(0,r.jsx)(a.A,{name:"Blocks","aria-hidden":"true"})," ",(0,r.jsx)(t.a,{href:"/components-bundle-components",children:(0,r.jsx)(t.strong,{children:"Bundles"})})," contain custom components that support specific third-party integrations with Langflow."]}),"\n",(0,r.jsxs)(t.p,{children:["This page describes the components that are available in the ",(0,r.jsx)(t.strong,{children:"FAISS"})," bundle."]}),"\n",(0,r.jsx)(t.h2,{id:"faiss-vector-store",children:"FAISS vector store"}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"FAISS"})," component provides access to the Facebook AI Similarity Search (FAISS) library through an instance of ",(0,r.jsx)(t.code,{children:"FAISS"})," vector store."]}),"\n",(0,r.jsxs)(n,{children:[(0,r.jsx)("summary",{children:"About vector store instances"}),(0,r.jsx)(l.Ay,{})]}),"\n",(0,r.jsx)(d.Ay,{}),"\n",(0,r.jsx)(t.h3,{id:"faiss-vector-store-parameters",children:"FAISS vector store parameters"}),"\n",(0,r.jsx)(t.p,{children:"You can inspect a vector store component's parameters to learn more about the inputs it accepts, the features it supports, and how to configure it."}),"\n",(0,r.jsx)(i.Ay,{}),"\n",(0,r.jsx)(c.Ay,{}),"\n",(0,r.jsxs)(t.p,{children:["For information about accepted values and functionality, see the ",(0,r.jsx)(t.a,{href:"https://faiss.ai/index.html",children:"FAISS documentation"})," or inspect ",(0,r.jsx)(t.a,{href:"/concepts-components#component-code",children:"component code"}),"."]}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Name"}),(0,r.jsx)(t.th,{children:"Type"}),(0,r.jsx)(t.th,{children:"Description"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"index_name"}),(0,r.jsx)(t.td,{children:"String"}),(0,r.jsx)(t.td,{children:'Input parameter. The name of the FAISS index. Default: "langflow_index".'})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"persist_directory"}),(0,r.jsx)(t.td,{children:"String"}),(0,r.jsx)(t.td,{children:"Input parameter. Path to save the FAISS index. It is relative to where Langflow is running."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"search_query"}),(0,r.jsx)(t.td,{children:"String"}),(0,r.jsx)(t.td,{children:"Input parameter. The query to search for in the vector store."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"ingest_data"}),(0,r.jsx)(t.td,{children:"Data"}),(0,r.jsx)(t.td,{children:"Input parameter. The list of data to ingest into the vector store."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"allow_dangerous_deserialization"}),(0,r.jsx)(t.td,{children:"Boolean"}),(0,r.jsx)(t.td,{children:"Input parameter. Set to True to allow loading pickle files from untrusted sources. Default: True."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"embedding"}),(0,r.jsx)(t.td,{children:"Embeddings"}),(0,r.jsx)(t.td,{children:"Input parameter. The embedding function to use for the vector store."})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"number_of_results"}),(0,r.jsx)(t.td,{children:"Integer"}),(0,r.jsx)(t.td,{children:"Input parameter. Number of results to return from the search. Default: 4."})]})]})]})]})}function f(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(x,{...e})}):x(e)}},17886:(e,t,n)=>{n.d(t,{A:()=>o});n(96540);var s=n(64058),r=n(74848);function o({name:e,...t}){const n=s[e];return n?(0,r.jsx)(n,{...t}):null}},31929:(e,t,n)=>{n.d(t,{Ay:()=>c,RM:()=>a});var s=n(74848),r=n(28453),o=n(17886);const a=[];function i(e){const t={a:"a",p:"p",strong:"strong",...(0,r.R)(),...e.components};return(0,s.jsxs)(t.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,s.jsx)(o.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,s.jsx)(t.strong,{children:"Controls"})," in the ",(0,s.jsx)(t.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function c(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(i,{...e})}):i(e)}},50005:(e,t,n)=>{n.d(t,{Ay:()=>i,RM:()=>o});var s=n(74848),r=n(28453);const o=[];function a(e){const t={a:"a",code:"code",p:"p",...(0,r.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(t.p,{children:["Because Langflow is based on LangChain, vector store components use an instance of ",(0,s.jsx)(t.a,{href:"https://python.langchain.com/docs/integrations/vectorstores/",children:"LangChain vector store"})," to drive the underlying read and write functions.\nThese instances are provider-specific and configured according to the component's parameters, such as the connection string, index name, and schema."]}),"\n",(0,s.jsxs)(t.p,{children:["In component code, this is often instantiated as ",(0,s.jsx)(t.code,{children:"vector_store"}),", but some vector store components use a different name, such as the provider name."]}),"\n",(0,s.jsx)(t.p,{children:"Some LangChain classes don't expose all possible options as component parameters.\nDepending on the provider, these options might use default values or allow modification through environment variables, if they are supported in Langflow.\nFor information about specific options, see the LangChain API reference and vector store provider's documentation."})]})}function i(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(a,{...e})}):a(e)}},80223:(e,t,n)=>{n.d(t,{Ay:()=>i,RM:()=>o});var s=n(74848),r=n(28453);const o=[];function a(e){const t={p:"p",strong:"strong",...(0,r.R)(),...e.components};return(0,s.jsxs)(t.p,{children:["Some parameters are conditional, and they are only available after you set other parameters or select specific options for other parameters.\nConditional parameters may not be visible on the ",(0,s.jsx)(t.strong,{children:"Controls"})," pane until you set the required dependencies."]})}function i(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(a,{...e})}):a(e)}},90465:(e,t,n)=>{n.d(t,{Ay:()=>i,RM:()=>o});var s=n(74848),r=n(28453);const o=[];function a(e){const t={a:"a",code:"code",p:"p",...(0,r.R)(),...e.components};return(0,s.jsxs)(t.p,{children:["If you use a vector store component to query your vector database, it produces search results that you can pass to downstream components in your flow as a list of ",(0,s.jsx)(t.a,{href:"/data-types#data",children:(0,s.jsx)(t.code,{children:"Data"})})," objects or a tabular ",(0,s.jsx)(t.a,{href:"/data-types#dataframe",children:(0,s.jsx)(t.code,{children:"DataFrame"})}),".\nIf both types are supported, you can set the format near the vector store component's output port in the visual editor."]})}function i(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(a,{...e})}):a(e)}}}]); \ No newline at end of file diff --git a/assets/js/7f193c41.613cc11b.js b/assets/js/7f193c41.613cc11b.js new file mode 100644 index 0000000000..b0da1b2f21 --- /dev/null +++ b/assets/js/7f193c41.613cc11b.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[5761],{11470:(e,n,t)=>{t.d(n,{A:()=>w});var s=t(96540),r=t(18215),o=t(23104),a=t(56347),i=t(205),d=t(57485),c=t(31682),l=t(70679);function h(e){return s.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,s.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function p(e){const{values:n,children:t}=e;return(0,s.useMemo)(()=>{const e=n??function(e){return h(e).map(({props:{value:e,label:n,attributes:t,default:s}})=>({value:e,label:n,attributes:t,default:s}))}(t);return function(e){const n=(0,c.XI)(e,(e,n)=>e.value===n.value);if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map(e=>e.value).join(", ")}" found in . Every value needs to be unique.`)}(e),e},[n,t])}function u({value:e,tabValues:n}){return n.some(n=>n.value===e)}function x({queryString:e=!1,groupId:n}){const t=(0,a.W6)(),r=function({queryString:e=!1,groupId:n}){if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:e,groupId:n});return[(0,d.aZ)(r),(0,s.useCallback)(e=>{if(!r)return;const n=new URLSearchParams(t.location.search);n.set(r,e),t.replace({...t.location,search:n.toString()})},[r,t])]}function j(e){const{defaultValue:n,queryString:t=!1,groupId:r}=e,o=p(e),[a,d]=(0,s.useState)(()=>function({defaultValue:e,tabValues:n}){if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(e){if(!u({value:e,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${n.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}const t=n.find(e=>e.default)??n[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:n,tabValues:o})),[c,h]=x({queryString:t,groupId:r}),[j,m]=function({groupId:e}){const n=function(e){return e?`docusaurus.tab.${e}`:null}(e),[t,r]=(0,l.Dv)(n);return[t,(0,s.useCallback)(e=>{n&&r.set(e)},[n,r])]}({groupId:r}),g=(()=>{const e=c??j;return u({value:e,tabValues:o})?e:null})();(0,i.A)(()=>{g&&d(g)},[g]);return{selectedValue:a,selectValue:(0,s.useCallback)(e=>{if(!u({value:e,tabValues:o}))throw new Error(`Can't select invalid tab value=${e}`);d(e),h(e),m(e)},[h,m,o]),tabValues:o}}var m=t(92303);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=t(74848);function y({className:e,block:n,selectedValue:t,selectValue:s,tabValues:a}){const i=[],{blockElementScrollPositionUntilNextRender:d}=(0,o.a_)(),c=e=>{const n=e.currentTarget,r=i.indexOf(n),o=a[r].value;o!==t&&(d(n),s(o))},l=e=>{let n=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const t=i.indexOf(e.currentTarget)+1;n=i[t]??i[0];break}case"ArrowLeft":{const t=i.indexOf(e.currentTarget)-1;n=i[t]??i[i.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.A)("tabs",{"tabs--block":n},e),children:a.map(({value:e,label:n,attributes:s})=>(0,f.jsx)("li",{role:"tab",tabIndex:t===e?0:-1,"aria-selected":t===e,ref:e=>{i.push(e)},onKeyDown:l,onClick:c,...s,className:(0,r.A)("tabs__item",g.tabItem,s?.className,{"tabs__item--active":t===e}),children:n??e},e))})}function b({lazy:e,children:n,selectedValue:t}){const o=(Array.isArray(n)?n:[n]).filter(Boolean);if(e){const e=o.find(e=>e.props.value===t);return e?(0,s.cloneElement)(e,{className:(0,r.A)("margin-top--md",e.props.className)}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:o.map((e,n)=>(0,s.cloneElement)(e,{key:n,hidden:e.props.value!==t}))})}function v(e){const n=j(e);return(0,f.jsxs)("div",{className:(0,r.A)("tabs-container",g.tabList),children:[(0,f.jsx)(y,{...n,...e}),(0,f.jsx)(b,{...n,...e})]})}function w(e){const n=(0,m.A)();return(0,f.jsx)(v,{...e,children:h(e.children)},String(n))}},14876:(e,n,t)=>{t.r(n),t.d(n,{CH:()=>m,assets:()=>j,chCodeConfig:()=>g,contentTitle:()=>x,default:()=>b,frontMatter:()=>u,metadata:()=>s,toc:()=>f});const s=JSON.parse('{"id":"Components/components-data","title":"Data","description":"Data components bring data into your flows from various sources like files, API endpoints, and URLs.","source":"@site/docs/Components/components-data.mdx","sourceDirName":"Components","slug":"/components-data","permalink":"/components-data","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Data","slug":"/components-data"},"sidebar":"docs","previous":{"title":"Embedding Model","permalink":"/components-embedding-models"},"next":{"title":"Processing components","permalink":"/components-processing"}}');var r=t(74848),o=t(28453),a=t(24754),i=t(17886),d=t(11470),c=t(19365),l=t(31929),h=t(40935),p=t(36813);const u={title:"Data",slug:"/components-data"},x=void 0,j={},m={annotations:a.hk,Code:a.Cy},g={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},f=[{value:"Use Data components in flows",id:"use-data-components-in-flows",level:2},{value:"API Request",id:"api-request",level:2},{value:"API Request parameters",id:"api-request-parameters",level:3},...l.RM,{value:"Directory",id:"directory",level:2},{value:"Directory parameters",id:"directory-parameters",level:3},...l.RM,{value:"File",id:"file",level:2},{value:"File type and size limits",id:"file-type-and-size-limits",level:3},{value:"File parameters",id:"file-parameters",level:3},...l.RM,{value:"Advanced parsing",id:"advanced-parsing",level:3},...h.RM,{value:"File output",id:"file-output",level:3},{value:"News Search",id:"news-search",level:2},{value:"News Search parameters",id:"news-search-parameters",level:3},...l.RM,{value:"RSS Reader",id:"rss-reader",level:2},{value:"RSS Reader parameters",id:"rss-reader-parameters",level:3},{value:"SQL Database",id:"sql-database",level:2},{value:"Query an SQL database with natural language prompts",id:"query-an-sql-database-with-natural-language-prompts",level:3},{value:"SQL Database parameters",id:"sql-database-parameters",level:3},...l.RM,{value:"URL",id:"url",level:2},{value:"URL parameters",id:"url-parameters",level:3},...l.RM,{value:"URL output",id:"url-output",level:3},{value:"Web Search",id:"web-search",level:2},{value:"Use the Web Search component in a flow",id:"use-the-web-search-component-in-a-flow",level:3},{value:"Web Search parameters",id:"web-search-parameters",level:3},{value:"Web Search output",id:"web-search-output",level:3},{value:"Webhook",id:"webhook",level:2},{value:"Trigger the webhook",id:"trigger-the-webhook",level:3},{value:"Webhook parameters",id:"webhook-parameters",level:3},{value:"Additional Data components",id:"additional-data-components",level:2},{value:"Legacy Data components",id:"legacy-data-components",level:2},...p.RM,{value:"See also",id:"see-also",level:2}];function y(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,o.R)(),...e.components},{Details:s}=n;return m||v("CH",!1),m.Code||v("CH.Code",!0),s||v("Details",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n","\n",(0,r.jsx)(n.p,{children:"Data components bring data into your flows from various sources like files, API endpoints, and URLs.\nFor example:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Load files"}),": Import data from a file or directory with the ",(0,r.jsxs)(n.a,{href:"#file",children:[(0,r.jsx)(n.strong,{children:"File"})," component"]})," and ",(0,r.jsxs)(n.a,{href:"#directory",children:[(0,r.jsx)(n.strong,{children:"Directory"})," component"]}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Search the web"}),": Fetch data from the web with components like the ",(0,r.jsxs)(n.a,{href:"#news-search",children:[(0,r.jsx)(n.strong,{children:"News Search"})," component"]}),", ",(0,r.jsxs)(n.a,{href:"#rss-reader",children:[(0,r.jsx)(n.strong,{children:"RSS Reader"})," component"]}),", ",(0,r.jsxs)(n.a,{href:"#web-search",children:[(0,r.jsx)(n.strong,{children:"Web Search"})," component"]}),", and ",(0,r.jsxs)(n.a,{href:"#url",children:[(0,r.jsx)(n.strong,{children:"URL"})," component"]}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Make API calls"}),": Use APIs to trigger flows or perform actions with the ",(0,r.jsxs)(n.a,{href:"#api-request",children:[(0,r.jsx)(n.strong,{children:"API Request"})," component"]})," and ",(0,r.jsxs)(n.a,{href:"#webhook",children:[(0,r.jsx)(n.strong,{children:"Webhook"})," component"]}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Run SQL queries"}),": Query an SQL database with the ",(0,r.jsxs)(n.a,{href:"#sql-database",children:[(0,r.jsx)(n.strong,{children:"SQL Database"})," component"]}),"."]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"Each component runs different commands for retrieval, processing, and type checking.\nSome components are a minimal wrapper for a command that you provide, and others include built-in scripts to fetch and process data based on variable inputs.\nAdditionally, some components return raw data, whereas others can convert, restructure, or validate the data before outputting it.\nThis means that some similar components might produce different results."}),"\n",(0,r.jsxs)(n.admonition,{type:"tip",children:[(0,r.jsxs)(n.p,{children:["Data components pair well with ",(0,r.jsx)(n.a,{href:"/components-processing",children:"Processing components"})," that can perform additional parsing, transformation, and validation after retrieving the data."]}),(0,r.jsxs)(n.p,{children:["This can include basic operations, like saving a file in a specific format, or more complex tasks, like using a ",(0,r.jsx)(n.strong,{children:"Text Splitter"})," component to break down a large document into smaller chunks before generating embeddings for vector search."]})]}),"\n",(0,r.jsx)(n.h2,{id:"use-data-components-in-flows",children:"Use Data components in flows"}),"\n",(0,r.jsx)(n.p,{children:"Data components are used often in flows because they offer a versatile way to perform common functions."}),"\n",(0,r.jsxs)(n.p,{children:["You can use these components to perform their base functions as isolated steps in your flow, or you can connect them to an ",(0,r.jsx)(n.strong,{children:"Agent"})," component as tools."]}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.img,{alt:"An agent flow with three Data components connected to the agent as tools",src:t(84987).A+"",width:"4000",height:"3028"})}),"\n",(0,r.jsx)(n.p,{children:"For example flows, see the following:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.a,{href:"/chat-with-files",children:"Create a chatbot that can ingest files"}),": Learn how to use a ",(0,r.jsx)(n.strong,{children:"File"})," component to load a file as context for a chatbot.\nThe file and user input are both passed to the LLM so you can ask questions about the file you uploaded."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.a,{href:"/chat-with-rag",children:"Create a vector RAG chatbot"}),": Learn how to ingest files for use in Retrieval-Augmented Generation (RAG), and then set up a chatbot that can use the ingested files as context.\nThe two flows in this tutorial prepare files for RAG, and then let your LLM use vector search to retrieve contextually relevant data during a chat session."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.a,{href:"/agents-tools",children:"Configure tools for agents"}),": Learn how to use any component as a tool for an agent.\nWhen used as tools, the agent autonomously decides when to call a component based on the user's query."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.a,{href:"/webhook",children:"Trigger flows with webhooks"}),": Learn how to use the ",(0,r.jsx)(n.strong,{children:"Webhook"})," component to trigger a flow run in response to an external event."]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"api-request",children:"API Request"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"API Request"})," component constructs and sends HTTP requests using URLs or curl commands:"]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"URL mode"}),": Enter one or more comma-separated URLs, and then select the method for the request to each URL."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"curl mode"}),": Enter the curl command to execute."]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"You can enable additional request options and fields in the component's parameters."}),"\n",(0,r.jsxs)(n.p,{children:["Returns a ",(0,r.jsxs)(n.a,{href:"/data-types#data",children:[(0,r.jsx)(n.code,{children:"Data"})," object"]})," containing the response."]}),"\n",(0,r.jsxs)(n.p,{children:["For provider-specific API components, see ",(0,r.jsx)(i.A,{name:"Blocks","aria-hidden":"true"})," ",(0,r.jsx)(n.a,{href:"/components-bundle-components",children:(0,r.jsx)(n.strong,{children:"Bundles"})}),"."]}),"\n",(0,r.jsx)(n.h3,{id:"api-request-parameters",children:"API Request parameters"}),"\n",(0,r.jsx)(l.Ay,{}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Display Name"}),(0,r.jsx)(n.th,{children:"Info"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"mode"}),(0,r.jsx)(n.td,{children:"Mode"}),(0,r.jsxs)(n.td,{children:["Input parameter. Set the mode to either ",(0,r.jsx)(n.strong,{children:"URL"})," or ",(0,r.jsx)(n.strong,{children:"curl"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"urls"}),(0,r.jsx)(n.td,{children:"URL"}),(0,r.jsx)(n.td,{children:"Input parameter. Enter one or more comma-separated URLs for the request."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"curl"}),(0,r.jsx)(n.td,{children:"curl"}),(0,r.jsxs)(n.td,{children:["Input parameter. ",(0,r.jsx)(n.strong,{children:"curl mode"})," only. Enter a complete curl command. Other component parameters are populated from the command arguments."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"method"}),(0,r.jsx)(n.td,{children:"Method"}),(0,r.jsx)(n.td,{children:"Input parameter. The HTTP method to use."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"query_params"}),(0,r.jsx)(n.td,{children:"Query Parameters"}),(0,r.jsx)(n.td,{children:"Input parameter. The query parameters to append to the URL."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"body"}),(0,r.jsx)(n.td,{children:"Body"}),(0,r.jsx)(n.td,{children:"Input parameter. The body to send with POST, PATCH, and PUT requests as a dictionary."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"headers"}),(0,r.jsx)(n.td,{children:"Headers"}),(0,r.jsx)(n.td,{children:"Input parameter. The headers to send with the request as a dictionary."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"timeout"}),(0,r.jsx)(n.td,{children:"Timeout"}),(0,r.jsx)(n.td,{children:"Input parameter. The timeout to use for the request."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"follow_redirects"}),(0,r.jsx)(n.td,{children:"Follow Redirects"}),(0,r.jsxs)(n.td,{children:["Input parameter. Whether to follow HTTP redirects. The default is enabled (",(0,r.jsx)(n.code,{children:"true"}),"). If disabled (",(0,r.jsx)(n.code,{children:"false"}),"), HTTP redirects aren't followed."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"save_to_file"}),(0,r.jsx)(n.td,{children:"Save to File"}),(0,r.jsxs)(n.td,{children:["Input parameter. Whether to save the API response to a temporary file. Default: Disabled (",(0,r.jsx)(n.code,{children:"false"}),")"]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"include_httpx_metadata"}),(0,r.jsx)(n.td,{children:"Include HTTPx Metadata"}),(0,r.jsxs)(n.td,{children:["Input parameter. Whether to include properties such as ",(0,r.jsx)(n.code,{children:"headers"}),", ",(0,r.jsx)(n.code,{children:"status_code"}),", ",(0,r.jsx)(n.code,{children:"response_headers"}),", and ",(0,r.jsx)(n.code,{children:"redirection_history"})," in the output. Default: Disabled (",(0,r.jsx)(n.code,{children:"false"}),")"]})]})]})]}),"\n",(0,r.jsx)(n.h2,{id:"directory",children:"Directory"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"Directory"})," component recursively loads files from a directory, with options for file types, depth, and concurrency."]}),"\n",(0,r.jsxs)(n.p,{children:["Files must be of a ",(0,r.jsx)(n.a,{href:"#file-type-and-size-limits",children:"supported type and size"})," to be loaded."]}),"\n",(0,r.jsxs)(n.p,{children:["Outputs either a ",(0,r.jsx)(n.a,{href:"/data-types#data",children:(0,r.jsx)(n.code,{children:"Data"})})," or ",(0,r.jsx)(n.a,{href:"/data-types#dataframe",children:(0,r.jsx)(n.code,{children:"DataFrame"})})," object, depending on the directory contents."]}),"\n",(0,r.jsx)(n.h3,{id:"directory-parameters",children:"Directory parameters"}),"\n",(0,r.jsx)(l.Ay,{}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"path"}),(0,r.jsx)(n.td,{children:"MessageTextInput"}),(0,r.jsxs)(n.td,{children:["Input parameter. The path to the directory to load files from. Default: Current directory (",(0,r.jsx)(n.code,{children:"."}),")"]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"types"}),(0,r.jsx)(n.td,{children:"MessageTextInput"}),(0,r.jsx)(n.td,{children:"Input parameter. The file types to load. Select one or more, or leave empty to attempt to load all files."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"depth"}),(0,r.jsx)(n.td,{children:"IntInput"}),(0,r.jsx)(n.td,{children:"Input parameter. The depth to search for files."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"max_concurrency"}),(0,r.jsx)(n.td,{children:"IntInput"}),(0,r.jsx)(n.td,{children:"Input parameter. The maximum concurrency for loading multiple files."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"load_hidden"}),(0,r.jsx)(n.td,{children:"BoolInput"}),(0,r.jsxs)(n.td,{children:["Input parameter. If ",(0,r.jsx)(n.code,{children:"true"}),", hidden files are loaded."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"recursive"}),(0,r.jsx)(n.td,{children:"BoolInput"}),(0,r.jsxs)(n.td,{children:["Input parameter. If ",(0,r.jsx)(n.code,{children:"true"}),", the search is recursive."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"silent_errors"}),(0,r.jsx)(n.td,{children:"BoolInput"}),(0,r.jsxs)(n.td,{children:["Input parameter. If ",(0,r.jsx)(n.code,{children:"true"}),", errors don't raise an exception."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"use_multithreading"}),(0,r.jsx)(n.td,{children:"BoolInput"}),(0,r.jsxs)(n.td,{children:["Input parameter. If ",(0,r.jsx)(n.code,{children:"true"}),", multithreading is used."]})]})]})]}),"\n",(0,r.jsx)(n.h2,{id:"file",children:"File"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"File"})," component loads and parses files, converts the content into a ",(0,r.jsx)(n.code,{children:"Data"}),", ",(0,r.jsx)(n.code,{children:"DataFrame"}),", or ",(0,r.jsx)(n.code,{children:"Message"})," object.\nIt supports multiple file types, provides parameters for parallel processing and error handling, and supports advanced parsing with the Docling library."]}),"\n",(0,r.jsxs)(n.p,{children:["You can add files to the ",(0,r.jsx)(n.strong,{children:"File"})," component in the visual editor or at runtime, and you can upload multiple files at once.\nFor more information about uploading files and working with files in flows, see ",(0,r.jsx)(n.a,{href:"/concepts-file-management",children:"File management"})," and ",(0,r.jsx)(n.a,{href:"/chat-with-files",children:"Create a chatbot that can ingest files"}),"."]}),"\n",(0,r.jsx)(n.h3,{id:"file-type-and-size-limits",children:"File type and size limits"}),"\n",(0,r.jsxs)(n.p,{children:["By default, the maximum file size is 1024 MB.\nTo modify this value, change the ",(0,r.jsx)(n.code,{children:"LANGFLOW_MAX_FILE_SIZE_UPLOAD"})," ",(0,r.jsx)(n.a,{href:"/environment-variables",children:"environment variable"}),"."]}),"\n",(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"Supported file types"}),(0,r.jsxs)(n.p,{children:["The following file types are supported by the ",(0,r.jsx)(n.strong,{children:"File"})," component.\nUse archive and compressed formats to bundle multiple files together, or use the ",(0,r.jsxs)(n.a,{href:"#directory",children:[(0,r.jsx)(n.strong,{children:"Directory"})," component"]})," to load all files in a directory."]}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:".bz2"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:".csv"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:".docx"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:".gz"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:".htm"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:".html"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:".json"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:".js"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:".md"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:".mdx"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:".pdf"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:".py"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:".sh"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:".sql"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:".tar"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:".tgz"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:".ts"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:".tsx"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:".txt"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:".xml"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:".yaml"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:".yml"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:".zip"})}),"\n"]})]}),"\n",(0,r.jsx)(n.p,{children:"If you need to load an unsupported file type, you must use a different component that supports that file type and, potentially, parses it outside Langflow, or you must convert it to a supported type before uploading it."}),"\n",(0,r.jsxs)(n.p,{children:["For images, see ",(0,r.jsx)(n.a,{href:"/concepts-file-management#upload-images",children:"Upload images"}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["For videos, see the ",(0,r.jsx)(n.strong,{children:"Twelve Labs"})," and ",(0,r.jsx)(n.strong,{children:"YouTube"})," ",(0,r.jsx)(i.A,{name:"Blocks","aria-hidden":"true"})," ",(0,r.jsx)(n.a,{href:"/components-bundle-components",children:(0,r.jsx)(n.strong,{children:"Bundles"})}),"."]}),"\n",(0,r.jsx)(n.h3,{id:"file-parameters",children:"File parameters"}),"\n",(0,r.jsx)(l.Ay,{}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Display Name"}),(0,r.jsx)(n.th,{children:"Info"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"path"}),(0,r.jsx)(n.td,{children:"Files"}),(0,r.jsxs)(n.td,{children:["Input parameter. The path to files to load. Can be local or in ",(0,r.jsx)(n.a,{href:"/concepts-file-management",children:"Langflow file management"}),". Supports individual files and bundled archives."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"file_path"}),(0,r.jsx)(n.td,{children:"Server File Path"}),(0,r.jsxs)(n.td,{children:["Input parameter. A ",(0,r.jsx)(n.code,{children:"Data"})," object with a ",(0,r.jsx)(n.code,{children:"file_path"})," property pointing to a file in ",(0,r.jsx)(n.a,{href:"/concepts-file-management",children:"Langflow file management"})," or a ",(0,r.jsx)(n.code,{children:"Message"})," object with a path to the file. Supersedes ",(0,r.jsx)(n.strong,{children:"Files"})," (",(0,r.jsx)(n.code,{children:"path"}),") but supports the same file types."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"separator"}),(0,r.jsx)(n.td,{children:"Separator"}),(0,r.jsxs)(n.td,{children:["Input parameter. The separator to use between multiple outputs in ",(0,r.jsx)(n.code,{children:"Message"})," format."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"silent_errors"}),(0,r.jsx)(n.td,{children:"Silent Errors"}),(0,r.jsxs)(n.td,{children:["Input parameter. If ",(0,r.jsx)(n.code,{children:"true"}),", errors in the component don't raise an exception. Default: Disabled (",(0,r.jsx)(n.code,{children:"false"}),")."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"delete_server_file_after_processing"}),(0,r.jsx)(n.td,{children:"Delete Server File After Processing"}),(0,r.jsxs)(n.td,{children:["Input parameter. If ",(0,r.jsx)(n.code,{children:"true"})," (default), the ",(0,r.jsx)(n.strong,{children:"Server File Path"})," (",(0,r.jsx)(n.code,{children:"file_path"}),") is deleted after processing."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"ignore_unsupported_extensions"}),(0,r.jsx)(n.td,{children:"Ignore Unsupported Extensions"}),(0,r.jsxs)(n.td,{children:["Input parameter. If enabled (",(0,r.jsx)(n.code,{children:"true"}),"), files with unsupported extensions are accepted but not processed. If disabled (",(0,r.jsx)(n.code,{children:"false"}),"), the ",(0,r.jsx)(n.strong,{children:"File"})," component either can throw an error if an unsupported file type is provided. The default is ",(0,r.jsx)(n.code,{children:"true"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"ignore_unspecified_files"}),(0,r.jsx)(n.td,{children:"Ignore Unspecified Files"}),(0,r.jsxs)(n.td,{children:["Input parameter. If ",(0,r.jsx)(n.code,{children:"true"}),", ",(0,r.jsx)(n.code,{children:"Data"})," with no ",(0,r.jsx)(n.code,{children:"file_path"})," property is ignored. If ",(0,r.jsx)(n.code,{children:"false"})," (default), the component errors when a file isn't specified."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"concurrency_multithreading"}),(0,r.jsx)(n.td,{children:"Processing Concurrency"}),(0,r.jsx)(n.td,{children:"Input parameter. The number of files to process concurrently if multiple files are uploaded. Default is 1. Values greater than 1 enable parallel processing for 2 or more files. Ignored for single-file uploads and advanced parsing."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"advanced_parser"}),(0,r.jsx)(n.td,{children:"Advanced Parser"}),(0,r.jsxs)(n.td,{children:["Input parameter. If ",(0,r.jsx)(n.code,{children:"true"}),", enables ",(0,r.jsx)(n.a,{href:"#advanced-parsing",children:"advanced parsing"}),". Only available for single-file uploads of compatible file types. Default: Disabled (",(0,r.jsx)(n.code,{children:"false"}),")."]})]})]})]}),"\n",(0,r.jsx)(n.h3,{id:"advanced-parsing",children:"Advanced parsing"}),"\n",(0,r.jsxs)(n.p,{children:["Starting in Langflow version 1.6, the ",(0,r.jsx)(n.strong,{children:"File"})," component supports advanced document parsing using the ",(0,r.jsx)(n.a,{href:"https://docling-project.github.io/docling/",children:"Docling"})," library for supported file types."]}),"\n",(0,r.jsx)(n.p,{children:"To use advanced parsing, do the following:"}),"\n",(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Complete the following prerequisites, if applicable:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Install Langflow version 1.6 or later"}),": Earlier versions don't support advanced parsing with the ",(0,r.jsx)(n.strong,{children:"File"})," component. For upgrade guidance, see the ",(0,r.jsx)(n.a,{href:"/release-notes",children:"Release notes"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Install Docling dependency on macOS Intel (x86_64)"}),": The Docling dependency isn't installed by default for macOS Intel (x86_64). Use the ",(0,r.jsx)(n.a,{href:"https://docling-project.github.io/docling/installation/",children:"Docling installation guide"})," to install the Docling dependency."]}),"\n",(0,r.jsx)(n.p,{children:"For all other operating systems, the Docling dependency is installed by default."}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Enable Developer Mode for Windows"}),":"]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(h.Ay,{}),"\n",(0,r.jsx)(n.p,{children:"Developer Mode isn't required for Langflow OSS on Windows."}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Add one valid file to the ",(0,r.jsx)(n.strong,{children:"File"})," component."]}),"\n",(0,r.jsx)(n.admonition,{title:"Advanced parsing limitations",type:"info",children:(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Advanced parsing processes only one file.\nIf you select multiple files, the ",(0,r.jsx)(n.strong,{children:"File"})," component processes the first file only, ignoring any additional files.\nTo process multiple files with advanced parsing, pass each file to a separate ",(0,r.jsx)(n.strong,{children:"File"})," components, or use the dedicated ",(0,r.jsxs)(n.a,{href:"/integrations-docling",children:[(0,r.jsx)(n.strong,{children:"Docling"})," components"]}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Advanced parsing can process any of the ",(0,r.jsx)(n.strong,{children:"File"})," component's supported file types except ",(0,r.jsx)(n.code,{children:".csv"}),", ",(0,r.jsx)(n.code,{children:".xlsx"}),", and ",(0,r.jsx)(n.code,{children:".parquet"})," files because it is designed for document processing, such as extracting text from PDFs.\nFor structured data analysis, use the ",(0,r.jsxs)(n.a,{href:"/components-processing#parser",children:[(0,r.jsx)(n.strong,{children:"Parser"})," component"]}),"."]}),"\n"]}),"\n"]})}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Enable ",(0,r.jsx)(n.strong,{children:"Advanced Parsing"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Click ",(0,r.jsx)(i.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Controls"})," in the ",(0,r.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"})," to configure advanced parsing parameters, which are hidden by default:"]}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Display Name"}),(0,r.jsx)(n.th,{children:"Info"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"pipeline"}),(0,r.jsx)(n.td,{children:"Pipeline"}),(0,r.jsxs)(n.td,{children:["Input parameter, advanced parsing. The Docling pipeline to use, either ",(0,r.jsx)(n.code,{children:"standard"})," (default, recommended) or ",(0,r.jsx)(n.code,{children:"vlm"})," (may produce inconsistent results)."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"ocr_engine"}),(0,r.jsx)(n.td,{children:"OCR Engine"}),(0,r.jsxs)(n.td,{children:["Input parameter, advanced parsing. The OCR parser to use if ",(0,r.jsx)(n.code,{children:"pipeline"})," is ",(0,r.jsx)(n.code,{children:"standard"}),". Options are ",(0,r.jsx)(n.code,{children:"None"})," (default) or ",(0,r.jsx)(n.a,{href:"https://pypi.org/project/easyocr/",children:(0,r.jsx)(n.code,{children:"EasyOCR"})}),". ",(0,r.jsx)(n.code,{children:"None"})," means that no OCR engine is used, and this can produce inconsistent or broken results for some documents. This setting has no effect with the ",(0,r.jsx)(n.code,{children:"vlm"})," pipeline."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"md_image_placeholder"}),(0,r.jsx)(n.td,{children:"Markdown Image Placeholder"}),(0,r.jsxs)(n.td,{children:["Input parameter, advanced parsing. Defines the placeholder for image files if the output type is ",(0,r.jsx)(n.strong,{children:"Markdown"}),". Default: ",(0,r.jsx)(n.code,{children:"\x3c!-- image --\x3e"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"md_page_break_placeholder"}),(0,r.jsx)(n.td,{children:"Markdown Page Break Placeholder"}),(0,r.jsxs)(n.td,{children:["Input parameter, advanced parsing. Defines the placeholder for page breaks if the output type is ",(0,r.jsx)(n.strong,{children:"Markdown"}),". Default: ",(0,r.jsx)(n.code,{children:'""'})," (empty string)."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"doc_key"}),(0,r.jsx)(n.td,{children:"Document Key"}),(0,r.jsxs)(n.td,{children:["Input parameter, advanced parsing. The key to use for the ",(0,r.jsx)(n.code,{children:"DoclingDocument"})," column, which holds the structured information extracted from the source document. See ",(0,r.jsx)(n.a,{href:"https://docling-project.github.io/docling/concepts/docling_document/",children:"Docling Document"})," for details. Default: ",(0,r.jsx)(n.code,{children:"doc"}),"."]})]})]})]}),"\n",(0,r.jsx)(n.admonition,{type:"tip",children:(0,r.jsxs)(n.p,{children:["For additional Docling features, including other components and OCR parsers, use the ",(0,r.jsxs)(n.a,{href:"/integrations-docling",children:[(0,r.jsx)(n.strong,{children:"Docling"})," bundle"]}),"."]})}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.h3,{id:"file-output",children:"File output"}),"\n",(0,r.jsxs)(n.p,{children:["The output of the ",(0,r.jsx)(n.strong,{children:"File"})," component depends on the number of files loaded and whether advanced parsing is enabled.\nIf multiple options are available, you can set the output type near the component's output port."]}),"\n",(0,r.jsxs)(d.A,{children:[(0,r.jsx)(c.A,{value:"zero",label:"No files",children:(0,r.jsxs)(n.p,{children:["If you run the ",(0,r.jsx)(n.strong,{children:"File"})," component with no file selected, it throws an error, or, if ",(0,r.jsx)(n.strong,{children:"Silent Errors"})," is enabled, produces no output."]})}),(0,r.jsxs)(c.A,{value:"one-false",label:"One file without advanced parsing",children:[(0,r.jsx)(n.p,{children:"If advanced parsing is disabled and you upload one file, the following output types are available:"}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Structured Content"}),": Available only for ",(0,r.jsx)(n.code,{children:".csv"}),", ",(0,r.jsx)(n.code,{children:".xlsx"}),", ",(0,r.jsx)(n.code,{children:".parquet"}),", and ",(0,r.jsx)(n.code,{children:".json"})," files."]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["For ",(0,r.jsx)(n.code,{children:".csv"})," files, produces a ",(0,r.jsx)(n.a,{href:"/data-types#dataframe",children:(0,r.jsx)(n.code,{children:"DataFrame"})})," representing the table data."]}),"\n",(0,r.jsxs)(n.li,{children:["For ",(0,r.jsx)(n.code,{children:".json"})," files, produces a ",(0,r.jsx)(n.a,{href:"/data-types#data",children:(0,r.jsx)(n.code,{children:"Data"})})," object with the parsed JSON data."]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Raw Content"}),": A ",(0,r.jsx)(n.a,{href:"/data-types#message",children:(0,r.jsx)(n.code,{children:"Message"})})," containing the file's raw text content."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"File Path"}),": A ",(0,r.jsx)(n.a,{href:"/data-types#message",children:(0,r.jsx)(n.code,{children:"Message"})})," containing the path to the file in ",(0,r.jsx)(n.a,{href:"/concepts-file-management",children:"Langflow file management"}),"."]}),"\n"]}),"\n"]})]}),(0,r.jsxs)(c.A,{value:"one-true",label:"One file with advanced parsing",children:[(0,r.jsx)(n.p,{children:"If advanced parsing is enabled and you upload one file, the following output types are available:"}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Structured Output"}),": A ",(0,r.jsx)(n.a,{href:"/data-types#dataframe",children:(0,r.jsx)(n.code,{children:"DataFrame"})})," containing the Docling-processed document data with text elements, page numbers, and metadata."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Markdown"}),": A ",(0,r.jsx)(n.a,{href:"/data-types#message",children:(0,r.jsx)(n.code,{children:"Message"})})," containing the uploaded document contents in Markdown format with image placeholders."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"File Path"}),": A ",(0,r.jsx)(n.a,{href:"/data-types#message",children:(0,r.jsx)(n.code,{children:"Message"})})," containing the path to the file in ",(0,r.jsx)(n.a,{href:"/concepts-file-management",children:"Langflow file management"}),"."]}),"\n"]}),"\n"]})]}),(0,r.jsxs)(c.A,{value:"multi",label:"Multiple files",children:[(0,r.jsxs)(n.p,{children:["If you upload multiple files, the component outputs ",(0,r.jsx)(n.strong,{children:"Files"}),", which is a ",(0,r.jsx)(n.a,{href:"/data-types#dataframe",children:(0,r.jsx)(n.code,{children:"DataFrame"})})," containing the content and metadata of all selected files."]}),(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.a,{href:"#advanced-parsing",children:"Advanced parsing"})," doesn't support multiple files; it processes only the first file."]})]})]}),"\n",(0,r.jsx)(n.h2,{id:"news-search",children:"News Search"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"News Search"})," component searches Google News through RSS, and then returns clean article data as a ",(0,r.jsx)(n.a,{href:"/data-types#dataframe",children:(0,r.jsx)(n.code,{children:"DataFrame"})})," containing article titles, links, publication dates, and summaries.\nThe component's ",(0,r.jsx)(n.code,{children:"clean_html"})," method parses the HTML content with the BeautifulSoup library, removes HTML markup, and strips whitespace to output clean data."]}),"\n",(0,r.jsxs)(n.p,{children:["For other RSS feeds, use the ",(0,r.jsxs)(n.a,{href:"#rss-reader",children:[(0,r.jsx)(n.strong,{children:"RSS Reader"})," component"]}),", and for other searches use the ",(0,r.jsxs)(n.a,{href:"#web-search",children:[(0,r.jsx)(n.strong,{children:"Web Search"})," component"]})," or provider-specific ",(0,r.jsx)(i.A,{name:"Blocks","aria-hidden":"true"})," ",(0,r.jsx)(n.a,{href:"/components-bundle-components",children:(0,r.jsx)(n.strong,{children:"Bundles"})}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["When used as a standard component in a flow, the ",(0,r.jsx)(n.strong,{children:"News Search"})," component must be connected to a component that accepts ",(0,r.jsx)(n.code,{children:"DataFrame"})," input.\nYou can connect the ",(0,r.jsx)(n.strong,{children:"News Search"})," component directly to a compatible component, or you can use a ",(0,r.jsx)(n.a,{href:"/components-processing",children:"Processing component"})," to convert or extract data of a different type between components."]}),"\n",(0,r.jsxs)(n.p,{children:["When used in ",(0,r.jsx)(n.strong,{children:"Tool Mode"})," with an ",(0,r.jsx)(n.strong,{children:"Agent"})," component, the ",(0,r.jsx)(n.strong,{children:"News Search"})," component can be connected directly to the ",(0,r.jsx)(n.strong,{children:"Agent"})," component's ",(0,r.jsx)(n.strong,{children:"Tools"})," port without converting the data.\nThe agent decides whether to use the ",(0,r.jsx)(n.strong,{children:"News Search"})," component based on the user's query, and it can process the ",(0,r.jsx)(n.code,{children:"DataFrame"})," output directly."]}),"\n",(0,r.jsx)(n.h3,{id:"news-search-parameters",children:"News Search parameters"}),"\n",(0,r.jsx)(l.Ay,{}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Display Name"}),(0,r.jsx)(n.th,{children:"Info"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"query"}),(0,r.jsx)(n.td,{children:"Search Query"}),(0,r.jsx)(n.td,{children:"Input parameter. Search keywords for news articles."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"hl"}),(0,r.jsx)(n.td,{children:"Language (hl)"}),(0,r.jsxs)(n.td,{children:["Input parameter. Language code, such as en-US, fr, de. Default: ",(0,r.jsx)(n.code,{children:"en-US"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"gl"}),(0,r.jsx)(n.td,{children:"Country (gl)"}),(0,r.jsxs)(n.td,{children:["Input parameter. Country code, such as US, FR, DE. Default: ",(0,r.jsx)(n.code,{children:"US"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"ceid"}),(0,r.jsxs)(n.td,{children:["Country",":Language"," (ceid)"]}),(0,r.jsxs)(n.td,{children:["Input parameter. Language, such as US",":en",", FR",":fr",". Default: ",(0,r.jsx)(n.code,{children:"US:en"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"topic"}),(0,r.jsx)(n.td,{children:"Topic"}),(0,r.jsxs)(n.td,{children:["Input parameter. One of: ",(0,r.jsx)(n.code,{children:"WORLD"}),", ",(0,r.jsx)(n.code,{children:"NATION"}),", ",(0,r.jsx)(n.code,{children:"BUSINESS"}),", ",(0,r.jsx)(n.code,{children:"TECHNOLOGY"}),", ",(0,r.jsx)(n.code,{children:"ENTERTAINMENT"}),", ",(0,r.jsx)(n.code,{children:"SCIENCE"}),", ",(0,r.jsx)(n.code,{children:"SPORTS"}),", ",(0,r.jsx)(n.code,{children:"HEALTH"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"location"}),(0,r.jsx)(n.td,{children:"Location (Geo)"}),(0,r.jsx)(n.td,{children:"Input parameter. City, state, or country for location-based news. Leave blank for keyword search."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"timeout"}),(0,r.jsx)(n.td,{children:"Timeout"}),(0,r.jsx)(n.td,{children:"Input parameter. Timeout for the request in seconds."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"articles"}),(0,r.jsx)(n.td,{children:"News Articles"}),(0,r.jsxs)(n.td,{children:["Output parameter. A ",(0,r.jsx)(n.code,{children:"DataFrame"})," with the key columns ",(0,r.jsx)(n.code,{children:"title"}),", ",(0,r.jsx)(n.code,{children:"link"}),", ",(0,r.jsx)(n.code,{children:"published"})," and ",(0,r.jsx)(n.code,{children:"summary"}),"."]})]})]})]}),"\n",(0,r.jsx)(n.h2,{id:"rss-reader",children:"RSS Reader"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"RSS Reader"})," component fetches and parses RSS feeds from any valid RSS feed URL, and then returns the feed content as a ",(0,r.jsx)(n.a,{href:"/data-types#dataframe",children:(0,r.jsx)(n.code,{children:"DataFrame"})})," containing article titles, links, publication dates, and summaries."]}),"\n",(0,r.jsxs)(n.p,{children:["When used as a standard component in a flow, the ",(0,r.jsx)(n.strong,{children:"RSS Reader"})," component must be connected to a component that accepts ",(0,r.jsx)(n.code,{children:"DataFrame"})," input.\nYou can connect the ",(0,r.jsx)(n.strong,{children:"RSS Reader"})," component directly to a compatible component, or you can use a ",(0,r.jsx)(n.a,{href:"/components-processing",children:"Processing component"})," to convert or extract data of a different type between components."]}),"\n",(0,r.jsxs)(n.p,{children:["When used in ",(0,r.jsx)(n.strong,{children:"Tool Mode"})," with an ",(0,r.jsx)(n.strong,{children:"Agent"})," component, the ",(0,r.jsx)(n.strong,{children:"RSS Reader"})," component can be connected directly to the ",(0,r.jsx)(n.strong,{children:"Agent"})," component's ",(0,r.jsx)(n.strong,{children:"Tools"})," port without converting the data.\nThe agent decides whether to use the ",(0,r.jsx)(n.strong,{children:"RSS Reader"})," component based on the user's query, and it can process the ",(0,r.jsx)(n.code,{children:"DataFrame"})," output directly."]}),"\n",(0,r.jsx)(n.h3,{id:"rss-reader-parameters",children:"RSS Reader parameters"}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Display Name"}),(0,r.jsx)(n.th,{children:"Info"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"rss_url"}),(0,r.jsx)(n.td,{children:"RSS Feed URL"}),(0,r.jsxs)(n.td,{children:["Input parameter. URL of the RSS feed to parse, such as ",(0,r.jsx)(n.code,{children:"https://rss.nytimes.com/services/xml/rss/nyt/HomePage.xml"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"timeout"}),(0,r.jsx)(n.td,{children:"Timeout"}),(0,r.jsxs)(n.td,{children:["Input parameter. Timeout for the RSS feed request in seconds. Default: ",(0,r.jsx)(n.code,{children:"5"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"articles"}),(0,r.jsx)(n.td,{children:"Articles"}),(0,r.jsxs)(n.td,{children:["Output parameter. A ",(0,r.jsx)(n.code,{children:"DataFrame"})," containing the key columns ",(0,r.jsx)(n.code,{children:"title"}),", ",(0,r.jsx)(n.code,{children:"link"}),", ",(0,r.jsx)(n.code,{children:"published"})," and ",(0,r.jsx)(n.code,{children:"summary"}),"."]})]})]})]}),"\n",(0,r.jsx)(n.h2,{id:"sql-database",children:"SQL Database"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"SQL Database"})," component executes SQL queries on ",(0,r.jsx)(n.a,{href:"https://docs.sqlalchemy.org/en/20/",children:"SQLAlchemy-compatible databases"}),".\nIt supports any SQLAlchemy-compatible database, such as PostgreSQL, MySQL, and SQLite."]}),"\n",(0,r.jsxs)(n.p,{children:["For CQL queries, see the ",(0,r.jsxs)(n.a,{href:"/bundles-datastax",children:[(0,r.jsx)(n.strong,{children:"DataStax"})," bundle"]}),"."]}),"\n",(0,r.jsx)(n.h3,{id:"query-an-sql-database-with-natural-language-prompts",children:"Query an SQL database with natural language prompts"}),"\n",(0,r.jsxs)(n.p,{children:["The following example demonstrates how to use the ",(0,r.jsx)(n.strong,{children:"SQL Database"})," component in a flow, and then modify the component to support natural language queries through an ",(0,r.jsx)(n.strong,{children:"Agent"})," component."]}),"\n",(0,r.jsxs)(n.p,{children:["This allows you to use the same ",(0,r.jsx)(n.strong,{children:"SQL Database"})," component for any query, rather than limiting it to a single manually entered query or requiring the user, application, or another component to provide valid SQL syntax as input.\nUsers don't need to master SQL syntax because the ",(0,r.jsx)(n.strong,{children:"Agent"})," component translates the users' natural language prompts into SQL queries, passes the query to the ",(0,r.jsx)(n.strong,{children:"SQL Database"})," component, and then returns the results to the user."]}),"\n",(0,r.jsx)(n.p,{children:"Additionally, input from applications and other components doesn't have to be extracted and transformed to exact SQL queries.\nInstead, you only need to provide enough context for the agent to understand that it should create and run a SQL query according to the incoming data."}),"\n",(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Use your own sample database or create a test database."}),"\n",(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"Create a test SQL database"}),(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Create a database called ",(0,r.jsx)(n.code,{children:"test.db"}),":"]}),"\n",(0,r.jsx)(m.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"sqlite3 ",props:{style:{color:"#FFA657"}}},{content:"test.db",props:{style:{color:"#A5D6FF"}}}]}],lang:"shell"},annotations:[]}]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Add some values to the database:"}),"\n",(0,r.jsx)(m.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"sqlite3 ",props:{style:{color:"#FFA657"}}},{content:'test.db "',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"CREATE TABLE users (",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" id INTEGER PRIMARY KEY,",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" name TEXT,",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" email TEXT,",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" age INTEGER",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:");",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"INSERT INTO users (name, email, age) VALUES",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" ('John Doe', 'john@example.com', 30),",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" ('Jane Smith', 'jane@example.com', 25),",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" ('Bob Johnson', 'bob@example.com', 35);",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:'"',props:{style:{color:"#A5D6FF"}}}]}],lang:"shell"},annotations:[]}]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Verify that the database has been created and contains your data:"}),"\n",(0,r.jsx)(m.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"sqlite3 ",props:{style:{color:"#FFA657"}}},{content:'test.db "SELECT * FROM users;"',props:{style:{color:"#A5D6FF"}}}]}],lang:"shell"},annotations:[]}]}),"\n",(0,r.jsx)(n.p,{children:"The result should list the text data you entered in the previous step:"}),"\n",(0,r.jsx)(m.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"1",props:{style:{color:"#FFA657"}}},{content:"|",props:{style:{color:"#FF7B72"}}},{content:"John ",props:{style:{color:"#FFA657"}}},{content:"Doe",props:{style:{color:"#A5D6FF"}}},{content:"|",props:{style:{color:"#FF7B72"}}},{content:"john@example.com",props:{style:{color:"#FFA657"}}}]},{tokens:[{content:"2",props:{style:{color:"#FFA657"}}},{content:"|",props:{style:{color:"#FF7B72"}}},{content:"Jane ",props:{style:{color:"#FFA657"}}},{content:"Smith",props:{style:{color:"#A5D6FF"}}},{content:"|",props:{style:{color:"#FF7B72"}}},{content:"jane@example.com",props:{style:{color:"#FFA657"}}}]},{tokens:[{content:"3",props:{style:{color:"#FFA657"}}},{content:"|",props:{style:{color:"#FF7B72"}}},{content:"John ",props:{style:{color:"#FFA657"}}},{content:"Doe",props:{style:{color:"#A5D6FF"}}},{content:"|",props:{style:{color:"#FF7B72"}}},{content:"john@example.com",props:{style:{color:"#FFA657"}}}]},{tokens:[{content:"4",props:{style:{color:"#FFA657"}}},{content:"|",props:{style:{color:"#FF7B72"}}},{content:"Jane ",props:{style:{color:"#FFA657"}}},{content:"Smith",props:{style:{color:"#A5D6FF"}}},{content:"|",props:{style:{color:"#FF7B72"}}},{content:"jane@example.com",props:{style:{color:"#FFA657"}}}]}],lang:"shell"},annotations:[]}]}),"\n"]}),"\n"]})]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Add an ",(0,r.jsx)(n.strong,{children:"SQL Database"})," component to your flow."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["In the ",(0,r.jsx)(n.strong,{children:"Database URL"})," field, add the connection string for your database, such as ",(0,r.jsx)(n.code,{children:"sqlite:///test.db"}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["At this point, you can enter an SQL query in the ",(0,r.jsx)(n.strong,{children:"SQL Query"})," field or use the ",(0,r.jsx)(n.a,{href:"/concepts-components#component-ports",children:"port"})," to pass a query from another component, such as a ",(0,r.jsx)(n.strong,{children:"Chat Input"})," component.\nIf you need more space, click ",(0,r.jsx)(i.A,{name:"Expand","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Expand"})," to open a full-screen text field."]}),"\n",(0,r.jsxs)(n.p,{children:["However, to make this component more dynamic in an agentic context, use an ",(0,r.jsx)(n.strong,{children:"Agent"})," component to transform natural language input to SQL queries, as explained in the following steps."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Click the ",(0,r.jsx)(n.strong,{children:"SQL Database"})," component to expose the ",(0,r.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),", and then enable ",(0,r.jsx)(n.strong,{children:"Tool Mode"}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["You can now use this component as a tool for an agent.\nIn ",(0,r.jsx)(n.strong,{children:"Tool Mode"}),", no query is set in the ",(0,r.jsx)(n.strong,{children:"SQL Database"})," component because the agent will generate and send one if it determines that the tool is required to complete the user's request.\nFor more information, see ",(0,r.jsx)(n.a,{href:"/agents-tools",children:"Configure tools for agents"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Add an ",(0,r.jsx)(n.strong,{children:"Agent"})," component to your flow, and then enter your OpenAI API key."]}),"\n",(0,r.jsxs)(n.p,{children:["The default model is an OpenAI model.\nIf you want to use a different model, edit the ",(0,r.jsx)(n.strong,{children:"Model Provider"}),", ",(0,r.jsx)(n.strong,{children:"Model Name"}),", and ",(0,r.jsx)(n.strong,{children:"API Key"})," fields accordingly."]}),"\n",(0,r.jsxs)(n.p,{children:["If you need to execute highly specialized queries, consider selecting a model that is trained for tasks like advanced SQL queries.\nIf your preferred model isn't in the ",(0,r.jsx)(n.strong,{children:"Agent"})," component's built-in model list, set ",(0,r.jsx)(n.strong,{children:"Model Provider"})," to ",(0,r.jsx)(n.strong,{children:"Connect other models"}),", and then connect any ",(0,r.jsx)(n.a,{href:"/components-models",children:"language model component"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Connect the ",(0,r.jsx)(n.strong,{children:"SQL Database"})," component's ",(0,r.jsx)(n.strong,{children:"Toolset"})," output to the ",(0,r.jsx)(n.strong,{children:"Agent"})," component's ",(0,r.jsx)(n.strong,{children:"Tools"})," input."]}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.img,{alt:"SQL Database component connected to an Agent component",src:t(52189).A+"",width:"4000",height:"2400"})}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Click ",(0,r.jsx)(n.strong,{children:"Playground"}),", and then ask the agent a question about the data in your database, such as ",(0,r.jsx)(n.code,{children:"Which users are in my database?"})]}),"\n",(0,r.jsxs)(n.p,{children:["The agent determines that it needs to query the database to answer the question, uses the LLM to generate an SQL query, and then uses the ",(0,r.jsx)(n.strong,{children:"SQL Database"})," component's ",(0,r.jsx)(n.code,{children:"RUN_SQL_QUERY"})," action to run the query on your database.\nFinally, it returns the results in a conversational format, unless you provide instructions to return raw results or a different format."]}),"\n",(0,r.jsx)(n.p,{children:"The following example queried a test database with little data, but with a more robust dataset you could ask more detailed or complex questions."}),"\n",(0,r.jsx)(m.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"Here are the users in your database:",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"1. **John Doe** - Email: john@example.com",props:{}}]},{tokens:[{content:"2. **Jane Smith** - Email: jane@example.com",props:{}}]},{tokens:[{content:"3. **John Doe** - Email: john@example.com",props:{}}]},{tokens:[{content:"4. **Jane Smith** - Email: jane@example.com",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"It seems there are duplicate entries for the users.",props:{}}]}],lang:"text"},annotations:[]}]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.h3,{id:"sql-database-parameters",children:"SQL Database parameters"}),"\n",(0,r.jsx)(l.Ay,{}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Display Name"}),(0,r.jsx)(n.th,{children:"Info"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"database_url"}),(0,r.jsx)(n.td,{children:"Database URL"}),(0,r.jsx)(n.td,{children:"Input parameter. The SQLAlchemy-compatible database connection URL."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"query"}),(0,r.jsx)(n.td,{children:"SQL Query"}),(0,r.jsxs)(n.td,{children:["Input parameter. The SQL query to execute, which can be entered directly, passed in from another component, or, in ",(0,r.jsx)(n.strong,{children:"Tool Mode"}),", automatically provided by an ",(0,r.jsx)(n.strong,{children:"Agent"})," component."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"include_columns"}),(0,r.jsx)(n.td,{children:"Include Columns"}),(0,r.jsxs)(n.td,{children:["Input parameter. Whether to include column names in the result. The default is enabled (",(0,r.jsx)(n.code,{children:"true"}),")."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"add_error"}),(0,r.jsx)(n.td,{children:"Add Error"}),(0,r.jsxs)(n.td,{children:["Input parameter. If enabled, adds any error messages to the result, if any are returned. The default is disabled (",(0,r.jsx)(n.code,{children:"false"}),")."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"run_sql_query"}),(0,r.jsx)(n.td,{children:"Result Table"}),(0,r.jsxs)(n.td,{children:["Output parameter. The query results as a ",(0,r.jsx)(n.a,{href:"/data-types#dataframe",children:(0,r.jsx)(n.code,{children:"DataFrame"})}),"."]})]})]})]}),"\n",(0,r.jsx)(n.h2,{id:"url",children:"URL"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"URL"})," component fetches content from one or more URLs, processes the content, and returns it in various formats.\nIt follows links recursively to a given depth, and it supports output in plain text or raw HTML."]}),"\n",(0,r.jsx)(n.h3,{id:"url-parameters",children:"URL parameters"}),"\n",(0,r.jsx)(l.Ay,{}),"\n",(0,r.jsx)(n.p,{children:"Some of the available parameters include the following:"}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Display Name"}),(0,r.jsx)(n.th,{children:"Info"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"urls"}),(0,r.jsx)(n.td,{children:"URLs"}),(0,r.jsxs)(n.td,{children:["Input parameter. One or more URLs to crawl recursively. In the visual editor, click ",(0,r.jsx)(i.A,{name:"Plus","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Add URL"})," to add multiple URLs."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"max_depth"}),(0,r.jsx)(n.td,{children:"Depth"}),(0,r.jsx)(n.td,{children:'Input parameter. Controls link traversal: how many "clicks" away from the initial page the crawler will go. A depth of 1 limits the crawl to the first page at the given URL only. A depth of 2 means the crawler crawls the first page plus each page directly linked from the first page, then stops. This setting exclusively controls link traversal; it doesn\'t limit the number of URL path segments or the domain.'})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"prevent_outside"}),(0,r.jsx)(n.td,{children:"Prevent Outside"}),(0,r.jsx)(n.td,{children:"Input parameter. If enabled, only crawls URLs within the same domain as the root URL. This prevents the crawler from accessing sites outside the given URL's domain, even if they are linked from one of the crawled pages."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"use_async"}),(0,r.jsx)(n.td,{children:"Use Async"}),(0,r.jsx)(n.td,{children:"Input parameter. If enabled, uses asynchronous loading which can be significantly faster but might use more system resources."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"format"}),(0,r.jsx)(n.td,{children:"Output Format"}),(0,r.jsxs)(n.td,{children:["Input parameter. Sets the desired output format as ",(0,r.jsx)(n.strong,{children:"Text"})," or ",(0,r.jsx)(n.strong,{children:"HTML"}),". The default is ",(0,r.jsx)(n.strong,{children:"Text"}),". For more information, see ",(0,r.jsx)(n.a,{href:"#url-output",children:"URL output"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"timeout"}),(0,r.jsx)(n.td,{children:"Timeout"}),(0,r.jsx)(n.td,{children:"Input parameter. Timeout for the request in seconds."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"headers"}),(0,r.jsx)(n.td,{children:"Headers"}),(0,r.jsx)(n.td,{children:"Input parameter. The headers to send with the request if needed for authentication or otherwise."})]})]})]}),"\n",(0,r.jsx)(n.p,{children:"Additional input parameters are available for error handling and encoding."}),"\n",(0,r.jsx)(n.h3,{id:"url-output",children:"URL output"}),"\n",(0,r.jsxs)(n.p,{children:["There are two settings that control the output of the ",(0,r.jsx)(n.strong,{children:"URL"})," component at different stages:"]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Output Format"}),": This optional parameter controls the content extracted from the crawled pages:"]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Text (default)"}),": The component extracts only the text from the HTML of the crawled pages."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"HTML"}),": The component extracts the entire raw HTML content of the crawled pages."]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Output data type"}),": In the component's output field (near the output port) you can select the structure of the outgoing data when it is passed to other components:"]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Extracted Pages"}),": Outputs a ",(0,r.jsx)(n.a,{href:"/data-types#dataframe",children:(0,r.jsx)(n.code,{children:"DataFrame"})})," that breaks the crawled pages into columns for the entire page content (",(0,r.jsx)(n.code,{children:"text"}),") and metadata like ",(0,r.jsx)(n.code,{children:"url"})," and ",(0,r.jsx)(n.code,{children:"title"}),"."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Raw Content"}),": Outputs a ",(0,r.jsx)(n.a,{href:"/data-types#message",children:(0,r.jsx)(n.code,{children:"Message"})})," containing the entire text or HTML from the crawled pages, including metadata, in a single block of text."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["When used as a standard component in a flow, the ",(0,r.jsx)(n.strong,{children:"URL"})," component must be connected to a component that accepts the selected output data type (",(0,r.jsx)(n.code,{children:"DataFrame"})," or ",(0,r.jsx)(n.code,{children:"Message"}),").\nYou can connect the ",(0,r.jsx)(n.strong,{children:"URL"})," component directly to a compatible component, or you can use a ",(0,r.jsxs)(n.a,{href:"/components-processing#type-convert",children:[(0,r.jsx)(n.strong,{children:"Type Convert"})," component"]})," to convert the output to another type before passing the data to other components if the data types aren't directly compatible."]}),"\n",(0,r.jsxs)(n.p,{children:["Processing components like the ",(0,r.jsx)(n.strong,{children:"Type Convert"})," component are useful with the ",(0,r.jsx)(n.strong,{children:"URL"})," component because it can extract a large amount of data from the crawled pages.\nFor example, if you only want to pass specific fields to other components, you can use a ",(0,r.jsxs)(n.a,{href:"/components-processing#parser",children:[(0,r.jsx)(n.strong,{children:"Parser"})," component"]})," to extract only that data from the crawled pages before passing the data to other components."]}),"\n",(0,r.jsxs)(n.p,{children:["When used in ",(0,r.jsx)(n.strong,{children:"Tool Mode"})," with an ",(0,r.jsx)(n.strong,{children:"Agent"})," component, the ",(0,r.jsx)(n.strong,{children:"URL"})," component can be connected directly to the ",(0,r.jsx)(n.strong,{children:"Agent"})," component's ",(0,r.jsx)(n.strong,{children:"Tools"})," port without converting the data.\nThe agent decides whether to use the ",(0,r.jsx)(n.strong,{children:"URL"})," component based on the user's query, and it can process the ",(0,r.jsx)(n.code,{children:"DataFrame"})," or ",(0,r.jsx)(n.code,{children:"Message"})," output directly."]}),"\n",(0,r.jsx)(n.h2,{id:"web-search",children:"Web Search"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"Web Search"})," component performs a basic web search using DuckDuckGo's HTML scraping interface.\nFor other search APIs, see ",(0,r.jsx)(i.A,{name:"Blocks","aria-hidden":"true"})," ",(0,r.jsx)(n.a,{href:"/components-bundle-components",children:(0,r.jsx)(n.strong,{children:"Bundles"})}),"."]}),"\n",(0,r.jsxs)(n.admonition,{type:"info",children:[(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"Web Search"})," component uses web scraping that can be subject to rate limits."]}),(0,r.jsx)(n.p,{children:"For production use, consider using another search component with more robust API support, such as provider-specific bundles."})]}),"\n",(0,r.jsx)(n.h3,{id:"use-the-web-search-component-in-a-flow",children:"Use the Web Search component in a flow"}),"\n",(0,r.jsxs)(n.p,{children:["The following steps demonstrate one way that you can use a ",(0,r.jsx)(n.strong,{children:"Web Search"})," component in a flow:"]}),"\n",(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Create a flow based on the ",(0,r.jsx)(n.strong,{children:"Basic Prompting"})," template."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Add a ",(0,r.jsx)(n.strong,{children:"Web Search"})," component, and then enter a search query, such as ",(0,r.jsx)(n.code,{children:"environmental news"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Add a ",(0,r.jsxs)(n.a,{href:"/components-processing#type-convert",children:[(0,r.jsx)(n.strong,{children:"Type Convert"})," component"]}),", set the ",(0,r.jsx)(n.strong,{children:"Output Type"})," to ",(0,r.jsx)(n.strong,{children:"Message"}),", and then connect the ",(0,r.jsx)(n.strong,{children:"Web Search"})," component's output to the ",(0,r.jsx)(n.strong,{children:"Type Convert"})," component's input."]}),"\n",(0,r.jsxs)(n.p,{children:["By default, the ",(0,r.jsx)(n.strong,{children:"Web Search"})," component outputs a ",(0,r.jsx)(n.code,{children:"DataFrame"}),".\nBecause the ",(0,r.jsx)(n.strong,{children:"Prompt Template"})," component only accepts ",(0,r.jsx)(n.code,{children:"Message"})," data, this conversion is required so that the flow can pass the search results to the ",(0,r.jsx)(n.strong,{children:"Prompt Template"})," component.\nFor more information, see ",(0,r.jsx)(n.a,{href:"#web-search-output",children:"Web Search output"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["In the ",(0,r.jsx)(n.strong,{children:"Prompt Template"})," component's ",(0,r.jsx)(n.strong,{children:"Template"})," field, add a variable like ",(0,r.jsx)(n.code,{children:"{searchresults}"})," or ",(0,r.jsx)(n.code,{children:"{context}"}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["This adds a field to the ",(0,r.jsx)(n.strong,{children:"Prompt Template"})," component that you can use to pass the converted search results to the prompt.\nFor more information, see ",(0,r.jsx)(n.a,{href:"/components-prompts#define-variables-in-prompts",children:"Define variables in prompts"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Connect the ",(0,r.jsx)(n.strong,{children:"Type Convert"})," component's output to the new variable field on the ",(0,r.jsx)(n.strong,{children:"Prompt Template"})," component."]}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.img,{alt:"Type convert web search output to chat",src:t(42547).A+"",width:"4000",height:"1826"})}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["In the ",(0,r.jsx)(n.strong,{children:"Language Model"})," component, add your OpenAI API key, or select a different provider and model."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Click ",(0,r.jsx)(n.strong,{children:"Playground"}),", and then enter ",(0,r.jsx)(n.code,{children:"latest news"}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["The LLM processes the request, including the context passed through the ",(0,r.jsx)(n.strong,{children:"Prompt Template"})," component, and then prints the response in the ",(0,r.jsx)(n.strong,{children:"Playground"})," chat interface."]}),"\n",(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"Result"}),(0,r.jsx)(n.p,{children:"The following is an example of a possible response.\nYour response may vary based on the current state of the web, your specific query, the model, and other factors."}),(0,r.jsx)(m.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"Here are some of the latest news articles related to the environment:",props:{}}]},{tokens:[{content:"Ozone Pollution and Global Warming: A recent study highlights that ozone pollution is a significant global environmental concern, threatening human health and crop production while exacerbating global warming. Read more",props:{}}]},{tokens:[{content:"...",props:{}}]}],lang:"text"},annotations:[]}]})]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.h3,{id:"web-search-parameters",children:"Web Search parameters"}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Display Name"}),(0,r.jsx)(n.th,{children:"Info"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"query"}),(0,r.jsx)(n.td,{children:"Search Query"}),(0,r.jsx)(n.td,{children:"Input parameter. Keywords to search for."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"timeout"}),(0,r.jsx)(n.td,{children:"Timeout"}),(0,r.jsxs)(n.td,{children:["Input parameter. Timeout for the web search request in seconds. Default: ",(0,r.jsx)(n.code,{children:"5"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"results"}),(0,r.jsx)(n.td,{children:"Search Results"}),(0,r.jsxs)(n.td,{children:["Output parameter. Returns a ",(0,r.jsx)(n.code,{children:"DataFrame"})," containing ",(0,r.jsx)(n.code,{children:"title"}),", ",(0,r.jsx)(n.code,{children:"links"}),", and ",(0,r.jsx)(n.code,{children:"snippets"}),". For more information, see ",(0,r.jsx)(n.a,{href:"#web-search-output",children:"Web Search output"}),"."]})]})]})]}),"\n",(0,r.jsx)(n.h3,{id:"web-search-output",children:"Web Search output"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"Web Search"})," component outputs a ",(0,r.jsx)(n.a,{href:"/data-types#dataframe",children:(0,r.jsx)(n.code,{children:"DataFrame"})})," containing the key columns ",(0,r.jsx)(n.code,{children:"title"}),", ",(0,r.jsx)(n.code,{children:"links"}),", and ",(0,r.jsx)(n.code,{children:"snippets"}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["When used as a standard component in a flow, the ",(0,r.jsx)(n.strong,{children:"Web Search"})," component must be connected to a component that accepts ",(0,r.jsx)(n.code,{children:"DataFrame"})," input, or you must use a ",(0,r.jsxs)(n.a,{href:"/components-processing#type-convert",children:[(0,r.jsx)(n.strong,{children:"Type Convert"})," component"]})," to convert the output to ",(0,r.jsx)(n.code,{children:"Data"})," or ",(0,r.jsx)(n.code,{children:"Message"})," type before passing the data to other components."]}),"\n",(0,r.jsxs)(n.p,{children:["When used in ",(0,r.jsx)(n.strong,{children:"Tool Mode"})," with an ",(0,r.jsx)(n.strong,{children:"Agent"})," component, the ",(0,r.jsx)(n.strong,{children:"Web Search"})," component can be connected directly to the ",(0,r.jsx)(n.strong,{children:"Agent"})," component's ",(0,r.jsx)(n.strong,{children:"Tools"})," port without converting the data.\nThe agent decides whether to use the ",(0,r.jsx)(n.strong,{children:"Web Search"})," component based on the user's query, and it can process the ",(0,r.jsx)(n.code,{children:"DataFrame"})," output directly."]}),"\n",(0,r.jsx)(n.h2,{id:"webhook",children:"Webhook"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"Webhook"})," component defines a webhook trigger that runs a flow when it receives an HTTP POST request."]}),"\n",(0,r.jsx)(n.h3,{id:"trigger-the-webhook",children:"Trigger the webhook"}),"\n",(0,r.jsxs)(n.p,{children:["When you add a ",(0,r.jsx)(n.strong,{children:"Webhook"})," component to your flow, a ",(0,r.jsx)(n.strong,{children:"Webhook curl"})," tab is added to the flow's ",(0,r.jsxs)(n.a,{href:"/concepts-publish#api-access",children:[(0,r.jsx)(n.strong,{children:"API Access"})," pane"]}),".\nThis tab automatically generates an HTTP POST request code snippet that you can use to trigger your flow through the ",(0,r.jsx)(n.strong,{children:"Webhook"})," component.\nFor example:"]}),"\n",(0,r.jsx)(m.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:"POST ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:' "http://',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_SERVER_ADDRESS",props:{style:{color:"#C9D1D9"}}},{content:"/api/v1/webhook/",props:{style:{color:"#A5D6FF"}}},{content:"$FLOW_ID",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:"'Content-Type: application/json' ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:"'x-api-key: $LANGFLOW_API_KEY' ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -d ",props:{style:{color:"#79C0FF"}}},{content:'\'{"any": "data"}\'',props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,r.jsxs)(n.p,{children:["For more information, see ",(0,r.jsx)(n.a,{href:"/webhook",children:"Trigger flows with webhooks"}),"."]}),"\n",(0,r.jsx)(n.h3,{id:"webhook-parameters",children:"Webhook parameters"}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Display Name"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"data"}),(0,r.jsx)(n.td,{children:"Payload"}),(0,r.jsx)(n.td,{children:"Input parameter. Receives a payload from external systems through HTTP POST requests."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"curl"}),(0,r.jsx)(n.td,{children:"curl"}),(0,r.jsx)(n.td,{children:"Input parameter. The curl command template for making requests to this webhook."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"endpoint"}),(0,r.jsx)(n.td,{children:"Endpoint"}),(0,r.jsx)(n.td,{children:"Input parameter. The endpoint URL where this webhook receives requests."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"output_data"}),(0,r.jsx)(n.td,{children:"Data"}),(0,r.jsxs)(n.td,{children:["Output parameter. The processed data from the webhook input. Returns an empty ",(0,r.jsx)(n.a,{href:"/data-types#data",children:(0,r.jsx)(n.code,{children:"Data"})})," object if no input is provided. If the input isn't valid JSON, the ",(0,r.jsx)(n.strong,{children:"Webhook"})," component wraps it in a ",(0,r.jsx)(n.code,{children:"payload"})," object so that it can be accepted as input to trigger the flow."]})]})]})]}),"\n",(0,r.jsx)(n.h2,{id:"additional-data-components",children:"Additional Data components"}),"\n",(0,r.jsx)(n.p,{children:"Langflow's core components are meant to be generic and support a range of use cases.\nCore components typically aren't limited to a single provider."}),"\n",(0,r.jsxs)(n.p,{children:["If the core components don't meet your needs, you can find provider-specific components in ",(0,r.jsx)(i.A,{name:"Blocks","aria-hidden":"true"})," ",(0,r.jsx)(n.a,{href:"/components-bundle-components",children:(0,r.jsx)(n.strong,{children:"Bundles"})}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["For example, the ",(0,r.jsxs)(n.a,{href:"/bundles-datastax",children:[(0,r.jsx)(n.strong,{children:"DataStax"})," bundle"]})," includes components for CQL queries, and the ",(0,r.jsxs)(n.a,{href:"/bundles-google",children:[(0,r.jsx)(n.strong,{children:"Google"})," bundle"]})," includes components for Google Search APIs."]}),"\n",(0,r.jsx)(n.h2,{id:"legacy-data-components",children:"Legacy Data components"}),"\n","\n",(0,r.jsx)(p.Ay,{}),"\n",(0,r.jsx)(n.p,{children:"The following Data components are in legacy status:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.strong,{children:"Load CSV"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.strong,{children:"Load JSON"})}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["Replace these components with the ",(0,r.jsx)(n.strong,{children:"File"})," component, which supports loading CSV and JSON files, as well as many other file types."]}),"\n",(0,r.jsx)(n.h2,{id:"see-also",children:"See also"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsxs)(n.a,{href:"/bundles-google",children:[(0,r.jsx)(n.strong,{children:"Google"})," bundle"]})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsxs)(n.a,{href:"/integrations-composio",children:[(0,r.jsx)(n.strong,{children:"Composio"})," bundle"]})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"/concepts-file-management",children:"File management"})}),"\n"]})]})}function b(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(y,{...e})}):y(e)}function v(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}},17886:(e,n,t)=>{t.d(n,{A:()=>o});t(96540);var s=t(64058),r=t(74848);function o({name:e,...n}){const t=s[e];return t?(0,r.jsx)(t,{...n}):null}},19365:(e,n,t)=>{t.d(n,{A:()=>a});t(96540);var s=t(18215);const r={tabItem:"tabItem_Ymn6"};var o=t(74848);function a({children:e,hidden:n,className:t}){return(0,o.jsx)("div",{role:"tabpanel",className:(0,s.A)(r.tabItem,t),hidden:n,children:e})}},31929:(e,n,t)=>{t.d(n,{Ay:()=>d,RM:()=>a});var s=t(74848),r=t(28453),o=t(17886);const a=[];function i(e){const n={a:"a",p:"p",strong:"strong",...(0,r.R)(),...e.components};return(0,s.jsxs)(n.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,s.jsx)(o.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Controls"})," in the ",(0,s.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function d(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(i,{...e})}):i(e)}},36813:(e,n,t)=>{t.d(n,{Ay:()=>d,RM:()=>a});var s=t(74848),r=t(28453),o=t(17886);const a=[];function i(e){const n={a:"a",p:"p",strong:"strong",...(0,r.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:["Legacy components are longer supported and can be removed in a future release.\nYou can continue to use them in existing flows, but it is recommended that you replace them with supported components as soon as possible.\nSuggested replacements are included in the ",(0,s.jsx)(n.strong,{children:"Legacy"})," banner on components in your flows.\nThey are also given in release notes and Langflow documentation whenever possible."]}),"\n",(0,s.jsxs)(n.p,{children:["If you aren't sure how to replace a legacy component, ",(0,s.jsx)(o.A,{name:"Search","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Search"})," for components by provider, service, or component name.\nThe component may have been deprecated in favor of a completely new component, a similar component, or a new version of the same component in a different category."]}),"\n",(0,s.jsxs)(n.p,{children:["If there is no obvious replacement, consider whether another component can be adapted to your use case.\nFor example, many ",(0,s.jsx)(o.A,{name:"Component","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Core components"})," provide generic functionality that can support multiple providers and use cases, such as the ",(0,s.jsxs)(n.a,{href:"/components-data#api-request",children:[(0,s.jsx)(n.strong,{children:"API Request"})," component"]}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["If neither of these options are viable, you could use the legacy component's code to create your own custom component, or ",(0,s.jsx)(n.a,{href:"/contributing-github-issues",children:"start a discussion"})," about the legacy component."]}),"\n",(0,s.jsxs)(n.p,{children:["To discourage use of legacy components in new flows, these components are hidden by default.\nIn the visual editor, you can click ",(0,s.jsx)(o.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Component settings"})," to toggle the ",(0,s.jsx)(n.strong,{children:"Legacy"})," filter."]})]})}function d(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(i,{...e})}):i(e)}},40935:(e,n,t)=>{t.d(n,{Ay:()=>i,RM:()=>o});var s=t(74848),r=t(28453);const o=[];function a(e){const n={a:"a",p:"p",strong:"strong",...(0,r.R)(),...e.components};return(0,s.jsxs)(n.p,{children:["If you are running Langflow Desktop on Windows, you must ",(0,s.jsx)(n.a,{href:"https://learn.microsoft.com/en-us/windows/apps/get-started/enable-your-device-for-development#activate-developer-mode",children:"enable Developer Mode"})," to use the Docling components.\nThe location of this setting depends on your Windows OS version.\nFind ",(0,s.jsx)(n.strong,{children:"For developers"}),' in your Windows Settings, or search for "Developer" in the Windows search bar, and then enable ',(0,s.jsx)(n.strong,{children:"Developer mode"}),".\nYou might need to restart your computer or Langflow to apply the change."]})}function i(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(a,{...e})}):a(e)}},42547:(e,n,t)=>{t.d(n,{A:()=>s});const s=t.p+"assets/images/component-type-convert-and-web-search-1eef7b9a7c1a243f4a08d9717728d0e1.png"},52189:(e,n,t)=>{t.d(n,{A:()=>s});const s=t.p+"assets/images/component-sql-database-3d2c985aee2dd9970874cb85e1d2b570.png"},84987:(e,n,t)=>{t.d(n,{A:()=>s});const s=t.p+"assets/images/connect-data-components-to-agent-a8cd8c94d0474ae434aeb5d507a803e8.png"}}]); \ No newline at end of file diff --git a/assets/js/7f193c41.988ebd3f.js b/assets/js/7f193c41.988ebd3f.js deleted file mode 100644 index 5ede2c72fb..0000000000 --- a/assets/js/7f193c41.988ebd3f.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[5761],{11470:(e,n,t)=>{t.d(n,{A:()=>w});var s=t(96540),r=t(18215),o=t(23104),a=t(56347),i=t(205),d=t(57485),c=t(31682),l=t(70679);function h(e){return s.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,s.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function p(e){const{values:n,children:t}=e;return(0,s.useMemo)(()=>{const e=n??function(e){return h(e).map(({props:{value:e,label:n,attributes:t,default:s}})=>({value:e,label:n,attributes:t,default:s}))}(t);return function(e){const n=(0,c.XI)(e,(e,n)=>e.value===n.value);if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map(e=>e.value).join(", ")}" found in . Every value needs to be unique.`)}(e),e},[n,t])}function u({value:e,tabValues:n}){return n.some(n=>n.value===e)}function x({queryString:e=!1,groupId:n}){const t=(0,a.W6)(),r=function({queryString:e=!1,groupId:n}){if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:e,groupId:n});return[(0,d.aZ)(r),(0,s.useCallback)(e=>{if(!r)return;const n=new URLSearchParams(t.location.search);n.set(r,e),t.replace({...t.location,search:n.toString()})},[r,t])]}function j(e){const{defaultValue:n,queryString:t=!1,groupId:r}=e,o=p(e),[a,d]=(0,s.useState)(()=>function({defaultValue:e,tabValues:n}){if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(e){if(!u({value:e,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${n.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}const t=n.find(e=>e.default)??n[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:n,tabValues:o})),[c,h]=x({queryString:t,groupId:r}),[j,m]=function({groupId:e}){const n=function(e){return e?`docusaurus.tab.${e}`:null}(e),[t,r]=(0,l.Dv)(n);return[t,(0,s.useCallback)(e=>{n&&r.set(e)},[n,r])]}({groupId:r}),g=(()=>{const e=c??j;return u({value:e,tabValues:o})?e:null})();(0,i.A)(()=>{g&&d(g)},[g]);return{selectedValue:a,selectValue:(0,s.useCallback)(e=>{if(!u({value:e,tabValues:o}))throw new Error(`Can't select invalid tab value=${e}`);d(e),h(e),m(e)},[h,m,o]),tabValues:o}}var m=t(92303);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=t(74848);function y({className:e,block:n,selectedValue:t,selectValue:s,tabValues:a}){const i=[],{blockElementScrollPositionUntilNextRender:d}=(0,o.a_)(),c=e=>{const n=e.currentTarget,r=i.indexOf(n),o=a[r].value;o!==t&&(d(n),s(o))},l=e=>{let n=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const t=i.indexOf(e.currentTarget)+1;n=i[t]??i[0];break}case"ArrowLeft":{const t=i.indexOf(e.currentTarget)-1;n=i[t]??i[i.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.A)("tabs",{"tabs--block":n},e),children:a.map(({value:e,label:n,attributes:s})=>(0,f.jsx)("li",{role:"tab",tabIndex:t===e?0:-1,"aria-selected":t===e,ref:e=>{i.push(e)},onKeyDown:l,onClick:c,...s,className:(0,r.A)("tabs__item",g.tabItem,s?.className,{"tabs__item--active":t===e}),children:n??e},e))})}function b({lazy:e,children:n,selectedValue:t}){const o=(Array.isArray(n)?n:[n]).filter(Boolean);if(e){const e=o.find(e=>e.props.value===t);return e?(0,s.cloneElement)(e,{className:(0,r.A)("margin-top--md",e.props.className)}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:o.map((e,n)=>(0,s.cloneElement)(e,{key:n,hidden:e.props.value!==t}))})}function v(e){const n=j(e);return(0,f.jsxs)("div",{className:(0,r.A)("tabs-container",g.tabList),children:[(0,f.jsx)(y,{...n,...e}),(0,f.jsx)(b,{...n,...e})]})}function w(e){const n=(0,m.A)();return(0,f.jsx)(v,{...e,children:h(e.children)},String(n))}},14876:(e,n,t)=>{t.r(n),t.d(n,{CH:()=>m,assets:()=>j,chCodeConfig:()=>g,contentTitle:()=>x,default:()=>b,frontMatter:()=>u,metadata:()=>s,toc:()=>f});const s=JSON.parse('{"id":"Components/components-data","title":"Data","description":"Data components bring data into your flows from various sources like files, API endpoints, and URLs.","source":"@site/docs/Components/components-data.mdx","sourceDirName":"Components","slug":"/components-data","permalink":"/components-data","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Data","slug":"/components-data"},"sidebar":"docs","previous":{"title":"Embedding Model","permalink":"/components-embedding-models"},"next":{"title":"Processing components","permalink":"/components-processing"}}');var r=t(74848),o=t(28453),a=t(24754),i=t(17886),d=t(11470),c=t(19365),l=t(31929),h=t(40935),p=t(36813);const u={title:"Data",slug:"/components-data"},x=void 0,j={},m={annotations:a.hk,Code:a.Cy},g={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},f=[{value:"Use Data components in flows",id:"use-data-components-in-flows",level:2},{value:"API Request",id:"api-request",level:2},{value:"API Request parameters",id:"api-request-parameters",level:3},...l.RM,{value:"Directory",id:"directory",level:2},{value:"Directory parameters",id:"directory-parameters",level:3},...l.RM,{value:"File",id:"file",level:2},{value:"File type and size limits",id:"file-type-and-size-limits",level:3},{value:"File parameters",id:"file-parameters",level:3},...l.RM,{value:"Advanced parsing",id:"advanced-parsing",level:3},...h.RM,{value:"File output",id:"file-output",level:3},{value:"News Search",id:"news-search",level:2},{value:"News Search parameters",id:"news-search-parameters",level:3},...l.RM,{value:"RSS Reader",id:"rss-reader",level:2},{value:"RSS Reader parameters",id:"rss-reader-parameters",level:3},{value:"SQL Database",id:"sql-database",level:2},{value:"Query an SQL database with natural language prompts",id:"query-an-sql-database-with-natural-language-prompts",level:3},{value:"SQL Database parameters",id:"sql-database-parameters",level:3},...l.RM,{value:"URL",id:"url",level:2},{value:"URL parameters",id:"url-parameters",level:3},...l.RM,{value:"URL output",id:"url-output",level:3},{value:"Web Search",id:"web-search",level:2},{value:"Use the Web Search component in a flow",id:"use-the-web-search-component-in-a-flow",level:3},{value:"Web Search parameters",id:"web-search-parameters",level:3},{value:"Web Search output",id:"web-search-output",level:3},{value:"Webhook",id:"webhook",level:2},{value:"Trigger the webhook",id:"trigger-the-webhook",level:3},{value:"Webhook parameters",id:"webhook-parameters",level:3},{value:"Additional Data components",id:"additional-data-components",level:2},{value:"Legacy Data components",id:"legacy-data-components",level:2},...p.RM,{value:"See also",id:"see-also",level:2}];function y(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,o.R)(),...e.components},{Details:s}=n;return m||v("CH",!1),m.Code||v("CH.Code",!0),s||v("Details",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n","\n",(0,r.jsx)(n.p,{children:"Data components bring data into your flows from various sources like files, API endpoints, and URLs.\nFor example:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Load files"}),": Import data from a file or directory with the ",(0,r.jsxs)(n.a,{href:"#file",children:[(0,r.jsx)(n.strong,{children:"File"})," component"]})," and ",(0,r.jsxs)(n.a,{href:"#directory",children:[(0,r.jsx)(n.strong,{children:"Directory"})," component"]}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Search the web"}),": Fetch data from the web with components like the ",(0,r.jsxs)(n.a,{href:"#news-search",children:[(0,r.jsx)(n.strong,{children:"News Search"})," component"]}),", ",(0,r.jsxs)(n.a,{href:"#rss-reader",children:[(0,r.jsx)(n.strong,{children:"RSS Reader"})," component"]}),", ",(0,r.jsxs)(n.a,{href:"#web-search",children:[(0,r.jsx)(n.strong,{children:"Web Search"})," component"]}),", and ",(0,r.jsxs)(n.a,{href:"#url",children:[(0,r.jsx)(n.strong,{children:"URL"})," component"]}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Make API calls"}),": Use APIs to trigger flows or perform actions with the ",(0,r.jsxs)(n.a,{href:"#api-request",children:[(0,r.jsx)(n.strong,{children:"API Request"})," component"]})," and ",(0,r.jsxs)(n.a,{href:"#webhook",children:[(0,r.jsx)(n.strong,{children:"Webhook"})," component"]}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Run SQL queries"}),": Query an SQL database with the ",(0,r.jsxs)(n.a,{href:"#sql-database",children:[(0,r.jsx)(n.strong,{children:"SQL Database"})," component"]}),"."]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"Each component runs different commands for retrieval, processing, and type checking.\nSome components are a minimal wrapper for a command that you provide, and others include built-in scripts to fetch and process data based on variable inputs.\nAdditionally, some components return raw data, whereas others can convert, restructure, or validate the data before outputting it.\nThis means that some similar components might produce different results."}),"\n",(0,r.jsxs)(n.admonition,{type:"tip",children:[(0,r.jsxs)(n.p,{children:["Data components pair well with ",(0,r.jsx)(n.a,{href:"/components-processing",children:"Processing components"})," that can perform additional parsing, transformation, and validation after retrieving the data."]}),(0,r.jsxs)(n.p,{children:["This can include basic operations, like saving a file in a specific format, or more complex tasks, like using a ",(0,r.jsx)(n.strong,{children:"Text Splitter"})," component to break down a large document into smaller chunks before generating embeddings for vector search."]})]}),"\n",(0,r.jsx)(n.h2,{id:"use-data-components-in-flows",children:"Use Data components in flows"}),"\n",(0,r.jsx)(n.p,{children:"Data components are used often in flows because they offer a versatile way to perform common functions."}),"\n",(0,r.jsxs)(n.p,{children:["You can use these components to perform their base functions as isolated steps in your flow, or you can connect them to an ",(0,r.jsx)(n.strong,{children:"Agent"})," component as tools."]}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.img,{alt:"An agent flow with three Data components connected to the agent as tools",src:t(84987).A+"",width:"4000",height:"3028"})}),"\n",(0,r.jsx)(n.p,{children:"For example flows, see the following:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.a,{href:"/chat-with-files",children:"Create a chatbot that can ingest files"}),": Learn how to use a ",(0,r.jsx)(n.strong,{children:"File"})," component to load a file as context for a chatbot.\nThe file and user input are both passed to the LLM so you can ask questions about the file you uploaded."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.a,{href:"/chat-with-rag",children:"Create a vector RAG chatbot"}),": Learn how to ingest files for use in Retrieval-Augmented Generation (RAG), and then set up a chatbot that can use the ingested files as context.\nThe two flows in this tutorial prepare files for RAG, and then let your LLM use vector search to retrieve contextually relevant data during a chat session."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.a,{href:"/agents-tools",children:"Configure tools for agents"}),": Learn how to use any component as a tool for an agent.\nWhen used as tools, the agent autonomously decides when to call a component based on the user's query."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.a,{href:"/webhook",children:"Trigger flows with webhooks"}),": Learn how to use the ",(0,r.jsx)(n.strong,{children:"Webhook"})," component to trigger a flow run in response to an external event."]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"api-request",children:"API Request"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"API Request"})," component constructs and sends HTTP requests using URLs or curl commands:"]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"URL mode"}),": Enter one or more comma-separated URLs, and then select the method for the request to each URL."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"curl mode"}),": Enter the curl command to execute."]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"You can enable additional request options and fields in the component's parameters."}),"\n",(0,r.jsxs)(n.p,{children:["Returns a ",(0,r.jsxs)(n.a,{href:"/data-types#data",children:[(0,r.jsx)(n.code,{children:"Data"})," object"]})," containing the response."]}),"\n",(0,r.jsxs)(n.p,{children:["For provider-specific API components, see ",(0,r.jsx)(i.A,{name:"Blocks","aria-hidden":"true"})," ",(0,r.jsx)(n.a,{href:"/components-bundle-components",children:(0,r.jsx)(n.strong,{children:"Bundles"})}),"."]}),"\n",(0,r.jsx)(n.h3,{id:"api-request-parameters",children:"API Request parameters"}),"\n",(0,r.jsx)(l.Ay,{}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Display Name"}),(0,r.jsx)(n.th,{children:"Info"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"mode"}),(0,r.jsx)(n.td,{children:"Mode"}),(0,r.jsxs)(n.td,{children:["Input parameter. Set the mode to either ",(0,r.jsx)(n.strong,{children:"URL"})," or ",(0,r.jsx)(n.strong,{children:"curl"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"urls"}),(0,r.jsx)(n.td,{children:"URL"}),(0,r.jsx)(n.td,{children:"Input parameter. Enter one or more comma-separated URLs for the request."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"curl"}),(0,r.jsx)(n.td,{children:"curl"}),(0,r.jsxs)(n.td,{children:["Input parameter. ",(0,r.jsx)(n.strong,{children:"curl mode"})," only. Enter a complete curl command. Other component parameters are populated from the command arguments."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"method"}),(0,r.jsx)(n.td,{children:"Method"}),(0,r.jsx)(n.td,{children:"Input parameter. The HTTP method to use."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"query_params"}),(0,r.jsx)(n.td,{children:"Query Parameters"}),(0,r.jsx)(n.td,{children:"Input parameter. The query parameters to append to the URL."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"body"}),(0,r.jsx)(n.td,{children:"Body"}),(0,r.jsx)(n.td,{children:"Input parameter. The body to send with POST, PATCH, and PUT requests as a dictionary."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"headers"}),(0,r.jsx)(n.td,{children:"Headers"}),(0,r.jsx)(n.td,{children:"Input parameter. The headers to send with the request as a dictionary."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"timeout"}),(0,r.jsx)(n.td,{children:"Timeout"}),(0,r.jsx)(n.td,{children:"Input parameter. The timeout to use for the request."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"follow_redirects"}),(0,r.jsx)(n.td,{children:"Follow Redirects"}),(0,r.jsx)(n.td,{children:"Input parameter. Whether to follow HTTP redirects. The default is enabled (true). If disabled (false), HTTP redirects aren't followed."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"save_to_file"}),(0,r.jsx)(n.td,{children:"Save to File"}),(0,r.jsx)(n.td,{children:"Input parameter. Whether to save the API response to a temporary file. Default: Disabled/false"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"include_httpx_metadata"}),(0,r.jsx)(n.td,{children:"Include HTTPx Metadata"}),(0,r.jsxs)(n.td,{children:["Input parameter. Whether to include properties such as ",(0,r.jsx)(n.code,{children:"headers"}),", ",(0,r.jsx)(n.code,{children:"status_code"}),", ",(0,r.jsx)(n.code,{children:"response_headers"}),", and ",(0,r.jsx)(n.code,{children:"redirection_history"})," in the output. Default: Disabled/false"]})]})]})]}),"\n",(0,r.jsx)(n.h2,{id:"directory",children:"Directory"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"Directory"})," component recursively loads files from a directory, with options for file types, depth, and concurrency."]}),"\n",(0,r.jsxs)(n.p,{children:["Files must be of a ",(0,r.jsx)(n.a,{href:"#file-type-and-size-limits",children:"supported type and size"})," to be loaded."]}),"\n",(0,r.jsxs)(n.p,{children:["Outputs either a ",(0,r.jsx)(n.a,{href:"/data-types#data",children:(0,r.jsx)(n.code,{children:"Data"})})," or ",(0,r.jsx)(n.a,{href:"/data-types#dataframe",children:(0,r.jsx)(n.code,{children:"DataFrame"})})," object, depending on the directory contents."]}),"\n",(0,r.jsx)(n.h3,{id:"directory-parameters",children:"Directory parameters"}),"\n",(0,r.jsx)(l.Ay,{}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"path"}),(0,r.jsx)(n.td,{children:"MessageTextInput"}),(0,r.jsxs)(n.td,{children:["Input parameter. The path to the directory to load files from. Default: Current directory (",(0,r.jsx)(n.code,{children:"."}),")"]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"types"}),(0,r.jsx)(n.td,{children:"MessageTextInput"}),(0,r.jsx)(n.td,{children:"Input parameter. The file types to load. Select one or more, or leave empty to attempt to load all files."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"depth"}),(0,r.jsx)(n.td,{children:"IntInput"}),(0,r.jsx)(n.td,{children:"Input parameter. The depth to search for files."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"max_concurrency"}),(0,r.jsx)(n.td,{children:"IntInput"}),(0,r.jsx)(n.td,{children:"Input parameter. The maximum concurrency for loading multiple files."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"load_hidden"}),(0,r.jsx)(n.td,{children:"BoolInput"}),(0,r.jsx)(n.td,{children:"Input parameter. If true, hidden files are loaded."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"recursive"}),(0,r.jsx)(n.td,{children:"BoolInput"}),(0,r.jsx)(n.td,{children:"Input parameter. If true, the search is recursive."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"silent_errors"}),(0,r.jsx)(n.td,{children:"BoolInput"}),(0,r.jsx)(n.td,{children:"Input parameter. If true, errors don't raise an exception."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"use_multithreading"}),(0,r.jsx)(n.td,{children:"BoolInput"}),(0,r.jsx)(n.td,{children:"Input parameter. If true, multithreading is used."})]})]})]}),"\n",(0,r.jsx)(n.h2,{id:"file",children:"File"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"File"})," component loads and parses files, converts the content into a ",(0,r.jsx)(n.code,{children:"Data"}),", ",(0,r.jsx)(n.code,{children:"DataFrame"}),", or ",(0,r.jsx)(n.code,{children:"Message"})," object.\nIt supports multiple file types, provides parameters for parallel processing and error handling, and supports advanced parsing with the Docling library."]}),"\n",(0,r.jsxs)(n.p,{children:["You can add files to the ",(0,r.jsx)(n.strong,{children:"File"})," component in the visual editor or at runtime, and you can upload multiple files at once.\nFor more information about uploading files and working with files in flows, see ",(0,r.jsx)(n.a,{href:"/concepts-file-management",children:"File management"})," and ",(0,r.jsx)(n.a,{href:"/chat-with-files",children:"Create a chatbot that can ingest files"}),"."]}),"\n",(0,r.jsx)(n.h3,{id:"file-type-and-size-limits",children:"File type and size limits"}),"\n",(0,r.jsxs)(n.p,{children:["By default, the maximum file size is 1024 MB.\nTo modify this value, change the ",(0,r.jsx)(n.code,{children:"LANGFLOW_MAX_FILE_SIZE_UPLOAD"})," ",(0,r.jsx)(n.a,{href:"/environment-variables",children:"environment variable"}),"."]}),"\n",(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"Supported file types"}),(0,r.jsxs)(n.p,{children:["The following file types are supported by the ",(0,r.jsx)(n.strong,{children:"File"})," component.\nUse archive and compressed formats to bundle multiple files together, or use the ",(0,r.jsxs)(n.a,{href:"#directory",children:[(0,r.jsx)(n.strong,{children:"Directory"})," component"]})," to load all files in a directory."]}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:".bz2"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:".csv"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:".docx"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:".gz"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:".htm"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:".html"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:".json"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:".js"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:".md"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:".mdx"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:".pdf"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:".py"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:".sh"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:".sql"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:".tar"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:".tgz"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:".ts"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:".tsx"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:".txt"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:".xml"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:".yaml"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:".yml"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:".zip"})}),"\n"]})]}),"\n",(0,r.jsx)(n.p,{children:"If you need to load an unsupported file type, you must use a different component that supports that file type and, potentially, parses it outside Langflow, or you must convert it to a supported type before uploading it."}),"\n",(0,r.jsxs)(n.p,{children:["For images, see ",(0,r.jsx)(n.a,{href:"/concepts-file-management#upload-images",children:"Upload images"}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["For videos, see the ",(0,r.jsx)(n.strong,{children:"Twelve Labs"})," and ",(0,r.jsx)(n.strong,{children:"YouTube"})," ",(0,r.jsx)(i.A,{name:"Blocks","aria-hidden":"true"})," ",(0,r.jsx)(n.a,{href:"/components-bundle-components",children:(0,r.jsx)(n.strong,{children:"Bundles"})}),"."]}),"\n",(0,r.jsx)(n.h3,{id:"file-parameters",children:"File parameters"}),"\n",(0,r.jsx)(l.Ay,{}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Display Name"}),(0,r.jsx)(n.th,{children:"Info"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"path"}),(0,r.jsx)(n.td,{children:"Files"}),(0,r.jsxs)(n.td,{children:["Input parameter. The path to files to load. Can be local or in ",(0,r.jsx)(n.a,{href:"/concepts-file-management",children:"Langflow file management"}),". Supports individual files and bundled archives."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"file_path"}),(0,r.jsx)(n.td,{children:"Server File Path"}),(0,r.jsxs)(n.td,{children:["Input parameter. A ",(0,r.jsx)(n.code,{children:"Data"})," object with a ",(0,r.jsx)(n.code,{children:"file_path"})," property pointing to a file in ",(0,r.jsx)(n.a,{href:"/concepts-file-management",children:"Langflow file management"})," or a ",(0,r.jsx)(n.code,{children:"Message"})," object with a path to the file. Supersedes ",(0,r.jsx)(n.strong,{children:"Files"})," (",(0,r.jsx)(n.code,{children:"path"}),") but supports the same file types."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"separator"}),(0,r.jsx)(n.td,{children:"Separator"}),(0,r.jsxs)(n.td,{children:["Input parameter. The separator to use between multiple outputs in ",(0,r.jsx)(n.code,{children:"Message"})," format."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"silent_errors"}),(0,r.jsx)(n.td,{children:"Silent Errors"}),(0,r.jsx)(n.td,{children:"Input parameter. If true, errors in the component don't raise an exception. The default is false/disabled."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"delete_server_file_after_processing"}),(0,r.jsx)(n.td,{children:"Delete Server File After Processing"}),(0,r.jsxs)(n.td,{children:["Input parameter. If true (default), the ",(0,r.jsx)(n.strong,{children:"Server File Path"})," (",(0,r.jsx)(n.code,{children:"file_path"}),") is deleted after processing."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"ignore_unsupported_extensions"}),(0,r.jsx)(n.td,{children:"Ignore Unsupported Extensions"}),(0,r.jsxs)(n.td,{children:["Input parameter. If enabled (true), files with unsupported extensions are accepted but not processed. If disabled (false), the ",(0,r.jsx)(n.strong,{children:"File"})," component either can throw an error if an unsupported file type is provided. The default is true."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"ignore_unspecified_files"}),(0,r.jsx)(n.td,{children:"Ignore Unspecified Files"}),(0,r.jsxs)(n.td,{children:["Input parameter. If true, ",(0,r.jsx)(n.code,{children:"Data"})," with no ",(0,r.jsx)(n.code,{children:"file_path"})," property is ignored. If false (default), the component errors when a file isn't specified."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"concurrency_multithreading"}),(0,r.jsx)(n.td,{children:"Processing Concurrency"}),(0,r.jsx)(n.td,{children:"Input parameter. The number of files to process concurrently if multiple files are uploaded. Default is 1. Values greater than 1 enable parallel processing for 2 or more files. Ignored for single-file uploads and advanced parsing."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"advanced_parser"}),(0,r.jsx)(n.td,{children:"Advanced Parser"}),(0,r.jsxs)(n.td,{children:["Input parameter. If true, enables ",(0,r.jsx)(n.a,{href:"#advanced-parsing",children:"advanced parsing"}),". Only available for single-file uploads of compatible file types. Default: Disabled (false)."]})]})]})]}),"\n",(0,r.jsx)(n.h3,{id:"advanced-parsing",children:"Advanced parsing"}),"\n",(0,r.jsxs)(n.p,{children:["Starting in Langflow version 1.6, the ",(0,r.jsx)(n.strong,{children:"File"})," component supports advanced document parsing using the ",(0,r.jsx)(n.a,{href:"https://docling-project.github.io/docling/",children:"Docling"})," library for supported file types."]}),"\n",(0,r.jsx)(n.p,{children:"To use advanced parsing, do the following:"}),"\n",(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Complete the following prerequisites, if applicable:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Install Langflow version 1.6 or later"}),": Earlier versions don't support advanced parsing with the ",(0,r.jsx)(n.strong,{children:"File"})," component. For upgrade guidance, see the ",(0,r.jsx)(n.a,{href:"/release-notes",children:"Release notes"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Install Docling dependency on macOS Intel (x86_64)"}),": The Docling dependency isn't installed by default for macOS Intel (x86_64). Use the ",(0,r.jsx)(n.a,{href:"https://docling-project.github.io/docling/installation/",children:"Docling installation guide"})," to install the Docling dependency."]}),"\n",(0,r.jsx)(n.p,{children:"For all other operating systems, the Docling dependency is installed by default."}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Enable Developer Mode for Windows"}),":"]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(h.Ay,{}),"\n",(0,r.jsx)(n.p,{children:"Developer Mode isn't required for Langflow OSS on Windows."}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Add one valid file to the ",(0,r.jsx)(n.strong,{children:"File"})," component."]}),"\n",(0,r.jsx)(n.admonition,{title:"Advanced parsing limitations",type:"info",children:(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Advanced parsing processes only one file.\nIf you select multiple files, the ",(0,r.jsx)(n.strong,{children:"File"})," component processes the first file only, ignoring any additional files.\nTo process multiple files with advanced parsing, pass each file to a separate ",(0,r.jsx)(n.strong,{children:"File"})," components, or use the dedicated ",(0,r.jsxs)(n.a,{href:"/integrations-docling",children:[(0,r.jsx)(n.strong,{children:"Docling"})," components"]}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Advanced parsing can process any of the ",(0,r.jsx)(n.strong,{children:"File"})," component's supported file types except ",(0,r.jsx)(n.code,{children:".csv"}),", ",(0,r.jsx)(n.code,{children:".xlsx"}),", and ",(0,r.jsx)(n.code,{children:".parquet"})," files because it is designed for document processing, such as extracting text from PDFs.\nFor structured data analysis, use the ",(0,r.jsxs)(n.a,{href:"/components-processing#parser",children:[(0,r.jsx)(n.strong,{children:"Parser"})," component"]}),"."]}),"\n"]}),"\n"]})}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Enable ",(0,r.jsx)(n.strong,{children:"Advanced Parsing"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Click ",(0,r.jsx)(i.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Controls"})," in the ",(0,r.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"})," to configure advanced parsing parameters, which are hidden by default:"]}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Display Name"}),(0,r.jsx)(n.th,{children:"Info"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"pipeline"}),(0,r.jsx)(n.td,{children:"Pipeline"}),(0,r.jsxs)(n.td,{children:["Input parameter, advanced parsing. The Docling pipeline to use, either ",(0,r.jsx)(n.code,{children:"standard"})," (default, recommended) or ",(0,r.jsx)(n.code,{children:"vlm"})," (may produce inconsistent results)."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"ocr_engine"}),(0,r.jsx)(n.td,{children:"OCR Engine"}),(0,r.jsxs)(n.td,{children:["Input parameter, advanced parsing. The OCR parser to use if ",(0,r.jsx)(n.code,{children:"pipeline"})," is ",(0,r.jsx)(n.code,{children:"standard"}),". Options are ",(0,r.jsx)(n.code,{children:"None"})," (default) or ",(0,r.jsx)(n.a,{href:"https://pypi.org/project/easyocr/",children:(0,r.jsx)(n.code,{children:"EasyOCR"})}),". ",(0,r.jsx)(n.code,{children:"None"})," means that no OCR engine is used, and this can produce inconsistent or broken results for some documents. This setting has no effect with the ",(0,r.jsx)(n.code,{children:"vlm"})," pipeline."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"md_image_placeholder"}),(0,r.jsx)(n.td,{children:"Markdown Image Placeholder"}),(0,r.jsxs)(n.td,{children:["Input parameter, advanced parsing. Defines the placeholder for image files if the output type is ",(0,r.jsx)(n.strong,{children:"Markdown"}),". Default: ",(0,r.jsx)(n.code,{children:"\x3c!-- image --\x3e"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"md_page_break_placeholder"}),(0,r.jsx)(n.td,{children:"Markdown Page Break Placeholder"}),(0,r.jsxs)(n.td,{children:["Input parameter, advanced parsing. Defines the placeholder for page breaks if the output type is ",(0,r.jsx)(n.strong,{children:"Markdown"}),". Default: ",(0,r.jsx)(n.code,{children:'""'})," (empty string)."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"doc_key"}),(0,r.jsx)(n.td,{children:"Document Key"}),(0,r.jsxs)(n.td,{children:["Input parameter, advanced parsing. The key to use for the ",(0,r.jsx)(n.code,{children:"DoclingDocument"})," column, which holds the structured information extracted from the source document. See ",(0,r.jsx)(n.a,{href:"https://docling-project.github.io/docling/concepts/docling_document/",children:"Docling Document"})," for details. Default: ",(0,r.jsx)(n.code,{children:"doc"}),"."]})]})]})]}),"\n",(0,r.jsx)(n.admonition,{type:"tip",children:(0,r.jsxs)(n.p,{children:["For additional Docling features, including other components and OCR parsers, use the ",(0,r.jsxs)(n.a,{href:"/integrations-docling",children:[(0,r.jsx)(n.strong,{children:"Docling"})," bundle"]}),"."]})}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.h3,{id:"file-output",children:"File output"}),"\n",(0,r.jsxs)(n.p,{children:["The output of the ",(0,r.jsx)(n.strong,{children:"File"})," component depends on the number of files loaded and whether advanced parsing is enabled.\nIf multiple options are available, you can set the output type near the component's output port."]}),"\n",(0,r.jsxs)(d.A,{children:[(0,r.jsx)(c.A,{value:"zero",label:"No files",children:(0,r.jsxs)(n.p,{children:["If you run the ",(0,r.jsx)(n.strong,{children:"File"})," component with no file selected, it throws an error, or, if ",(0,r.jsx)(n.strong,{children:"Silent Errors"})," is enabled, produces no output."]})}),(0,r.jsxs)(c.A,{value:"one-false",label:"One file without advanced parsing",children:[(0,r.jsx)(n.p,{children:"If advanced parsing is disabled and you upload one file, the following output types are available:"}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Structured Content"}),": Available only for ",(0,r.jsx)(n.code,{children:".csv"}),", ",(0,r.jsx)(n.code,{children:".xlsx"}),", ",(0,r.jsx)(n.code,{children:".parquet"}),", and ",(0,r.jsx)(n.code,{children:".json"})," files."]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["For ",(0,r.jsx)(n.code,{children:".csv"})," files, produces a ",(0,r.jsx)(n.a,{href:"/data-types#dataframe",children:(0,r.jsx)(n.code,{children:"DataFrame"})})," representing the table data."]}),"\n",(0,r.jsxs)(n.li,{children:["For ",(0,r.jsx)(n.code,{children:".json"})," files, produces a ",(0,r.jsx)(n.a,{href:"/data-types#data",children:(0,r.jsx)(n.code,{children:"Data"})})," object with the parsed JSON data."]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Raw Content"}),": A ",(0,r.jsx)(n.a,{href:"/data-types#message",children:(0,r.jsx)(n.code,{children:"Message"})})," containing the file's raw text content."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"File Path"}),": A ",(0,r.jsx)(n.a,{href:"/data-types#message",children:(0,r.jsx)(n.code,{children:"Message"})})," containing the path to the file in ",(0,r.jsx)(n.a,{href:"/concepts-file-management",children:"Langflow file management"}),"."]}),"\n"]}),"\n"]})]}),(0,r.jsxs)(c.A,{value:"one-true",label:"One file with advanced parsing",children:[(0,r.jsx)(n.p,{children:"If advanced parsing is enabled and you upload one file, the following output types are available:"}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Structured Output"}),": A ",(0,r.jsx)(n.a,{href:"/data-types#dataframe",children:(0,r.jsx)(n.code,{children:"DataFrame"})})," containing the Docling-processed document data with text elements, page numbers, and metadata."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Markdown"}),": A ",(0,r.jsx)(n.a,{href:"/data-types#message",children:(0,r.jsx)(n.code,{children:"Message"})})," containing the uploaded document contents in Markdown format with image placeholders."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"File Path"}),": A ",(0,r.jsx)(n.a,{href:"/data-types#message",children:(0,r.jsx)(n.code,{children:"Message"})})," containing the path to the file in ",(0,r.jsx)(n.a,{href:"/concepts-file-management",children:"Langflow file management"}),"."]}),"\n"]}),"\n"]})]}),(0,r.jsxs)(c.A,{value:"multi",label:"Multiple files",children:[(0,r.jsxs)(n.p,{children:["If you upload multiple files, the component outputs ",(0,r.jsx)(n.strong,{children:"Files"}),", which is a ",(0,r.jsx)(n.a,{href:"/data-types#dataframe",children:(0,r.jsx)(n.code,{children:"DataFrame"})})," containing the content and metadata of all selected files."]}),(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.a,{href:"#advanced-parsing",children:"Advanced parsing"})," doesn't support multiple files; it processes only the first file."]})]})]}),"\n",(0,r.jsx)(n.h2,{id:"news-search",children:"News Search"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"News Search"})," component searches Google News through RSS, and then returns clean article data as a ",(0,r.jsx)(n.a,{href:"/data-types#dataframe",children:(0,r.jsx)(n.code,{children:"DataFrame"})})," containing article titles, links, publication dates, and summaries.\nThe component's ",(0,r.jsx)(n.code,{children:"clean_html"})," method parses the HTML content with the BeautifulSoup library, removes HTML markup, and strips whitespace to output clean data."]}),"\n",(0,r.jsxs)(n.p,{children:["For other RSS feeds, use the ",(0,r.jsxs)(n.a,{href:"#rss-reader",children:[(0,r.jsx)(n.strong,{children:"RSS Reader"})," component"]}),", and for other searches use the ",(0,r.jsxs)(n.a,{href:"#web-search",children:[(0,r.jsx)(n.strong,{children:"Web Search"})," component"]})," or provider-specific ",(0,r.jsx)(i.A,{name:"Blocks","aria-hidden":"true"})," ",(0,r.jsx)(n.a,{href:"/components-bundle-components",children:(0,r.jsx)(n.strong,{children:"Bundles"})}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["When used as a standard component in a flow, the ",(0,r.jsx)(n.strong,{children:"News Search"})," component must be connected to a component that accepts ",(0,r.jsx)(n.code,{children:"DataFrame"})," input.\nYou can connect the ",(0,r.jsx)(n.strong,{children:"News Search"})," component directly to a compatible component, or you can use a ",(0,r.jsx)(n.a,{href:"/components-processing",children:"Processing component"})," to convert or extract data of a different type between components."]}),"\n",(0,r.jsxs)(n.p,{children:["When used in ",(0,r.jsx)(n.strong,{children:"Tool Mode"})," with an ",(0,r.jsx)(n.strong,{children:"Agent"})," component, the ",(0,r.jsx)(n.strong,{children:"News Search"})," component can be connected directly to the ",(0,r.jsx)(n.strong,{children:"Agent"})," component's ",(0,r.jsx)(n.strong,{children:"Tools"})," port without converting the data.\nThe agent decides whether to use the ",(0,r.jsx)(n.strong,{children:"News Search"})," component based on the user's query, and it can process the ",(0,r.jsx)(n.code,{children:"DataFrame"})," output directly."]}),"\n",(0,r.jsx)(n.h3,{id:"news-search-parameters",children:"News Search parameters"}),"\n",(0,r.jsx)(l.Ay,{}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Display Name"}),(0,r.jsx)(n.th,{children:"Info"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"query"}),(0,r.jsx)(n.td,{children:"Search Query"}),(0,r.jsx)(n.td,{children:"Input parameter. Search keywords for news articles."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"hl"}),(0,r.jsx)(n.td,{children:"Language (hl)"}),(0,r.jsxs)(n.td,{children:["Input parameter. Language code, such as en-US, fr, de. Default: ",(0,r.jsx)(n.code,{children:"en-US"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"gl"}),(0,r.jsx)(n.td,{children:"Country (gl)"}),(0,r.jsxs)(n.td,{children:["Input parameter. Country code, such as US, FR, DE. Default: ",(0,r.jsx)(n.code,{children:"US"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"ceid"}),(0,r.jsxs)(n.td,{children:["Country",":Language"," (ceid)"]}),(0,r.jsxs)(n.td,{children:["Input parameter. Language, such as US",":en",", FR",":fr",". Default: ",(0,r.jsx)(n.code,{children:"US:en"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"topic"}),(0,r.jsx)(n.td,{children:"Topic"}),(0,r.jsxs)(n.td,{children:["Input parameter. One of: ",(0,r.jsx)(n.code,{children:"WORLD"}),", ",(0,r.jsx)(n.code,{children:"NATION"}),", ",(0,r.jsx)(n.code,{children:"BUSINESS"}),", ",(0,r.jsx)(n.code,{children:"TECHNOLOGY"}),", ",(0,r.jsx)(n.code,{children:"ENTERTAINMENT"}),", ",(0,r.jsx)(n.code,{children:"SCIENCE"}),", ",(0,r.jsx)(n.code,{children:"SPORTS"}),", ",(0,r.jsx)(n.code,{children:"HEALTH"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"location"}),(0,r.jsx)(n.td,{children:"Location (Geo)"}),(0,r.jsx)(n.td,{children:"Input parameter. City, state, or country for location-based news. Leave blank for keyword search."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"timeout"}),(0,r.jsx)(n.td,{children:"Timeout"}),(0,r.jsx)(n.td,{children:"Input parameter. Timeout for the request in seconds."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"articles"}),(0,r.jsx)(n.td,{children:"News Articles"}),(0,r.jsxs)(n.td,{children:["Output parameter. A ",(0,r.jsx)(n.code,{children:"DataFrame"})," with the key columns ",(0,r.jsx)(n.code,{children:"title"}),", ",(0,r.jsx)(n.code,{children:"link"}),", ",(0,r.jsx)(n.code,{children:"published"})," and ",(0,r.jsx)(n.code,{children:"summary"}),"."]})]})]})]}),"\n",(0,r.jsx)(n.h2,{id:"rss-reader",children:"RSS Reader"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"RSS Reader"})," component fetches and parses RSS feeds from any valid RSS feed URL, and then returns the feed content as a ",(0,r.jsx)(n.a,{href:"/data-types#dataframe",children:(0,r.jsx)(n.code,{children:"DataFrame"})})," containing article titles, links, publication dates, and summaries."]}),"\n",(0,r.jsxs)(n.p,{children:["When used as a standard component in a flow, the ",(0,r.jsx)(n.strong,{children:"RSS Reader"})," component must be connected to a component that accepts ",(0,r.jsx)(n.code,{children:"DataFrame"})," input.\nYou can connect the ",(0,r.jsx)(n.strong,{children:"RSS Reader"})," component directly to a compatible component, or you can use a ",(0,r.jsx)(n.a,{href:"/components-processing",children:"Processing component"})," to convert or extract data of a different type between components."]}),"\n",(0,r.jsxs)(n.p,{children:["When used in ",(0,r.jsx)(n.strong,{children:"Tool Mode"})," with an ",(0,r.jsx)(n.strong,{children:"Agent"})," component, the ",(0,r.jsx)(n.strong,{children:"RSS Reader"})," component can be connected directly to the ",(0,r.jsx)(n.strong,{children:"Agent"})," component's ",(0,r.jsx)(n.strong,{children:"Tools"})," port without converting the data.\nThe agent decides whether to use the ",(0,r.jsx)(n.strong,{children:"RSS Reader"})," component based on the user's query, and it can process the ",(0,r.jsx)(n.code,{children:"DataFrame"})," output directly."]}),"\n",(0,r.jsx)(n.h3,{id:"rss-reader-parameters",children:"RSS Reader parameters"}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Display Name"}),(0,r.jsx)(n.th,{children:"Info"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"rss_url"}),(0,r.jsx)(n.td,{children:"RSS Feed URL"}),(0,r.jsxs)(n.td,{children:["Input parameter. URL of the RSS feed to parse, such as ",(0,r.jsx)(n.code,{children:"https://rss.nytimes.com/services/xml/rss/nyt/HomePage.xml"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"timeout"}),(0,r.jsx)(n.td,{children:"Timeout"}),(0,r.jsxs)(n.td,{children:["Input parameter. Timeout for the RSS feed request in seconds. Default: ",(0,r.jsx)(n.code,{children:"5"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"articles"}),(0,r.jsx)(n.td,{children:"Articles"}),(0,r.jsxs)(n.td,{children:["Output parameter. A ",(0,r.jsx)(n.code,{children:"DataFrame"})," containing the key columns ",(0,r.jsx)(n.code,{children:"title"}),", ",(0,r.jsx)(n.code,{children:"link"}),", ",(0,r.jsx)(n.code,{children:"published"})," and ",(0,r.jsx)(n.code,{children:"summary"}),"."]})]})]})]}),"\n",(0,r.jsx)(n.h2,{id:"sql-database",children:"SQL Database"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"SQL Database"})," component executes SQL queries on ",(0,r.jsx)(n.a,{href:"https://docs.sqlalchemy.org/en/20/",children:"SQLAlchemy-compatible databases"}),".\nIt supports any SQLAlchemy-compatible database, such as PostgreSQL, MySQL, and SQLite."]}),"\n",(0,r.jsxs)(n.p,{children:["For CQL queries, see the ",(0,r.jsxs)(n.a,{href:"/bundles-datastax",children:[(0,r.jsx)(n.strong,{children:"DataStax"})," bundle"]}),"."]}),"\n",(0,r.jsx)(n.h3,{id:"query-an-sql-database-with-natural-language-prompts",children:"Query an SQL database with natural language prompts"}),"\n",(0,r.jsxs)(n.p,{children:["The following example demonstrates how to use the ",(0,r.jsx)(n.strong,{children:"SQL Database"})," component in a flow, and then modify the component to support natural language queries through an ",(0,r.jsx)(n.strong,{children:"Agent"})," component."]}),"\n",(0,r.jsxs)(n.p,{children:["This allows you to use the same ",(0,r.jsx)(n.strong,{children:"SQL Database"})," component for any query, rather than limiting it to a single manually entered query or requiring the user, application, or another component to provide valid SQL syntax as input.\nUsers don't need to master SQL syntax because the ",(0,r.jsx)(n.strong,{children:"Agent"})," component translates the users' natural language prompts into SQL queries, passes the query to the ",(0,r.jsx)(n.strong,{children:"SQL Database"})," component, and then returns the results to the user."]}),"\n",(0,r.jsx)(n.p,{children:"Additionally, input from applications and other components doesn't have to be extracted and transformed to exact SQL queries.\nInstead, you only need to provide enough context for the agent to understand that it should create and run a SQL query according to the incoming data."}),"\n",(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Use your own sample database or create a test database."}),"\n",(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"Create a test SQL database"}),(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Create a database called ",(0,r.jsx)(n.code,{children:"test.db"}),":"]}),"\n",(0,r.jsx)(m.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"sqlite3 ",props:{style:{color:"#FFA657"}}},{content:"test.db",props:{style:{color:"#A5D6FF"}}}]}],lang:"shell"},annotations:[]}]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Add some values to the database:"}),"\n",(0,r.jsx)(m.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"sqlite3 ",props:{style:{color:"#FFA657"}}},{content:'test.db "',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"CREATE TABLE users (",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" id INTEGER PRIMARY KEY,",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" name TEXT,",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" email TEXT,",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" age INTEGER",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:");",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"INSERT INTO users (name, email, age) VALUES",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" ('John Doe', 'john@example.com', 30),",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" ('Jane Smith', 'jane@example.com', 25),",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" ('Bob Johnson', 'bob@example.com', 35);",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:'"',props:{style:{color:"#A5D6FF"}}}]}],lang:"shell"},annotations:[]}]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Verify that the database has been created and contains your data:"}),"\n",(0,r.jsx)(m.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"sqlite3 ",props:{style:{color:"#FFA657"}}},{content:'test.db "SELECT * FROM users;"',props:{style:{color:"#A5D6FF"}}}]}],lang:"shell"},annotations:[]}]}),"\n",(0,r.jsx)(n.p,{children:"The result should list the text data you entered in the previous step:"}),"\n",(0,r.jsx)(m.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"1",props:{style:{color:"#FFA657"}}},{content:"|",props:{style:{color:"#FF7B72"}}},{content:"John ",props:{style:{color:"#FFA657"}}},{content:"Doe",props:{style:{color:"#A5D6FF"}}},{content:"|",props:{style:{color:"#FF7B72"}}},{content:"john@example.com",props:{style:{color:"#FFA657"}}}]},{tokens:[{content:"2",props:{style:{color:"#FFA657"}}},{content:"|",props:{style:{color:"#FF7B72"}}},{content:"Jane ",props:{style:{color:"#FFA657"}}},{content:"Smith",props:{style:{color:"#A5D6FF"}}},{content:"|",props:{style:{color:"#FF7B72"}}},{content:"jane@example.com",props:{style:{color:"#FFA657"}}}]},{tokens:[{content:"3",props:{style:{color:"#FFA657"}}},{content:"|",props:{style:{color:"#FF7B72"}}},{content:"John ",props:{style:{color:"#FFA657"}}},{content:"Doe",props:{style:{color:"#A5D6FF"}}},{content:"|",props:{style:{color:"#FF7B72"}}},{content:"john@example.com",props:{style:{color:"#FFA657"}}}]},{tokens:[{content:"4",props:{style:{color:"#FFA657"}}},{content:"|",props:{style:{color:"#FF7B72"}}},{content:"Jane ",props:{style:{color:"#FFA657"}}},{content:"Smith",props:{style:{color:"#A5D6FF"}}},{content:"|",props:{style:{color:"#FF7B72"}}},{content:"jane@example.com",props:{style:{color:"#FFA657"}}}]}],lang:"shell"},annotations:[]}]}),"\n"]}),"\n"]})]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Add an ",(0,r.jsx)(n.strong,{children:"SQL Database"})," component to your flow."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["In the ",(0,r.jsx)(n.strong,{children:"Database URL"})," field, add the connection string for your database, such as ",(0,r.jsx)(n.code,{children:"sqlite:///test.db"}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["At this point, you can enter an SQL query in the ",(0,r.jsx)(n.strong,{children:"SQL Query"})," field or use the ",(0,r.jsx)(n.a,{href:"/concepts-components#component-ports",children:"port"})," to pass a query from another component, such as a ",(0,r.jsx)(n.strong,{children:"Chat Input"})," component.\nIf you need more space, click ",(0,r.jsx)(i.A,{name:"Expand","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Expand"})," to open a full-screen text field."]}),"\n",(0,r.jsxs)(n.p,{children:["However, to make this component more dynamic in an agentic context, use an ",(0,r.jsx)(n.strong,{children:"Agent"})," component to transform natural language input to SQL queries, as explained in the following steps."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Click the ",(0,r.jsx)(n.strong,{children:"SQL Database"})," component to expose the ",(0,r.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),", and then enable ",(0,r.jsx)(n.strong,{children:"Tool Mode"}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["You can now use this component as a tool for an agent.\nIn ",(0,r.jsx)(n.strong,{children:"Tool Mode"}),", no query is set in the ",(0,r.jsx)(n.strong,{children:"SQL Database"})," component because the agent will generate and send one if it determines that the tool is required to complete the user's request.\nFor more information, see ",(0,r.jsx)(n.a,{href:"/agents-tools",children:"Configure tools for agents"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Add an ",(0,r.jsx)(n.strong,{children:"Agent"})," component to your flow, and then enter your OpenAI API key."]}),"\n",(0,r.jsxs)(n.p,{children:["The default model is an OpenAI model.\nIf you want to use a different model, edit the ",(0,r.jsx)(n.strong,{children:"Model Provider"}),", ",(0,r.jsx)(n.strong,{children:"Model Name"}),", and ",(0,r.jsx)(n.strong,{children:"API Key"})," fields accordingly."]}),"\n",(0,r.jsxs)(n.p,{children:["If you need to execute highly specialized queries, consider selecting a model that is trained for tasks like advanced SQL queries.\nIf your preferred model isn't in the ",(0,r.jsx)(n.strong,{children:"Agent"})," component's built-in model list, set ",(0,r.jsx)(n.strong,{children:"Model Provider"})," to ",(0,r.jsx)(n.strong,{children:"Connect other models"}),", and then connect any ",(0,r.jsx)(n.a,{href:"/components-models",children:"language model component"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Connect the ",(0,r.jsx)(n.strong,{children:"SQL Database"})," component's ",(0,r.jsx)(n.strong,{children:"Toolset"})," output to the ",(0,r.jsx)(n.strong,{children:"Agent"})," component's ",(0,r.jsx)(n.strong,{children:"Tools"})," input."]}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.img,{alt:"SQL Database component connected to an Agent component",src:t(52189).A+"",width:"4000",height:"2400"})}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Click ",(0,r.jsx)(n.strong,{children:"Playground"}),", and then ask the agent a question about the data in your database, such as ",(0,r.jsx)(n.code,{children:"Which users are in my database?"})]}),"\n",(0,r.jsxs)(n.p,{children:["The agent determines that it needs to query the database to answer the question, uses the LLM to generate an SQL query, and then uses the ",(0,r.jsx)(n.strong,{children:"SQL Database"})," component's ",(0,r.jsx)(n.code,{children:"RUN_SQL_QUERY"})," action to run the query on your database.\nFinally, it returns the results in a conversational format, unless you provide instructions to return raw results or a different format."]}),"\n",(0,r.jsx)(n.p,{children:"The following example queried a test database with little data, but with a more robust dataset you could ask more detailed or complex questions."}),"\n",(0,r.jsx)(m.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"Here are the users in your database:",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"1. **John Doe** - Email: john@example.com",props:{}}]},{tokens:[{content:"2. **Jane Smith** - Email: jane@example.com",props:{}}]},{tokens:[{content:"3. **John Doe** - Email: john@example.com",props:{}}]},{tokens:[{content:"4. **Jane Smith** - Email: jane@example.com",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"It seems there are duplicate entries for the users.",props:{}}]}],lang:"text"},annotations:[]}]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.h3,{id:"sql-database-parameters",children:"SQL Database parameters"}),"\n",(0,r.jsx)(l.Ay,{}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Display Name"}),(0,r.jsx)(n.th,{children:"Info"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"database_url"}),(0,r.jsx)(n.td,{children:"Database URL"}),(0,r.jsx)(n.td,{children:"Input parameter. The SQLAlchemy-compatible database connection URL."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"query"}),(0,r.jsx)(n.td,{children:"SQL Query"}),(0,r.jsxs)(n.td,{children:["Input parameter. The SQL query to execute, which can be entered directly, passed in from another component, or, in ",(0,r.jsx)(n.strong,{children:"Tool Mode"}),", automatically provided by an ",(0,r.jsx)(n.strong,{children:"Agent"})," component."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"include_columns"}),(0,r.jsx)(n.td,{children:"Include Columns"}),(0,r.jsx)(n.td,{children:"Input parameter. Whether to include column names in the result. The default is enabled (true)."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"add_error"}),(0,r.jsx)(n.td,{children:"Add Error"}),(0,r.jsx)(n.td,{children:"Input parameter. If enabled, adds any error messages to the result, if any are returned. The default is disabled (false)."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"run_sql_query"}),(0,r.jsx)(n.td,{children:"Result Table"}),(0,r.jsxs)(n.td,{children:["Output parameter. The query results as a ",(0,r.jsx)(n.a,{href:"/data-types#dataframe",children:(0,r.jsx)(n.code,{children:"DataFrame"})}),"."]})]})]})]}),"\n",(0,r.jsx)(n.h2,{id:"url",children:"URL"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"URL"})," component fetches content from one or more URLs, processes the content, and returns it in various formats.\nIt follows links recursively to a given depth, and it supports output in plain text or raw HTML."]}),"\n",(0,r.jsx)(n.h3,{id:"url-parameters",children:"URL parameters"}),"\n",(0,r.jsx)(l.Ay,{}),"\n",(0,r.jsx)(n.p,{children:"Some of the available parameters include the following:"}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Display Name"}),(0,r.jsx)(n.th,{children:"Info"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"urls"}),(0,r.jsx)(n.td,{children:"URLs"}),(0,r.jsxs)(n.td,{children:["Input parameter. One or more URLs to crawl recursively. In the visual editor, click ",(0,r.jsx)(i.A,{name:"Plus","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Add URL"})," to add multiple URLs."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"max_depth"}),(0,r.jsx)(n.td,{children:"Depth"}),(0,r.jsx)(n.td,{children:'Input parameter. Controls link traversal: how many "clicks" away from the initial page the crawler will go. A depth of 1 limits the crawl to the first page at the given URL only. A depth of 2 means the crawler crawls the first page plus each page directly linked from the first page, then stops. This setting exclusively controls link traversal; it doesn\'t limit the number of URL path segments or the domain.'})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"prevent_outside"}),(0,r.jsx)(n.td,{children:"Prevent Outside"}),(0,r.jsx)(n.td,{children:"Input parameter. If enabled, only crawls URLs within the same domain as the root URL. This prevents the crawler from accessing sites outside the given URL's domain, even if they are linked from one of the crawled pages."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"use_async"}),(0,r.jsx)(n.td,{children:"Use Async"}),(0,r.jsx)(n.td,{children:"Input parameter. If enabled, uses asynchronous loading which can be significantly faster but might use more system resources."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"format"}),(0,r.jsx)(n.td,{children:"Output Format"}),(0,r.jsxs)(n.td,{children:["Input parameter. Sets the desired output format as ",(0,r.jsx)(n.strong,{children:"Text"})," or ",(0,r.jsx)(n.strong,{children:"HTML"}),". The default is ",(0,r.jsx)(n.strong,{children:"Text"}),". For more information, see ",(0,r.jsx)(n.a,{href:"#url-output",children:"URL output"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"timeout"}),(0,r.jsx)(n.td,{children:"Timeout"}),(0,r.jsx)(n.td,{children:"Input parameter. Timeout for the request in seconds."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"headers"}),(0,r.jsx)(n.td,{children:"Headers"}),(0,r.jsx)(n.td,{children:"Input parameter. The headers to send with the request if needed for authentication or otherwise."})]})]})]}),"\n",(0,r.jsx)(n.p,{children:"Additional input parameters are available for error handling and encoding."}),"\n",(0,r.jsx)(n.h3,{id:"url-output",children:"URL output"}),"\n",(0,r.jsxs)(n.p,{children:["There are two settings that control the output of the ",(0,r.jsx)(n.strong,{children:"URL"})," component at different stages:"]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Output Format"}),": This optional parameter controls the content extracted from the crawled pages:"]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Text (default)"}),": The component extracts only the text from the HTML of the crawled pages."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"HTML"}),": The component extracts the entire raw HTML content of the crawled pages."]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Output data type"}),": In the component's output field (near the output port) you can select the structure of the outgoing data when it is passed to other components:"]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Extracted Pages"}),": Outputs a ",(0,r.jsx)(n.a,{href:"/data-types#dataframe",children:(0,r.jsx)(n.code,{children:"DataFrame"})})," that breaks the crawled pages into columns for the entire page content (",(0,r.jsx)(n.code,{children:"text"}),") and metadata like ",(0,r.jsx)(n.code,{children:"url"})," and ",(0,r.jsx)(n.code,{children:"title"}),"."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Raw Content"}),": Outputs a ",(0,r.jsx)(n.a,{href:"/data-types#message",children:(0,r.jsx)(n.code,{children:"Message"})})," containing the entire text or HTML from the crawled pages, including metadata, in a single block of text."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["When used as a standard component in a flow, the ",(0,r.jsx)(n.strong,{children:"URL"})," component must be connected to a component that accepts the selected output data type (",(0,r.jsx)(n.code,{children:"DataFrame"})," or ",(0,r.jsx)(n.code,{children:"Message"}),").\nYou can connect the ",(0,r.jsx)(n.strong,{children:"URL"})," component directly to a compatible component, or you can use a ",(0,r.jsxs)(n.a,{href:"/components-processing#type-convert",children:[(0,r.jsx)(n.strong,{children:"Type Convert"})," component"]})," to convert the output to another type before passing the data to other components if the data types aren't directly compatible."]}),"\n",(0,r.jsxs)(n.p,{children:["Processing components like the ",(0,r.jsx)(n.strong,{children:"Type Convert"})," component are useful with the ",(0,r.jsx)(n.strong,{children:"URL"})," component because it can extract a large amount of data from the crawled pages.\nFor example, if you only want to pass specific fields to other components, you can use a ",(0,r.jsxs)(n.a,{href:"/components-processing#parser",children:[(0,r.jsx)(n.strong,{children:"Parser"})," component"]})," to extract only that data from the crawled pages before passing the data to other components."]}),"\n",(0,r.jsxs)(n.p,{children:["When used in ",(0,r.jsx)(n.strong,{children:"Tool Mode"})," with an ",(0,r.jsx)(n.strong,{children:"Agent"})," component, the ",(0,r.jsx)(n.strong,{children:"URL"})," component can be connected directly to the ",(0,r.jsx)(n.strong,{children:"Agent"})," component's ",(0,r.jsx)(n.strong,{children:"Tools"})," port without converting the data.\nThe agent decides whether to use the ",(0,r.jsx)(n.strong,{children:"URL"})," component based on the user's query, and it can process the ",(0,r.jsx)(n.code,{children:"DataFrame"})," or ",(0,r.jsx)(n.code,{children:"Message"})," output directly."]}),"\n",(0,r.jsx)(n.h2,{id:"web-search",children:"Web Search"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"Web Search"})," component performs a basic web search using DuckDuckGo's HTML scraping interface.\nFor other search APIs, see ",(0,r.jsx)(i.A,{name:"Blocks","aria-hidden":"true"})," ",(0,r.jsx)(n.a,{href:"/components-bundle-components",children:(0,r.jsx)(n.strong,{children:"Bundles"})}),"."]}),"\n",(0,r.jsxs)(n.admonition,{type:"important",children:[(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"Web Search"})," component uses web scraping that can be subject to rate limits."]}),(0,r.jsx)(n.p,{children:"For production use, consider using another search component with more robust API support, such as provider-specific bundles."})]}),"\n",(0,r.jsx)(n.h3,{id:"use-the-web-search-component-in-a-flow",children:"Use the Web Search component in a flow"}),"\n",(0,r.jsxs)(n.p,{children:["The following steps demonstrate one way that you can use a ",(0,r.jsx)(n.strong,{children:"Web Search"})," component in a flow:"]}),"\n",(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Create a flow based on the ",(0,r.jsx)(n.strong,{children:"Basic Prompting"})," template."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Add a ",(0,r.jsx)(n.strong,{children:"Web Search"})," component, and then enter a search query, such as ",(0,r.jsx)(n.code,{children:"environmental news"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Add a ",(0,r.jsxs)(n.a,{href:"/components-processing#type-convert",children:[(0,r.jsx)(n.strong,{children:"Type Convert"})," component"]}),", set the ",(0,r.jsx)(n.strong,{children:"Output Type"})," to ",(0,r.jsx)(n.strong,{children:"Message"}),", and then connect the ",(0,r.jsx)(n.strong,{children:"Web Search"})," component's output to the ",(0,r.jsx)(n.strong,{children:"Type Convert"})," component's input."]}),"\n",(0,r.jsxs)(n.p,{children:["By default, the ",(0,r.jsx)(n.strong,{children:"Web Search"})," component outputs a ",(0,r.jsx)(n.code,{children:"DataFrame"}),".\nBecause the ",(0,r.jsx)(n.strong,{children:"Prompt Template"})," component only accepts ",(0,r.jsx)(n.code,{children:"Message"})," data, this conversion is required so that the flow can pass the search results to the ",(0,r.jsx)(n.strong,{children:"Prompt Template"})," component.\nFor more information, see ",(0,r.jsx)(n.a,{href:"#web-search-output",children:"Web Search output"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["In the ",(0,r.jsx)(n.strong,{children:"Prompt Template"})," component's ",(0,r.jsx)(n.strong,{children:"Template"})," field, add a variable like ",(0,r.jsx)(n.code,{children:"{searchresults}"})," or ",(0,r.jsx)(n.code,{children:"{context}"}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["This adds a field to the ",(0,r.jsx)(n.strong,{children:"Prompt Template"})," component that you can use to pass the converted search results to the prompt."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Connect the ",(0,r.jsx)(n.strong,{children:"Type Convert"})," component's output to the new variable field on the ",(0,r.jsx)(n.strong,{children:"Prompt Template"})," component."]}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.img,{alt:"Type convert web search output to chat",src:t(42547).A+"",width:"4000",height:"1826"})}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["In the ",(0,r.jsx)(n.strong,{children:"Language Model"})," component, add your OpenAI API key, or select a different provider and model."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Click ",(0,r.jsx)(n.strong,{children:"Playground"}),", and then enter ",(0,r.jsx)(n.code,{children:"latest news"}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["The LLM processes the request, including the context passed through the ",(0,r.jsx)(n.strong,{children:"Prompt Template"})," component, and then prints the response in the ",(0,r.jsx)(n.strong,{children:"Playground"})," chat interface."]}),"\n",(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"Result"}),(0,r.jsx)(n.p,{children:"The following is an example of a possible response.\nYour response may vary based on the current state of the web, your specific query, the model, and other factors."}),(0,r.jsx)(m.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"Here are some of the latest news articles related to the environment:",props:{}}]},{tokens:[{content:"Ozone Pollution and Global Warming: A recent study highlights that ozone pollution is a significant global environmental concern, threatening human health and crop production while exacerbating global warming. Read more",props:{}}]},{tokens:[{content:"...",props:{}}]}],lang:"text"},annotations:[]}]})]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.h3,{id:"web-search-parameters",children:"Web Search parameters"}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Display Name"}),(0,r.jsx)(n.th,{children:"Info"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"query"}),(0,r.jsx)(n.td,{children:"Search Query"}),(0,r.jsx)(n.td,{children:"Input parameter. Keywords to search for."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"timeout"}),(0,r.jsx)(n.td,{children:"Timeout"}),(0,r.jsxs)(n.td,{children:["Input parameter. Timeout for the web search request in seconds. Default: ",(0,r.jsx)(n.code,{children:"5"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"results"}),(0,r.jsx)(n.td,{children:"Search Results"}),(0,r.jsxs)(n.td,{children:["Output parameter. Returns a ",(0,r.jsx)(n.code,{children:"DataFrame"})," containing ",(0,r.jsx)(n.code,{children:"title"}),", ",(0,r.jsx)(n.code,{children:"links"}),", and ",(0,r.jsx)(n.code,{children:"snippets"}),". For more information, see ",(0,r.jsx)(n.a,{href:"#web-search-output",children:"Web Search output"}),"."]})]})]})]}),"\n",(0,r.jsx)(n.h3,{id:"web-search-output",children:"Web Search output"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"Web Search"})," component outputs a ",(0,r.jsx)(n.a,{href:"/data-types#dataframe",children:(0,r.jsx)(n.code,{children:"DataFrame"})})," containing the key columns ",(0,r.jsx)(n.code,{children:"title"}),", ",(0,r.jsx)(n.code,{children:"links"}),", and ",(0,r.jsx)(n.code,{children:"snippets"}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["When used as a standard component in a flow, the ",(0,r.jsx)(n.strong,{children:"Web Search"})," component must be connected to a component that accepts ",(0,r.jsx)(n.code,{children:"DataFrame"})," input, or you must use a ",(0,r.jsxs)(n.a,{href:"/components-processing#type-convert",children:[(0,r.jsx)(n.strong,{children:"Type Convert"})," component"]})," to convert the output to ",(0,r.jsx)(n.code,{children:"Data"})," or ",(0,r.jsx)(n.code,{children:"Message"})," type before passing the data to other components."]}),"\n",(0,r.jsxs)(n.p,{children:["When used in ",(0,r.jsx)(n.strong,{children:"Tool Mode"})," with an ",(0,r.jsx)(n.strong,{children:"Agent"})," component, the ",(0,r.jsx)(n.strong,{children:"Web Search"})," component can be connected directly to the ",(0,r.jsx)(n.strong,{children:"Agent"})," component's ",(0,r.jsx)(n.strong,{children:"Tools"})," port without converting the data.\nThe agent decides whether to use the ",(0,r.jsx)(n.strong,{children:"Web Search"})," component based on the user's query, and it can process the ",(0,r.jsx)(n.code,{children:"DataFrame"})," output directly."]}),"\n",(0,r.jsx)(n.h2,{id:"webhook",children:"Webhook"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"Webhook"})," component defines a webhook trigger that runs a flow when it receives an HTTP POST request."]}),"\n",(0,r.jsx)(n.h3,{id:"trigger-the-webhook",children:"Trigger the webhook"}),"\n",(0,r.jsxs)(n.p,{children:["When you add a ",(0,r.jsx)(n.strong,{children:"Webhook"})," component to your flow, a ",(0,r.jsx)(n.strong,{children:"Webhook curl"})," tab is added to the flow's ",(0,r.jsxs)(n.a,{href:"/concepts-publish#api-access",children:[(0,r.jsx)(n.strong,{children:"API Access"})," pane"]}),".\nThis tab automatically generates an HTTP POST request code snippet that you can use to trigger your flow through the ",(0,r.jsx)(n.strong,{children:"Webhook"})," component.\nFor example:"]}),"\n",(0,r.jsx)(m.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:"POST ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:' "http://',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_SERVER_ADDRESS",props:{style:{color:"#C9D1D9"}}},{content:"/api/v1/webhook/",props:{style:{color:"#A5D6FF"}}},{content:"$FLOW_ID",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:"'Content-Type: application/json' ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:"'x-api-key: $LANGFLOW_API_KEY' ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -d ",props:{style:{color:"#79C0FF"}}},{content:'\'{"any": "data"}\'',props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,r.jsxs)(n.p,{children:["For more information, see ",(0,r.jsx)(n.a,{href:"/webhook",children:"Trigger flows with webhooks"}),"."]}),"\n",(0,r.jsx)(n.h3,{id:"webhook-parameters",children:"Webhook parameters"}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Display Name"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"data"}),(0,r.jsx)(n.td,{children:"Payload"}),(0,r.jsx)(n.td,{children:"Input parameter. Receives a payload from external systems through HTTP POST requests."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"curl"}),(0,r.jsx)(n.td,{children:"curl"}),(0,r.jsx)(n.td,{children:"Input parameter. The curl command template for making requests to this webhook."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"endpoint"}),(0,r.jsx)(n.td,{children:"Endpoint"}),(0,r.jsx)(n.td,{children:"Input parameter. The endpoint URL where this webhook receives requests."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"output_data"}),(0,r.jsx)(n.td,{children:"Data"}),(0,r.jsxs)(n.td,{children:["Output parameter. The processed data from the webhook input. Returns an empty ",(0,r.jsx)(n.a,{href:"/data-types#data",children:(0,r.jsx)(n.code,{children:"Data"})})," object if no input is provided. If the input isn't valid JSON, the ",(0,r.jsx)(n.strong,{children:"Webhook"})," component wraps it in a ",(0,r.jsx)(n.code,{children:"payload"})," object so that it can be accepted as input to trigger the flow."]})]})]})]}),"\n",(0,r.jsx)(n.h2,{id:"additional-data-components",children:"Additional Data components"}),"\n",(0,r.jsx)(n.p,{children:"Langflow's core components are meant to be generic and support a range of use cases.\nCore components typically aren't limited to a single provider."}),"\n",(0,r.jsxs)(n.p,{children:["If the core components don't meet your needs, you can find provider-specific components in ",(0,r.jsx)(i.A,{name:"Blocks","aria-hidden":"true"})," ",(0,r.jsx)(n.a,{href:"/components-bundle-components",children:(0,r.jsx)(n.strong,{children:"Bundles"})}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["For example, the ",(0,r.jsxs)(n.a,{href:"/bundles-datastax",children:[(0,r.jsx)(n.strong,{children:"DataStax"})," bundle"]})," includes components for CQL queries, and the ",(0,r.jsxs)(n.a,{href:"/bundles-google",children:[(0,r.jsx)(n.strong,{children:"Google"})," bundle"]})," includes components for Google Search APIs."]}),"\n",(0,r.jsx)(n.h2,{id:"legacy-data-components",children:"Legacy Data components"}),"\n","\n",(0,r.jsx)(p.Ay,{}),"\n",(0,r.jsx)(n.p,{children:"The following Data components are in legacy status:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.strong,{children:"Load CSV"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.strong,{children:"Load JSON"})}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["Replace these components with the ",(0,r.jsx)(n.strong,{children:"File"})," component, which supports loading CSV and JSON files, as well as many other file types."]}),"\n",(0,r.jsx)(n.h2,{id:"see-also",children:"See also"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsxs)(n.a,{href:"/bundles-google",children:[(0,r.jsx)(n.strong,{children:"Google"})," bundle"]})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsxs)(n.a,{href:"/integrations-composio",children:[(0,r.jsx)(n.strong,{children:"Composio"})," bundle"]})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"/concepts-file-management",children:"File management"})}),"\n"]})]})}function b(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(y,{...e})}):y(e)}function v(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}},17886:(e,n,t)=>{t.d(n,{A:()=>o});t(96540);var s=t(64058),r=t(74848);function o({name:e,...n}){const t=s[e];return t?(0,r.jsx)(t,{...n}):null}},19365:(e,n,t)=>{t.d(n,{A:()=>a});t(96540);var s=t(18215);const r={tabItem:"tabItem_Ymn6"};var o=t(74848);function a({children:e,hidden:n,className:t}){return(0,o.jsx)("div",{role:"tabpanel",className:(0,s.A)(r.tabItem,t),hidden:n,children:e})}},31929:(e,n,t)=>{t.d(n,{Ay:()=>d,RM:()=>a});var s=t(74848),r=t(28453),o=t(17886);const a=[];function i(e){const n={a:"a",p:"p",strong:"strong",...(0,r.R)(),...e.components};return(0,s.jsxs)(n.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,s.jsx)(o.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Controls"})," in the ",(0,s.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function d(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(i,{...e})}):i(e)}},36813:(e,n,t)=>{t.d(n,{Ay:()=>d,RM:()=>a});var s=t(74848),r=t(28453),o=t(17886);const a=[];function i(e){const n={a:"a",p:"p",strong:"strong",...(0,r.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:["Legacy components are longer supported and can be removed in a future release.\nYou can continue to use them in existing flows, but it is recommended that you replace them with supported components as soon as possible.\nSuggested replacements are included in the ",(0,s.jsx)(n.strong,{children:"Legacy"})," banner on components in your flows.\nThey are also given in release notes and Langflow documentation whenever possible."]}),"\n",(0,s.jsxs)(n.p,{children:["If you aren't sure how to replace a legacy component, ",(0,s.jsx)(o.A,{name:"Search","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Search"})," for components by provider, service, or component name.\nThe component may have been deprecated in favor of a completely new component, a similar component, or a new version of the same component in a different category."]}),"\n",(0,s.jsxs)(n.p,{children:["If there is no obvious replacement, consider whether another component can be adapted to your use case.\nFor example, many ",(0,s.jsx)(o.A,{name:"Component","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Core components"})," provide generic functionality that can support multiple providers and use cases, such as the ",(0,s.jsxs)(n.a,{href:"/components-data#api-request",children:[(0,s.jsx)(n.strong,{children:"API Request"})," component"]}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["If neither of these options are viable, you could use the legacy component's code to create your own custom component, or ",(0,s.jsx)(n.a,{href:"/contributing-github-issues",children:"start a discussion"})," about the legacy component."]}),"\n",(0,s.jsxs)(n.p,{children:["To discourage use of legacy components in new flows, these components are hidden by default.\nIn the visual editor, you can click ",(0,s.jsx)(o.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Component settings"})," to toggle the ",(0,s.jsx)(n.strong,{children:"Legacy"})," filter."]})]})}function d(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(i,{...e})}):i(e)}},40935:(e,n,t)=>{t.d(n,{Ay:()=>i,RM:()=>o});var s=t(74848),r=t(28453);const o=[];function a(e){const n={a:"a",p:"p",strong:"strong",...(0,r.R)(),...e.components};return(0,s.jsxs)(n.p,{children:["If you are running Langflow Desktop on Windows, you must ",(0,s.jsx)(n.a,{href:"https://learn.microsoft.com/en-us/windows/apps/get-started/enable-your-device-for-development#activate-developer-mode",children:"enable Developer Mode"})," to use the Docling components.\nThe location of this setting depends on your Windows OS version.\nFind ",(0,s.jsx)(n.strong,{children:"For developers"}),' in your Windows Settings, or search for "Developer" in the Windows search bar, and then enable ',(0,s.jsx)(n.strong,{children:"Developer mode"}),".\nYou might need to restart your computer or Langflow to apply the change."]})}function i(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(a,{...e})}):a(e)}},42547:(e,n,t)=>{t.d(n,{A:()=>s});const s=t.p+"assets/images/component-type-convert-and-web-search-1eef7b9a7c1a243f4a08d9717728d0e1.png"},52189:(e,n,t)=>{t.d(n,{A:()=>s});const s=t.p+"assets/images/component-sql-database-3d2c985aee2dd9970874cb85e1d2b570.png"},84987:(e,n,t)=>{t.d(n,{A:()=>s});const s=t.p+"assets/images/connect-data-components-to-agent-a8cd8c94d0474ae434aeb5d507a803e8.png"}}]); \ No newline at end of file diff --git a/assets/js/7f7a8893.06889bb2.js b/assets/js/7f7a8893.06889bb2.js deleted file mode 100644 index f2101e508c..0000000000 --- a/assets/js/7f7a8893.06889bb2.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[188],{6944:(e,t,n)=>{n.d(t,{A:()=>s});const s=n.p+"assets/images/component-chat-io-8d114bb5279770d2e3bc8250ec6396ed.png"},16878:(e,t,n)=>{n.r(t),n.d(t,{CH:()=>h,assets:()=>l,chCodeConfig:()=>p,contentTitle:()=>i,default:()=>j,frontMatter:()=>d,metadata:()=>s,toc:()=>u});const s=JSON.parse('{"id":"Components/components-io","title":"Input / Output","description":"Input and output components define where data enters and exits your flow, but they don\'t have identical functionality.","source":"@site/docs/Components/components-io.mdx","sourceDirName":"Components","slug":"/components-io","permalink":"/components-io","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Input / Output","slug":"/components-io"},"sidebar":"docs","previous":{"title":"Components overview","permalink":"/concepts-components"},"next":{"title":"Agents","permalink":"/components-agents"}}');var o=n(74848),r=n(28453),c=n(24754),a=(n(17886),n(31929));const d={title:"Input / Output",slug:"/components-io"},i=void 0,l={},h={annotations:c.hk,Code:c.Cy},p={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},u=[{value:"Chat Input and Output",id:"chat-io",level:2},{value:"Chat Input",id:"chat-input",level:3},{value:"Chat Input parameters",id:"chat-input-parameters",level:4},...a.RM,{value:"Chat Output",id:"chat-output",level:3},{value:"Chat Output parameters",id:"chat-output-parameters",level:4},...a.RM,{value:"Use Chat Input and Output components in a flow",id:"use-chat-input-and-output-components-in-a-flow",level:3},{value:"Send chat input with the Langflow API",id:"send-chat-input-with-the-langflow-api",level:3},{value:"Text Input and Output",id:"text-io",level:2},{value:"Text Input",id:"text-input",level:3},{value:"Text Output",id:"text-output",level:3}];function x(e){const t={a:"a",admonition:"admonition",code:"code",em:"em",h2:"h2",h3:"h3",h4:"h4",img:"img",li:"li",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,r.R)(),...e.components},{Details:s}=t;return h||m("CH",!1),h.Code||m("CH.Code",!0),s||m("Details",!0),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n","\n",(0,o.jsx)(t.p,{children:"Input and output components define where data enters and exits your flow, but they don't have identical functionality."}),"\n",(0,o.jsxs)(t.p,{children:["Specifically, ",(0,o.jsx)(t.strong,{children:"Chat Input and Output"})," components are designed to facilitate conversational interactions where messages are exchanged in a cumulative dialogue.\nThe data handled by these components includes the message text plus additional metadata like senders, session IDs, and timestamps."]}),"\n",(0,o.jsxs)(t.p,{children:["In contrast, ",(0,o.jsx)(t.strong,{children:"Text Input and Output"})," components are designed for simple string input and output that doesn't require the additional context and metadata associated with chat messages.\nThe data handled by these components is pared down to basic text strings."]}),"\n",(0,o.jsx)(t.h2,{id:"chat-io",children:"Chat Input and Output"}),"\n",(0,o.jsx)(t.admonition,{type:"important",children:(0,o.jsxs)(t.p,{children:[(0,o.jsx)(t.strong,{children:"Chat Input and Output"})," components are required to chat with your flow in the ",(0,o.jsx)(t.strong,{children:"Playground"}),".\nFor more information, see ",(0,o.jsx)(t.a,{href:"/concepts-playground",children:"Test flows in the Playground"}),"."]})}),"\n",(0,o.jsxs)(t.p,{children:[(0,o.jsx)(t.strong,{children:"Chat Input and Output"})," components are designed to handle conversational interactions in Langflow."]}),"\n",(0,o.jsx)(t.h3,{id:"chat-input",children:"Chat Input"}),"\n",(0,o.jsxs)(t.p,{children:["The ",(0,o.jsx)(t.strong,{children:"Chat Input"})," component accepts text and file input, such as a chat message or a file.\nThis data is passed to other components as ",(0,o.jsxs)(t.a,{href:"/data-types",children:[(0,o.jsx)(t.code,{children:"Message"})," data"]})," containing the provided input as well as associated chat metadata, such as the sender, session ID, timestamp, and file attachments."]}),"\n",(0,o.jsxs)(t.p,{children:["Initial input should ",(0,o.jsx)(t.em,{children:"not"})," be provided as a complete ",(0,o.jsx)(t.code,{children:"Message"})," object because the ",(0,o.jsx)(t.strong,{children:"Chat Input"})," component constructs the ",(0,o.jsx)(t.code,{children:"Message"})," object that is then passed to other components in the flow."]}),"\n",(0,o.jsx)(t.h4,{id:"chat-input-parameters",children:"Chat Input parameters"}),"\n",(0,o.jsx)(a.Ay,{}),"\n",(0,o.jsxs)(t.table,{children:[(0,o.jsx)(t.thead,{children:(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.th,{children:"Name"}),(0,o.jsx)(t.th,{children:"Display Name"}),(0,o.jsx)(t.th,{children:"Info"})]})}),(0,o.jsxs)(t.tbody,{children:[(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"input_value"}),(0,o.jsx)(t.td,{children:"Input Text"}),(0,o.jsx)(t.td,{children:"Input parameter. The message text string to be passed as input."})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"sender"}),(0,o.jsx)(t.td,{children:"Sender Type"}),(0,o.jsxs)(t.td,{children:["Input parameter. Identifies the sender as either ",(0,o.jsx)(t.code,{children:"User"})," or ",(0,o.jsx)(t.code,{children:"Language Model"}),"."]})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"sender_name"}),(0,o.jsx)(t.td,{children:"Sender Name"}),(0,o.jsxs)(t.td,{children:["Input parameter. The name of the sender. If unspecified, defaults to ",(0,o.jsx)(t.code,{children:"User"})," or ",(0,o.jsx)(t.code,{children:"Language Model"}),"."]})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"session_id"}),(0,o.jsx)(t.td,{children:"Session ID"}),(0,o.jsx)(t.td,{children:"Input parameter. The unique identifier for the chat session. If empty, the current session ID parameter is used."})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"files"}),(0,o.jsx)(t.td,{children:"Files"}),(0,o.jsx)(t.td,{children:"Input parameter. The files to be sent with the message."})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"background_color"}),(0,o.jsx)(t.td,{children:"Background Color"}),(0,o.jsx)(t.td,{children:"Input parameter. The background color of the icon."})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"chat_icon"}),(0,o.jsx)(t.td,{children:"Icon"}),(0,o.jsx)(t.td,{children:"Input parameter. The icon of the message."})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"should_store_message"}),(0,o.jsx)(t.td,{children:"Store Messages"}),(0,o.jsx)(t.td,{children:"Input parameter. Whether to store the message in chat history."})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"text_color"}),(0,o.jsx)(t.td,{children:"Text Color"}),(0,o.jsx)(t.td,{children:"Input parameter. The text color of the name."})]})]})]}),"\n",(0,o.jsxs)(t.p,{children:["For information about the resulting ",(0,o.jsx)(t.code,{children:"Message"})," object, including input parameters that are directly mapped to ",(0,o.jsx)(t.code,{children:"Message"})," attributes, see ",(0,o.jsxs)(t.a,{href:"/data-types#message",children:[(0,o.jsx)(t.code,{children:"Message"})," data"]}),"."]}),"\n",(0,o.jsxs)(s,{children:[(0,o.jsx)("summary",{children:"Message method for Chat Input"}),(0,o.jsxs)(t.p,{children:["The ",(0,o.jsx)(t.code,{children:"ChatInput"})," class provides an asynchronous method to create and store a ",(0,o.jsx)(t.code,{children:"Message"})," object based on the input parameters.\nThe ",(0,o.jsx)(t.code,{children:"Message"})," object is created in the ",(0,o.jsx)(t.code,{children:"message_response"})," method of the ",(0,o.jsx)(t.code,{children:"ChatInput"})," class using the ",(0,o.jsx)(t.code,{children:"Message.create()"})," factory method."]}),(0,o.jsx)(h.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"message ",props:{style:{color:"#C9D1D9"}}},{content:"= await",props:{style:{color:"#FF7B72"}}},{content:" Message.create(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" text",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"self",props:{style:{color:"#79C0FF"}}},{content:".input_value,",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" sender",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"self",props:{style:{color:"#79C0FF"}}},{content:".sender,",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" sender_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"self",props:{style:{color:"#79C0FF"}}},{content:".sender_name,",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" session_id",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"self",props:{style:{color:"#79C0FF"}}},{content:".session_id,",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" files",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"self",props:{style:{color:"#79C0FF"}}},{content:".files,",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" properties",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"{",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "background_color"',props:{style:{color:"#A5D6FF"}}},{content:": background_color,",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "text_color"',props:{style:{color:"#A5D6FF"}}},{content:": text_color,",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "icon"',props:{style:{color:"#A5D6FF"}}},{content:": icon,",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" },",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:")",props:{style:{color:"#C9D1D9"}}}]}],lang:"python"},annotations:[]}]})]}),"\n",(0,o.jsx)(t.h3,{id:"chat-output",children:"Chat Output"}),"\n",(0,o.jsxs)(t.p,{children:["The ",(0,o.jsx)(t.strong,{children:"Chat Output"})," component ingests ",(0,o.jsx)(t.code,{children:"Message"}),", ",(0,o.jsx)(t.code,{children:"Data"}),", or ",(0,o.jsx)(t.code,{children:"DataFrame"})," data from other components, transforms it into ",(0,o.jsx)(t.code,{children:"Message"})," data if needed, and then emits the final output as a chat message.\nFor information about these data types, see ",(0,o.jsx)(t.a,{href:"/data-types",children:"Use Langflow data types"}),"."]}),"\n",(0,o.jsxs)(t.p,{children:["In the ",(0,o.jsx)(t.strong,{children:"Playground"}),", chat output is limited to the parts of the ",(0,o.jsx)(t.code,{children:"Message"})," object that are relevant to the chat interface, such as the text response, sender name, and file attachments.\nTo see the metadata associated with a chat message, inspect the message logs in the ",(0,o.jsx)(t.strong,{children:"Playground"}),"."]}),"\n",(0,o.jsxs)(t.p,{children:["When using the Langflow API, the API response includes the ",(0,o.jsx)(t.strong,{children:"Chat Output"})," ",(0,o.jsx)(t.code,{children:"Message"})," object along with other response data from the flow run.\nLangflow API responses can be extremely verbose, so your applications must include code to extract relevant data from the response to return to the user.\nFor an example, see the ",(0,o.jsx)(t.a,{href:"/get-started-quickstart",children:"Langflow quickstart"}),"."]}),"\n",(0,o.jsx)(t.h4,{id:"chat-output-parameters",children:"Chat Output parameters"}),"\n",(0,o.jsx)(a.Ay,{}),"\n",(0,o.jsxs)(t.table,{children:[(0,o.jsx)(t.thead,{children:(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.th,{children:"Name"}),(0,o.jsx)(t.th,{children:"Display Name"}),(0,o.jsx)(t.th,{children:"Info"})]})}),(0,o.jsxs)(t.tbody,{children:[(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"input_value"}),(0,o.jsx)(t.td,{children:"Inputs"}),(0,o.jsx)(t.td,{children:"Input parameter. The message text string to be passed as output."})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"should_store_message"}),(0,o.jsx)(t.td,{children:"Store Messages"}),(0,o.jsx)(t.td,{children:"Input parameter. Whether to store the message in chat history."})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"sender"}),(0,o.jsx)(t.td,{children:"Sender Type"}),(0,o.jsxs)(t.td,{children:["Input parameter. Identifies the sender as either ",(0,o.jsx)(t.code,{children:"User"})," or ",(0,o.jsx)(t.code,{children:"Language Model"}),"."]})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"sender_name"}),(0,o.jsx)(t.td,{children:"Sender Name"}),(0,o.jsxs)(t.td,{children:["Input parameter. The name of the sender. If unspecified, defaults to ",(0,o.jsx)(t.code,{children:"User"})," or ",(0,o.jsx)(t.code,{children:"Language Model"}),"."]})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"session_id"}),(0,o.jsx)(t.td,{children:"Session ID"}),(0,o.jsx)(t.td,{children:"Input parameter. The unique identifier for the chat session. If empty, the current session ID parameter is used."})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"data_template"}),(0,o.jsx)(t.td,{children:"Data Template"}),(0,o.jsxs)(t.td,{children:["Input parameter. The template to convert ",(0,o.jsxs)(t.a,{href:"/data-types#data",children:[(0,o.jsx)(t.code,{children:"Data"})," input"]})," to ",(0,o.jsx)(t.code,{children:"text"}),". If empty, it is dynamically set to the ",(0,o.jsx)(t.code,{children:"Data"})," object's ",(0,o.jsx)(t.code,{children:"text"})," key."]})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"background_color"}),(0,o.jsx)(t.td,{children:"Background Color"}),(0,o.jsx)(t.td,{children:"Input parameter. The background color of the icon."})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"chat_icon"}),(0,o.jsx)(t.td,{children:"Icon"}),(0,o.jsx)(t.td,{children:"Input parameter. The icon of the message."})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"text_color"}),(0,o.jsx)(t.td,{children:"Text Color"}),(0,o.jsx)(t.td,{children:"Input parameter. The text color of the name."})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"clean_data"}),(0,o.jsx)(t.td,{children:"Basic Clean Data"}),(0,o.jsxs)(t.td,{children:["Input parameter. When enabled, ",(0,o.jsxs)(t.a,{href:"/data-types#dataframe",children:[(0,o.jsx)(t.code,{children:"DataFrame"})," input"]})," is cleaned when converted to text. Cleaning removes empty rows, empty lines in cells, and multiple newlines."]})]})]})]}),"\n",(0,o.jsxs)(t.p,{children:["For information about the resulting ",(0,o.jsx)(t.code,{children:"Message"})," object, including input parameters that are directly mapped to ",(0,o.jsx)(t.code,{children:"Message"})," attributes, see ",(0,o.jsxs)(t.a,{href:"/data-types#message",children:[(0,o.jsx)(t.code,{children:"Message"})," data"]}),"."]}),"\n",(0,o.jsx)(t.h3,{id:"use-chat-input-and-output-components-in-a-flow",children:"Use Chat Input and Output components in a flow"}),"\n",(0,o.jsxs)(t.p,{children:["To use the ",(0,o.jsx)(t.strong,{children:"Chat Input"})," and ",(0,o.jsx)(t.strong,{children:"Chat Output"})," components in a flow, connect them to components that accept or emit ",(0,o.jsxs)(t.a,{href:"/data-types#message",children:[(0,o.jsx)(t.code,{children:"Message"})," data"]}),"."]}),"\n",(0,o.jsxs)(t.p,{children:["For example, the following flow connects ",(0,o.jsx)(t.strong,{children:"Chat Input"})," and ",(0,o.jsx)(t.strong,{children:"Chat Output"})," to a ",(0,o.jsx)(t.strong,{children:"Language Model"})," component, creating a simple LLM-based chat flow."]}),"\n",(0,o.jsx)(t.p,{children:(0,o.jsx)(t.img,{alt:"Chat Input and Output components connected to an OpenAI component",src:n(6944).A+"",width:"3548",height:"1944"})}),"\n",(0,o.jsxs)(t.admonition,{type:"tip",children:[(0,o.jsxs)(t.p,{children:["For detailed examples of ",(0,o.jsx)(t.strong,{children:"Chat Input and Output"})," components in flows, see the following:"]}),(0,o.jsxs)(t.ul,{children:["\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.a,{href:"/get-started-quickstart",children:"Langflow quickstart"}),": Create and run a basic agent flow."]}),"\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.strong,{children:"Basic Prompting"})," template: Create an LLM-based chat flow that accepts chat input as well as a prompt with additional instructions for the LLM. Many other Langflow templates also use ",(0,o.jsx)(t.strong,{children:"Chat Input and Output"})," components."]}),"\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.a,{href:"/agent-tutorial",children:"Connect applications to agents"}),": Explore more advanced concepts around agent flows and prompting, including triggering agent flows from external applications."]}),"\n"]})]}),"\n",(0,o.jsx)(t.h3,{id:"send-chat-input-with-the-langflow-api",children:"Send chat input with the Langflow API"}),"\n",(0,o.jsxs)(t.p,{children:["You can use the Langflow API to run a flow by sending input to a ",(0,o.jsx)(t.strong,{children:"Chat Input"})," component:"]}),"\n",(0,o.jsx)(h.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"--request ",props:{style:{color:"#79C0FF"}}},{content:"POST ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" --url ",props:{style:{color:"#79C0FF"}}},{content:'"http://',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_SERVER_ADDRESS",props:{style:{color:"#C9D1D9"}}},{content:"/api/v1/run/",props:{style:{color:"#A5D6FF"}}},{content:"$FLOW_ID",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" --header ",props:{style:{color:"#79C0FF"}}},{content:'"Content-Type: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" --header ",props:{style:{color:"#79C0FF"}}},{content:'"x-api-key: ',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" --data ",props:{style:{color:"#79C0FF"}}},{content:"'{",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "input_value": "What\'s the recommended way to install Docker on Mac M1?",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "output_type": "chat",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "input_type": "chat"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"}'",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,o.jsxs)(t.p,{children:["When triggering flows with the Langflow API, the payload must contain the values for the ",(0,o.jsx)(t.strong,{children:"Chat Input"})," component's input parameters, such as ",(0,o.jsx)(t.code,{children:"input_value"}),"."]}),"\n",(0,o.jsxs)(t.p,{children:["Not all parameters need to be specified in the request.\nFor example, ",(0,o.jsx)(t.code,{children:"session_id"})," uses the flow's default session ID if omitted.\nIf you want to use a custom session ID, include ",(0,o.jsx)(t.code,{children:"session_id"})," in your request:"]}),"\n",(0,o.jsx)(h.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"--request ",props:{style:{color:"#79C0FF"}}},{content:"POST ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" --url ",props:{style:{color:"#79C0FF"}}},{content:'"http://',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_SERVER_ADDRESS",props:{style:{color:"#C9D1D9"}}},{content:"/api/v1/run/",props:{style:{color:"#A5D6FF"}}},{content:"$FLOW_ID",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" --header ",props:{style:{color:"#79C0FF"}}},{content:'"Content-Type: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" --header ",props:{style:{color:"#79C0FF"}}},{content:'"x-api-key: ',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" --data ",props:{style:{color:"#79C0FF"}}},{content:"'{",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "input_value": "Whats the recommended way to install Docker on Mac M1",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "session_id": "$USER_ID",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "output_type": "chat",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "input_type": "chat"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"}'",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,o.jsxs)(t.p,{children:["For more information, see ",(0,o.jsx)(t.a,{href:"/concepts-publish",children:"Trigger flows with the Langflow API"}),"."]}),"\n",(0,o.jsx)(t.h2,{id:"text-io",children:"Text Input and Output"}),"\n",(0,o.jsxs)(t.admonition,{type:"important",children:[(0,o.jsxs)(t.p,{children:[(0,o.jsx)(t.strong,{children:"Text Input and Output"})," components aren't supported in the ",(0,o.jsx)(t.strong,{children:"Playground"}),".\nBecause the data isn't formatted as a chat message, the data doesn't appear in the ",(0,o.jsx)(t.strong,{children:"Playground"}),", and you can't chat with your flow in the ",(0,o.jsx)(t.strong,{children:"Playground"}),"."]}),(0,o.jsxs)(t.p,{children:["If you want to chat with a flow in the ",(0,o.jsx)(t.strong,{children:"Playground"}),", you must use the ",(0,o.jsxs)(t.a,{href:"#chat-io",children:[(0,o.jsx)(t.strong,{children:"Chat Input and Output"})," components"]}),"."]})]}),"\n",(0,o.jsxs)(t.p,{children:[(0,o.jsx)(t.strong,{children:"Text Input and Output"})," components are designed for flows that ingest or emit simple text strings.\nThese components don't support full conversational interactions."]}),"\n",(0,o.jsxs)(t.p,{children:["Passing chat-like metadata to a ",(0,o.jsx)(t.strong,{children:"Text Input and Output"})," component doesn't change the component's behavior; the result is still a simple text string."]}),"\n",(0,o.jsx)(t.h3,{id:"text-input",children:"Text Input"}),"\n",(0,o.jsxs)(t.p,{children:["The ",(0,o.jsx)(t.strong,{children:"Text Input"})," component accepts a text string input that is passed to other components as ",(0,o.jsxs)(t.a,{href:"/data-types",children:[(0,o.jsx)(t.code,{children:"Message"})," data"]})," containing only the provided input text string in the ",(0,o.jsx)(t.code,{children:"text"})," attribute."]}),"\n",(0,o.jsxs)(t.p,{children:["It accepts only ",(0,o.jsx)(t.strong,{children:"Text"})," (",(0,o.jsx)(t.code,{children:"input_value"}),"), which is the text supplied as input to the component.\nThis can be entered directly into the component or passed as ",(0,o.jsx)(t.code,{children:"Message"})," data from other components."]}),"\n",(0,o.jsxs)(t.p,{children:["Initial input ",(0,o.jsx)(t.em,{children:"shouldn't"})," be provided as a complete ",(0,o.jsx)(t.code,{children:"Message"})," object because the ",(0,o.jsx)(t.strong,{children:"Text Input"})," component constructs the ",(0,o.jsx)(t.code,{children:"Message"})," object that is then passed to other components in the flow."]}),"\n",(0,o.jsx)(t.h3,{id:"text-output",children:"Text Output"}),"\n",(0,o.jsxs)(t.p,{children:["The ",(0,o.jsx)(t.strong,{children:"Text Output"})," component ingests ",(0,o.jsxs)(t.a,{href:"/data-types#message",children:[(0,o.jsx)(t.code,{children:"Message"})," data"]})," from other components, emitting only the ",(0,o.jsx)(t.code,{children:"text"})," attribute in a simplified ",(0,o.jsx)(t.code,{children:"Message"})," object."]}),"\n",(0,o.jsxs)(t.p,{children:["It accepts only ",(0,o.jsx)(t.strong,{children:"Text"})," (",(0,o.jsx)(t.code,{children:"input_value"}),"), which is the text to be ingested and output as a string.\nThis can be entered directly into the component or passed as ",(0,o.jsx)(t.code,{children:"Message"})," data from other components."]})]})}function j(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,o.jsx)(t,{...e,children:(0,o.jsx)(x,{...e})}):x(e)}function m(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}},17886:(e,t,n)=>{n.d(t,{A:()=>r});n(96540);var s=n(64058),o=n(74848);function r({name:e,...t}){const n=s[e];return n?(0,o.jsx)(n,{...t}):null}},31929:(e,t,n)=>{n.d(t,{Ay:()=>d,RM:()=>c});var s=n(74848),o=n(28453),r=n(17886);const c=[];function a(e){const t={a:"a",p:"p",strong:"strong",...(0,o.R)(),...e.components};return(0,s.jsxs)(t.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,s.jsx)(r.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,s.jsx)(t.strong,{children:"Controls"})," in the ",(0,s.jsx)(t.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function d(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(a,{...e})}):a(e)}}}]); \ No newline at end of file diff --git a/assets/js/7f7a8893.ab062521.js b/assets/js/7f7a8893.ab062521.js new file mode 100644 index 0000000000..b5bec6d21f --- /dev/null +++ b/assets/js/7f7a8893.ab062521.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[188],{6944:(e,t,n)=>{n.d(t,{A:()=>s});const s=n.p+"assets/images/component-chat-io-8d114bb5279770d2e3bc8250ec6396ed.png"},16878:(e,t,n)=>{n.r(t),n.d(t,{CH:()=>h,assets:()=>l,chCodeConfig:()=>p,contentTitle:()=>i,default:()=>j,frontMatter:()=>d,metadata:()=>s,toc:()=>u});const s=JSON.parse('{"id":"Components/components-io","title":"Input / Output","description":"Input and output components define where data enters and exits your flow, but they don\'t have identical functionality.","source":"@site/docs/Components/components-io.mdx","sourceDirName":"Components","slug":"/components-io","permalink":"/components-io","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Input / Output","slug":"/components-io"},"sidebar":"docs","previous":{"title":"Components overview","permalink":"/concepts-components"},"next":{"title":"Agents","permalink":"/components-agents"}}');var o=n(74848),r=n(28453),c=n(24754),a=(n(17886),n(31929));const d={title:"Input / Output",slug:"/components-io"},i=void 0,l={},h={annotations:c.hk,Code:c.Cy},p={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},u=[{value:"Chat Input and Output",id:"chat-io",level:2},{value:"Chat Input",id:"chat-input",level:3},{value:"Chat Input parameters",id:"chat-input-parameters",level:4},...a.RM,{value:"Chat Output",id:"chat-output",level:3},{value:"Chat Output parameters",id:"chat-output-parameters",level:4},...a.RM,{value:"Use Chat Input and Output components in a flow",id:"use-chat-input-and-output-components-in-a-flow",level:3},{value:"Send chat input with the Langflow API",id:"send-chat-input-with-the-langflow-api",level:3},{value:"Text Input and Output",id:"text-io",level:2},{value:"Text Input",id:"text-input",level:3},{value:"Text Output",id:"text-output",level:3}];function x(e){const t={a:"a",admonition:"admonition",code:"code",em:"em",h2:"h2",h3:"h3",h4:"h4",img:"img",li:"li",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,r.R)(),...e.components},{Details:s}=t;return h||m("CH",!1),h.Code||m("CH.Code",!0),s||m("Details",!0),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n","\n",(0,o.jsx)(t.p,{children:"Input and output components define where data enters and exits your flow, but they don't have identical functionality."}),"\n",(0,o.jsxs)(t.p,{children:["Specifically, ",(0,o.jsx)(t.strong,{children:"Chat Input and Output"})," components are designed to facilitate conversational interactions where messages are exchanged in a cumulative dialogue.\nThe data handled by these components includes the message text plus additional metadata like senders, session IDs, and timestamps."]}),"\n",(0,o.jsxs)(t.p,{children:["In contrast, ",(0,o.jsx)(t.strong,{children:"Text Input and Output"})," components are designed for simple string input and output that doesn't require the additional context and metadata associated with chat messages.\nThe data handled by these components is pared down to basic text strings."]}),"\n",(0,o.jsx)(t.h2,{id:"chat-io",children:"Chat Input and Output"}),"\n",(0,o.jsx)(t.admonition,{type:"warning",children:(0,o.jsxs)(t.p,{children:[(0,o.jsx)(t.strong,{children:"Chat Input and Output"})," components are required to chat with your flow in the ",(0,o.jsx)(t.strong,{children:"Playground"}),".\nFor more information, see ",(0,o.jsx)(t.a,{href:"/concepts-playground",children:"Test flows in the Playground"}),"."]})}),"\n",(0,o.jsxs)(t.p,{children:[(0,o.jsx)(t.strong,{children:"Chat Input and Output"})," components are designed to handle conversational interactions in Langflow."]}),"\n",(0,o.jsx)(t.h3,{id:"chat-input",children:"Chat Input"}),"\n",(0,o.jsxs)(t.p,{children:["The ",(0,o.jsx)(t.strong,{children:"Chat Input"})," component accepts text and file input, such as a chat message or a file.\nThis data is passed to other components as ",(0,o.jsxs)(t.a,{href:"/data-types",children:[(0,o.jsx)(t.code,{children:"Message"})," data"]})," containing the provided input as well as associated chat metadata, such as the sender, session ID, timestamp, and file attachments."]}),"\n",(0,o.jsxs)(t.p,{children:["Initial input should ",(0,o.jsx)(t.em,{children:"not"})," be provided as a complete ",(0,o.jsx)(t.code,{children:"Message"})," object because the ",(0,o.jsx)(t.strong,{children:"Chat Input"})," component constructs the ",(0,o.jsx)(t.code,{children:"Message"})," object that is then passed to other components in the flow."]}),"\n",(0,o.jsx)(t.h4,{id:"chat-input-parameters",children:"Chat Input parameters"}),"\n",(0,o.jsx)(a.Ay,{}),"\n",(0,o.jsxs)(t.table,{children:[(0,o.jsx)(t.thead,{children:(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.th,{children:"Name"}),(0,o.jsx)(t.th,{children:"Display Name"}),(0,o.jsx)(t.th,{children:"Info"})]})}),(0,o.jsxs)(t.tbody,{children:[(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"input_value"}),(0,o.jsx)(t.td,{children:"Input Text"}),(0,o.jsx)(t.td,{children:"Input parameter. The message text string to be passed as input."})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"sender"}),(0,o.jsx)(t.td,{children:"Sender Type"}),(0,o.jsxs)(t.td,{children:["Input parameter. Identifies the sender as either ",(0,o.jsx)(t.code,{children:"User"})," or ",(0,o.jsx)(t.code,{children:"Language Model"}),"."]})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"sender_name"}),(0,o.jsx)(t.td,{children:"Sender Name"}),(0,o.jsxs)(t.td,{children:["Input parameter. The name of the sender. If unspecified, defaults to ",(0,o.jsx)(t.code,{children:"User"})," or ",(0,o.jsx)(t.code,{children:"Language Model"}),"."]})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"session_id"}),(0,o.jsx)(t.td,{children:"Session ID"}),(0,o.jsx)(t.td,{children:"Input parameter. The unique identifier for the chat session. If empty, the current session ID parameter is used."})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"files"}),(0,o.jsx)(t.td,{children:"Files"}),(0,o.jsx)(t.td,{children:"Input parameter. The files to be sent with the message."})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"background_color"}),(0,o.jsx)(t.td,{children:"Background Color"}),(0,o.jsx)(t.td,{children:"Input parameter. The background color of the icon."})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"chat_icon"}),(0,o.jsx)(t.td,{children:"Icon"}),(0,o.jsx)(t.td,{children:"Input parameter. The icon of the message."})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"should_store_message"}),(0,o.jsx)(t.td,{children:"Store Messages"}),(0,o.jsx)(t.td,{children:"Input parameter. Whether to store the message in chat history."})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"text_color"}),(0,o.jsx)(t.td,{children:"Text Color"}),(0,o.jsx)(t.td,{children:"Input parameter. The text color of the name."})]})]})]}),"\n",(0,o.jsxs)(t.p,{children:["For information about the resulting ",(0,o.jsx)(t.code,{children:"Message"})," object, including input parameters that are directly mapped to ",(0,o.jsx)(t.code,{children:"Message"})," attributes, see ",(0,o.jsxs)(t.a,{href:"/data-types#message",children:[(0,o.jsx)(t.code,{children:"Message"})," data"]}),"."]}),"\n",(0,o.jsxs)(s,{children:[(0,o.jsx)("summary",{children:"Message method for Chat Input"}),(0,o.jsxs)(t.p,{children:["The ",(0,o.jsx)(t.code,{children:"ChatInput"})," class provides an asynchronous method to create and store a ",(0,o.jsx)(t.code,{children:"Message"})," object based on the input parameters.\nThe ",(0,o.jsx)(t.code,{children:"Message"})," object is created in the ",(0,o.jsx)(t.code,{children:"message_response"})," method of the ",(0,o.jsx)(t.code,{children:"ChatInput"})," class using the ",(0,o.jsx)(t.code,{children:"Message.create()"})," factory method."]}),(0,o.jsx)(h.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"message ",props:{style:{color:"#C9D1D9"}}},{content:"= await",props:{style:{color:"#FF7B72"}}},{content:" Message.create(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" text",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"self",props:{style:{color:"#79C0FF"}}},{content:".input_value,",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" sender",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"self",props:{style:{color:"#79C0FF"}}},{content:".sender,",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" sender_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"self",props:{style:{color:"#79C0FF"}}},{content:".sender_name,",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" session_id",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"self",props:{style:{color:"#79C0FF"}}},{content:".session_id,",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" files",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"self",props:{style:{color:"#79C0FF"}}},{content:".files,",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" properties",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"{",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "background_color"',props:{style:{color:"#A5D6FF"}}},{content:": background_color,",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "text_color"',props:{style:{color:"#A5D6FF"}}},{content:": text_color,",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "icon"',props:{style:{color:"#A5D6FF"}}},{content:": icon,",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" },",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:")",props:{style:{color:"#C9D1D9"}}}]}],lang:"python"},annotations:[]}]})]}),"\n",(0,o.jsx)(t.h3,{id:"chat-output",children:"Chat Output"}),"\n",(0,o.jsxs)(t.p,{children:["The ",(0,o.jsx)(t.strong,{children:"Chat Output"})," component ingests ",(0,o.jsx)(t.code,{children:"Message"}),", ",(0,o.jsx)(t.code,{children:"Data"}),", or ",(0,o.jsx)(t.code,{children:"DataFrame"})," data from other components, transforms it into ",(0,o.jsx)(t.code,{children:"Message"})," data if needed, and then emits the final output as a chat message.\nFor information about these data types, see ",(0,o.jsx)(t.a,{href:"/data-types",children:"Use Langflow data types"}),"."]}),"\n",(0,o.jsxs)(t.p,{children:["In the ",(0,o.jsx)(t.strong,{children:"Playground"}),", chat output is limited to the parts of the ",(0,o.jsx)(t.code,{children:"Message"})," object that are relevant to the chat interface, such as the text response, sender name, and file attachments.\nTo see the metadata associated with a chat message, inspect the message logs in the ",(0,o.jsx)(t.strong,{children:"Playground"}),"."]}),"\n",(0,o.jsxs)(t.p,{children:["When using the Langflow API, the API response includes the ",(0,o.jsx)(t.strong,{children:"Chat Output"})," ",(0,o.jsx)(t.code,{children:"Message"})," object along with other response data from the flow run.\nLangflow API responses can be extremely verbose, so your applications must include code to extract relevant data from the response to return to the user.\nFor an example, see the ",(0,o.jsx)(t.a,{href:"/get-started-quickstart",children:"Langflow quickstart"}),"."]}),"\n",(0,o.jsx)(t.h4,{id:"chat-output-parameters",children:"Chat Output parameters"}),"\n",(0,o.jsx)(a.Ay,{}),"\n",(0,o.jsxs)(t.table,{children:[(0,o.jsx)(t.thead,{children:(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.th,{children:"Name"}),(0,o.jsx)(t.th,{children:"Display Name"}),(0,o.jsx)(t.th,{children:"Info"})]})}),(0,o.jsxs)(t.tbody,{children:[(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"input_value"}),(0,o.jsx)(t.td,{children:"Inputs"}),(0,o.jsx)(t.td,{children:"Input parameter. The message text string to be passed as output."})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"should_store_message"}),(0,o.jsx)(t.td,{children:"Store Messages"}),(0,o.jsx)(t.td,{children:"Input parameter. Whether to store the message in chat history."})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"sender"}),(0,o.jsx)(t.td,{children:"Sender Type"}),(0,o.jsxs)(t.td,{children:["Input parameter. Identifies the sender as either ",(0,o.jsx)(t.code,{children:"User"})," or ",(0,o.jsx)(t.code,{children:"Language Model"}),"."]})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"sender_name"}),(0,o.jsx)(t.td,{children:"Sender Name"}),(0,o.jsxs)(t.td,{children:["Input parameter. The name of the sender. If unspecified, defaults to ",(0,o.jsx)(t.code,{children:"User"})," or ",(0,o.jsx)(t.code,{children:"Language Model"}),"."]})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"session_id"}),(0,o.jsx)(t.td,{children:"Session ID"}),(0,o.jsx)(t.td,{children:"Input parameter. The unique identifier for the chat session. If empty, the current session ID parameter is used."})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"data_template"}),(0,o.jsx)(t.td,{children:"Data Template"}),(0,o.jsxs)(t.td,{children:["Input parameter. The template to convert ",(0,o.jsxs)(t.a,{href:"/data-types#data",children:[(0,o.jsx)(t.code,{children:"Data"})," input"]})," to ",(0,o.jsx)(t.code,{children:"text"}),". If empty, it is dynamically set to the ",(0,o.jsx)(t.code,{children:"Data"})," object's ",(0,o.jsx)(t.code,{children:"text"})," key."]})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"background_color"}),(0,o.jsx)(t.td,{children:"Background Color"}),(0,o.jsx)(t.td,{children:"Input parameter. The background color of the icon."})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"chat_icon"}),(0,o.jsx)(t.td,{children:"Icon"}),(0,o.jsx)(t.td,{children:"Input parameter. The icon of the message."})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"text_color"}),(0,o.jsx)(t.td,{children:"Text Color"}),(0,o.jsx)(t.td,{children:"Input parameter. The text color of the name."})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"clean_data"}),(0,o.jsx)(t.td,{children:"Basic Clean Data"}),(0,o.jsxs)(t.td,{children:["Input parameter. When enabled, ",(0,o.jsxs)(t.a,{href:"/data-types#dataframe",children:[(0,o.jsx)(t.code,{children:"DataFrame"})," input"]})," is cleaned when converted to text. Cleaning removes empty rows, empty lines in cells, and multiple newlines."]})]})]})]}),"\n",(0,o.jsxs)(t.p,{children:["For information about the resulting ",(0,o.jsx)(t.code,{children:"Message"})," object, including input parameters that are directly mapped to ",(0,o.jsx)(t.code,{children:"Message"})," attributes, see ",(0,o.jsxs)(t.a,{href:"/data-types#message",children:[(0,o.jsx)(t.code,{children:"Message"})," data"]}),"."]}),"\n",(0,o.jsx)(t.h3,{id:"use-chat-input-and-output-components-in-a-flow",children:"Use Chat Input and Output components in a flow"}),"\n",(0,o.jsxs)(t.p,{children:["To use the ",(0,o.jsx)(t.strong,{children:"Chat Input"})," and ",(0,o.jsx)(t.strong,{children:"Chat Output"})," components in a flow, connect them to components that accept or emit ",(0,o.jsxs)(t.a,{href:"/data-types#message",children:[(0,o.jsx)(t.code,{children:"Message"})," data"]}),"."]}),"\n",(0,o.jsxs)(t.p,{children:["For example, the following flow connects ",(0,o.jsx)(t.strong,{children:"Chat Input"})," and ",(0,o.jsx)(t.strong,{children:"Chat Output"})," to a ",(0,o.jsx)(t.strong,{children:"Language Model"})," component, creating a simple LLM-based chat flow."]}),"\n",(0,o.jsx)(t.p,{children:(0,o.jsx)(t.img,{alt:"Chat Input and Output components connected to an OpenAI component",src:n(6944).A+"",width:"3548",height:"1944"})}),"\n",(0,o.jsxs)(t.admonition,{type:"tip",children:[(0,o.jsxs)(t.p,{children:["For detailed examples of ",(0,o.jsx)(t.strong,{children:"Chat Input and Output"})," components in flows, see the following:"]}),(0,o.jsxs)(t.ul,{children:["\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.a,{href:"/get-started-quickstart",children:"Langflow quickstart"}),": Create and run a basic agent flow."]}),"\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.strong,{children:"Basic Prompting"})," template: Create an LLM-based chat flow that accepts chat input as well as a prompt with additional instructions for the LLM. Many other Langflow templates also use ",(0,o.jsx)(t.strong,{children:"Chat Input and Output"})," components."]}),"\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.a,{href:"/agent-tutorial",children:"Connect applications to agents"}),": Explore more advanced concepts around agent flows and prompting, including triggering agent flows from external applications."]}),"\n"]})]}),"\n",(0,o.jsx)(t.h3,{id:"send-chat-input-with-the-langflow-api",children:"Send chat input with the Langflow API"}),"\n",(0,o.jsxs)(t.p,{children:["You can use the Langflow API to run a flow by sending input to a ",(0,o.jsx)(t.strong,{children:"Chat Input"})," component:"]}),"\n",(0,o.jsx)(h.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"--request ",props:{style:{color:"#79C0FF"}}},{content:"POST ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" --url ",props:{style:{color:"#79C0FF"}}},{content:'"http://',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_SERVER_ADDRESS",props:{style:{color:"#C9D1D9"}}},{content:"/api/v1/run/",props:{style:{color:"#A5D6FF"}}},{content:"$FLOW_ID",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" --header ",props:{style:{color:"#79C0FF"}}},{content:'"Content-Type: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" --header ",props:{style:{color:"#79C0FF"}}},{content:'"x-api-key: ',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" --data ",props:{style:{color:"#79C0FF"}}},{content:"'{",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "input_value": "What\'s the recommended way to install Docker on Mac M1?",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "output_type": "chat",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "input_type": "chat"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"}'",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,o.jsxs)(t.p,{children:["When triggering flows with the Langflow API, the payload must contain the values for the ",(0,o.jsx)(t.strong,{children:"Chat Input"})," component's input parameters, such as ",(0,o.jsx)(t.code,{children:"input_value"}),"."]}),"\n",(0,o.jsxs)(t.p,{children:["Not all parameters need to be specified in the request.\nFor example, ",(0,o.jsx)(t.code,{children:"session_id"})," uses the flow's default session ID if omitted.\nIf you want to use a custom session ID, include ",(0,o.jsx)(t.code,{children:"session_id"})," in your request:"]}),"\n",(0,o.jsx)(h.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"--request ",props:{style:{color:"#79C0FF"}}},{content:"POST ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" --url ",props:{style:{color:"#79C0FF"}}},{content:'"http://',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_SERVER_ADDRESS",props:{style:{color:"#C9D1D9"}}},{content:"/api/v1/run/",props:{style:{color:"#A5D6FF"}}},{content:"$FLOW_ID",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" --header ",props:{style:{color:"#79C0FF"}}},{content:'"Content-Type: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" --header ",props:{style:{color:"#79C0FF"}}},{content:'"x-api-key: ',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" --data ",props:{style:{color:"#79C0FF"}}},{content:"'{",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "input_value": "Whats the recommended way to install Docker on Mac M1",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "session_id": "$USER_ID",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "output_type": "chat",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "input_type": "chat"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"}'",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,o.jsxs)(t.p,{children:["For more information, see ",(0,o.jsx)(t.a,{href:"/concepts-publish",children:"Trigger flows with the Langflow API"}),"."]}),"\n",(0,o.jsx)(t.h2,{id:"text-io",children:"Text Input and Output"}),"\n",(0,o.jsxs)(t.admonition,{type:"warning",children:[(0,o.jsxs)(t.p,{children:[(0,o.jsx)(t.strong,{children:"Text Input and Output"})," components aren't supported in the ",(0,o.jsx)(t.strong,{children:"Playground"}),".\nBecause the data isn't formatted as a chat message, the data doesn't appear in the ",(0,o.jsx)(t.strong,{children:"Playground"}),", and you can't chat with your flow in the ",(0,o.jsx)(t.strong,{children:"Playground"}),"."]}),(0,o.jsxs)(t.p,{children:["If you want to chat with a flow in the ",(0,o.jsx)(t.strong,{children:"Playground"}),", you must use the ",(0,o.jsxs)(t.a,{href:"#chat-io",children:[(0,o.jsx)(t.strong,{children:"Chat Input and Output"})," components"]}),"."]})]}),"\n",(0,o.jsxs)(t.p,{children:[(0,o.jsx)(t.strong,{children:"Text Input and Output"})," components are designed for flows that ingest or emit simple text strings.\nThese components don't support full conversational interactions."]}),"\n",(0,o.jsxs)(t.p,{children:["Passing chat-like metadata to a ",(0,o.jsx)(t.strong,{children:"Text Input and Output"})," component doesn't change the component's behavior; the result is still a simple text string."]}),"\n",(0,o.jsx)(t.h3,{id:"text-input",children:"Text Input"}),"\n",(0,o.jsxs)(t.p,{children:["The ",(0,o.jsx)(t.strong,{children:"Text Input"})," component accepts a text string input that is passed to other components as ",(0,o.jsxs)(t.a,{href:"/data-types",children:[(0,o.jsx)(t.code,{children:"Message"})," data"]})," containing only the provided input text string in the ",(0,o.jsx)(t.code,{children:"text"})," attribute."]}),"\n",(0,o.jsxs)(t.p,{children:["It accepts only ",(0,o.jsx)(t.strong,{children:"Text"})," (",(0,o.jsx)(t.code,{children:"input_value"}),"), which is the text supplied as input to the component.\nThis can be entered directly into the component or passed as ",(0,o.jsx)(t.code,{children:"Message"})," data from other components."]}),"\n",(0,o.jsxs)(t.p,{children:["Initial input ",(0,o.jsx)(t.em,{children:"shouldn't"})," be provided as a complete ",(0,o.jsx)(t.code,{children:"Message"})," object because the ",(0,o.jsx)(t.strong,{children:"Text Input"})," component constructs the ",(0,o.jsx)(t.code,{children:"Message"})," object that is then passed to other components in the flow."]}),"\n",(0,o.jsx)(t.h3,{id:"text-output",children:"Text Output"}),"\n",(0,o.jsxs)(t.p,{children:["The ",(0,o.jsx)(t.strong,{children:"Text Output"})," component ingests ",(0,o.jsxs)(t.a,{href:"/data-types#message",children:[(0,o.jsx)(t.code,{children:"Message"})," data"]})," from other components, emitting only the ",(0,o.jsx)(t.code,{children:"text"})," attribute in a simplified ",(0,o.jsx)(t.code,{children:"Message"})," object."]}),"\n",(0,o.jsxs)(t.p,{children:["It accepts only ",(0,o.jsx)(t.strong,{children:"Text"})," (",(0,o.jsx)(t.code,{children:"input_value"}),"), which is the text to be ingested and output as a string.\nThis can be entered directly into the component or passed as ",(0,o.jsx)(t.code,{children:"Message"})," data from other components."]})]})}function j(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,o.jsx)(t,{...e,children:(0,o.jsx)(x,{...e})}):x(e)}function m(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}},17886:(e,t,n)=>{n.d(t,{A:()=>r});n(96540);var s=n(64058),o=n(74848);function r({name:e,...t}){const n=s[e];return n?(0,o.jsx)(n,{...t}):null}},31929:(e,t,n)=>{n.d(t,{Ay:()=>d,RM:()=>c});var s=n(74848),o=n(28453),r=n(17886);const c=[];function a(e){const t={a:"a",p:"p",strong:"strong",...(0,o.R)(),...e.components};return(0,s.jsxs)(t.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,s.jsx)(r.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,s.jsx)(t.strong,{children:"Controls"})," in the ",(0,s.jsx)(t.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function d(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(a,{...e})}):a(e)}}}]); \ No newline at end of file diff --git a/assets/js/8bee5443.62bcd20a.js b/assets/js/8bee5443.62bcd20a.js new file mode 100644 index 0000000000..69ebb8ec70 --- /dev/null +++ b/assets/js/8bee5443.62bcd20a.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[879],{17886:(e,n,s)=>{s.d(n,{A:()=>t});s(96540);var o=s(64058),r=s(74848);function t({name:e,...n}){const s=o[e];return s?(0,r.jsx)(s,{...n}):null}},45783:(e,n,s)=>{s.d(n,{A:()=>l});var o,r,t=s(96540);function i(){return i=Object.assign?Object.assign.bind():function(e){for(var n=1;nt.createElement("svg",i({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16","aria-labelledby":n},s),e?t.createElement("title",{id:n},e):null,o||(o=t.createElement("g",{fill:"#fff",clipPath:"url(#a)"},t.createElement("path",{d:"M10.352 1.675a1.655 1.655 0 0 0-2.341 0L1.769 7.917a.552.552 0 1 1-.78-.78L7.23.893a2.759 2.759 0 0 1 4.682 2.341 2.75 2.75 0 0 1 2.34.78l.033.033a2.76 2.76 0 0 1 0 3.901L8.64 13.595a.184.184 0 0 0 0 .26l1.16 1.159a.552.552 0 0 1-.78.78l-1.16-1.16a1.287 1.287 0 0 1 0-1.82l5.645-5.645a1.655 1.655 0 0 0 0-2.34l-.032-.033a1.655 1.655 0 0 0-2.34-.002l-4.65 4.65-.002.003-.063.063a.552.552 0 1 1-.78-.78l4.715-4.716a1.655 1.655 0 0 0-.001-2.34"}),t.createElement("path",{d:"M9.572 3.235a.552.552 0 1 0-.78-.78L4.174 7.07a2.759 2.759 0 0 0 3.901 3.902l4.617-4.617a.552.552 0 0 0-.78-.78l-4.617 4.617a1.655 1.655 0 0 1-2.341-2.341z"}))),r||(r=t.createElement("defs",null,t.createElement("clipPath",{id:"a"},t.createElement("path",{fill:"#fff",d:"M0 0h16v16H0z"})))))},84739:(e,n,s)=>{s.r(n),s.d(n,{CH:()=>p,assets:()=>h,chCodeConfig:()=>g,contentTitle:()=>d,default:()=>m,frontMatter:()=>c,metadata:()=>o,toc:()=>u});const o=JSON.parse('{"id":"Support/release-notes","title":"Langflow release notes","description":"This page summarizes significant changes to Langflow in each release.","source":"@site/docs/Support/release-notes.mdx","sourceDirName":"Support","slug":"/release-notes","permalink":"/release-notes","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Langflow release notes","slug":"/release-notes"},"sidebar":"docs","previous":{"title":"Contribute bundles","permalink":"/contributing-bundles"},"next":{"title":"Troubleshoot","permalink":"/troubleshoot"}}');var r=s(74848),t=s(28453),i=s(24754),l=s(17886),a=s(45783);const c={title:"Langflow release notes",slug:"/release-notes"},d=void 0,h={},p={annotations:i.hk,Code:i.Cy},g={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},u=[{value:"Prepare to upgrade",id:"prepare-to-upgrade",level:2},{value:"1.6.0",id:"160",level:2},{value:"Breaking changes",id:"breaking-changes",level:3},{value:"New features and enhancements",id:"new-features-and-enhancements",level:3},{value:"Deprecations",id:"deprecations",level:3},{value:"1.5.0",id:"150",level:2},{value:"New features and enhancements",id:"new-features-and-enhancements-1",level:3},{value:"1.4.2",id:"142",level:2},{value:"New features and enhancements",id:"new-features-and-enhancements-2",level:3},{value:"Deprecations",id:"deprecations-1",level:3},{value:"1.4.1",id:"141",level:2},{value:"New features and enhancements",id:"new-features-and-enhancements-3",level:3},{value:"1.4.0",id:"140",level:2},{value:"New features and enhancements",id:"new-features-and-enhancements-4",level:3},{value:"Deprecations",id:"deprecations-2",level:3},{value:"Earlier releases",id:"earlier-releases",level:2}];function x(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,t.R)(),...e.components};return p||f("CH",!1),p.Code||f("CH.Code",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n","\n",(0,r.jsxs)(n.p,{children:["This page summarizes significant changes to Langflow in each release.\nFor all changes, see the ",(0,r.jsx)(n.a,{href:"https://github.com/langflow-ai/langflow/releases/latest",children:"Changelog"}),"."]}),"\n",(0,r.jsx)(n.p,{children:"Due to strict SemVer requirements, Langflow Desktop can have different patch versions than the core Langflow OSS Python package, but the major and minor versions are aligned."}),"\n",(0,r.jsx)(n.h2,{id:"prepare-to-upgrade",children:"Prepare to upgrade"}),"\n",(0,r.jsx)(n.admonition,{type:"warning",children:(0,r.jsxs)(n.p,{children:["Whenever possible, the Langflow team recommends installing new Langflow versions in a new virtual environment or VM before upgrading your primary installation.\nThis allows you to ",(0,r.jsx)(n.a,{href:"/concepts-flows-import#import-a-flow",children:"import flows"})," from your existing installation and test them in the new version without disrupting your existing installation.\nIn the event of breaking changes or bugs, your existing installation is preserved in a stable state."]})}),"\n",(0,r.jsx)(n.p,{children:"To avoid the impact of potential breaking changes and test new versions, the Langflow team recommends the following upgrade process:"}),"\n",(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Recommended: ",(0,r.jsx)(n.a,{href:"/api-projects#export-a-project",children:"Export your projects"})," to create backups of your flows:"]}),"\n",(0,r.jsx)(p.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:"GET ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:'"',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_SERVER_URL",props:{style:{color:"#C9D1D9"}}},{content:"/api/v1/projects/download/",props:{style:{color:"#A5D6FF"}}},{content:"$PROJECT_ID",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"accept: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"x-api-key: ',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'"',props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,r.jsxs)(n.p,{children:["To export flows from the visual editor, see ",(0,r.jsx)(n.a,{href:"/concepts-flows-import",children:"Import and export flows"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Install the new version:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Langflow OSS Python package"}),": Install the new version in a new virtual environment. For instructions, see ",(0,r.jsx)(n.a,{href:"/get-started-installation#install-and-run-the-langflow-oss-python-package",children:"Install and run the Langflow OSS Python package"}),"."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Langflow Docker image"}),": Run the new image in a separate container."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Langflow Desktop"}),": To upgrade in place, open Langflow Desktop, and then click ",(0,r.jsx)(n.strong,{children:"Upgrade Available"})," in the Langflow header. If you want to isolate the new version, you must install Langflow Desktop on a separate physical or virtual machine, and then ",(0,r.jsx)(n.a,{href:"/concepts-flows-import",children:"import your flows"})," to the new installation."]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.a,{href:"/concepts-flows-import",children:"Import your flows"})," to test them in the new version, ",(0,r.jsx)(n.a,{href:"/concepts-components#component-versions",children:"upgrading components"})," as needed."]}),"\n",(0,r.jsxs)(n.p,{children:["When upgrading components, you can use the ",(0,r.jsx)(n.strong,{children:"Create backup flow before updating"})," option if you didn't previously export your flows."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"If you installed the new version in isolation, upgrade your primary installation after testing the new version."}),"\n",(0,r.jsx)(n.p,{children:"If you made changes to your flows in the isolated installation, you might want to export and import those flows back to your upgraded primary installation so you don't have to repeat the component upgrade process."}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"160",children:"1.6.0"}),"\n",(0,r.jsxs)(n.p,{children:["Highlights of this release include the following changes.\nFor all changes, see the ",(0,r.jsx)(n.a,{href:"https://github.com/langflow-ai/langflow/releases",children:"Changelog"}),"."]}),"\n",(0,r.jsx)(n.h3,{id:"breaking-changes",children:"Breaking changes"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Authentication enforced for Langflow API requests by default"}),"\n",(0,r.jsxs)(n.p,{children:["In Langflow version 1.6, ",(0,r.jsx)(n.code,{children:"LANGFLOW_AUTO_LOGIN=True"})," and ",(0,r.jsx)(n.code,{children:"LANGFLOW_SKIP_AUTH_AUTO_LOGIN=False"})," by default.\nThis enforces authentication for Langflow API requests while still automatically authenticating all users as superusers in the visual editor."]}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["This is a breaking change from 1.5 where both of these environment variables were ",(0,r.jsx)(n.code,{children:"true"})," by default, bypassing all authentication."]})}),"\n",(0,r.jsxs)(n.p,{children:["For temporary backwards compatibility, you can revert to the earlier unauthenticated behavior by setting both variables to ",(0,r.jsx)(n.code,{children:"true"}),".\nHowever, a future release will set ",(0,r.jsx)(n.code,{children:"LANGFLOW_AUTO_LOGIN=False"})," and remove ",(0,r.jsx)(n.code,{children:"LANGFLOW_SKIP_AUTH_AUTO_LOGIN"}),".\nAt that point, Langflow will strictly enforce API key authentication for API requests, and you can manually disable authentication for some features, like the visual editor, by setting ",(0,r.jsx)(n.code,{children:"LANGFLOW_AUTO_LOGIN=True"}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["For more information, see the documentation for ",(0,r.jsx)(n.a,{href:"/api-keys-and-authentication#langflow-auto-login",children:(0,r.jsx)(n.code,{children:"LANGFLOW_AUTO_LOGIN"})}),"."]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.h3,{id:"new-features-and-enhancements",children:"New features and enhancements"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"OpenAI Responses API compatibility"}),"\n",(0,r.jsxs)(n.p,{children:["Langflow now includes an endpoint that is compatible with the ",(0,r.jsx)(n.a,{href:"https://platform.openai.com/docs/api-reference/responses",children:"OpenAI Responses API"})," at ",(0,r.jsx)(n.code,{children:"POST /api/v1/responses"}),".\nThis allows you to use existing OpenAI client libraries with minimal code changes by replacing the ",(0,r.jsx)(n.code,{children:"model"})," name with your ",(0,r.jsx)(n.code,{children:"flow_id"}),".\nThe endpoint supports streaming responses, conversation continuity, tool call results, and global variable passing through headers.\nFor more information, see ",(0,r.jsx)(n.a,{href:"/api-openai-responses",children:"OpenAI Responses API"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Advanced document parsing with built-in Docling support"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"File"})," component supports advanced parsing with the Docling library."]}),"\n",(0,r.jsxs)(n.p,{children:["To make it easier to use the ",(0,r.jsxs)(n.a,{href:"/integrations-docling",children:[(0,r.jsx)(n.strong,{children:"Docling"})," components"]})," and the ",(0,r.jsx)(n.strong,{children:"File"})," component's new advanced parsing feature, the Docling dependency is now included with Langflow for all operating systems except macOS Intel (x86_64)."]}),"\n",(0,r.jsxs)(n.p,{children:["For more information, see ",(0,r.jsx)(n.a,{href:"/components-data#advanced-parsing",children:"Advanced parsing"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Reorganized component menus and visual editor controls"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["The ",(0,r.jsx)(n.a,{href:"/concepts-overview#workspace",children:"workspace"})," sidebar is divided into separate sections for ",(0,r.jsx)(l.A,{name:"Search","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Search"}),", ",(0,r.jsx)(l.A,{name:"Component","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Core components"}),", ",(0,r.jsx)(a.A,{})," ",(0,r.jsx)(n.a,{href:"/mcp-server",children:(0,r.jsx)(n.strong,{children:"MCP servers"})}),", ",(0,r.jsx)(l.A,{name:"Blocks","aria-hidden":"true"})," ",(0,r.jsx)(n.a,{href:"/components-bundle-components",children:(0,r.jsx)(n.strong,{children:"Bundles"})}),", and ",(0,r.jsx)(l.A,{name:"StickyNote","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Add Note"}),"."]}),"\n",(0,r.jsxs)(n.li,{children:["Lock/unlock controls moved to flow details in ",(0,r.jsx)(n.a,{href:"/concepts-flows#projects",children:(0,r.jsx)(n.strong,{children:"Projects"})}),"."]}),"\n",(0,r.jsx)(n.li,{children:"Zoom and help controls moved to the lower-right corner of the workspace."}),"\n",(0,r.jsxs)(n.li,{children:["Vector store components moved to provider-specific ",(0,r.jsx)(l.A,{name:"Blocks","aria-hidden":"true"})," ",(0,r.jsx)(n.a,{href:"/components-bundle-components",children:(0,r.jsx)(n.strong,{children:"Bundles"})})]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Serper Google Search API"})," component moved to the ",(0,r.jsx)(n.strong,{children:"Serper"})," bundle"]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Increased the default maximum file upload size from ",(0,r.jsx)(n.code,{children:"100 MB"})," to ",(0,r.jsx)(n.code,{children:"1024 MB"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"New integrations and bundles:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"/integrations-instana-traceloop",children:"Traceloop"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"/bundles-cohere",children:"Cohere Rerank"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"/bundles-amazon",children:"S3 Bucket Uploader"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"/integrations-composio",children:"Composio single-service components"})}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.h3,{id:"deprecations",children:"Deprecations"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["The ",(0,r.jsx)(n.strong,{children:"Local DB"})," component is now in legacy status.\nReplace this component with the ",(0,r.jsxs)(n.a,{href:"/bundles-chroma",children:[(0,r.jsx)(n.strong,{children:"Chroma DB"})," component"]}),"."]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"150",children:"1.5.0"}),"\n",(0,r.jsxs)(n.p,{children:["Highlights of this release include the following changes.\nFor all changes, see the ",(0,r.jsx)(n.a,{href:"https://github.com/langflow-ai/langflow/releases",children:"Changelog"}),"."]}),"\n",(0,r.jsx)(n.h3,{id:"new-features-and-enhancements-1",children:"New features and enhancements"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Langflow API requests can require authentication"}),"\n",(0,r.jsxs)(n.p,{children:["To enhance security and ensure proper authentication for automatic login features, Langflow API endpoints now require authentication with a Langflow API key, even when ",(0,r.jsx)(n.code,{children:"LANGFLOW_AUTO_LOGIN=True"}),".\nThis change will be enforced in a future release.\nFor temporary backwards compatibility, this release adds the ",(0,r.jsx)(n.code,{children:"LANGFLOW_SKIP_AUTH_AUTO_LOGIN"})," environment variable.\nThe default value is ",(0,r.jsx)(n.code,{children:"true"}),", which disables API authentication enforcement.\nTo enforce API authentication, set ",(0,r.jsx)(n.code,{children:"LANGFLOW_SKIP_AUTH_AUTO_LOGIN=False"}),".\nFor more information, see the documentation for ",(0,r.jsx)(n.a,{href:"/api-keys-and-authentication#langflow-auto-login",children:(0,r.jsx)(n.code,{children:"LANGFLOW_AUTO_LOGIN"})}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Centralized ",(0,r.jsx)(n.strong,{children:"Language Model"})," and ",(0,r.jsx)(n.strong,{children:"Embedding Model"})," components"]}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsxs)(n.a,{href:"/components-models",children:[(0,r.jsx)(n.strong,{children:"Language Model"})," component"]})," and ",(0,r.jsxs)(n.a,{href:"/components-embedding-models",children:[(0,r.jsx)(n.strong,{children:"Embedding Model"})," component"]})," are now core components for your LLM and embeddings flows. They support multiple models and model providers, and allow you to experiment with different models without swapping out single-provider components.\nFind them in the visual editor in the ",(0,r.jsx)(n.strong,{children:"Models"})," category."]}),"\n",(0,r.jsxs)(n.p,{children:["The single-provider components moved to the ",(0,r.jsx)(n.a,{href:"/components-bundle-components",children:(0,r.jsx)(n.strong,{children:"Bundles"})})," section.\nYou can use them to replace the ",(0,r.jsx)(n.strong,{children:"Language Model"})," and ",(0,r.jsx)(n.strong,{children:"Embedding Model"})," core components, or connect them to the ",(0,r.jsx)(n.strong,{children:"Agent"})," component with the ",(0,r.jsx)(n.strong,{children:"Connect other models"})," provider option."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"MCP server one-click installation"}),"\n",(0,r.jsxs)(n.p,{children:["On your Langflow project's ",(0,r.jsx)(n.strong,{children:"MCP server"})," page, click ",(0,r.jsx)(n.strong,{children:"Auto install"})," to install your Langflow MCP server to MCP clients with just one click.\nThe option to install with a JSON configuration file is available for macOS, Windows, and WSL.\nFor more information, see ",(0,r.jsx)(n.a,{href:"/mcp-server",children:"Use Langflow as an MCP server"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"MCP server management"}),"\n",(0,r.jsxs)(n.p,{children:["You can now add, remove, and edit your MCP servers in the ",(0,r.jsx)(n.strong,{children:"MCP Tools"})," components and through your Langflow ",(0,r.jsx)(n.strong,{children:"Settings"})," page.\nFor more information, see ",(0,r.jsx)(n.a,{href:"/mcp-client",children:"Use Langflow as an MCP client"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Input schema replaces temporary overrides"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"Input schema"})," pane replaces the need to manage tweak values in the ",(0,r.jsx)(n.strong,{children:"API access"})," pane. When you enable a parameter in the ",(0,r.jsx)(n.strong,{children:"Input schema"})," pane, the parameter is automatically added to your flow's code snippets, providing ready-to-use templates for making requests in your preferred programming language."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Tools components are redistributed"}),"\n",(0,r.jsxs)(n.p,{children:["All components in the ",(0,r.jsx)(n.strong,{children:"Tools"})," category were moved to other component categories, such as ",(0,r.jsx)(n.strong,{children:"Helpers"})," and ",(0,r.jsx)(n.a,{href:"/components-bundle-components",children:(0,r.jsx)(n.strong,{children:"Bundles"})}),", or marked as legacy."]}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsxs)(n.a,{href:"/mcp-client",children:[(0,r.jsx)(n.strong,{children:"MCP Tools"})," component"]})," is now under the ",(0,r.jsx)(n.strong,{children:"Agents"})," category."]}),"\n",(0,r.jsxs)(n.p,{children:["Tools that performed the same function were combined into single components that support multiple providers, such as the ",(0,r.jsxs)(n.a,{href:"/components-data#web-search",children:[(0,r.jsx)(n.strong,{children:"Web Search"})," component"]})," and the ",(0,r.jsxs)(n.a,{href:"/components-data#news-search",children:[(0,r.jsx)(n.strong,{children:"News Search"})," component"]}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["For more information, see ",(0,r.jsx)(n.a,{href:"/components-tools",children:"Tools components"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Stability improvements"}),"\n",(0,r.jsxs)(n.p,{children:["General stability improvements and bug fixes for enhanced reliability.\nSee an issue? ",(0,r.jsx)(n.a,{href:"https://github.com/langflow-ai/langflow/issues",children:"Raise it on GitHub"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"New integrations and bundles"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsxs)(n.a,{href:"/integrations-cleanlab",children:[(0,r.jsx)(n.strong,{children:"Cleanlab"})," bundle"]})}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"142",children:"1.4.2"}),"\n",(0,r.jsxs)(n.p,{children:["Highlights of this release include the following changes.\nFor all changes, see the ",(0,r.jsx)(n.a,{href:"https://github.com/langflow-ai/langflow/releases",children:"Changelog"}),"."]}),"\n",(0,r.jsx)(n.h3,{id:"new-features-and-enhancements-2",children:"New features and enhancements"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Enhanced file and flow management system with improved bulk capabilities."}),"\n",(0,r.jsxs)(n.li,{children:["Added the ",(0,r.jsx)(n.strong,{children:"BigQuery"})," component"]}),"\n",(0,r.jsxs)(n.li,{children:["Added the ",(0,r.jsx)(n.strong,{children:"Twelve Labs"})," bundle"]}),"\n",(0,r.jsxs)(n.li,{children:["Added the ",(0,r.jsx)(n.strong,{children:"NVIDIA System-Assist"})," component"]}),"\n"]}),"\n",(0,r.jsx)(n.h3,{id:"deprecations-1",children:"Deprecations"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["Deprecated the ",(0,r.jsx)(n.strong,{children:"Combine Text"})," component."]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"141",children:"1.4.1"}),"\n",(0,r.jsxs)(n.p,{children:["Highlights of this release include the following changes.\nFor all changes, see the ",(0,r.jsx)(n.a,{href:"https://github.com/langflow-ai/langflow/releases",children:"Changelog"}),"."]}),"\n",(0,r.jsx)(n.h3,{id:"new-features-and-enhancements-3",children:"New features and enhancements"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["Added an enhanced ",(0,r.jsx)(n.strong,{children:"Breaking Changes"})," feature to help update components without breaking flows after updating Langflow."]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"140",children:"1.4.0"}),"\n",(0,r.jsxs)(n.p,{children:["Highlights of this release include the following changes.\nFor all changes, see the ",(0,r.jsx)(n.a,{href:"https://github.com/langflow-ai/langflow/releases",children:"Changelog"}),"."]}),"\n",(0,r.jsx)(n.h3,{id:"new-features-and-enhancements-4",children:"New features and enhancements"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Introduced MCP server functionality to serve Langflow tools to MCP-compatible clients."}),"\n",(0,r.jsxs)(n.li,{children:["Renamed ",(0,r.jsx)(n.strong,{children:"Folders"})," to ",(0,r.jsx)(n.strong,{children:"Projects"})," in the visual editor."]}),"\n",(0,r.jsxs)(n.li,{children:["The ",(0,r.jsx)(n.code,{children:"/folders"})," endpoints now redirect to ",(0,r.jsx)(n.code,{children:"/projects"}),"."]}),"\n"]}),"\n",(0,r.jsx)(n.h3,{id:"deprecations-2",children:"Deprecations"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["Deprecated the ",(0,r.jsx)(n.strong,{children:"Gmail"}),", ",(0,r.jsx)(n.strong,{children:"Google Drive"}),", and ",(0,r.jsx)(n.strong,{children:"Google Search"})," components.\nFor alternatives, see the ",(0,r.jsxs)(n.a,{href:"/bundles-google",children:[(0,r.jsx)(n.strong,{children:"Google"})," bundle"]}),"."]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"earlier-releases",children:"Earlier releases"}),"\n",(0,r.jsxs)(n.p,{children:["See the ",(0,r.jsx)(n.a,{href:"https://github.com/langflow-ai/langflow/releases",children:"Changelog"}),"."]})]})}function m(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(x,{...e})}):x(e)}function f(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}}}]); \ No newline at end of file diff --git a/assets/js/8bee5443.b186253d.js b/assets/js/8bee5443.b186253d.js deleted file mode 100644 index 3ba472ea79..0000000000 --- a/assets/js/8bee5443.b186253d.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[879],{17886:(e,n,s)=>{s.d(n,{A:()=>t});s(96540);var o=s(64058),r=s(74848);function t({name:e,...n}){const s=o[e];return s?(0,r.jsx)(s,{...n}):null}},45783:(e,n,s)=>{s.d(n,{A:()=>l});var o,r,t=s(96540);function i(){return i=Object.assign?Object.assign.bind():function(e){for(var n=1;nt.createElement("svg",i({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16","aria-labelledby":n},s),e?t.createElement("title",{id:n},e):null,o||(o=t.createElement("g",{fill:"#fff",clipPath:"url(#a)"},t.createElement("path",{d:"M10.352 1.675a1.655 1.655 0 0 0-2.341 0L1.769 7.917a.552.552 0 1 1-.78-.78L7.23.893a2.759 2.759 0 0 1 4.682 2.341 2.75 2.75 0 0 1 2.34.78l.033.033a2.76 2.76 0 0 1 0 3.901L8.64 13.595a.184.184 0 0 0 0 .26l1.16 1.159a.552.552 0 0 1-.78.78l-1.16-1.16a1.287 1.287 0 0 1 0-1.82l5.645-5.645a1.655 1.655 0 0 0 0-2.34l-.032-.033a1.655 1.655 0 0 0-2.34-.002l-4.65 4.65-.002.003-.063.063a.552.552 0 1 1-.78-.78l4.715-4.716a1.655 1.655 0 0 0-.001-2.34"}),t.createElement("path",{d:"M9.572 3.235a.552.552 0 1 0-.78-.78L4.174 7.07a2.759 2.759 0 0 0 3.901 3.902l4.617-4.617a.552.552 0 0 0-.78-.78l-4.617 4.617a1.655 1.655 0 0 1-2.341-2.341z"}))),r||(r=t.createElement("defs",null,t.createElement("clipPath",{id:"a"},t.createElement("path",{fill:"#fff",d:"M0 0h16v16H0z"})))))},84739:(e,n,s)=>{s.r(n),s.d(n,{CH:()=>p,assets:()=>h,chCodeConfig:()=>g,contentTitle:()=>d,default:()=>x,frontMatter:()=>c,metadata:()=>o,toc:()=>u});const o=JSON.parse('{"id":"Support/release-notes","title":"Langflow release notes","description":"This page summarizes significant changes to Langflow in each release.","source":"@site/docs/Support/release-notes.mdx","sourceDirName":"Support","slug":"/release-notes","permalink":"/release-notes","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Langflow release notes","slug":"/release-notes"},"sidebar":"docs","previous":{"title":"Contribute bundles","permalink":"/contributing-bundles"},"next":{"title":"Troubleshoot","permalink":"/troubleshoot"}}');var r=s(74848),t=s(28453),i=s(24754),l=s(17886),a=s(45783);const c={title:"Langflow release notes",slug:"/release-notes"},d=void 0,h={},p={annotations:i.hk,Code:i.Cy},g={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},u=[{value:"Prepare to upgrade",id:"prepare-to-upgrade",level:2},{value:"1.6.0",id:"160",level:2},{value:"Breaking changes",id:"breaking-changes",level:3},{value:"New features and enhancements",id:"new-features-and-enhancements",level:3},{value:"Deprecations",id:"deprecations",level:3},{value:"1.5.0",id:"150",level:2},{value:"New features and enhancements",id:"new-features-and-enhancements-1",level:3},{value:"1.4.2",id:"142",level:2},{value:"New features and enhancements",id:"new-features-and-enhancements-2",level:3},{value:"Deprecations",id:"deprecations-1",level:3},{value:"1.4.1",id:"141",level:2},{value:"New features and enhancements",id:"new-features-and-enhancements-3",level:3},{value:"1.4.0",id:"140",level:2},{value:"New features and enhancements",id:"new-features-and-enhancements-4",level:3},{value:"Deprecations",id:"deprecations-2",level:3},{value:"Earlier releases",id:"earlier-releases",level:2}];function m(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,t.R)(),...e.components};return p||f("CH",!1),p.Code||f("CH.Code",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n","\n",(0,r.jsxs)(n.p,{children:["This page summarizes significant changes to Langflow in each release.\nFor all changes, see the ",(0,r.jsx)(n.a,{href:"https://github.com/langflow-ai/langflow/releases/latest",children:"Changelog"}),"."]}),"\n",(0,r.jsx)(n.p,{children:"Due to strict SemVer requirements, Langflow Desktop can have different patch versions than the core Langflow OSS Python package, but the major and minor versions are aligned."}),"\n",(0,r.jsx)(n.h2,{id:"prepare-to-upgrade",children:"Prepare to upgrade"}),"\n",(0,r.jsx)(n.admonition,{type:"important",children:(0,r.jsxs)(n.p,{children:["Whenever possible, the Langflow team recommends installing new Langflow versions in a new virtual environment or VM before upgrading your primary installation.\nThis allows you to ",(0,r.jsx)(n.a,{href:"/concepts-flows-import#import-a-flow",children:"import flows"})," from your existing installation and test them in the new version without disrupting your existing installation.\nIn the event of breaking changes or bugs, your existing installation is preserved in a stable state."]})}),"\n",(0,r.jsx)(n.p,{children:"To avoid the impact of potential breaking changes and test new versions, the Langflow team recommends the following upgrade process:"}),"\n",(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Recommended: ",(0,r.jsx)(n.a,{href:"/api-projects#export-a-project",children:"Export your projects"})," to create backups of your flows:"]}),"\n",(0,r.jsx)(p.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:"GET ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:'"',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_SERVER_URL",props:{style:{color:"#C9D1D9"}}},{content:"/api/v1/projects/download/",props:{style:{color:"#A5D6FF"}}},{content:"$PROJECT_ID",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"accept: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"x-api-key: ',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'"',props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,r.jsxs)(n.p,{children:["To export flows from the visual editor, see ",(0,r.jsx)(n.a,{href:"/concepts-flows-import",children:"Import and export flows"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Install the new version:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Langflow OSS Python package"}),": Install the new version in a new virtual environment. For instructions, see ",(0,r.jsx)(n.a,{href:"/get-started-installation#install-and-run-the-langflow-oss-python-package",children:"Install and run the Langflow OSS Python package"}),"."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Langflow Docker image"}),": Run the new image in a separate container."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Langflow Desktop"}),": To upgrade in place, open Langflow Desktop, and then click ",(0,r.jsx)(n.strong,{children:"Upgrade Available"})," in the Langflow header. If you want to isolate the new version, you must install Langflow Desktop on a separate physical or virtual machine, and then ",(0,r.jsx)(n.a,{href:"/concepts-flows-import",children:"import your flows"})," to the new installation."]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.a,{href:"/concepts-flows-import",children:"Import your flows"})," to test them in the new version, ",(0,r.jsx)(n.a,{href:"/concepts-components#component-versions",children:"upgrading components"})," as needed."]}),"\n",(0,r.jsxs)(n.p,{children:["When upgrading components, you can use the ",(0,r.jsx)(n.strong,{children:"Create backup flow before updating"})," option if you didn't previously export your flows."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"If you installed the new version in isolation, upgrade your primary installation after testing the new version."}),"\n",(0,r.jsx)(n.p,{children:"If you made changes to your flows in the isolated installation, you might want to export and import those flows back to your upgraded primary installation so you don't have to repeat the component upgrade process."}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"160",children:"1.6.0"}),"\n",(0,r.jsxs)(n.p,{children:["Highlights of this release include the following changes.\nFor all changes, see the ",(0,r.jsx)(n.a,{href:"https://github.com/langflow-ai/langflow/releases",children:"Changelog"}),"."]}),"\n",(0,r.jsx)(n.h3,{id:"breaking-changes",children:"Breaking changes"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Authentication enforced for Langflow API requests by default"}),"\n",(0,r.jsxs)(n.p,{children:["In Langflow version 1.6, ",(0,r.jsx)(n.code,{children:"LANGFLOW_AUTO_LOGIN=True"})," and ",(0,r.jsx)(n.code,{children:"LANGFLOW_SKIP_AUTH_AUTO_LOGIN=False"})," by default.\nThis enforces authentication for Langflow API requests while still automatically authenticating all users as superusers in the visual editor."]}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"This is a breaking change from 1.5 where both of these environment variables were true by default, bypassing all authentication."})}),"\n",(0,r.jsxs)(n.p,{children:["For temporary backwards compatibility, you can revert to the earlier unauthenticated behavior by setting both variables to true.\nHowever, a future release will set ",(0,r.jsx)(n.code,{children:"LANGFLOW_AUTO_LOGIN=False"})," and remove ",(0,r.jsx)(n.code,{children:"LANGFLOW_SKIP_AUTH_AUTO_LOGIN"}),".\nAt that point, Langflow will strictly enforce API key authentication for API requests, and you can manually disable authentication for some features, like the visual editor, by setting ",(0,r.jsx)(n.code,{children:"LANGFLOW_AUTO_LOGIN=True"}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["For more information, see the documentation for ",(0,r.jsx)(n.a,{href:"/api-keys-and-authentication#langflow-auto-login",children:(0,r.jsx)(n.code,{children:"LANGFLOW_AUTO_LOGIN"})}),"."]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.h3,{id:"new-features-and-enhancements",children:"New features and enhancements"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"OpenAI Responses API compatibility"}),"\n",(0,r.jsxs)(n.p,{children:["Langflow now includes an endpoint that is compatible with the ",(0,r.jsx)(n.a,{href:"https://platform.openai.com/docs/api-reference/responses",children:"OpenAI Responses API"})," at ",(0,r.jsx)(n.code,{children:"POST /api/v1/responses"}),".\nThis allows you to use existing OpenAI client libraries with minimal code changes by replacing the ",(0,r.jsx)(n.code,{children:"model"})," name with your ",(0,r.jsx)(n.code,{children:"flow_id"}),".\nThe endpoint supports streaming responses, conversation continuity, tool call results, and global variable passing through headers.\nFor more information, see ",(0,r.jsx)(n.a,{href:"/api-openai-responses",children:"OpenAI Responses API"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Advanced document parsing with built-in Docling support"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"File"})," component supports advanced parsing with the Docling library."]}),"\n",(0,r.jsxs)(n.p,{children:["To make it easier to use the ",(0,r.jsxs)(n.a,{href:"/integrations-docling",children:[(0,r.jsx)(n.strong,{children:"Docling"})," components"]})," and the ",(0,r.jsx)(n.strong,{children:"File"})," component's new advanced parsing feature, the Docling dependency is now included with Langflow for all operating systems except macOS Intel (x86_64)."]}),"\n",(0,r.jsxs)(n.p,{children:["For more information, see ",(0,r.jsx)(n.a,{href:"/components-data#advanced-parsing",children:"Advanced parsing"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Reorganized component menus and visual editor controls"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["The ",(0,r.jsx)(n.a,{href:"/concepts-overview#workspace",children:"workspace"})," sidebar is divided into separate sections for ",(0,r.jsx)(l.A,{name:"Search","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Search"}),", ",(0,r.jsx)(l.A,{name:"Component","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Core components"}),", ",(0,r.jsx)(a.A,{})," ",(0,r.jsx)(n.a,{href:"/mcp-server",children:(0,r.jsx)(n.strong,{children:"MCP servers"})}),", ",(0,r.jsx)(l.A,{name:"Blocks","aria-hidden":"true"})," ",(0,r.jsx)(n.a,{href:"/components-bundle-components",children:(0,r.jsx)(n.strong,{children:"Bundles"})}),", and ",(0,r.jsx)(l.A,{name:"StickyNote","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Add Note"}),"."]}),"\n",(0,r.jsxs)(n.li,{children:["Lock/unlock controls moved to flow details in ",(0,r.jsx)(n.a,{href:"/concepts-flows#projects",children:(0,r.jsx)(n.strong,{children:"Projects"})}),"."]}),"\n",(0,r.jsx)(n.li,{children:"Zoom and help controls moved to the lower-right corner of the workspace."}),"\n",(0,r.jsxs)(n.li,{children:["Vector store components moved to provider-specific ",(0,r.jsx)(l.A,{name:"Blocks","aria-hidden":"true"})," ",(0,r.jsx)(n.a,{href:"/components-bundle-components",children:(0,r.jsx)(n.strong,{children:"Bundles"})})]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Serper Google Search API"})," component moved to the ",(0,r.jsx)(n.strong,{children:"Serper"})," bundle"]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Increased the default maximum file upload size from ",(0,r.jsx)(n.code,{children:"100 MB"})," to ",(0,r.jsx)(n.code,{children:"1024 MB"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"New integrations and bundles:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"/integrations-instana-traceloop",children:"Traceloop"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"/bundles-cohere",children:"Cohere Rerank"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"/bundles-amazon",children:"S3 Bucket Uploader"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"/integrations-composio",children:"Composio single-service components"})}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.h3,{id:"deprecations",children:"Deprecations"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["The ",(0,r.jsx)(n.strong,{children:"Local DB"})," component is now in legacy status.\nReplace this component with the ",(0,r.jsxs)(n.a,{href:"/bundles-chroma",children:[(0,r.jsx)(n.strong,{children:"Chroma DB"})," component"]}),"."]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"150",children:"1.5.0"}),"\n",(0,r.jsxs)(n.p,{children:["Highlights of this release include the following changes.\nFor all changes, see the ",(0,r.jsx)(n.a,{href:"https://github.com/langflow-ai/langflow/releases",children:"Changelog"}),"."]}),"\n",(0,r.jsx)(n.h3,{id:"new-features-and-enhancements-1",children:"New features and enhancements"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Langflow API requests can require authentication"}),"\n",(0,r.jsxs)(n.p,{children:["To enhance security and ensure proper authentication for automatic login features, Langflow API endpoints now require authentication with a Langflow API key, even when ",(0,r.jsx)(n.code,{children:"LANGFLOW_AUTO_LOGIN=True"}),".\nThis change will be enforced in a future release.\nFor temporary backwards compatibility, this release adds the ",(0,r.jsx)(n.code,{children:"LANGFLOW_SKIP_AUTH_AUTO_LOGIN"})," environment variable.\nThe default value is true, which disables API authentication enforcement.\nTo enforce API authentication, set ",(0,r.jsx)(n.code,{children:"LANGFLOW_SKIP_AUTH_AUTO_LOGIN=False"}),".\nFor more information, see the documentation for ",(0,r.jsx)(n.a,{href:"/api-keys-and-authentication#langflow-auto-login",children:(0,r.jsx)(n.code,{children:"LANGFLOW_AUTO_LOGIN"})}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Centralized ",(0,r.jsx)(n.strong,{children:"Language Model"})," and ",(0,r.jsx)(n.strong,{children:"Embedding Model"})," components"]}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsxs)(n.a,{href:"/components-models",children:[(0,r.jsx)(n.strong,{children:"Language Model"})," component"]})," and ",(0,r.jsxs)(n.a,{href:"/components-embedding-models",children:[(0,r.jsx)(n.strong,{children:"Embedding Model"})," component"]})," are now core components for your LLM and embeddings flows. They support multiple models and model providers, and allow you to experiment with different models without swapping out single-provider components.\nFind them in the visual editor in the ",(0,r.jsx)(n.strong,{children:"Models"})," category."]}),"\n",(0,r.jsxs)(n.p,{children:["The single-provider components moved to the ",(0,r.jsx)(n.a,{href:"/components-bundle-components",children:(0,r.jsx)(n.strong,{children:"Bundles"})})," section.\nYou can use them to replace the ",(0,r.jsx)(n.strong,{children:"Language Model"})," and ",(0,r.jsx)(n.strong,{children:"Embedding Model"})," core components, or connect them to the ",(0,r.jsx)(n.strong,{children:"Agent"})," component with the ",(0,r.jsx)(n.strong,{children:"Connect other models"})," provider option."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"MCP server one-click installation"}),"\n",(0,r.jsxs)(n.p,{children:["On your Langflow project's ",(0,r.jsx)(n.strong,{children:"MCP server"})," page, click ",(0,r.jsx)(n.strong,{children:"Auto install"})," to install your Langflow MCP server to MCP clients with just one click.\nThe option to install with a JSON configuration file is available for macOS, Windows, and WSL.\nFor more information, see ",(0,r.jsx)(n.a,{href:"/mcp-server",children:"Use Langflow as an MCP server"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"MCP server management"}),"\n",(0,r.jsxs)(n.p,{children:["You can now add, remove, and edit your MCP servers in the ",(0,r.jsx)(n.strong,{children:"MCP Tools"})," components and through your Langflow ",(0,r.jsx)(n.strong,{children:"Settings"})," page.\nFor more information, see ",(0,r.jsx)(n.a,{href:"/mcp-client",children:"Use Langflow as an MCP client"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Input schema replaces temporary overrides"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"Input schema"})," pane replaces the need to manage tweak values in the ",(0,r.jsx)(n.strong,{children:"API access"})," pane. When you enable a parameter in the ",(0,r.jsx)(n.strong,{children:"Input schema"})," pane, the parameter is automatically added to your flow's code snippets, providing ready-to-use templates for making requests in your preferred programming language."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Tools components are redistributed"}),"\n",(0,r.jsxs)(n.p,{children:["All components in the ",(0,r.jsx)(n.strong,{children:"Tools"})," category were moved to other component categories, such as ",(0,r.jsx)(n.strong,{children:"Helpers"})," and ",(0,r.jsx)(n.a,{href:"/components-bundle-components",children:(0,r.jsx)(n.strong,{children:"Bundles"})}),", or marked as legacy."]}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsxs)(n.a,{href:"/mcp-client",children:[(0,r.jsx)(n.strong,{children:"MCP Tools"})," component"]})," is now under the ",(0,r.jsx)(n.strong,{children:"Agents"})," category."]}),"\n",(0,r.jsxs)(n.p,{children:["Tools that performed the same function were combined into single components that support multiple providers, such as the ",(0,r.jsxs)(n.a,{href:"/components-data#web-search",children:[(0,r.jsx)(n.strong,{children:"Web Search"})," component"]})," and the ",(0,r.jsxs)(n.a,{href:"/components-data#news-search",children:[(0,r.jsx)(n.strong,{children:"News Search"})," component"]}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["For more information, see ",(0,r.jsx)(n.a,{href:"/components-tools",children:"Tools components"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Stability improvements"}),"\n",(0,r.jsxs)(n.p,{children:["General stability improvements and bug fixes for enhanced reliability.\nSee an issue? ",(0,r.jsx)(n.a,{href:"https://github.com/langflow-ai/langflow/issues",children:"Raise it on GitHub"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"New integrations and bundles"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsxs)(n.a,{href:"/integrations-cleanlab",children:[(0,r.jsx)(n.strong,{children:"Cleanlab"})," bundle"]})}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"142",children:"1.4.2"}),"\n",(0,r.jsxs)(n.p,{children:["Highlights of this release include the following changes.\nFor all changes, see the ",(0,r.jsx)(n.a,{href:"https://github.com/langflow-ai/langflow/releases",children:"Changelog"}),"."]}),"\n",(0,r.jsx)(n.h3,{id:"new-features-and-enhancements-2",children:"New features and enhancements"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Enhanced file and flow management system with improved bulk capabilities."}),"\n",(0,r.jsxs)(n.li,{children:["Added the ",(0,r.jsx)(n.strong,{children:"BigQuery"})," component"]}),"\n",(0,r.jsxs)(n.li,{children:["Added the ",(0,r.jsx)(n.strong,{children:"Twelve Labs"})," bundle"]}),"\n",(0,r.jsxs)(n.li,{children:["Added the ",(0,r.jsx)(n.strong,{children:"NVIDIA System-Assist"})," component"]}),"\n"]}),"\n",(0,r.jsx)(n.h3,{id:"deprecations-1",children:"Deprecations"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["Deprecated the ",(0,r.jsx)(n.strong,{children:"Combine Text"})," component."]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"141",children:"1.4.1"}),"\n",(0,r.jsxs)(n.p,{children:["Highlights of this release include the following changes.\nFor all changes, see the ",(0,r.jsx)(n.a,{href:"https://github.com/langflow-ai/langflow/releases",children:"Changelog"}),"."]}),"\n",(0,r.jsx)(n.h3,{id:"new-features-and-enhancements-3",children:"New features and enhancements"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["Added an enhanced ",(0,r.jsx)(n.strong,{children:"Breaking Changes"})," feature to help update components without breaking flows after updating Langflow."]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"140",children:"1.4.0"}),"\n",(0,r.jsxs)(n.p,{children:["Highlights of this release include the following changes.\nFor all changes, see the ",(0,r.jsx)(n.a,{href:"https://github.com/langflow-ai/langflow/releases",children:"Changelog"}),"."]}),"\n",(0,r.jsx)(n.h3,{id:"new-features-and-enhancements-4",children:"New features and enhancements"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Introduced MCP server functionality to serve Langflow tools to MCP-compatible clients."}),"\n",(0,r.jsxs)(n.li,{children:["Renamed ",(0,r.jsx)(n.strong,{children:"Folders"})," to ",(0,r.jsx)(n.strong,{children:"Projects"})," in the visual editor."]}),"\n",(0,r.jsxs)(n.li,{children:["The ",(0,r.jsx)(n.code,{children:"/folders"})," endpoints now redirect to ",(0,r.jsx)(n.code,{children:"/projects"}),"."]}),"\n"]}),"\n",(0,r.jsx)(n.h3,{id:"deprecations-2",children:"Deprecations"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["Deprecated the ",(0,r.jsx)(n.strong,{children:"Gmail"}),", ",(0,r.jsx)(n.strong,{children:"Google Drive"}),", and ",(0,r.jsx)(n.strong,{children:"Google Search"})," components.\nFor alternatives, see the ",(0,r.jsxs)(n.a,{href:"/bundles-google",children:[(0,r.jsx)(n.strong,{children:"Google"})," bundle"]}),"."]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"earlier-releases",children:"Earlier releases"}),"\n",(0,r.jsxs)(n.p,{children:["See the ",(0,r.jsx)(n.a,{href:"https://github.com/langflow-ai/langflow/releases",children:"Changelog"}),"."]})]})}function x(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(m,{...e})}):m(e)}function f(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}}}]); \ No newline at end of file diff --git a/assets/js/97254d1d.c5d869cc.js b/assets/js/97254d1d.9d7b254b.js similarity index 62% rename from assets/js/97254d1d.c5d869cc.js rename to assets/js/97254d1d.9d7b254b.js index 3703415564..54f585c7a5 100644 --- a/assets/js/97254d1d.c5d869cc.js +++ b/assets/js/97254d1d.9d7b254b.js @@ -1 +1 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[9459],{28453:(o,e,t)=>{t.d(e,{R:()=>c,x:()=>r});var n=t(96540);const s={},l=n.createContext(s);function c(o){const e=n.useContext(l);return n.useMemo(function(){return"function"==typeof o?o(e):{...e,...o}},[e,o])}function r(o){let e;return e=o.disableParentContext?"function"==typeof o.components?o.components(s):o.components||s:c(o.components),n.createElement(l.Provider,{value:e},o.children)}},90837:(o,e,t)=>{t.r(e),t.d(e,{CH:()=>a,assets:()=>i,chCodeConfig:()=>d,contentTitle:()=>p,default:()=>y,frontMatter:()=>r,metadata:()=>n,toc:()=>F});const n=JSON.parse('{"id":"API-Reference/api-files","title":"Files endpoints","description":"Use the /files endpoints to move files between your local machine and Langflow.","source":"@site/docs/API-Reference/api-files.mdx","sourceDirName":"API-Reference","slug":"/api-files","permalink":"/api-files","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Files endpoints","slug":"/api-files"},"sidebar":"docs","previous":{"title":"Flow management endpoints","permalink":"/api-flows"},"next":{"title":"Projects endpoints","permalink":"/api-projects"}}');var s=t(74848),l=t(28453),c=t(24754);const r={title:"Files endpoints",slug:"/api-files"},p=void 0,i={},a={annotations:c.hk,Code:c.Cy},d={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},F=[{value:"Differences between /v1/files and /v2/files",id:"differences-between-v1files-and-v2files",level:2},{value:"Files/V1 endpoints",id:"filesv1-endpoints",level:2},{value:"Upload file (v1)",id:"upload-file-v1",level:3},{value:"Upload image files (v1)",id:"upload-image-files-v1",level:3},{value:"List files (v1)",id:"list-files-v1",level:3},{value:"Download file (v1)",id:"download-file-v1",level:3},{value:"Delete file (v1)",id:"delete-file-v1",level:3},{value:"Files/V2 endpoints",id:"filesv2-endpoints",level:2},{value:"Upload file (v2)",id:"upload-file-v2",level:3},{value:"Send files to your flows (v2)",id:"send-files-to-your-flows-v2",level:3},{value:"List files (v2)",id:"list-files-v2",level:3},{value:"Download file (v2)",id:"download-file-v2",level:3},{value:"Edit file name (v2)",id:"edit-file-name-v2",level:3},{value:"Delete file (v2)",id:"delete-file-v2",level:3},{value:"Delete all files (v2)",id:"delete-all-files-v2",level:3},{value:"Create upload file (Deprecated)",id:"create-upload-file-deprecated",level:2},{value:"See also",id:"see-also",level:2}];function h(o){const e={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,l.R)(),...o.components},{Details:t}=e;return a||f("CH",!1),a.Code||f("CH.Code",!0),t||f("Details",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n",(0,s.jsxs)(e.p,{children:["Use the ",(0,s.jsx)(e.code,{children:"/files"})," endpoints to move files between your local machine and Langflow."]}),"\n",(0,s.jsxs)(e.h2,{id:"differences-between-v1files-and-v2files",children:["Differences between ",(0,s.jsx)(e.code,{children:"/v1/files"})," and ",(0,s.jsx)(e.code,{children:"/v2/files"})]}),"\n",(0,s.jsxs)(e.p,{children:["There are two versions of the ",(0,s.jsx)(e.code,{children:"/files"})," endpoints."]}),"\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.code,{children:"/v2/files"})," offers the following improvements over ",(0,s.jsx)(e.code,{children:"/v1/files"}),":"]}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.code,{children:"/v2"})," files are organized by ",(0,s.jsx)(e.code,{children:"user_id"})," instead of ",(0,s.jsx)(e.code,{children:"flow_id"}),".\nThis means files are owned by users, and they aren't attached to specific flows.\nYou can upload a file to Langflow one time, and use it with multiple flows."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.code,{children:"/v2"})," files are tracked in the Langflow database."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.code,{children:"/v2"})," supports bulk upload and delete."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.code,{children:"/v2"})," responses contain more descriptive metadata."]}),"\n"]}),"\n",(0,s.jsxs)(e.p,{children:["However, ",(0,s.jsx)(e.code,{children:"/v2/files"})," doesn't support image files.\nTo send image files to your flows through the API, use ",(0,s.jsx)(e.a,{href:"#upload-image-files-v1",children:"Upload image files (v1)"}),"."]}),"\n",(0,s.jsx)(e.h2,{id:"filesv1-endpoints",children:"Files/V1 endpoints"}),"\n",(0,s.jsxs)(e.p,{children:["Use the ",(0,s.jsx)(e.code,{children:"/files"})," endpoints to move files between your local machine and Langflow."]}),"\n",(0,s.jsx)(e.h3,{id:"upload-file-v1",children:"Upload file (v1)"}),"\n",(0,s.jsxs)(e.p,{children:["Upload a file to the ",(0,s.jsx)(e.code,{children:"v1/files/upload/$FLOW_ID"})," endpoint:\nReplace ",(0,s.jsx)(e.strong,{children:"FILE_NAME"})," with the uploaded file name."]}),"\n",(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:"POST ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:' "',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_URL",props:{style:{color:"#C9D1D9"}}},{content:"/api/v1/files/upload/",props:{style:{color:"#A5D6FF"}}},{content:"$FLOW_ID",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"accept: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"Content-Type: multipart/form-data" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"x-api-key: ',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -F ",props:{style:{color:"#79C0FF"}}},{content:'"file=@FILE_NAME.txt"',props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,s.jsxs)(e.p,{children:["Replace ",(0,s.jsx)(e.code,{children:"FILE_NAME.txt"})," with the name and extension of the file you want to upload.\nNot all file types are supported."]}),"\n",(0,s.jsxs)(t,{children:[(0,s.jsx)("summary",{children:"Result"}),(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"{",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "flowId"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"92f9a4c5-cfc8-4656-ae63-1f0881163c28"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "file_path"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"92f9a4c5-cfc8-4656-ae63-1f0881163c28/2024-12-30_15-19-43_your_file.txt"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]}],lang:"json"},annotations:[]}]})]}),"\n",(0,s.jsx)(e.h3,{id:"upload-image-files-v1",children:"Upload image files (v1)"}),"\n",(0,s.jsx)(e.p,{children:"Send image files to Langflow to use them in flows."}),"\n",(0,s.jsxs)(e.p,{children:["The default file limit is 1024 MB.\nTo change this limit, set the ",(0,s.jsx)(e.code,{children:"LANGFLOW_MAX_FILE_SIZE_UPLOAD"})," ",(0,s.jsx)(e.a,{href:"/environment-variables",children:"environment variable"}),"."]}),"\n",(0,s.jsxs)(e.ol,{children:["\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:["Attach the image to a ",(0,s.jsx)(e.code,{children:"POST /v1/files/upload/$FLOW_ID"})," request with ",(0,s.jsx)(e.code,{children:"--form"})," (",(0,s.jsx)(e.code,{children:"-F"}),") and the file path:"]}),"\n",(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:'POST "',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_URL",props:{style:{color:"#C9D1D9"}}},{content:"/api/v1/files/upload/",props:{style:{color:"#A5D6FF"}}},{content:"$FLOW_ID",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"Content-Type: multipart/form-data" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"x-api-key: ',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -F ",props:{style:{color:"#79C0FF"}}},{content:'"file=@PATH/TO/FILE.png"',props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,s.jsxs)(e.p,{children:["A successful request returns the ",(0,s.jsx)(e.code,{children:"file_path"})," for the image in the Langflow file management system in the format ",(0,s.jsx)(e.code,{children:"FLOW_ID/TIMESTAMP_FILENAME.TYPE"}),".\nFor example:"]}),"\n",(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"{",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "flowId"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"a430cc57-06bb-4c11-be39-d3d4de68d2c4"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "file_path"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"a430cc57-06bb-4c11-be39-d3d4de68d2c4/2024-11-27_14-47-50_image-file.png"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]}],lang:"json"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:["Use the returned ",(0,s.jsx)(e.code,{children:"file_path"})," to send the image file to other components that can accept file input. Where you specify the file path depends on the component type."]}),"\n",(0,s.jsxs)(e.p,{children:["The following example runs the ",(0,s.jsx)(e.strong,{children:"Basic Prompting"})," template flow, passing the image file and the query ",(0,s.jsx)(e.code,{children:"describe this image"})," as input for the ",(0,s.jsx)(e.strong,{children:"Chat Input"})," component.\nIn this case, the file path is specified in ",(0,s.jsx)(e.code,{children:"tweaks"}),"."]}),"\n",(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:"POST ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:' "',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_URL",props:{style:{color:"#C9D1D9"}}},{content:'/api/v1/run/a430cc57-06bb-4c11-be39-d3d4de68d2c4?stream=false" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"Content-Type: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"x-api-key: ',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -d ",props:{style:{color:"#79C0FF"}}},{content:"'{",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "output_type": "chat",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "input_type": "chat",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "tweaks": {',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "ChatInput-b67sL": {',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "files": "a430cc57-06bb-4c11-be39-d3d4de68d2c4/2024-11-27_14-47-50_image-file.png",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "input_value": "describe this image"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" }",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" }",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" }'",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,s.jsx)(e.admonition,{type:"tip",children:(0,s.jsxs)(e.p,{children:["For help with tweaks, use the ",(0,s.jsx)(e.strong,{children:"Input Schema"})," in a flow's ",(0,s.jsxs)(e.a,{href:"/concepts-publish#api-access",children:[(0,s.jsx)(e.strong,{children:"API access"})," pane"]}),".\nSetting tweaks with ",(0,s.jsx)(e.strong,{children:"Input Schema"})," also automatically populates the required component IDs."]})}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(e.h3,{id:"list-files-v1",children:"List files (v1)"}),"\n",(0,s.jsx)(e.p,{children:"List all files associated with a specific flow."}),"\n",(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:"GET ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:' "',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_URL",props:{style:{color:"#C9D1D9"}}},{content:"/api/v1/files/list/",props:{style:{color:"#A5D6FF"}}},{content:"$FLOW_ID",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"accept: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"x-api-key: ',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'"',props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,s.jsxs)(t,{children:[(0,s.jsx)("summary",{children:"Result"}),(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"{",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "files"',props:{style:{color:"#7EE787"}}},{content:": [",props:{style:{color:"#C9D1D9"}}},{content:'"2024-12-30_15-19-43_your_file.txt"',props:{style:{color:"#A5D6FF"}}},{content:"]",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]}],lang:"json"},annotations:[]}]})]}),"\n",(0,s.jsx)(e.h3,{id:"download-file-v1",children:"Download file (v1)"}),"\n",(0,s.jsx)(e.p,{children:"Download a specific file from a flow."}),"\n",(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:"GET ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:' "',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_URL",props:{style:{color:"#C9D1D9"}}},{content:"/api/v1/files/download/",props:{style:{color:"#A5D6FF"}}},{content:"$FLOW_ID",props:{style:{color:"#C9D1D9"}}},{content:'/2024-12-30_15-19-43_your_file.txt" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"accept: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"x-api-key: ',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" --output ",props:{style:{color:"#79C0FF"}}},{content:"downloaded_file.txt",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,s.jsxs)(t,{children:[(0,s.jsx)("summary",{children:"Result"}),(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"File contents downloaded to downloaded_file.txt",props:{}}]}],lang:"text"},annotations:[]}]})]}),"\n",(0,s.jsx)(e.h3,{id:"delete-file-v1",children:"Delete file (v1)"}),"\n",(0,s.jsx)(e.p,{children:"Delete a specific file from a flow."}),"\n",(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:"DELETE ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:' "',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_URL",props:{style:{color:"#C9D1D9"}}},{content:"/api/v1/files/delete/",props:{style:{color:"#A5D6FF"}}},{content:"$FLOW_ID",props:{style:{color:"#C9D1D9"}}},{content:'/2024-12-30_15-19-43_your_file.txt" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"accept: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"x-api-key: ',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'"',props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,s.jsxs)(t,{children:[(0,s.jsx)("summary",{children:"Result"}),(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"{",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "message"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"File 2024-12-30_15-19-43_your_file.txt deleted successfully"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]}],lang:"json"},annotations:[]}]})]}),"\n",(0,s.jsx)(e.h2,{id:"filesv2-endpoints",children:"Files/V2 endpoints"}),"\n",(0,s.jsxs)(e.p,{children:["Use the ",(0,s.jsx)(e.code,{children:"/files"})," endpoints to move files between your local machine and Langflow."]}),"\n",(0,s.jsxs)(e.p,{children:["The ",(0,s.jsx)(e.code,{children:"/v2/files"})," endpoints can be authenticated by an API key or JWT.\nTo create a Langflow API key and export it as an environment variable, see ",(0,s.jsx)(e.a,{href:"/api-reference-api-examples",children:"Get started with the Langflow API"}),"."]}),"\n",(0,s.jsx)(e.h3,{id:"upload-file-v2",children:"Upload file (v2)"}),"\n",(0,s.jsx)(e.p,{children:"Upload a file to your user account. The file can be used across multiple flows."}),"\n",(0,s.jsxs)(e.p,{children:["The file is uploaded in the format ",(0,s.jsx)(e.code,{children:"USER_ID/FILE_ID.FILE_EXTENSION"}),", such as ",(0,s.jsx)(e.code,{children:"07e5b864-e367-4f52-b647-a48035ae7e5e/d44dc2e1-9ae9-4cf6-9114-8d34a6126c94.pdf"}),"."]}),"\n",(0,s.jsxs)(e.ol,{children:["\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:["To retrieve your current ",(0,s.jsx)(e.code,{children:"user_id"}),", call the ",(0,s.jsx)(e.code,{children:"/whoami"})," endpoint:"]}),"\n",(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:"GET ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:' "',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_URL",props:{style:{color:"#C9D1D9"}}},{content:'/api/v1/users/whoami" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"accept: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"x-api-key: ',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'"',props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,s.jsxs)(t,{children:[(0,s.jsx)("summary",{children:"Result"}),(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:'{"id":"07e5b864-e367-4f52-b647-a48035ae7e5e","username":"langflow","profile_image":null,"store_api_key":null,"is_active":true,"is_superuser":true,"create_at":"2025-05-08T17:59:07.855965","updated_at":"2025-05-28T19:00:42.556460","last_login_at":"2025-05-28T19:00:42.554338","optins":{"github_starred":false,"dialog_dismissed":true,"discord_clicked":false,"mcp_dialog_dismissed":true}}',props:{}}]}],lang:"text"},annotations:[]}]})]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:["In the POST request to ",(0,s.jsx)(e.code,{children:"v2/files"}),", replace ",(0,s.jsx)(e.strong,{children:"@FILE_NAME.EXTENSION"})," with the uploaded file name and its extension.\nYou must include the ampersand (",(0,s.jsx)(e.code,{children:"@"}),") in the request to instruct curl to upload the contents of the file, not the string ",(0,s.jsx)(e.code,{children:"FILE_NAME.EXTENSION"}),"."]}),"\n",(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:"POST ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:' "',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_URL",props:{style:{color:"#C9D1D9"}}},{content:'/api/v2/files" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"accept: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"Content-Type: multipart/form-data" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"x-api-key: ',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -F ",props:{style:{color:"#79C0FF"}}},{content:'"file=@FILE_NAME.EXTENSION"',props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,s.jsxs)(e.p,{children:["The file is uploaded in the format ",(0,s.jsx)(e.code,{children:"USER_ID/FILE_ID.FILE_EXTENSION"}),", and the API returns metadata about the uploaded file:"]}),"\n",(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"{",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "id"',props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}},{content:'"d44dc2e1-9ae9-4cf6-9114-8d34a6126c94"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "name"',props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}},{content:'"engine_manual"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "path"',props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}},{content:'"07e5b864-e367-4f52-b647-a48035ae7e5e/d44dc2e1-9ae9-4cf6-9114-8d34a6126c94.pdf"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "size"',props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}},{content:"851160",props:{style:{color:"#79C0FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "provider"',props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}},{content:"null",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]}],lang:"json"},annotations:[]}]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(e.h3,{id:"send-files-to-your-flows-v2",children:"Send files to your flows (v2)"}),"\n",(0,s.jsx)(e.admonition,{type:"important",children:(0,s.jsxs)(e.p,{children:["The ",(0,s.jsx)(e.code,{children:"/v2/files"})," endpoint can't send image files to flows.\nTo send image files to your flows through the API, see ",(0,s.jsx)(e.a,{href:"#upload-image-files-v1",children:"Upload image files (v1)"}),"."]})}),"\n",(0,s.jsxs)(e.p,{children:["This endpoint uploads files to your Langflow server's file management system.\nTo use an uploaded file in a flow, send the file path to a flow with a ",(0,s.jsxs)(e.a,{href:"/components-data#file",children:[(0,s.jsx)(e.strong,{children:"File"})," component"]}),"."]}),"\n",(0,s.jsxs)(e.p,{children:["The default file limit is 1024 MB. To configure this value, change the ",(0,s.jsx)(e.code,{children:"LANGFLOW_MAX_FILE_SIZE_UPLOAD"})," ",(0,s.jsx)(e.a,{href:"/environment-variables",children:"environment variable"}),"."]}),"\n",(0,s.jsxs)(e.ol,{children:["\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:["To send a file to your flow with the API, POST the file to the ",(0,s.jsx)(e.code,{children:"/api/v2/files"})," endpoint."]}),"\n",(0,s.jsxs)(e.p,{children:["Replace ",(0,s.jsx)(e.strong,{children:"FILE_NAME.EXTENSION"})," with the name and extension of the file you want to upload.\nThis is the same step described in ",(0,s.jsx)(e.a,{href:"#upload-file-v2",children:"Upload file (v2)"}),", but since you need the filename to upload to your flow, it is included here."]}),"\n",(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:"POST ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:' "',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_URL",props:{style:{color:"#C9D1D9"}}},{content:'/api/v2/files" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"accept: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"Content-Type: multipart/form-data" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"x-api-key: ',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -F ",props:{style:{color:"#79C0FF"}}},{content:'"file=@FILE_NAME.EXTENSION"',props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,s.jsxs)(e.p,{children:["The file is uploaded in the format ",(0,s.jsx)(e.code,{children:"USER_ID/FILE_ID.FILE_EXTENSION"}),", and the API returns metadata about the uploaded file:"]}),"\n",(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"{",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "id"',props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}},{content:'"d44dc2e1-9ae9-4cf6-9114-8d34a6126c94"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "name"',props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}},{content:'"engine_manual"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "path"',props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}},{content:'"07e5b864-e367-4f52-b647-a48035ae7e5e/d44dc2e1-9ae9-4cf6-9114-8d34a6126c94.pdf"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "size"',props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}},{content:"851160",props:{style:{color:"#79C0FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "provider"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"null",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]}],lang:"json"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:["To use this file in your flow, add a ",(0,s.jsx)(e.strong,{children:"File"})," component to your flow.\nThis component loads files into flows from your local machine or Langflow file management."]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:["Run the flow, passing the ",(0,s.jsx)(e.code,{children:"path"})," to the ",(0,s.jsx)(e.code,{children:"File"})," component in the ",(0,s.jsx)(e.code,{children:"tweaks"})," object:"]}),"\n",(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl --request POST \\",props:{}}]},{tokens:[{content:' --url "$LANGFLOW_URL/api/v1/run/$FLOW_ID" \\',props:{}}]},{tokens:[{content:' --header "Content-Type: application/json" \\',props:{}}]},{tokens:[{content:' --header "x-api-key: $LANGFLOW_API_KEY" \\',props:{}}]},{tokens:[{content:" --data '{",props:{}}]},{tokens:[{content:' "input_value": "what do you see?",',props:{}}]},{tokens:[{content:' "output_type": "chat",',props:{}}]},{tokens:[{content:' "input_type": "text",',props:{}}]},{tokens:[{content:' "tweaks": {',props:{}}]},{tokens:[{content:' "File-1olS3": {',props:{}}]},{tokens:[{content:' "path": [',props:{}}]},{tokens:[{content:' "07e5b864-e367-4f52-b647-a48035ae7e5e/3a290013-fe1e-4d3d-a454-cacae81288f3.pdf"',props:{}}]},{tokens:[{content:" ]",props:{}}]},{tokens:[{content:" }",props:{}}]},{tokens:[{content:" }",props:{}}]},{tokens:[{content:"}'",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,s.jsxs)(e.p,{children:["To get the ",(0,s.jsx)(e.code,{children:"File"})," component's ID, call the ",(0,s.jsx)(e.a,{href:"/api-flows#read-flow",children:"Read flow"})," endpoint or inspect the component in the visual editor."]}),"\n",(0,s.jsx)(e.p,{children:"If the file path is valid, the flow runs successfully."}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(e.h3,{id:"list-files-v2",children:"List files (v2)"}),"\n",(0,s.jsx)(e.p,{children:"List all files associated with your user account."}),"\n",(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:"GET ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:' "',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_URL",props:{style:{color:"#C9D1D9"}}},{content:'/api/v2/files" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"accept: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"x-api-key: ',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'"',props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,s.jsxs)(t,{children:[(0,s.jsx)("summary",{children:"Result"}),(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"[",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "id"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"c7b22c4c-d5e0-4ec9-af97-5d85b7657a34"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "name"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"your_file"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "path"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"6f17a73e-97d7-4519-a8d9-8e4c0be411bb/c7b22c4c-d5e0-4ec9-af97-5d85b7657a34.txt"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "size"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"1234",props:{style:{color:"#79C0FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "provider"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"null",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" }",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"]",props:{style:{color:"#C9D1D9"}}}]}],lang:"json"},annotations:[]}]})]}),"\n",(0,s.jsx)(e.h3,{id:"download-file-v2",children:"Download file (v2)"}),"\n",(0,s.jsx)(e.p,{children:"Download a specific file by its ID and file extension."}),"\n",(0,s.jsxs)(e.p,{children:["You must specify the file type you expect in the ",(0,s.jsx)(e.code,{children:"--output"})," value."]}),"\n",(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:"GET ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:' "',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_URL",props:{style:{color:"#C9D1D9"}}},{content:'/api/v2/files/c7b22c4c-d5e0-4ec9-af97-5d85b7657a34" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"accept: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"x-api-key: ',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" --output ",props:{style:{color:"#79C0FF"}}},{content:"downloaded_file.txt",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,s.jsxs)(t,{children:[(0,s.jsx)("summary",{children:"Result"}),(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"File contents downloaded to downloaded_file.txt",props:{}}]}],lang:"text"},annotations:[]}]})]}),"\n",(0,s.jsx)(e.h3,{id:"edit-file-name-v2",children:"Edit file name (v2)"}),"\n",(0,s.jsx)(e.p,{children:"Change a file name."}),"\n",(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:"PUT ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:' "',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_URL",props:{style:{color:"#C9D1D9"}}},{content:"/api/v2/files/",props:{style:{color:"#A5D6FF"}}},{content:"$FILE_ID",props:{style:{color:"#C9D1D9"}}},{content:'?name=new_file_name" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"accept: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"x-api-key: ',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'"',props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,s.jsxs)(t,{children:[(0,s.jsx)("summary",{children:"Result"}),(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"{",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "id"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"76543e40-f388-4cb3-b0ee-a1e870aca3d3"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "name"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"new_file_name"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "path"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"6f17a73e-97d7-4519-a8d9-8e4c0be411bb/76543e40-f388-4cb3-b0ee-a1e870aca3d3.png"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "size"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"2728251",props:{style:{color:"#79C0FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "provider"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"null",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]}],lang:"json"},annotations:[]}]})]}),"\n",(0,s.jsx)(e.h3,{id:"delete-file-v2",children:"Delete file (v2)"}),"\n",(0,s.jsx)(e.p,{children:"Delete a specific file by its ID."}),"\n",(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:"DELETE ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:' "',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_URL",props:{style:{color:"#C9D1D9"}}},{content:"/api/v2/files/",props:{style:{color:"#A5D6FF"}}},{content:"$FILE_ID",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"accept: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"x-api-key: ',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'"',props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,s.jsxs)(t,{children:[(0,s.jsx)("summary",{children:"Result"}),(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"{",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "message"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"File deleted successfully"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]}],lang:"json"},annotations:[]}]})]}),"\n",(0,s.jsx)(e.h3,{id:"delete-all-files-v2",children:"Delete all files (v2)"}),"\n",(0,s.jsx)(e.p,{children:"Delete all files associated with your user account."}),"\n",(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:"DELETE ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:' "',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_URL",props:{style:{color:"#C9D1D9"}}},{content:'/api/v2/files" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"accept: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"x-api-key: ',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'"',props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,s.jsxs)(t,{children:[(0,s.jsx)("summary",{children:"Result"}),(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"{",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "message"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"All files deleted successfully"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]}],lang:"json"},annotations:[]}]})]}),"\n",(0,s.jsx)(e.h2,{id:"create-upload-file-deprecated",children:"Create upload file (Deprecated)"}),"\n",(0,s.jsxs)(e.p,{children:["This endpoint is deprecated. Use the ",(0,s.jsx)(e.code,{children:"/files"})," endpoints instead."]}),"\n",(0,s.jsx)(e.h2,{id:"see-also",children:"See also"}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsx)(e.li,{children:(0,s.jsx)(e.a,{href:"/concepts-file-management",children:"Manage files"})}),"\n"]})]})}function y(o={}){const{wrapper:e}={...(0,l.R)(),...o.components};return e?(0,s.jsx)(e,{...o,children:(0,s.jsx)(h,{...o})}):h(o)}function f(o,e){throw new Error("Expected "+(e?"component":"object")+" `"+o+"` to be defined: you likely forgot to import, pass, or provide it.")}}}]); \ No newline at end of file +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[9459],{28453:(o,e,t)=>{t.d(e,{R:()=>c,x:()=>r});var n=t(96540);const s={},l=n.createContext(s);function c(o){const e=n.useContext(l);return n.useMemo(function(){return"function"==typeof o?o(e):{...e,...o}},[e,o])}function r(o){let e;return e=o.disableParentContext?"function"==typeof o.components?o.components(s):o.components||s:c(o.components),n.createElement(l.Provider,{value:e},o.children)}},90837:(o,e,t)=>{t.r(e),t.d(e,{CH:()=>a,assets:()=>i,chCodeConfig:()=>d,contentTitle:()=>p,default:()=>y,frontMatter:()=>r,metadata:()=>n,toc:()=>F});const n=JSON.parse('{"id":"API-Reference/api-files","title":"Files endpoints","description":"Use the /files endpoints to move files between your local machine and Langflow.","source":"@site/docs/API-Reference/api-files.mdx","sourceDirName":"API-Reference","slug":"/api-files","permalink":"/api-files","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Files endpoints","slug":"/api-files"},"sidebar":"docs","previous":{"title":"Flow management endpoints","permalink":"/api-flows"},"next":{"title":"Projects endpoints","permalink":"/api-projects"}}');var s=t(74848),l=t(28453),c=t(24754);const r={title:"Files endpoints",slug:"/api-files"},p=void 0,i={},a={annotations:c.hk,Code:c.Cy},d={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},F=[{value:"Differences between /v1/files and /v2/files",id:"differences-between-v1files-and-v2files",level:2},{value:"Files/V1 endpoints",id:"filesv1-endpoints",level:2},{value:"Upload file (v1)",id:"upload-file-v1",level:3},{value:"Upload image files (v1)",id:"upload-image-files-v1",level:3},{value:"List files (v1)",id:"list-files-v1",level:3},{value:"Download file (v1)",id:"download-file-v1",level:3},{value:"Delete file (v1)",id:"delete-file-v1",level:3},{value:"Files/V2 endpoints",id:"filesv2-endpoints",level:2},{value:"Upload file (v2)",id:"upload-file-v2",level:3},{value:"Send files to your flows (v2)",id:"send-files-to-your-flows-v2",level:3},{value:"List files (v2)",id:"list-files-v2",level:3},{value:"Download file (v2)",id:"download-file-v2",level:3},{value:"Edit file name (v2)",id:"edit-file-name-v2",level:3},{value:"Delete file (v2)",id:"delete-file-v2",level:3},{value:"Delete all files (v2)",id:"delete-all-files-v2",level:3},{value:"Create upload file (Deprecated)",id:"create-upload-file-deprecated",level:2},{value:"See also",id:"see-also",level:2}];function h(o){const e={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,l.R)(),...o.components},{Details:t}=e;return a||f("CH",!1),a.Code||f("CH.Code",!0),t||f("Details",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n",(0,s.jsxs)(e.p,{children:["Use the ",(0,s.jsx)(e.code,{children:"/files"})," endpoints to move files between your local machine and Langflow."]}),"\n",(0,s.jsxs)(e.h2,{id:"differences-between-v1files-and-v2files",children:["Differences between ",(0,s.jsx)(e.code,{children:"/v1/files"})," and ",(0,s.jsx)(e.code,{children:"/v2/files"})]}),"\n",(0,s.jsxs)(e.p,{children:["There are two versions of the ",(0,s.jsx)(e.code,{children:"/files"})," endpoints."]}),"\n",(0,s.jsxs)(e.p,{children:[(0,s.jsx)(e.code,{children:"/v2/files"})," offers the following improvements over ",(0,s.jsx)(e.code,{children:"/v1/files"}),":"]}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.code,{children:"/v2"})," files are organized by ",(0,s.jsx)(e.code,{children:"user_id"})," instead of ",(0,s.jsx)(e.code,{children:"flow_id"}),".\nThis means files are owned by users, and they aren't attached to specific flows.\nYou can upload a file to Langflow one time, and use it with multiple flows."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.code,{children:"/v2"})," files are tracked in the Langflow database."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.code,{children:"/v2"})," supports bulk upload and delete."]}),"\n",(0,s.jsxs)(e.li,{children:[(0,s.jsx)(e.code,{children:"/v2"})," responses contain more descriptive metadata."]}),"\n"]}),"\n",(0,s.jsxs)(e.p,{children:["However, ",(0,s.jsx)(e.code,{children:"/v2/files"})," doesn't support image files.\nTo send image files to your flows through the API, use ",(0,s.jsx)(e.a,{href:"#upload-image-files-v1",children:"Upload image files (v1)"}),"."]}),"\n",(0,s.jsx)(e.h2,{id:"filesv1-endpoints",children:"Files/V1 endpoints"}),"\n",(0,s.jsxs)(e.p,{children:["Use the ",(0,s.jsx)(e.code,{children:"/files"})," endpoints to move files between your local machine and Langflow."]}),"\n",(0,s.jsx)(e.h3,{id:"upload-file-v1",children:"Upload file (v1)"}),"\n",(0,s.jsxs)(e.p,{children:["Upload a file to the ",(0,s.jsx)(e.code,{children:"v1/files/upload/$FLOW_ID"})," endpoint:\nReplace ",(0,s.jsx)(e.strong,{children:"FILE_NAME"})," with the uploaded file name."]}),"\n",(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:"POST ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:' "',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_URL",props:{style:{color:"#C9D1D9"}}},{content:"/api/v1/files/upload/",props:{style:{color:"#A5D6FF"}}},{content:"$FLOW_ID",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"accept: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"Content-Type: multipart/form-data" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"x-api-key: ',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -F ",props:{style:{color:"#79C0FF"}}},{content:'"file=@FILE_NAME.txt"',props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,s.jsxs)(e.p,{children:["Replace ",(0,s.jsx)(e.code,{children:"FILE_NAME.txt"})," with the name and extension of the file you want to upload.\nNot all file types are supported."]}),"\n",(0,s.jsxs)(t,{children:[(0,s.jsx)("summary",{children:"Result"}),(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"{",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "flowId"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"92f9a4c5-cfc8-4656-ae63-1f0881163c28"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "file_path"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"92f9a4c5-cfc8-4656-ae63-1f0881163c28/2024-12-30_15-19-43_your_file.txt"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]}],lang:"json"},annotations:[]}]})]}),"\n",(0,s.jsx)(e.h3,{id:"upload-image-files-v1",children:"Upload image files (v1)"}),"\n",(0,s.jsx)(e.p,{children:"Send image files to Langflow to use them in flows."}),"\n",(0,s.jsxs)(e.p,{children:["The default file limit is 1024 MB.\nTo change this limit, set the ",(0,s.jsx)(e.code,{children:"LANGFLOW_MAX_FILE_SIZE_UPLOAD"})," ",(0,s.jsx)(e.a,{href:"/environment-variables",children:"environment variable"}),"."]}),"\n",(0,s.jsxs)(e.ol,{children:["\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:["Attach the image to a ",(0,s.jsx)(e.code,{children:"POST /v1/files/upload/$FLOW_ID"})," request with ",(0,s.jsx)(e.code,{children:"--form"})," (",(0,s.jsx)(e.code,{children:"-F"}),") and the file path:"]}),"\n",(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:'POST "',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_URL",props:{style:{color:"#C9D1D9"}}},{content:"/api/v1/files/upload/",props:{style:{color:"#A5D6FF"}}},{content:"$FLOW_ID",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"Content-Type: multipart/form-data" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"x-api-key: ',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -F ",props:{style:{color:"#79C0FF"}}},{content:'"file=@PATH/TO/FILE.png"',props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,s.jsxs)(e.p,{children:["A successful request returns the ",(0,s.jsx)(e.code,{children:"file_path"})," for the image in the Langflow file management system in the format ",(0,s.jsx)(e.code,{children:"FLOW_ID/TIMESTAMP_FILENAME.TYPE"}),".\nFor example:"]}),"\n",(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"{",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "flowId"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"a430cc57-06bb-4c11-be39-d3d4de68d2c4"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "file_path"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"a430cc57-06bb-4c11-be39-d3d4de68d2c4/2024-11-27_14-47-50_image-file.png"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]}],lang:"json"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:["Use the returned ",(0,s.jsx)(e.code,{children:"file_path"})," to send the image file to other components that can accept file input. Where you specify the file path depends on the component type."]}),"\n",(0,s.jsxs)(e.p,{children:["The following example runs the ",(0,s.jsx)(e.strong,{children:"Basic Prompting"})," template flow, passing the image file and the query ",(0,s.jsx)(e.code,{children:"describe this image"})," as input for the ",(0,s.jsx)(e.strong,{children:"Chat Input"})," component.\nIn this case, the file path is specified in ",(0,s.jsx)(e.code,{children:"tweaks"}),"."]}),"\n",(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:"POST ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:' "',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_URL",props:{style:{color:"#C9D1D9"}}},{content:'/api/v1/run/a430cc57-06bb-4c11-be39-d3d4de68d2c4?stream=false" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"Content-Type: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"x-api-key: ',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -d ",props:{style:{color:"#79C0FF"}}},{content:"'{",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "output_type": "chat",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "input_type": "chat",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "tweaks": {',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "ChatInput-b67sL": {',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "files": "a430cc57-06bb-4c11-be39-d3d4de68d2c4/2024-11-27_14-47-50_image-file.png",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "input_value": "describe this image"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" }",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" }",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" }'",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,s.jsx)(e.admonition,{type:"tip",children:(0,s.jsxs)(e.p,{children:["For help with tweaks, use the ",(0,s.jsx)(e.strong,{children:"Input Schema"})," in a flow's ",(0,s.jsxs)(e.a,{href:"/concepts-publish#api-access",children:[(0,s.jsx)(e.strong,{children:"API access"})," pane"]}),".\nSetting tweaks with ",(0,s.jsx)(e.strong,{children:"Input Schema"})," also automatically populates the required component IDs."]})}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(e.h3,{id:"list-files-v1",children:"List files (v1)"}),"\n",(0,s.jsx)(e.p,{children:"List all files associated with a specific flow."}),"\n",(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:"GET ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:' "',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_URL",props:{style:{color:"#C9D1D9"}}},{content:"/api/v1/files/list/",props:{style:{color:"#A5D6FF"}}},{content:"$FLOW_ID",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"accept: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"x-api-key: ',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'"',props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,s.jsxs)(t,{children:[(0,s.jsx)("summary",{children:"Result"}),(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"{",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "files"',props:{style:{color:"#7EE787"}}},{content:": [",props:{style:{color:"#C9D1D9"}}},{content:'"2024-12-30_15-19-43_your_file.txt"',props:{style:{color:"#A5D6FF"}}},{content:"]",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]}],lang:"json"},annotations:[]}]})]}),"\n",(0,s.jsx)(e.h3,{id:"download-file-v1",children:"Download file (v1)"}),"\n",(0,s.jsx)(e.p,{children:"Download a specific file from a flow."}),"\n",(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:"GET ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:' "',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_URL",props:{style:{color:"#C9D1D9"}}},{content:"/api/v1/files/download/",props:{style:{color:"#A5D6FF"}}},{content:"$FLOW_ID",props:{style:{color:"#C9D1D9"}}},{content:'/2024-12-30_15-19-43_your_file.txt" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"accept: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"x-api-key: ',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" --output ",props:{style:{color:"#79C0FF"}}},{content:"downloaded_file.txt",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,s.jsxs)(t,{children:[(0,s.jsx)("summary",{children:"Result"}),(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"File contents downloaded to downloaded_file.txt",props:{}}]}],lang:"text"},annotations:[]}]})]}),"\n",(0,s.jsx)(e.h3,{id:"delete-file-v1",children:"Delete file (v1)"}),"\n",(0,s.jsx)(e.p,{children:"Delete a specific file from a flow."}),"\n",(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:"DELETE ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:' "',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_URL",props:{style:{color:"#C9D1D9"}}},{content:"/api/v1/files/delete/",props:{style:{color:"#A5D6FF"}}},{content:"$FLOW_ID",props:{style:{color:"#C9D1D9"}}},{content:'/2024-12-30_15-19-43_your_file.txt" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"accept: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"x-api-key: ',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'"',props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,s.jsxs)(t,{children:[(0,s.jsx)("summary",{children:"Result"}),(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"{",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "message"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"File 2024-12-30_15-19-43_your_file.txt deleted successfully"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]}],lang:"json"},annotations:[]}]})]}),"\n",(0,s.jsx)(e.h2,{id:"filesv2-endpoints",children:"Files/V2 endpoints"}),"\n",(0,s.jsxs)(e.p,{children:["Use the ",(0,s.jsx)(e.code,{children:"/files"})," endpoints to move files between your local machine and Langflow."]}),"\n",(0,s.jsxs)(e.p,{children:["The ",(0,s.jsx)(e.code,{children:"/v2/files"})," endpoints can be authenticated by an API key or JWT.\nTo create a Langflow API key and export it as an environment variable, see ",(0,s.jsx)(e.a,{href:"/api-reference-api-examples",children:"Get started with the Langflow API"}),"."]}),"\n",(0,s.jsx)(e.h3,{id:"upload-file-v2",children:"Upload file (v2)"}),"\n",(0,s.jsx)(e.p,{children:"Upload a file to your user account. The file can be used across multiple flows."}),"\n",(0,s.jsxs)(e.p,{children:["The file is uploaded in the format ",(0,s.jsx)(e.code,{children:"USER_ID/FILE_ID.FILE_EXTENSION"}),", such as ",(0,s.jsx)(e.code,{children:"07e5b864-e367-4f52-b647-a48035ae7e5e/d44dc2e1-9ae9-4cf6-9114-8d34a6126c94.pdf"}),"."]}),"\n",(0,s.jsxs)(e.ol,{children:["\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:["To retrieve your current ",(0,s.jsx)(e.code,{children:"user_id"}),", call the ",(0,s.jsx)(e.code,{children:"/whoami"})," endpoint:"]}),"\n",(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:"GET ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:' "',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_URL",props:{style:{color:"#C9D1D9"}}},{content:'/api/v1/users/whoami" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"accept: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"x-api-key: ',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'"',props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,s.jsxs)(t,{children:[(0,s.jsx)("summary",{children:"Result"}),(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:'{"id":"07e5b864-e367-4f52-b647-a48035ae7e5e","username":"langflow","profile_image":null,"store_api_key":null,"is_active":true,"is_superuser":true,"create_at":"2025-05-08T17:59:07.855965","updated_at":"2025-05-28T19:00:42.556460","last_login_at":"2025-05-28T19:00:42.554338","optins":{"github_starred":false,"dialog_dismissed":true,"discord_clicked":false,"mcp_dialog_dismissed":true}}',props:{}}]}],lang:"text"},annotations:[]}]})]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:["In the POST request to ",(0,s.jsx)(e.code,{children:"v2/files"}),", replace ",(0,s.jsx)(e.strong,{children:"@FILE_NAME.EXTENSION"})," with the uploaded file name and its extension.\nYou must include the ampersand (",(0,s.jsx)(e.code,{children:"@"}),") in the request to instruct curl to upload the contents of the file, not the string ",(0,s.jsx)(e.code,{children:"FILE_NAME.EXTENSION"}),"."]}),"\n",(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:"POST ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:' "',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_URL",props:{style:{color:"#C9D1D9"}}},{content:'/api/v2/files" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"accept: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"Content-Type: multipart/form-data" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"x-api-key: ',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -F ",props:{style:{color:"#79C0FF"}}},{content:'"file=@FILE_NAME.EXTENSION"',props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,s.jsxs)(e.p,{children:["The file is uploaded in the format ",(0,s.jsx)(e.code,{children:"USER_ID/FILE_ID.FILE_EXTENSION"}),", and the API returns metadata about the uploaded file:"]}),"\n",(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"{",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "id"',props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}},{content:'"d44dc2e1-9ae9-4cf6-9114-8d34a6126c94"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "name"',props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}},{content:'"engine_manual"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "path"',props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}},{content:'"07e5b864-e367-4f52-b647-a48035ae7e5e/d44dc2e1-9ae9-4cf6-9114-8d34a6126c94.pdf"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "size"',props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}},{content:"851160",props:{style:{color:"#79C0FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "provider"',props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}},{content:"null",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]}],lang:"json"},annotations:[]}]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(e.h3,{id:"send-files-to-your-flows-v2",children:"Send files to your flows (v2)"}),"\n",(0,s.jsx)(e.admonition,{type:"info",children:(0,s.jsxs)(e.p,{children:["The ",(0,s.jsx)(e.code,{children:"/v2/files"})," endpoint can't send image files to flows.\nTo send image files to your flows through the API, see ",(0,s.jsx)(e.a,{href:"#upload-image-files-v1",children:"Upload image files (v1)"}),"."]})}),"\n",(0,s.jsxs)(e.p,{children:["This endpoint uploads files to your Langflow server's file management system.\nTo use an uploaded file in a flow, send the file path to a flow with a ",(0,s.jsxs)(e.a,{href:"/components-data#file",children:[(0,s.jsx)(e.strong,{children:"File"})," component"]}),"."]}),"\n",(0,s.jsxs)(e.p,{children:["The default file limit is 1024 MB. To configure this value, change the ",(0,s.jsx)(e.code,{children:"LANGFLOW_MAX_FILE_SIZE_UPLOAD"})," ",(0,s.jsx)(e.a,{href:"/environment-variables",children:"environment variable"}),"."]}),"\n",(0,s.jsxs)(e.ol,{children:["\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:["To send a file to your flow with the API, POST the file to the ",(0,s.jsx)(e.code,{children:"/api/v2/files"})," endpoint."]}),"\n",(0,s.jsxs)(e.p,{children:["Replace ",(0,s.jsx)(e.strong,{children:"FILE_NAME.EXTENSION"})," with the name and extension of the file you want to upload.\nThis is the same step described in ",(0,s.jsx)(e.a,{href:"#upload-file-v2",children:"Upload file (v2)"}),", but since you need the filename to upload to your flow, it is included here."]}),"\n",(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:"POST ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:' "',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_URL",props:{style:{color:"#C9D1D9"}}},{content:'/api/v2/files" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"accept: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"Content-Type: multipart/form-data" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"x-api-key: ',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -F ",props:{style:{color:"#79C0FF"}}},{content:'"file=@FILE_NAME.EXTENSION"',props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,s.jsxs)(e.p,{children:["The file is uploaded in the format ",(0,s.jsx)(e.code,{children:"USER_ID/FILE_ID.FILE_EXTENSION"}),", and the API returns metadata about the uploaded file:"]}),"\n",(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"{",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "id"',props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}},{content:'"d44dc2e1-9ae9-4cf6-9114-8d34a6126c94"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "name"',props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}},{content:'"engine_manual"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "path"',props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}},{content:'"07e5b864-e367-4f52-b647-a48035ae7e5e/d44dc2e1-9ae9-4cf6-9114-8d34a6126c94.pdf"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "size"',props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}},{content:"851160",props:{style:{color:"#79C0FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "provider"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"null",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]}],lang:"json"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:["To use this file in your flow, add a ",(0,s.jsx)(e.strong,{children:"File"})," component to your flow.\nThis component loads files into flows from your local machine or Langflow file management."]}),"\n"]}),"\n",(0,s.jsxs)(e.li,{children:["\n",(0,s.jsxs)(e.p,{children:["Run the flow, passing the ",(0,s.jsx)(e.code,{children:"path"})," to the ",(0,s.jsx)(e.code,{children:"File"})," component in the ",(0,s.jsx)(e.code,{children:"tweaks"})," object:"]}),"\n",(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl --request POST \\",props:{}}]},{tokens:[{content:' --url "$LANGFLOW_URL/api/v1/run/$FLOW_ID" \\',props:{}}]},{tokens:[{content:' --header "Content-Type: application/json" \\',props:{}}]},{tokens:[{content:' --header "x-api-key: $LANGFLOW_API_KEY" \\',props:{}}]},{tokens:[{content:" --data '{",props:{}}]},{tokens:[{content:' "input_value": "what do you see?",',props:{}}]},{tokens:[{content:' "output_type": "chat",',props:{}}]},{tokens:[{content:' "input_type": "text",',props:{}}]},{tokens:[{content:' "tweaks": {',props:{}}]},{tokens:[{content:' "File-1olS3": {',props:{}}]},{tokens:[{content:' "path": [',props:{}}]},{tokens:[{content:' "07e5b864-e367-4f52-b647-a48035ae7e5e/3a290013-fe1e-4d3d-a454-cacae81288f3.pdf"',props:{}}]},{tokens:[{content:" ]",props:{}}]},{tokens:[{content:" }",props:{}}]},{tokens:[{content:" }",props:{}}]},{tokens:[{content:"}'",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,s.jsxs)(e.p,{children:["To get the ",(0,s.jsx)(e.code,{children:"File"})," component's ID, call the ",(0,s.jsx)(e.a,{href:"/api-flows#read-flow",children:"Read flow"})," endpoint or inspect the component in the visual editor."]}),"\n",(0,s.jsx)(e.p,{children:"If the file path is valid, the flow runs successfully."}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(e.h3,{id:"list-files-v2",children:"List files (v2)"}),"\n",(0,s.jsx)(e.p,{children:"List all files associated with your user account."}),"\n",(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:"GET ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:' "',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_URL",props:{style:{color:"#C9D1D9"}}},{content:'/api/v2/files" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"accept: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"x-api-key: ',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'"',props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,s.jsxs)(t,{children:[(0,s.jsx)("summary",{children:"Result"}),(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"[",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "id"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"c7b22c4c-d5e0-4ec9-af97-5d85b7657a34"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "name"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"your_file"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "path"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"6f17a73e-97d7-4519-a8d9-8e4c0be411bb/c7b22c4c-d5e0-4ec9-af97-5d85b7657a34.txt"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "size"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"1234",props:{style:{color:"#79C0FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "provider"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"null",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" }",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"]",props:{style:{color:"#C9D1D9"}}}]}],lang:"json"},annotations:[]}]})]}),"\n",(0,s.jsx)(e.h3,{id:"download-file-v2",children:"Download file (v2)"}),"\n",(0,s.jsx)(e.p,{children:"Download a specific file by its ID and file extension."}),"\n",(0,s.jsxs)(e.p,{children:["You must specify the file type you expect in the ",(0,s.jsx)(e.code,{children:"--output"})," value."]}),"\n",(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:"GET ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:' "',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_URL",props:{style:{color:"#C9D1D9"}}},{content:'/api/v2/files/c7b22c4c-d5e0-4ec9-af97-5d85b7657a34" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"accept: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"x-api-key: ',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" --output ",props:{style:{color:"#79C0FF"}}},{content:"downloaded_file.txt",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,s.jsxs)(t,{children:[(0,s.jsx)("summary",{children:"Result"}),(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"File contents downloaded to downloaded_file.txt",props:{}}]}],lang:"text"},annotations:[]}]})]}),"\n",(0,s.jsx)(e.h3,{id:"edit-file-name-v2",children:"Edit file name (v2)"}),"\n",(0,s.jsx)(e.p,{children:"Change a file name."}),"\n",(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:"PUT ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:' "',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_URL",props:{style:{color:"#C9D1D9"}}},{content:"/api/v2/files/",props:{style:{color:"#A5D6FF"}}},{content:"$FILE_ID",props:{style:{color:"#C9D1D9"}}},{content:'?name=new_file_name" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"accept: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"x-api-key: ',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'"',props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,s.jsxs)(t,{children:[(0,s.jsx)("summary",{children:"Result"}),(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"{",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "id"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"76543e40-f388-4cb3-b0ee-a1e870aca3d3"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "name"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"new_file_name"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "path"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"6f17a73e-97d7-4519-a8d9-8e4c0be411bb/76543e40-f388-4cb3-b0ee-a1e870aca3d3.png"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "size"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"2728251",props:{style:{color:"#79C0FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "provider"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"null",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]}],lang:"json"},annotations:[]}]})]}),"\n",(0,s.jsx)(e.h3,{id:"delete-file-v2",children:"Delete file (v2)"}),"\n",(0,s.jsx)(e.p,{children:"Delete a specific file by its ID."}),"\n",(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:"DELETE ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:' "',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_URL",props:{style:{color:"#C9D1D9"}}},{content:"/api/v2/files/",props:{style:{color:"#A5D6FF"}}},{content:"$FILE_ID",props:{style:{color:"#C9D1D9"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"accept: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"x-api-key: ',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'"',props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,s.jsxs)(t,{children:[(0,s.jsx)("summary",{children:"Result"}),(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"{",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "message"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"File deleted successfully"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]}],lang:"json"},annotations:[]}]})]}),"\n",(0,s.jsx)(e.h3,{id:"delete-all-files-v2",children:"Delete all files (v2)"}),"\n",(0,s.jsx)(e.p,{children:"Delete all files associated with your user account."}),"\n",(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:"DELETE ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:' "',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_URL",props:{style:{color:"#C9D1D9"}}},{content:'/api/v2/files" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"accept: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"x-api-key: ',props:{style:{color:"#A5D6FF"}}},{content:"$LANGFLOW_API_KEY",props:{style:{color:"#C9D1D9"}}},{content:'"',props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,s.jsxs)(t,{children:[(0,s.jsx)("summary",{children:"Result"}),(0,s.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"{",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "message"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"All files deleted successfully"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]}],lang:"json"},annotations:[]}]})]}),"\n",(0,s.jsx)(e.h2,{id:"create-upload-file-deprecated",children:"Create upload file (Deprecated)"}),"\n",(0,s.jsxs)(e.p,{children:["This endpoint is deprecated. Use the ",(0,s.jsx)(e.code,{children:"/files"})," endpoints instead."]}),"\n",(0,s.jsx)(e.h2,{id:"see-also",children:"See also"}),"\n",(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsx)(e.li,{children:(0,s.jsx)(e.a,{href:"/concepts-file-management",children:"Manage files"})}),"\n"]})]})}function y(o={}){const{wrapper:e}={...(0,l.R)(),...o.components};return e?(0,s.jsx)(e,{...o,children:(0,s.jsx)(h,{...o})}):h(o)}function f(o,e){throw new Error("Expected "+(e?"component":"object")+" `"+o+"` to be defined: you likely forgot to import, pass, or provide it.")}}}]); \ No newline at end of file diff --git a/assets/js/9895db20.ebb58851.js b/assets/js/9895db20.9c8b3318.js similarity index 63% rename from assets/js/9895db20.ebb58851.js rename to assets/js/9895db20.9c8b3318.js index 075801b58a..5d7e8aaa03 100644 --- a/assets/js/9895db20.ebb58851.js +++ b/assets/js/9895db20.9c8b3318.js @@ -1 +1 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[5482],{6892:(e,n,t)=>{t.d(n,{A:()=>o});const o=t.p+"assets/images/component-mcp-astra-db-efbe2da591a955d0a6fa5259bd659a0e.png"},17886:(e,n,t)=>{t.d(n,{A:()=>s});t(96540);var o=t(64058),a=t(74848);function s({name:e,...n}){const t=o[e];return t?(0,a.jsx)(t,{...n}):null}},89481:(e,n,t)=>{t.r(n),t.d(n,{CH:()=>h,assets:()=>l,chCodeConfig:()=>p,contentTitle:()=>d,default:()=>f,frontMatter:()=>i,metadata:()=>o,toc:()=>g});const o=JSON.parse('{"id":"Integrations/mcp-component-astra","title":"Connect an Astra DB MCP server to Langflow","description":"This guide demonstrates how to use Langflow as an MCP client by using the MCP Tools component to run a DataStax Astra DB MCP server in an agent flow.","source":"@site/docs/Integrations/mcp-component-astra.mdx","sourceDirName":"Integrations","slug":"/mcp-component-astra","permalink":"/mcp-component-astra","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Connect an Astra DB MCP server to Langflow","slug":"/mcp-component-astra"},"sidebar":"docs","previous":{"title":"Use Langflow as an MCP server","permalink":"/mcp-server"},"next":{"title":"API keys and authentication","permalink":"/api-keys-and-authentication"}}');var a=t(74848),s=t(28453),r=t(24754),c=t(17886);const i={title:"Connect an Astra DB MCP server to Langflow",slug:"/mcp-component-astra"},d=void 0,l={},h={annotations:r.hk,Code:r.Cy},p={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},g=[];function u(e){const n={a:"a",admonition:"admonition",code:"code",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",...(0,s.R)(),...e.components};return h||m("CH",!1),h.Code||m("CH.Code",!0),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n","\n",(0,a.jsxs)(n.p,{children:["This guide demonstrates how to ",(0,a.jsx)(n.a,{href:"/mcp-client",children:"use Langflow as an MCP client"})," by using the ",(0,a.jsx)(n.strong,{children:"MCP Tools"})," component to run a ",(0,a.jsx)(n.a,{href:"https://github.com/datastax/astra-db-mcp",children:"DataStax Astra DB MCP server"})," in an agent flow."]}),"\n",(0,a.jsxs)(n.ol,{children:["\n",(0,a.jsxs)(n.li,{children:["\n",(0,a.jsxs)(n.p,{children:["Install an LTS release of ",(0,a.jsx)(n.a,{href:"https://docs.npmjs.com/downloading-and-installing-node-js-and-npm",children:"Node.js"}),"."]}),"\n"]}),"\n",(0,a.jsxs)(n.li,{children:["\n",(0,a.jsxs)(n.p,{children:["Create an ",(0,a.jsx)(n.a,{href:"https://platform.openai.com/",children:"OpenAI"})," API key."]}),"\n"]}),"\n",(0,a.jsxs)(n.li,{children:["\n",(0,a.jsxs)(n.p,{children:["Create an ",(0,a.jsx)(n.a,{href:"https://docs.datastax.com/en/astra-db-serverless/databases/create-database.html#create-vector-database",children:"Astra DB Serverless (Vector) database"}),", if you don't already have one."]}),"\n"]}),"\n",(0,a.jsxs)(n.li,{children:["\n",(0,a.jsxs)(n.p,{children:["Get your database's Astra DB API endpoint and an Astra application token with the ",(0,a.jsx)(n.strong,{children:"Database Administrator"})," role. For more information, see ",(0,a.jsx)(n.a,{href:"https://docs.datastax.com/en/astra-db-serverless/administration/manage-application-tokens.html#database-token",children:"Generate an application token for a database"}),"."]}),"\n"]}),"\n",(0,a.jsxs)(n.li,{children:["\n",(0,a.jsxs)(n.p,{children:["To follow along with this guide, create a flow based on the ",(0,a.jsx)(n.strong,{children:"Simple Agent"})," template."]}),"\n",(0,a.jsx)(n.p,{children:"You can also use an existing flow or create a blank flow."}),"\n"]}),"\n",(0,a.jsxs)(n.li,{children:["\n",(0,a.jsxs)(n.p,{children:["Remove the ",(0,a.jsx)(n.strong,{children:"URL"})," tool, and then replace it with an ",(0,a.jsxs)(n.a,{href:"/mcp-client",children:[(0,a.jsx)(n.strong,{children:"MCP Tools"})," component"]}),"."]}),"\n"]}),"\n",(0,a.jsxs)(n.li,{children:["\n",(0,a.jsxs)(n.p,{children:["Configure the ",(0,a.jsx)(n.strong,{children:"MCP Tools"})," component as follows:"]}),"\n",(0,a.jsxs)(n.ol,{children:["\n",(0,a.jsxs)(n.li,{children:["\n",(0,a.jsxs)(n.p,{children:["Select ",(0,a.jsx)(n.strong,{children:"Stdio"})," mode."]}),"\n"]}),"\n",(0,a.jsxs)(n.li,{children:["\n",(0,a.jsxs)(n.p,{children:["In the ",(0,a.jsx)(n.strong,{children:"MCP server"})," field, add the following code to connect to an Astra DB MCP server:"]}),"\n",(0,a.jsx)(h.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"npx ",props:{style:{color:"#FFA657"}}},{content:"-y ",props:{style:{color:"#79C0FF"}}},{content:"@datastax/astra-db-mcp",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n"]}),"\n",(0,a.jsxs)(n.li,{children:["\n",(0,a.jsxs)(n.p,{children:["In the ",(0,a.jsx)(n.strong,{children:"Env"})," fields, add variables for ",(0,a.jsx)(n.code,{children:"ASTRA_DB_APPLICATION_TOKEN"})," and ",(0,a.jsx)(n.code,{children:"ASTRA_DB_API_ENDPOINT"})," with the values from your Astra database."]}),"\n",(0,a.jsxs)(n.admonition,{type:"important",children:[(0,a.jsxs)(n.p,{children:["Environment variables declared in your Langflow ",(0,a.jsx)(n.code,{children:".env"})," file can be referenced in your MCP server commands, but you cannot reference global variables declared in Langflow."]}),(0,a.jsxs)(n.p,{children:["If you want to use variables for ",(0,a.jsx)(n.code,{children:"ASTRA_DB_APPLICATION_TOKEN"})," and ",(0,a.jsx)(n.code,{children:"ASTRA_DB_API_ENDPOINT"}),", add them to Langflow's ",(0,a.jsx)(n.code,{children:".env"})," file, and then restart Langflow.\nFor more information, see ",(0,a.jsx)(n.a,{href:"/configuration-global-variables",children:"global variables"}),"."]})]}),"\n",(0,a.jsxs)(n.p,{children:["Add each variable separately.\nTo add another variable field click ",(0,a.jsx)(c.A,{name:"Plus","aria-hidden":"true"})," ",(0,a.jsx)(n.strong,{children:"Add More"}),"."]}),"\n",(0,a.jsx)(h.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"ASTRA_DB_APPLICATION_TOKEN",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"AstraCS:...",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,a.jsx)(h.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"ASTRA_DB_API_ENDPOINT",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"https://...-us-east-2.apps.astra.datastax.com",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,a.jsxs)(n.li,{children:["\n",(0,a.jsxs)(n.p,{children:["In the ",(0,a.jsx)(n.strong,{children:"Agent"})," component, add your OpenAI API key."]}),"\n",(0,a.jsxs)(n.p,{children:["The default model is an OpenAI model.\nIf you want to use a different model, edit the ",(0,a.jsx)(n.strong,{children:"Model Provider"}),", ",(0,a.jsx)(n.strong,{children:"Model Name"}),", and ",(0,a.jsx)(n.strong,{children:"API Key"})," fields accordingly."]}),"\n",(0,a.jsx)(n.p,{children:(0,a.jsx)(n.img,{alt:"The Simple Agent flow with the URL tool replaced by an MCP Tools component, and the MCP Tools component launching an Astra DB MCP server",src:t(6892).A+"",width:"4000",height:"2450"})}),"\n"]}),"\n",(0,a.jsxs)(n.li,{children:["\n",(0,a.jsxs)(n.p,{children:["Open the ",(0,a.jsx)(n.strong,{children:"Playground"}),", and then ask the agent, ",(0,a.jsx)(n.code,{children:"What collections are available?"})]}),"\n",(0,a.jsx)(n.p,{children:"Since Langflow is connected to your Astra DB database through the MCP server, the agent chooses the correct tool and connects to your database to retrieve the answer.\nFor example:"}),"\n",(0,a.jsx)(h.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"The available collections in your database are:",props:{}}]},{tokens:[{content:"collection_002",props:{}}]},{tokens:[{content:"hardware_requirements",props:{}}]},{tokens:[{content:"load_collection",props:{}}]},{tokens:[{content:"nvidia_collection",props:{}}]},{tokens:[{content:"software_requirements",props:{}}]}],lang:"text"},annotations:[]}]}),"\n"]}),"\n"]})]})}function f(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,a.jsx)(n,{...e,children:(0,a.jsx)(u,{...e})}):u(e)}function m(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}}}]); \ No newline at end of file +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[5482],{6892:(e,n,t)=>{t.d(n,{A:()=>o});const o=t.p+"assets/images/component-mcp-astra-db-efbe2da591a955d0a6fa5259bd659a0e.png"},17886:(e,n,t)=>{t.d(n,{A:()=>s});t(96540);var o=t(64058),a=t(74848);function s({name:e,...n}){const t=o[e];return t?(0,a.jsx)(t,{...n}):null}},89481:(e,n,t)=>{t.r(n),t.d(n,{CH:()=>h,assets:()=>l,chCodeConfig:()=>p,contentTitle:()=>d,default:()=>f,frontMatter:()=>i,metadata:()=>o,toc:()=>g});const o=JSON.parse('{"id":"Integrations/mcp-component-astra","title":"Connect an Astra DB MCP server to Langflow","description":"This guide demonstrates how to use Langflow as an MCP client by using the MCP Tools component to run a DataStax Astra DB MCP server in an agent flow.","source":"@site/docs/Integrations/mcp-component-astra.mdx","sourceDirName":"Integrations","slug":"/mcp-component-astra","permalink":"/mcp-component-astra","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Connect an Astra DB MCP server to Langflow","slug":"/mcp-component-astra"},"sidebar":"docs","previous":{"title":"Use Langflow as an MCP server","permalink":"/mcp-server"},"next":{"title":"API keys and authentication","permalink":"/api-keys-and-authentication"}}');var a=t(74848),s=t(28453),r=t(24754),c=t(17886);const i={title:"Connect an Astra DB MCP server to Langflow",slug:"/mcp-component-astra"},d=void 0,l={},h={annotations:r.hk,Code:r.Cy},p={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},g=[];function u(e){const n={a:"a",admonition:"admonition",code:"code",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",...(0,s.R)(),...e.components};return h||m("CH",!1),h.Code||m("CH.Code",!0),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n","\n",(0,a.jsxs)(n.p,{children:["This guide demonstrates how to ",(0,a.jsx)(n.a,{href:"/mcp-client",children:"use Langflow as an MCP client"})," by using the ",(0,a.jsx)(n.strong,{children:"MCP Tools"})," component to run a ",(0,a.jsx)(n.a,{href:"https://github.com/datastax/astra-db-mcp",children:"DataStax Astra DB MCP server"})," in an agent flow."]}),"\n",(0,a.jsxs)(n.ol,{children:["\n",(0,a.jsxs)(n.li,{children:["\n",(0,a.jsxs)(n.p,{children:["Install an LTS release of ",(0,a.jsx)(n.a,{href:"https://docs.npmjs.com/downloading-and-installing-node-js-and-npm",children:"Node.js"}),"."]}),"\n"]}),"\n",(0,a.jsxs)(n.li,{children:["\n",(0,a.jsxs)(n.p,{children:["Create an ",(0,a.jsx)(n.a,{href:"https://platform.openai.com/",children:"OpenAI"})," API key."]}),"\n"]}),"\n",(0,a.jsxs)(n.li,{children:["\n",(0,a.jsxs)(n.p,{children:["Create an ",(0,a.jsx)(n.a,{href:"https://docs.datastax.com/en/astra-db-serverless/databases/create-database.html#create-vector-database",children:"Astra DB Serverless (Vector) database"}),", if you don't already have one."]}),"\n"]}),"\n",(0,a.jsxs)(n.li,{children:["\n",(0,a.jsxs)(n.p,{children:["Get your database's Astra DB API endpoint and an Astra application token with the ",(0,a.jsx)(n.strong,{children:"Database Administrator"})," role. For more information, see ",(0,a.jsx)(n.a,{href:"https://docs.datastax.com/en/astra-db-serverless/administration/manage-application-tokens.html#database-token",children:"Generate an application token for a database"}),"."]}),"\n"]}),"\n",(0,a.jsxs)(n.li,{children:["\n",(0,a.jsxs)(n.p,{children:["To follow along with this guide, create a flow based on the ",(0,a.jsx)(n.strong,{children:"Simple Agent"})," template."]}),"\n",(0,a.jsx)(n.p,{children:"You can also use an existing flow or create a blank flow."}),"\n"]}),"\n",(0,a.jsxs)(n.li,{children:["\n",(0,a.jsxs)(n.p,{children:["Remove the ",(0,a.jsx)(n.strong,{children:"URL"})," tool, and then replace it with an ",(0,a.jsxs)(n.a,{href:"/mcp-client",children:[(0,a.jsx)(n.strong,{children:"MCP Tools"})," component"]}),"."]}),"\n"]}),"\n",(0,a.jsxs)(n.li,{children:["\n",(0,a.jsxs)(n.p,{children:["Configure the ",(0,a.jsx)(n.strong,{children:"MCP Tools"})," component as follows:"]}),"\n",(0,a.jsxs)(n.ol,{children:["\n",(0,a.jsxs)(n.li,{children:["\n",(0,a.jsxs)(n.p,{children:["Select ",(0,a.jsx)(n.strong,{children:"Stdio"})," mode."]}),"\n"]}),"\n",(0,a.jsxs)(n.li,{children:["\n",(0,a.jsxs)(n.p,{children:["In the ",(0,a.jsx)(n.strong,{children:"MCP server"})," field, add the following code to connect to an Astra DB MCP server:"]}),"\n",(0,a.jsx)(h.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"npx ",props:{style:{color:"#FFA657"}}},{content:"-y ",props:{style:{color:"#79C0FF"}}},{content:"@datastax/astra-db-mcp",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n"]}),"\n",(0,a.jsxs)(n.li,{children:["\n",(0,a.jsxs)(n.p,{children:["In the ",(0,a.jsx)(n.strong,{children:"Env"})," fields, add variables for ",(0,a.jsx)(n.code,{children:"ASTRA_DB_APPLICATION_TOKEN"})," and ",(0,a.jsx)(n.code,{children:"ASTRA_DB_API_ENDPOINT"})," with the values from your Astra database."]}),"\n",(0,a.jsxs)(n.admonition,{type:"info",children:[(0,a.jsxs)(n.p,{children:["Environment variables declared in your Langflow ",(0,a.jsx)(n.code,{children:".env"})," file can be referenced in your MCP server commands, but you cannot reference global variables declared in Langflow."]}),(0,a.jsxs)(n.p,{children:["If you want to use variables for ",(0,a.jsx)(n.code,{children:"ASTRA_DB_APPLICATION_TOKEN"})," and ",(0,a.jsx)(n.code,{children:"ASTRA_DB_API_ENDPOINT"}),", add them to Langflow's ",(0,a.jsx)(n.code,{children:".env"})," file, and then restart Langflow.\nFor more information, see ",(0,a.jsx)(n.a,{href:"/configuration-global-variables",children:"global variables"}),"."]})]}),"\n",(0,a.jsxs)(n.p,{children:["Add each variable separately.\nTo add another variable field click ",(0,a.jsx)(c.A,{name:"Plus","aria-hidden":"true"})," ",(0,a.jsx)(n.strong,{children:"Add More"}),"."]}),"\n",(0,a.jsx)(h.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"ASTRA_DB_APPLICATION_TOKEN",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"AstraCS:...",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,a.jsx)(h.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"ASTRA_DB_API_ENDPOINT",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"https://...-us-east-2.apps.astra.datastax.com",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,a.jsxs)(n.li,{children:["\n",(0,a.jsxs)(n.p,{children:["In the ",(0,a.jsx)(n.strong,{children:"Agent"})," component, add your OpenAI API key."]}),"\n",(0,a.jsxs)(n.p,{children:["The default model is an OpenAI model.\nIf you want to use a different model, edit the ",(0,a.jsx)(n.strong,{children:"Model Provider"}),", ",(0,a.jsx)(n.strong,{children:"Model Name"}),", and ",(0,a.jsx)(n.strong,{children:"API Key"})," fields accordingly."]}),"\n",(0,a.jsx)(n.p,{children:(0,a.jsx)(n.img,{alt:"The Simple Agent flow with the URL tool replaced by an MCP Tools component, and the MCP Tools component launching an Astra DB MCP server",src:t(6892).A+"",width:"4000",height:"2450"})}),"\n"]}),"\n",(0,a.jsxs)(n.li,{children:["\n",(0,a.jsxs)(n.p,{children:["Open the ",(0,a.jsx)(n.strong,{children:"Playground"}),", and then ask the agent, ",(0,a.jsx)(n.code,{children:"What collections are available?"})]}),"\n",(0,a.jsx)(n.p,{children:"Since Langflow is connected to your Astra DB database through the MCP server, the agent chooses the correct tool and connects to your database to retrieve the answer.\nFor example:"}),"\n",(0,a.jsx)(h.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"The available collections in your database are:",props:{}}]},{tokens:[{content:"collection_002",props:{}}]},{tokens:[{content:"hardware_requirements",props:{}}]},{tokens:[{content:"load_collection",props:{}}]},{tokens:[{content:"nvidia_collection",props:{}}]},{tokens:[{content:"software_requirements",props:{}}]}],lang:"text"},annotations:[]}]}),"\n"]}),"\n"]})]})}function f(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,a.jsx)(n,{...e,children:(0,a.jsx)(u,{...e})}):u(e)}function m(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}}}]); \ No newline at end of file diff --git a/assets/js/a4232cf8.7fe4df4f.js b/assets/js/a4232cf8.be03c692.js similarity index 58% rename from assets/js/a4232cf8.7fe4df4f.js rename to assets/js/a4232cf8.be03c692.js index 8a2d0c13c3..654b475758 100644 --- a/assets/js/a4232cf8.7fe4df4f.js +++ b/assets/js/a4232cf8.be03c692.js @@ -1 +1 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[446],{17886:(e,n,r)=>{r.d(n,{A:()=>o});r(96540);var t=r(64058),s=r(74848);function o({name:e,...n}){const r=t[e];return r?(0,s.jsx)(r,{...n}):null}},31929:(e,n,r)=>{r.d(n,{Ay:()=>c,RM:()=>a});var t=r(74848),s=r(28453),o=r(17886);const a=[];function i(e){const n={a:"a",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,t.jsxs)(n.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,t.jsx)(o.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,t.jsx)(n.strong,{children:"Controls"})," in the ",(0,t.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function c(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(i,{...e})}):i(e)}},50005:(e,n,r)=>{r.d(n,{Ay:()=>i,RM:()=>o});var t=r(74848),s=r(28453);const o=[];function a(e){const n={a:"a",code:"code",p:"p",...(0,s.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(n.p,{children:["Because Langflow is based on LangChain, vector store components use an instance of ",(0,t.jsx)(n.a,{href:"https://python.langchain.com/docs/integrations/vectorstores/",children:"LangChain vector store"})," to drive the underlying read and write functions.\nThese instances are provider-specific and configured according to the component's parameters, such as the connection string, index name, and schema."]}),"\n",(0,t.jsxs)(n.p,{children:["In component code, this is often instantiated as ",(0,t.jsx)(n.code,{children:"vector_store"}),", but some vector store components use a different name, such as the provider name."]}),"\n",(0,t.jsx)(n.p,{children:"Some LangChain classes don't expose all possible options as component parameters.\nDepending on the provider, these options might use default values or allow modification through environment variables, if they are supported in Langflow.\nFor information about specific options, see the LangChain API reference and vector store provider's documentation."})]})}function i(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(a,{...e})}):a(e)}},80223:(e,n,r)=>{r.d(n,{Ay:()=>i,RM:()=>o});var t=r(74848),s=r(28453);const o=[];function a(e){const n={p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,t.jsxs)(n.p,{children:["Some parameters are conditional, and they are only available after you set other parameters or select specific options for other parameters.\nConditional parameters may not be visible on the ",(0,t.jsx)(n.strong,{children:"Controls"})," pane until you set the required dependencies."]})}function i(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(a,{...e})}):a(e)}},88690:(e,n,r)=>{r.d(n,{A:()=>t});const t=r.p+"assets/images/component-chroma-db-b69a08e861be3451fe6f2992e203f516.png"},90116:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>m,contentTitle:()=>p,default:()=>j,frontMatter:()=>l,metadata:()=>t,toc:()=>u});const t=JSON.parse('{"id":"Components/bundles-chroma","title":"Chroma","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/bundles-chroma.mdx","sourceDirName":"Components","slug":"/bundles-chroma","permalink":"/bundles-chroma","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Chroma","slug":"/bundles-chroma"},"sidebar":"docs","previous":{"title":"Cassandra","permalink":"/bundles-cassandra"},"next":{"title":"Cleanlab","permalink":"/integrations-cleanlab"}}');var s=r(74848),o=r(28453),a=r(17886),i=r(31929),c=r(80223),d=r(90465),h=r(50005);const l={title:"Chroma",slug:"/bundles-chroma"},p=void 0,m={},u=[{value:"Chroma DB",id:"chroma-db",level:2},...h.RM,...d.RM,{value:"Use the Chroma DB component in a flow",id:"use-the-chroma-db-component-in-a-flow",level:3},{value:"Chroma DB parameters",id:"chroma-db-parameters",level:3},...i.RM,...c.RM,{value:"See also",id:"see-also",level:2}];function x(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,o.R)(),...e.components},{Details:t}=n;return t||function(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:[(0,s.jsx)(a.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(n.a,{href:"/components-bundle-components",children:(0,s.jsx)(n.strong,{children:"Bundles"})})," contain custom components that support specific third-party integrations with Langflow."]}),"\n",(0,s.jsxs)(n.p,{children:["This page describes the components that are available in the ",(0,s.jsx)(n.strong,{children:"Chroma"})," bundle."]}),"\n",(0,s.jsx)(n.h2,{id:"chroma-db",children:"Chroma DB"}),"\n",(0,s.jsxs)(n.p,{children:["You can use the ",(0,s.jsx)(n.strong,{children:"Chroma DB"})," component to read and write to a Chroma database using an instance of ",(0,s.jsx)(n.code,{children:"Chroma"})," vector store.\nIncludes support for remote or in-memory instances with or without persistence."]}),"\n",(0,s.jsxs)(t,{children:[(0,s.jsx)("summary",{children:"About vector store instances"}),(0,s.jsx)(h.Ay,{})]}),"\n",(0,s.jsx)(n.p,{children:"When writing, the component can create a new database or collection at the specified location."}),"\n",(0,s.jsx)(n.admonition,{type:"tip",children:(0,s.jsx)(n.p,{children:"An ephemeral (non-persistent) local Chroma vector store is helpful for testing vector search flows where you don't need to retain the database."})}),"\n",(0,s.jsx)(d.Ay,{}),"\n",(0,s.jsx)(n.h3,{id:"use-the-chroma-db-component-in-a-flow",children:"Use the Chroma DB component in a flow"}),"\n",(0,s.jsxs)(n.p,{children:["The following example flow uses one ",(0,s.jsx)(n.strong,{children:"Chroma DB"})," component for both reads and writes:"]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"ChromaDB receiving split text",src:r(88690).A+"",width:"4000",height:"2694"})}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["When writing, it splits ",(0,s.jsx)(n.code,{children:"Data"})," from a ",(0,s.jsxs)(n.a,{href:"/components-data#url",children:[(0,s.jsx)(n.strong,{children:"URL"})," component"]})," into chunks, computes embeddings with attached ",(0,s.jsx)(n.strong,{children:"Embedding Model"})," component, and then loads the chunks and embeddings into the Chroma vector store.\nTo trigger writes, click ",(0,s.jsx)(a.A,{name:"Play","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Run component"})," on the ",(0,s.jsx)(n.strong,{children:"Chroma DB"})," component."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["When reading, it uses chat input to perform a similarity search on the vector store, and then print the search results to the chat.\nTo trigger reads, open the ",(0,s.jsx)(n.strong,{children:"Playground"})," and enter a chat message."]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["After running the flow once, you can click ",(0,s.jsx)(a.A,{name:"TextSearch","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Inspect Output"})," on each component to understand how the data transformed as it passed from component to component."]}),"\n",(0,s.jsx)(n.h3,{id:"chroma-db-parameters",children:"Chroma DB parameters"}),"\n",(0,s.jsx)(n.p,{children:"You can inspect a vector store component's parameters to learn more about the inputs it accepts, the features it supports, and how to configure it."}),"\n",(0,s.jsx)(i.Ay,{}),"\n",(0,s.jsx)(c.Ay,{}),"\n",(0,s.jsxs)(n.p,{children:["For information about accepted values and functionality, see the provider's documentation or inspect ",(0,s.jsx)(n.a,{href:"/concepts-components#component-code",children:"component code"}),"."]}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Collection Name"})," (",(0,s.jsx)(n.code,{children:"collection_name"}),")"]}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsxs)(n.td,{children:["Input parameter. The name of your Chroma vector store collection. Default: ",(0,s.jsx)(n.code,{children:"langflow"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Persist Directory"})," (",(0,s.jsx)(n.code,{children:"persist_directory"}),")"]}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsxs)(n.td,{children:["Input parameter. To persist the Chroma database, enter a relative or absolute path to a directory to store the ",(0,s.jsx)(n.code,{children:"chroma.sqlite3"})," file. Leave empty for an ephemeral database. When reading or writing to an existing persistent database, specify the path to the persistent directory."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Ingest Data"})," (",(0,s.jsx)(n.code,{children:"ingest_data"}),")"]}),(0,s.jsx)(n.td,{children:"Data or DataFrame"}),(0,s.jsxs)(n.td,{children:["Input parameter. ",(0,s.jsx)(n.code,{children:"Data"})," or ",(0,s.jsx)(n.code,{children:"DataFrame"})," input containing the records to write to the vector store. Only relevant for writes."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Search Query"})," (",(0,s.jsx)(n.code,{children:"search_query"}),")"]}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. The query to use for vector search. Only relevant for reads."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Cache Vector Store"})," (",(0,s.jsx)(n.code,{children:"cache_vector_store"}),")"]}),(0,s.jsx)(n.td,{children:"Boolean"}),(0,s.jsx)(n.td,{children:"Input parameter. If true, the component caches the vector store in memory for faster reads. Default: Enabled (true)."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Embedding"})," (",(0,s.jsx)(n.code,{children:"embedding"}),")"]}),(0,s.jsx)(n.td,{children:"Embeddings"}),(0,s.jsxs)(n.td,{children:["Input parameter. The embedding function to use for the vector store. By default, Chroma DB uses its built-in embeddings model, or you can attach an ",(0,s.jsx)(n.strong,{children:"Embedding Model"})," component to use a different provider or model."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"CORS Allow Origins"})," (",(0,s.jsx)(n.code,{children:"chroma_server_cors_allow_origins"}),")"]}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. The allowed CORS origins for the Chroma server."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Chroma Server Host"})," (",(0,s.jsx)(n.code,{children:"chroma_server_host"}),")"]}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. The host for the Chroma server."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Chroma Server HTTP Port"})," (",(0,s.jsx)(n.code,{children:"chroma_server_http_port"}),")"]}),(0,s.jsx)(n.td,{children:"Integer"}),(0,s.jsx)(n.td,{children:"Input parameter. The HTTP port for the Chroma server."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Chroma Server gRPC Port"})," (",(0,s.jsx)(n.code,{children:"chroma_server_grpc_port"}),")"]}),(0,s.jsx)(n.td,{children:"Integer"}),(0,s.jsx)(n.td,{children:"Input parameter. The gRPC port for the Chroma server."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Chroma Server SSL Enabled"})," (",(0,s.jsx)(n.code,{children:"chroma_server_ssl_enabled"}),")"]}),(0,s.jsx)(n.td,{children:"Boolean"}),(0,s.jsx)(n.td,{children:"Input parameter. Enable SSL for the Chroma server."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Allow Duplicates"})," (",(0,s.jsx)(n.code,{children:"allow_duplicates"}),")"]}),(0,s.jsx)(n.td,{children:"Boolean"}),(0,s.jsxs)(n.td,{children:["Input parameter. If true (default), writes don't check for existing duplicates in the collection, allowing you to store multiple copies of the same content. If false, writes won't add documents that match existing documents already present in the collection. If false, it can strictly enforce deduplication by searching the entire collection or only search the number of records, specified in ",(0,s.jsx)(n.code,{children:"limit"}),". Only relevant for writes."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Search Type"})," (",(0,s.jsx)(n.code,{children:"search_type"}),")"]}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsxs)(n.td,{children:["Input parameter. The type of search to perform, either ",(0,s.jsx)(n.code,{children:"Similarity"})," or ",(0,s.jsx)(n.code,{children:"MMR"}),". Only relevant for reads."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Number of Results"})," (",(0,s.jsx)(n.code,{children:"number_of_results"}),")"]}),(0,s.jsx)(n.td,{children:"Integer"}),(0,s.jsxs)(n.td,{children:["Input parameter. The number of search results to return. Default: ",(0,s.jsx)(n.code,{children:"10"}),". Only relevant for reads."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Limit"})," (",(0,s.jsx)(n.code,{children:"limit"}),")"]}),(0,s.jsx)(n.td,{children:"Integer"}),(0,s.jsxs)(n.td,{children:["Input parameter. Limit the number of records to compare when ",(0,s.jsx)(n.strong,{children:"Allow Duplicates"})," is false. This can help improve performance when writing to large collections, but it can result in some duplicate records. Only relevant for writes."]})]})]})]}),"\n",(0,s.jsx)(n.h2,{id:"see-also",children:"See also"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsxs)(n.a,{href:"/components-bundle-components#vector-stores-bundle",children:[(0,s.jsx)(n.strong,{children:"Local DB"})," component"]})}),"\n"]})]})}function j(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(x,{...e})}):x(e)}},90465:(e,n,r)=>{r.d(n,{Ay:()=>i,RM:()=>o});var t=r(74848),s=r(28453);const o=[];function a(e){const n={a:"a",code:"code",p:"p",...(0,s.R)(),...e.components};return(0,t.jsxs)(n.p,{children:["If you use a vector store component to query your vector database, it produces search results that you can pass to downstream components in your flow as a list of ",(0,t.jsx)(n.a,{href:"/data-types#data",children:(0,t.jsx)(n.code,{children:"Data"})})," objects or a tabular ",(0,t.jsx)(n.a,{href:"/data-types#dataframe",children:(0,t.jsx)(n.code,{children:"DataFrame"})}),".\nIf both types are supported, you can set the format near the vector store component's output port in the visual editor."]})}function i(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(a,{...e})}):a(e)}}}]); \ No newline at end of file +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[446],{17886:(e,n,r)=>{r.d(n,{A:()=>o});r(96540);var t=r(64058),s=r(74848);function o({name:e,...n}){const r=t[e];return r?(0,s.jsx)(r,{...n}):null}},31929:(e,n,r)=>{r.d(n,{Ay:()=>a,RM:()=>c});var t=r(74848),s=r(28453),o=r(17886);const c=[];function i(e){const n={a:"a",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,t.jsxs)(n.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,t.jsx)(o.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,t.jsx)(n.strong,{children:"Controls"})," in the ",(0,t.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function a(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(i,{...e})}):i(e)}},50005:(e,n,r)=>{r.d(n,{Ay:()=>i,RM:()=>o});var t=r(74848),s=r(28453);const o=[];function c(e){const n={a:"a",code:"code",p:"p",...(0,s.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(n.p,{children:["Because Langflow is based on LangChain, vector store components use an instance of ",(0,t.jsx)(n.a,{href:"https://python.langchain.com/docs/integrations/vectorstores/",children:"LangChain vector store"})," to drive the underlying read and write functions.\nThese instances are provider-specific and configured according to the component's parameters, such as the connection string, index name, and schema."]}),"\n",(0,t.jsxs)(n.p,{children:["In component code, this is often instantiated as ",(0,t.jsx)(n.code,{children:"vector_store"}),", but some vector store components use a different name, such as the provider name."]}),"\n",(0,t.jsx)(n.p,{children:"Some LangChain classes don't expose all possible options as component parameters.\nDepending on the provider, these options might use default values or allow modification through environment variables, if they are supported in Langflow.\nFor information about specific options, see the LangChain API reference and vector store provider's documentation."})]})}function i(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(c,{...e})}):c(e)}},80223:(e,n,r)=>{r.d(n,{Ay:()=>i,RM:()=>o});var t=r(74848),s=r(28453);const o=[];function c(e){const n={p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,t.jsxs)(n.p,{children:["Some parameters are conditional, and they are only available after you set other parameters or select specific options for other parameters.\nConditional parameters may not be visible on the ",(0,t.jsx)(n.strong,{children:"Controls"})," pane until you set the required dependencies."]})}function i(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(c,{...e})}):c(e)}},88690:(e,n,r)=>{r.d(n,{A:()=>t});const t=r.p+"assets/images/component-chroma-db-b69a08e861be3451fe6f2992e203f516.png"},90116:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>m,contentTitle:()=>p,default:()=>j,frontMatter:()=>l,metadata:()=>t,toc:()=>x});const t=JSON.parse('{"id":"Components/bundles-chroma","title":"Chroma","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/bundles-chroma.mdx","sourceDirName":"Components","slug":"/bundles-chroma","permalink":"/bundles-chroma","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Chroma","slug":"/bundles-chroma"},"sidebar":"docs","previous":{"title":"Cassandra","permalink":"/bundles-cassandra"},"next":{"title":"Cleanlab","permalink":"/integrations-cleanlab"}}');var s=r(74848),o=r(28453),c=r(17886),i=r(31929),a=r(80223),d=r(90465),h=r(50005);const l={title:"Chroma",slug:"/bundles-chroma"},p=void 0,m={},x=[{value:"Chroma DB",id:"chroma-db",level:2},...h.RM,...d.RM,{value:"Use the Chroma DB component in a flow",id:"use-the-chroma-db-component-in-a-flow",level:3},{value:"Chroma DB parameters",id:"chroma-db-parameters",level:3},...i.RM,...a.RM,{value:"See also",id:"see-also",level:2}];function u(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,o.R)(),...e.components},{Details:t}=n;return t||function(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:[(0,s.jsx)(c.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(n.a,{href:"/components-bundle-components",children:(0,s.jsx)(n.strong,{children:"Bundles"})})," contain custom components that support specific third-party integrations with Langflow."]}),"\n",(0,s.jsxs)(n.p,{children:["This page describes the components that are available in the ",(0,s.jsx)(n.strong,{children:"Chroma"})," bundle."]}),"\n",(0,s.jsx)(n.h2,{id:"chroma-db",children:"Chroma DB"}),"\n",(0,s.jsxs)(n.p,{children:["You can use the ",(0,s.jsx)(n.strong,{children:"Chroma DB"})," component to read and write to a Chroma database using an instance of ",(0,s.jsx)(n.code,{children:"Chroma"})," vector store.\nIncludes support for remote or in-memory instances with or without persistence."]}),"\n",(0,s.jsxs)(t,{children:[(0,s.jsx)("summary",{children:"About vector store instances"}),(0,s.jsx)(h.Ay,{})]}),"\n",(0,s.jsx)(n.p,{children:"When writing, the component can create a new database or collection at the specified location."}),"\n",(0,s.jsx)(n.admonition,{type:"tip",children:(0,s.jsx)(n.p,{children:"An ephemeral (non-persistent) local Chroma vector store is helpful for testing vector search flows where you don't need to retain the database."})}),"\n",(0,s.jsx)(d.Ay,{}),"\n",(0,s.jsx)(n.h3,{id:"use-the-chroma-db-component-in-a-flow",children:"Use the Chroma DB component in a flow"}),"\n",(0,s.jsxs)(n.p,{children:["The following example flow uses one ",(0,s.jsx)(n.strong,{children:"Chroma DB"})," component for both reads and writes:"]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"ChromaDB receiving split text",src:r(88690).A+"",width:"4000",height:"2694"})}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["When writing, it splits ",(0,s.jsx)(n.code,{children:"Data"})," from a ",(0,s.jsxs)(n.a,{href:"/components-data#url",children:[(0,s.jsx)(n.strong,{children:"URL"})," component"]})," into chunks, computes embeddings with attached ",(0,s.jsx)(n.strong,{children:"Embedding Model"})," component, and then loads the chunks and embeddings into the Chroma vector store.\nTo trigger writes, click ",(0,s.jsx)(c.A,{name:"Play","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Run component"})," on the ",(0,s.jsx)(n.strong,{children:"Chroma DB"})," component."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["When reading, it uses chat input to perform a similarity search on the vector store, and then print the search results to the chat.\nTo trigger reads, open the ",(0,s.jsx)(n.strong,{children:"Playground"})," and enter a chat message."]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["After running the flow once, you can click ",(0,s.jsx)(c.A,{name:"TextSearch","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Inspect Output"})," on each component to understand how the data transformed as it passed from component to component."]}),"\n",(0,s.jsx)(n.h3,{id:"chroma-db-parameters",children:"Chroma DB parameters"}),"\n",(0,s.jsx)(n.p,{children:"You can inspect a vector store component's parameters to learn more about the inputs it accepts, the features it supports, and how to configure it."}),"\n",(0,s.jsx)(i.Ay,{}),"\n",(0,s.jsx)(a.Ay,{}),"\n",(0,s.jsxs)(n.p,{children:["For information about accepted values and functionality, see the provider's documentation or inspect ",(0,s.jsx)(n.a,{href:"/concepts-components#component-code",children:"component code"}),"."]}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Collection Name"})," (",(0,s.jsx)(n.code,{children:"collection_name"}),")"]}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsxs)(n.td,{children:["Input parameter. The name of your Chroma vector store collection. Default: ",(0,s.jsx)(n.code,{children:"langflow"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Persist Directory"})," (",(0,s.jsx)(n.code,{children:"persist_directory"}),")"]}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsxs)(n.td,{children:["Input parameter. To persist the Chroma database, enter a relative or absolute path to a directory to store the ",(0,s.jsx)(n.code,{children:"chroma.sqlite3"})," file. Leave empty for an ephemeral database. When reading or writing to an existing persistent database, specify the path to the persistent directory."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Ingest Data"})," (",(0,s.jsx)(n.code,{children:"ingest_data"}),")"]}),(0,s.jsx)(n.td,{children:"Data or DataFrame"}),(0,s.jsxs)(n.td,{children:["Input parameter. ",(0,s.jsx)(n.code,{children:"Data"})," or ",(0,s.jsx)(n.code,{children:"DataFrame"})," input containing the records to write to the vector store. Only relevant for writes."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Search Query"})," (",(0,s.jsx)(n.code,{children:"search_query"}),")"]}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. The query to use for vector search. Only relevant for reads."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Cache Vector Store"})," (",(0,s.jsx)(n.code,{children:"cache_vector_store"}),")"]}),(0,s.jsx)(n.td,{children:"Boolean"}),(0,s.jsxs)(n.td,{children:["Input parameter. If ",(0,s.jsx)(n.code,{children:"true"}),", the component caches the vector store in memory for faster reads. Default: Enabled (",(0,s.jsx)(n.code,{children:"true"}),")."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Embedding"})," (",(0,s.jsx)(n.code,{children:"embedding"}),")"]}),(0,s.jsx)(n.td,{children:"Embeddings"}),(0,s.jsxs)(n.td,{children:["Input parameter. The embedding function to use for the vector store. By default, Chroma DB uses its built-in embeddings model, or you can attach an ",(0,s.jsx)(n.strong,{children:"Embedding Model"})," component to use a different provider or model."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"CORS Allow Origins"})," (",(0,s.jsx)(n.code,{children:"chroma_server_cors_allow_origins"}),")"]}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. The allowed CORS origins for the Chroma server."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Chroma Server Host"})," (",(0,s.jsx)(n.code,{children:"chroma_server_host"}),")"]}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. The host for the Chroma server."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Chroma Server HTTP Port"})," (",(0,s.jsx)(n.code,{children:"chroma_server_http_port"}),")"]}),(0,s.jsx)(n.td,{children:"Integer"}),(0,s.jsx)(n.td,{children:"Input parameter. The HTTP port for the Chroma server."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Chroma Server gRPC Port"})," (",(0,s.jsx)(n.code,{children:"chroma_server_grpc_port"}),")"]}),(0,s.jsx)(n.td,{children:"Integer"}),(0,s.jsx)(n.td,{children:"Input parameter. The gRPC port for the Chroma server."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Chroma Server SSL Enabled"})," (",(0,s.jsx)(n.code,{children:"chroma_server_ssl_enabled"}),")"]}),(0,s.jsx)(n.td,{children:"Boolean"}),(0,s.jsx)(n.td,{children:"Input parameter. Enable SSL for the Chroma server."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Allow Duplicates"})," (",(0,s.jsx)(n.code,{children:"allow_duplicates"}),")"]}),(0,s.jsx)(n.td,{children:"Boolean"}),(0,s.jsxs)(n.td,{children:["Input parameter. If ",(0,s.jsx)(n.code,{children:"true"})," (default), writes don't check for existing duplicates in the collection, allowing you to store multiple copies of the same content. If ",(0,s.jsx)(n.code,{children:"false"}),", writes won't add documents that match existing documents already present in the collection. If ",(0,s.jsx)(n.code,{children:"false"}),", it can strictly enforce deduplication by searching the entire collection or only search the number of records, specified in ",(0,s.jsx)(n.code,{children:"limit"}),". Only relevant for writes."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Search Type"})," (",(0,s.jsx)(n.code,{children:"search_type"}),")"]}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsxs)(n.td,{children:["Input parameter. The type of search to perform, either ",(0,s.jsx)(n.code,{children:"Similarity"})," or ",(0,s.jsx)(n.code,{children:"MMR"}),". Only relevant for reads."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Number of Results"})," (",(0,s.jsx)(n.code,{children:"number_of_results"}),")"]}),(0,s.jsx)(n.td,{children:"Integer"}),(0,s.jsxs)(n.td,{children:["Input parameter. The number of search results to return. Default: ",(0,s.jsx)(n.code,{children:"10"}),". Only relevant for reads."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsxs)(n.td,{children:[(0,s.jsx)(n.strong,{children:"Limit"})," (",(0,s.jsx)(n.code,{children:"limit"}),")"]}),(0,s.jsx)(n.td,{children:"Integer"}),(0,s.jsxs)(n.td,{children:["Input parameter. Limit the number of records to compare when ",(0,s.jsx)(n.strong,{children:"Allow Duplicates"})," is ",(0,s.jsx)(n.code,{children:"false"}),". This can help improve performance when writing to large collections, but it can result in some duplicate records. Only relevant for writes."]})]})]})]}),"\n",(0,s.jsx)(n.h2,{id:"see-also",children:"See also"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsxs)(n.a,{href:"/components-bundle-components#vector-stores-bundle",children:[(0,s.jsx)(n.strong,{children:"Local DB"})," component"]})}),"\n"]})]})}function j(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(u,{...e})}):u(e)}},90465:(e,n,r)=>{r.d(n,{Ay:()=>i,RM:()=>o});var t=r(74848),s=r(28453);const o=[];function c(e){const n={a:"a",code:"code",p:"p",...(0,s.R)(),...e.components};return(0,t.jsxs)(n.p,{children:["If you use a vector store component to query your vector database, it produces search results that you can pass to downstream components in your flow as a list of ",(0,t.jsx)(n.a,{href:"/data-types#data",children:(0,t.jsx)(n.code,{children:"Data"})})," objects or a tabular ",(0,t.jsx)(n.a,{href:"/data-types#dataframe",children:(0,t.jsx)(n.code,{children:"DataFrame"})}),".\nIf both types are supported, you can set the format near the vector store component's output port in the visual editor."]})}function i(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(c,{...e})}):c(e)}}}]); \ No newline at end of file diff --git a/assets/js/a4b6c971.d001e931.js b/assets/js/a4b6c971.79b20516.js similarity index 50% rename from assets/js/a4b6c971.d001e931.js rename to assets/js/a4b6c971.79b20516.js index ce59855fca..bdca331cb9 100644 --- a/assets/js/a4b6c971.d001e931.js +++ b/assets/js/a4b6c971.79b20516.js @@ -1 +1 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[8268],{11470:(e,n,t)=>{t.d(n,{A:()=>y});var o=t(96540),r=t(18215),l=t(23104),a=t(56347),s=t(205),i=t(57485),c=t(31682),d=t(70679);function h(e){return o.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,o.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function u(e){const{values:n,children:t}=e;return(0,o.useMemo)(()=>{const e=n??function(e){return h(e).map(({props:{value:e,label:n,attributes:t,default:o}})=>({value:e,label:n,attributes:t,default:o}))}(t);return function(e){const n=(0,c.XI)(e,(e,n)=>e.value===n.value);if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map(e=>e.value).join(", ")}" found in . Every value needs to be unique.`)}(e),e},[n,t])}function p({value:e,tabValues:n}){return n.some(n=>n.value===e)}function f({queryString:e=!1,groupId:n}){const t=(0,a.W6)(),r=function({queryString:e=!1,groupId:n}){if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:e,groupId:n});return[(0,i.aZ)(r),(0,o.useCallback)(e=>{if(!r)return;const n=new URLSearchParams(t.location.search);n.set(r,e),t.replace({...t.location,search:n.toString()})},[r,t])]}function g(e){const{defaultValue:n,queryString:t=!1,groupId:r}=e,l=u(e),[a,i]=(0,o.useState)(()=>function({defaultValue:e,tabValues:n}){if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(e){if(!p({value:e,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${n.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}const t=n.find(e=>e.default)??n[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:n,tabValues:l})),[c,h]=f({queryString:t,groupId:r}),[g,x]=function({groupId:e}){const n=function(e){return e?`docusaurus.tab.${e}`:null}(e),[t,r]=(0,d.Dv)(n);return[t,(0,o.useCallback)(e=>{n&&r.set(e)},[n,r])]}({groupId:r}),m=(()=>{const e=c??g;return p({value:e,tabValues:l})?e:null})();(0,s.A)(()=>{m&&i(m)},[m]);return{selectedValue:a,selectValue:(0,o.useCallback)(e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),h(e),x(e)},[h,x,l]),tabValues:l}}var x=t(92303);const m={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var j=t(74848);function v({className:e,block:n,selectedValue:t,selectValue:o,tabValues:a}){const s=[],{blockElementScrollPositionUntilNextRender:i}=(0,l.a_)(),c=e=>{const n=e.currentTarget,r=s.indexOf(n),l=a[r].value;l!==t&&(i(n),o(l))},d=e=>{let n=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const t=s.indexOf(e.currentTarget)+1;n=s[t]??s[0];break}case"ArrowLeft":{const t=s.indexOf(e.currentTarget)-1;n=s[t]??s[s.length-1];break}}n?.focus()};return(0,j.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.A)("tabs",{"tabs--block":n},e),children:a.map(({value:e,label:n,attributes:o})=>(0,j.jsx)("li",{role:"tab",tabIndex:t===e?0:-1,"aria-selected":t===e,ref:e=>{s.push(e)},onKeyDown:d,onClick:c,...o,className:(0,r.A)("tabs__item",m.tabItem,o?.className,{"tabs__item--active":t===e}),children:n??e},e))})}function w({lazy:e,children:n,selectedValue:t}){const l=(Array.isArray(n)?n:[n]).filter(Boolean);if(e){const e=l.find(e=>e.props.value===t);return e?(0,o.cloneElement)(e,{className:(0,r.A)("margin-top--md",e.props.className)}):null}return(0,j.jsx)("div",{className:"margin-top--md",children:l.map((e,n)=>(0,o.cloneElement)(e,{key:n,hidden:e.props.value!==t}))})}function b(e){const n=g(e);return(0,j.jsxs)("div",{className:(0,r.A)("tabs-container",m.tabList),children:[(0,j.jsx)(v,{...n,...e}),(0,j.jsx)(w,{...n,...e})]})}function y(e){const n=(0,x.A)();return(0,j.jsx)(b,{...e,children:h(e.children)},String(n))}},19365:(e,n,t)=>{t.d(n,{A:()=>a});t(96540);var o=t(18215);const r={tabItem:"tabItem_Ymn6"};var l=t(74848);function a({children:e,hidden:n,className:t}){return(0,l.jsx)("div",{role:"tabpanel",className:(0,o.A)(r.tabItem,t),hidden:n,children:e})}},28453:(e,n,t)=>{t.d(n,{R:()=>a,x:()=>s});var o=t(96540);const r={},l=o.createContext(r);function a(e){const n=o.useContext(l);return o.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function s(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:a(e.components),o.createElement(l.Provider,{value:n},e.children)}},29368:(e,n,t)=>{t.r(n),t.d(n,{CH:()=>u,assets:()=>h,chCodeConfig:()=>p,contentTitle:()=>d,default:()=>x,frontMatter:()=>c,metadata:()=>o,toc:()=>f});const o=JSON.parse('{"id":"Get-Started/get-started-installation","title":"Install Langflow","description":"Langflow can be installed in multiple ways:","source":"@site/docs/Get-Started/get-started-installation.mdx","sourceDirName":"Get-Started","slug":"/get-started-installation","permalink":"/get-started-installation","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Install Langflow","slug":"/get-started-installation"},"sidebar":"docs","previous":{"title":"About Langflow","permalink":"/"},"next":{"title":"Quickstart","permalink":"/get-started-quickstart"}}');var r=t(74848),l=t(28453),a=t(24754),s=t(11470),i=t(19365);const c={title:"Install Langflow",slug:"/get-started-installation"},d=void 0,h={},u={annotations:a.hk,Code:a.Cy},p={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},f=[{value:"Install and run Langflow Desktop",id:"install-and-run-langflow-desktop",level:2},{value:"Install and run Langflow with Docker",id:"install-and-run-langflow-docker",level:2},{value:"Install and run the Langflow OSS Python package",id:"install-and-run-the-langflow-oss-python-package",level:2},{value:"Next steps",id:"next-steps",level:2}];function g(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,l.R)(),...e.components},{Details:t}=n;return u||m("CH",!1),u.Code||m("CH.Code",!0),t||m("Details",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n","\n",(0,r.jsx)(n.p,{children:"Langflow can be installed in multiple ways:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.a,{href:"#install-and-run-langflow-desktop",children:(0,r.jsx)(n.strong,{children:"Langflow Desktop (Recommended)"})}),": Download and install the standalone desktop application for the least complicated setup experience.\nThis option includes dependency management and facilitated upgrades."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.a,{href:"#install-and-run-langflow-docker",children:(0,r.jsx)(n.strong,{children:"Docker"})}),": Pull and run the Langflow Docker image to start a Langflow container and run Langflow in isolation."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.a,{href:"#install-and-run-the-langflow-oss-python-package",children:(0,r.jsx)(n.strong,{children:"Python package"})}),": Install and run the Langflow OSS Python package.\nThis option offers more control over the environment, dependencies, and versioning."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.a,{href:"/contributing-how-to-contribute#install-langflow-from-source",children:(0,r.jsx)(n.strong,{children:"Install from source"})}),": Use this option if you want to contribute to the Langflow codebase or documentation."]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"install-and-run-langflow-desktop",children:"Install and run Langflow Desktop"}),"\n",(0,r.jsxs)(n.p,{children:["Langflow Desktop is a desktop version of Langflow that simplifies dependency management and upgrades.\nHowever, some features aren't available for Langflow Desktop, such as the ",(0,r.jsx)(n.strong,{children:"Shareable Playground"}),"."]}),"\n",(0,r.jsxs)(s.A,{children:[(0,r.jsxs)(i.A,{value:"macos",label:"macOS",default:!0,children:[(0,r.jsx)(n.p,{children:"Langflow Desktop requires macOS 13 or later."}),(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["Navigate to ",(0,r.jsx)(n.a,{href:"https://www.langflow.org/desktop",children:"Langflow Desktop"}),"."]}),"\n",(0,r.jsxs)(n.li,{children:["Click ",(0,r.jsx)(n.strong,{children:"Download Langflow"}),", enter your contact information, and then click ",(0,r.jsx)(n.strong,{children:"Download"}),"."]}),"\n",(0,r.jsx)(n.li,{children:"Mount and install the Langflow application."}),"\n",(0,r.jsxs)(n.li,{children:["When the installation completes, open the Langflow application, and then create your first flow with the ",(0,r.jsx)(n.a,{href:"/get-started-quickstart",children:"Quickstart"}),"."]}),"\n"]})]}),(0,r.jsx)(i.A,{value:"Windows",label:"Windows",children:(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Navigate to ",(0,r.jsx)(n.a,{href:"https://www.langflow.org/desktop",children:"Langflow Desktop"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Click ",(0,r.jsx)(n.strong,{children:"Download Langflow"}),", enter your contact information, and then click ",(0,r.jsx)(n.strong,{children:"Download"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Open the ",(0,r.jsx)(n.strong,{children:"File Explorer"}),", and then navigate to ",(0,r.jsx)(n.strong,{children:"Downloads"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Double-click the downloaded ",(0,r.jsx)(n.code,{children:".msi"})," file, and then use the install wizard to install Langflow Desktop."]}),"\n",(0,r.jsx)(n.admonition,{type:"important",children:(0,r.jsxs)(n.p,{children:["Windows installations of Langflow Desktop require a C++ compiler that may not be present on your system. If you receive a ",(0,r.jsx)(n.code,{children:"C++ Build Tools Required!"})," error, follow the on-screen prompt to install Microsoft C++ Build Tools, or ",(0,r.jsx)(n.a,{href:"https://visualstudio.microsoft.com/downloads/",children:"install Microsoft Visual Studio"}),"."]})}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["When the installation completes, open the Langflow application, and then create your first flow with the ",(0,r.jsx)(n.a,{href:"/get-started-quickstart",children:"Quickstart"}),"."]}),"\n"]}),"\n"]})})]}),"\n",(0,r.jsxs)(n.p,{children:["For upgrade information, see the ",(0,r.jsx)(n.a,{href:"/release-notes",children:"Release notes"}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["To manage dependencies in Langflow Desktop, see ",(0,r.jsx)(n.a,{href:"/install-custom-dependencies#langflow-desktop",children:"Install custom dependencies in Langflow Desktop"}),"."]}),"\n",(0,r.jsx)(n.h2,{id:"install-and-run-langflow-docker",children:"Install and run Langflow with Docker"}),"\n",(0,r.jsxs)(n.p,{children:["You can use the Langflow Docker image to start a Langflow container.\nFor more information, see ",(0,r.jsx)(n.a,{href:"/deployment-docker",children:"Deploy Langflow on Docker"}),"."]}),"\n",(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Install and start ",(0,r.jsx)(n.a,{href:"https://docs.docker.com/",children:"Docker"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Pull the latest ",(0,r.jsx)(n.a,{href:"https://hub.docker.com/r/langflowai/langflow",children:"Langflow Docker image"})," and start it:"]}),"\n",(0,r.jsx)(u.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"docker ",props:{style:{color:"#FFA657"}}},{content:"run ",props:{style:{color:"#A5D6FF"}}},{content:"-p ",props:{style:{color:"#79C0FF"}}},{content:"7860:",props:{style:{color:"#A5D6FF"}}},{content:"7860 ",props:{style:{color:"#79C0FF"}}},{content:"langflowai/langflow:latest",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["To access Langflow, navigate to ",(0,r.jsx)(n.code,{children:"http://localhost:7860/"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Create your first flow with the ",(0,r.jsx)(n.a,{href:"/get-started-quickstart",children:"Quickstart"}),"."]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"install-and-run-the-langflow-oss-python-package",children:"Install and run the Langflow OSS Python package"}),"\n",(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Make sure you have the required dependencies and infrastructure:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.a,{href:"https://www.python.org/downloads/release/python-3100/",children:"Python"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"macOS and Linux: Version 3.10 to 3.13"}),"\n",(0,r.jsx)(n.li,{children:"Windows: Version 3.10 to 3.12"}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://docs.astral.sh/uv/getting-started/installation/",children:"uv"})}),"\n",(0,r.jsxs)(n.li,{children:["Sufficient infrastructure:","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Minimum: Dual-core CPU and 2 GB RAM"}),"\n",(0,r.jsx)(n.li,{children:"Recommended: Multi-core CPU and at least 4 GB RAM"}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Create a virtual environment with ",(0,r.jsx)(n.a,{href:"https://docs.astral.sh/uv/pip/environments",children:"uv"}),"."]}),"\n",(0,r.jsxs)(t,{children:[(0,r.jsx)("summary",{children:"Need help with virtual environments?"}),(0,r.jsx)(n.p,{children:"Virtual environments ensure Langflow is installed in an isolated, fresh environment.\nTo create a new virtual environment, do the following."}),(0,r.jsxs)(s.A,{children:[(0,r.jsx)(i.A,{value:"linux-macos",label:"Linux or macOS",default:!0,children:(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Navigate to where you want your virtual environment to be created, and then create it with ",(0,r.jsx)(n.code,{children:"uv"}),":"]}),"\n",(0,r.jsx)(u.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"uv ",props:{style:{color:"#FFA657"}}},{content:"venv VENV_NAME",props:{style:{color:"#A5D6FF"}}}]}],lang:"shell"},annotations:[]}]}),"\n",(0,r.jsxs)(n.p,{children:["Replace ",(0,r.jsx)(n.code,{children:"VENV_NAME"})," with a name for your virtual environment."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Start the virtual environment:"}),"\n",(0,r.jsx)(u.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"source ",props:{style:{color:"#79C0FF"}}},{content:"VENV_NAME/bin/activate",props:{style:{color:"#A5D6FF"}}}]}],lang:"shell"},annotations:[]}]}),"\n",(0,r.jsx)(n.p,{children:"Your shell's prompt changes to display that you're currently working in a virtual environment:"}),"\n",(0,r.jsx)(u.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"(VENV_NAME) \u279c langflow git:(main) \u2717",props:{}}]}],lang:"text"},annotations:[]}]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["To deactivate the virtual environment and return to your regular shell, type ",(0,r.jsx)(n.code,{children:"deactivate"}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["When activated, the virtual environment temporarily modifies your ",(0,r.jsx)(n.code,{children:"PATH"})," variable to prioritize packages installed within the virtual environment.\nTo avoid conflicts with other projects, it's a good idea to deactivate your virtual environment when you're done working in it."]}),"\n",(0,r.jsxs)(n.p,{children:["To delete the virtual environment, type ",(0,r.jsx)(n.code,{children:"rm -rf VENV_NAME"}),".\nThis completely removes the virtual environment directory and its contents."]}),"\n"]}),"\n"]})}),(0,r.jsx)(i.A,{value:"Windows",label:"Windows",children:(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Navigate to where you want your virtual environment to be created, and create it with ",(0,r.jsx)(n.code,{children:"uv"}),"."]}),"\n",(0,r.jsx)(u.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"uv ",props:{style:{color:"#FFA657"}}},{content:"venv VENV_NAME",props:{style:{color:"#A5D6FF"}}}]}],lang:"shell"},annotations:[]}]}),"\n",(0,r.jsxs)(n.p,{children:["Replace ",(0,r.jsx)(n.code,{children:"VENV_NAME"})," with a name for your virtual environment."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Start the virtual environment:"}),"\n",(0,r.jsx)(u.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"VENV_NAME\\Scripts\\activate",props:{style:{color:"#FFA657"}}}]}],lang:"shell"},annotations:[]}]}),"\n",(0,r.jsx)(n.p,{children:"Your shell's prompt changes to display that you're currently working in a virtual environment:"}),"\n",(0,r.jsx)(u.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"(VENV_NAME) PS C:/users/username/langflow-dir>",props:{}}]}],lang:"text"},annotations:[]}]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["To deactivate the virtual environment and return to your regular shell, type ",(0,r.jsx)(n.code,{children:"deactivate"}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["When activated, the virtual environment temporarily modifies your ",(0,r.jsx)(n.code,{children:"PATH"})," variable to prioritize packages installed within the virtual environment.\nTo avoid conflicts with other projects, it's a good idea to deactivate your virtual environment when you're done working in it."]}),"\n",(0,r.jsxs)(n.p,{children:["To delete the virtual environment, type ",(0,r.jsx)(n.code,{children:"Remove-Item VENV_NAME"}),".\nThis completely removes the virtual environment directory and its contents."]}),"\n"]}),"\n"]})})]})]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"In your virtual environment, install Langflow:"}),"\n",(0,r.jsx)(u.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"uv ",props:{style:{color:"#FFA657"}}},{content:"pip install langflow",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,r.jsxs)(n.p,{children:["To install a specific version of the Langflow package by adding the required version to the command, such as ",(0,r.jsx)(n.code,{children:"uv pip install langflow==1.4.22"}),"."]}),"\n",(0,r.jsxs)(t,{children:[(0,r.jsx)("summary",{children:"Reinstall or upgrade Langflow"}),(0,r.jsxs)(n.p,{children:["To reinstall Langflow and all of its dependencies, run ",(0,r.jsx)(n.code,{children:"uv pip install langflow --force-reinstall"}),"."]}),(0,r.jsxs)(n.p,{children:["To upgrade Langflow to the latest version, run ",(0,r.jsx)(n.code,{children:"uv pip install langflow -U"}),".\nHowever, the Langflow team recommends taking steps to backup your existing installation before you upgrade Langflow.\nFor more information, see ",(0,r.jsx)(n.a,{href:"/release-notes#prepare-to-upgrade",children:"Prepare to upgrade"}),"."]})]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Start Langflow:"}),"\n",(0,r.jsx)(u.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"uv ",props:{style:{color:"#FFA657"}}},{content:"run langflow run",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,r.jsx)(n.p,{children:"It can take a few minutes for Langflow to start."}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["To confirm that a local Langflow instance is running, navigate to the default Langflow URL ",(0,r.jsx)(n.code,{children:"http://127.0.0.1:7860"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Create your first flow with the ",(0,r.jsx)(n.a,{href:"/get-started-quickstart",children:"Quickstart"}),"."]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["For upgrade information, see the ",(0,r.jsx)(n.a,{href:"/release-notes",children:"Release notes"}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["For information about optional dependency groups and support for custom dependencies to extend Langflow OSS functionality, see ",(0,r.jsx)(n.a,{href:"/install-custom-dependencies",children:"Install custom dependencies"}),"."]}),"\n",(0,r.jsx)(n.h2,{id:"next-steps",children:"Next steps"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.a,{href:"/get-started-quickstart",children:"Quickstart"}),": Build and run your first flow in minutes."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.a,{href:"/concepts-flows",children:"Build flows"}),": Learn about building flows."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.a,{href:"/troubleshoot",children:"Troubleshoot Langflow"}),": Get help with common Langflow install and startup issues."]}),"\n"]})]})}function x(e={}){const{wrapper:n}={...(0,l.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(g,{...e})}):g(e)}function m(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}}}]); \ No newline at end of file +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[8268],{11470:(e,n,t)=>{t.d(n,{A:()=>y});var o=t(96540),r=t(18215),l=t(23104),a=t(56347),s=t(205),i=t(57485),c=t(31682),d=t(70679);function h(e){return o.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,o.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function u(e){const{values:n,children:t}=e;return(0,o.useMemo)(()=>{const e=n??function(e){return h(e).map(({props:{value:e,label:n,attributes:t,default:o}})=>({value:e,label:n,attributes:t,default:o}))}(t);return function(e){const n=(0,c.XI)(e,(e,n)=>e.value===n.value);if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map(e=>e.value).join(", ")}" found in . Every value needs to be unique.`)}(e),e},[n,t])}function p({value:e,tabValues:n}){return n.some(n=>n.value===e)}function f({queryString:e=!1,groupId:n}){const t=(0,a.W6)(),r=function({queryString:e=!1,groupId:n}){if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:e,groupId:n});return[(0,i.aZ)(r),(0,o.useCallback)(e=>{if(!r)return;const n=new URLSearchParams(t.location.search);n.set(r,e),t.replace({...t.location,search:n.toString()})},[r,t])]}function g(e){const{defaultValue:n,queryString:t=!1,groupId:r}=e,l=u(e),[a,i]=(0,o.useState)(()=>function({defaultValue:e,tabValues:n}){if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(e){if(!p({value:e,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${n.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}const t=n.find(e=>e.default)??n[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:n,tabValues:l})),[c,h]=f({queryString:t,groupId:r}),[g,x]=function({groupId:e}){const n=function(e){return e?`docusaurus.tab.${e}`:null}(e),[t,r]=(0,d.Dv)(n);return[t,(0,o.useCallback)(e=>{n&&r.set(e)},[n,r])]}({groupId:r}),m=(()=>{const e=c??g;return p({value:e,tabValues:l})?e:null})();(0,s.A)(()=>{m&&i(m)},[m]);return{selectedValue:a,selectValue:(0,o.useCallback)(e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),h(e),x(e)},[h,x,l]),tabValues:l}}var x=t(92303);const m={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var j=t(74848);function v({className:e,block:n,selectedValue:t,selectValue:o,tabValues:a}){const s=[],{blockElementScrollPositionUntilNextRender:i}=(0,l.a_)(),c=e=>{const n=e.currentTarget,r=s.indexOf(n),l=a[r].value;l!==t&&(i(n),o(l))},d=e=>{let n=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const t=s.indexOf(e.currentTarget)+1;n=s[t]??s[0];break}case"ArrowLeft":{const t=s.indexOf(e.currentTarget)-1;n=s[t]??s[s.length-1];break}}n?.focus()};return(0,j.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.A)("tabs",{"tabs--block":n},e),children:a.map(({value:e,label:n,attributes:o})=>(0,j.jsx)("li",{role:"tab",tabIndex:t===e?0:-1,"aria-selected":t===e,ref:e=>{s.push(e)},onKeyDown:d,onClick:c,...o,className:(0,r.A)("tabs__item",m.tabItem,o?.className,{"tabs__item--active":t===e}),children:n??e},e))})}function w({lazy:e,children:n,selectedValue:t}){const l=(Array.isArray(n)?n:[n]).filter(Boolean);if(e){const e=l.find(e=>e.props.value===t);return e?(0,o.cloneElement)(e,{className:(0,r.A)("margin-top--md",e.props.className)}):null}return(0,j.jsx)("div",{className:"margin-top--md",children:l.map((e,n)=>(0,o.cloneElement)(e,{key:n,hidden:e.props.value!==t}))})}function b(e){const n=g(e);return(0,j.jsxs)("div",{className:(0,r.A)("tabs-container",m.tabList),children:[(0,j.jsx)(v,{...n,...e}),(0,j.jsx)(w,{...n,...e})]})}function y(e){const n=(0,x.A)();return(0,j.jsx)(b,{...e,children:h(e.children)},String(n))}},19365:(e,n,t)=>{t.d(n,{A:()=>a});t(96540);var o=t(18215);const r={tabItem:"tabItem_Ymn6"};var l=t(74848);function a({children:e,hidden:n,className:t}){return(0,l.jsx)("div",{role:"tabpanel",className:(0,o.A)(r.tabItem,t),hidden:n,children:e})}},28453:(e,n,t)=>{t.d(n,{R:()=>a,x:()=>s});var o=t(96540);const r={},l=o.createContext(r);function a(e){const n=o.useContext(l);return o.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function s(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:a(e.components),o.createElement(l.Provider,{value:n},e.children)}},29368:(e,n,t)=>{t.r(n),t.d(n,{CH:()=>u,assets:()=>h,chCodeConfig:()=>p,contentTitle:()=>d,default:()=>x,frontMatter:()=>c,metadata:()=>o,toc:()=>f});const o=JSON.parse('{"id":"Get-Started/get-started-installation","title":"Install Langflow","description":"Langflow can be installed in multiple ways:","source":"@site/docs/Get-Started/get-started-installation.mdx","sourceDirName":"Get-Started","slug":"/get-started-installation","permalink":"/get-started-installation","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Install Langflow","slug":"/get-started-installation"},"sidebar":"docs","previous":{"title":"About Langflow","permalink":"/"},"next":{"title":"Quickstart","permalink":"/get-started-quickstart"}}');var r=t(74848),l=t(28453),a=t(24754),s=t(11470),i=t(19365);const c={title:"Install Langflow",slug:"/get-started-installation"},d=void 0,h={},u={annotations:a.hk,Code:a.Cy},p={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},f=[{value:"Install and run Langflow Desktop",id:"install-and-run-langflow-desktop",level:2},{value:"Install and run Langflow with Docker",id:"install-and-run-langflow-docker",level:2},{value:"Install and run the Langflow OSS Python package",id:"install-and-run-the-langflow-oss-python-package",level:2},{value:"Next steps",id:"next-steps",level:2}];function g(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,l.R)(),...e.components},{Details:t}=n;return u||m("CH",!1),u.Code||m("CH.Code",!0),t||m("Details",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n","\n",(0,r.jsx)(n.p,{children:"Langflow can be installed in multiple ways:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.a,{href:"#install-and-run-langflow-desktop",children:(0,r.jsx)(n.strong,{children:"Langflow Desktop (Recommended)"})}),": Download and install the standalone desktop application for the least complicated setup experience.\nThis option includes dependency management and facilitated upgrades."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.a,{href:"#install-and-run-langflow-docker",children:(0,r.jsx)(n.strong,{children:"Docker"})}),": Pull and run the Langflow Docker image to start a Langflow container and run Langflow in isolation."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.a,{href:"#install-and-run-the-langflow-oss-python-package",children:(0,r.jsx)(n.strong,{children:"Python package"})}),": Install and run the Langflow OSS Python package.\nThis option offers more control over the environment, dependencies, and versioning."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.a,{href:"/contributing-how-to-contribute#install-langflow-from-source",children:(0,r.jsx)(n.strong,{children:"Install from source"})}),": Use this option if you want to contribute to the Langflow codebase or documentation."]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"install-and-run-langflow-desktop",children:"Install and run Langflow Desktop"}),"\n",(0,r.jsxs)(n.p,{children:["Langflow Desktop is a desktop version of Langflow that simplifies dependency management and upgrades.\nHowever, some features aren't available for Langflow Desktop, such as the ",(0,r.jsx)(n.strong,{children:"Shareable Playground"}),"."]}),"\n",(0,r.jsxs)(s.A,{children:[(0,r.jsxs)(i.A,{value:"macos",label:"macOS",default:!0,children:[(0,r.jsx)(n.p,{children:"Langflow Desktop requires macOS 13 or later."}),(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["Navigate to ",(0,r.jsx)(n.a,{href:"https://www.langflow.org/desktop",children:"Langflow Desktop"}),"."]}),"\n",(0,r.jsxs)(n.li,{children:["Click ",(0,r.jsx)(n.strong,{children:"Download Langflow"}),", enter your contact information, and then click ",(0,r.jsx)(n.strong,{children:"Download"}),"."]}),"\n",(0,r.jsx)(n.li,{children:"Mount and install the Langflow application."}),"\n",(0,r.jsxs)(n.li,{children:["When the installation completes, open the Langflow application, and then create your first flow with the ",(0,r.jsx)(n.a,{href:"/get-started-quickstart",children:"Quickstart"}),"."]}),"\n"]})]}),(0,r.jsx)(i.A,{value:"Windows",label:"Windows",children:(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Navigate to ",(0,r.jsx)(n.a,{href:"https://www.langflow.org/desktop",children:"Langflow Desktop"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Click ",(0,r.jsx)(n.strong,{children:"Download Langflow"}),", enter your contact information, and then click ",(0,r.jsx)(n.strong,{children:"Download"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Open the ",(0,r.jsx)(n.strong,{children:"File Explorer"}),", and then navigate to ",(0,r.jsx)(n.strong,{children:"Downloads"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Double-click the downloaded ",(0,r.jsx)(n.code,{children:".msi"})," file, and then use the install wizard to install Langflow Desktop."]}),"\n",(0,r.jsx)(n.admonition,{type:"tip",children:(0,r.jsxs)(n.p,{children:["Windows installations of Langflow Desktop require a C++ compiler that may not be present on your system. If you receive a ",(0,r.jsx)(n.code,{children:"C++ Build Tools Required!"})," error, follow the on-screen prompt to install Microsoft C++ Build Tools, or ",(0,r.jsx)(n.a,{href:"https://visualstudio.microsoft.com/downloads/",children:"install Microsoft Visual Studio"}),"."]})}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["When the installation completes, open the Langflow application, and then create your first flow with the ",(0,r.jsx)(n.a,{href:"/get-started-quickstart",children:"Quickstart"}),"."]}),"\n"]}),"\n"]})})]}),"\n",(0,r.jsxs)(n.p,{children:["For upgrade information, see the ",(0,r.jsx)(n.a,{href:"/release-notes",children:"Release notes"}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["To manage dependencies in Langflow Desktop, see ",(0,r.jsx)(n.a,{href:"/install-custom-dependencies#langflow-desktop",children:"Install custom dependencies in Langflow Desktop"}),"."]}),"\n",(0,r.jsx)(n.h2,{id:"install-and-run-langflow-docker",children:"Install and run Langflow with Docker"}),"\n",(0,r.jsxs)(n.p,{children:["You can use the Langflow Docker image to start a Langflow container.\nFor more information, see ",(0,r.jsx)(n.a,{href:"/deployment-docker",children:"Deploy Langflow on Docker"}),"."]}),"\n",(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Install and start ",(0,r.jsx)(n.a,{href:"https://docs.docker.com/",children:"Docker"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Pull the latest ",(0,r.jsx)(n.a,{href:"https://hub.docker.com/r/langflowai/langflow",children:"Langflow Docker image"})," and start it:"]}),"\n",(0,r.jsx)(u.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"docker ",props:{style:{color:"#FFA657"}}},{content:"run ",props:{style:{color:"#A5D6FF"}}},{content:"-p ",props:{style:{color:"#79C0FF"}}},{content:"7860:",props:{style:{color:"#A5D6FF"}}},{content:"7860 ",props:{style:{color:"#79C0FF"}}},{content:"langflowai/langflow:latest",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["To access Langflow, navigate to ",(0,r.jsx)(n.code,{children:"http://localhost:7860/"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Create your first flow with the ",(0,r.jsx)(n.a,{href:"/get-started-quickstart",children:"Quickstart"}),"."]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"install-and-run-the-langflow-oss-python-package",children:"Install and run the Langflow OSS Python package"}),"\n",(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Make sure you have the required dependencies and infrastructure:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.a,{href:"https://www.python.org/downloads/release/python-3100/",children:"Python"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"macOS and Linux: Version 3.10 to 3.13"}),"\n",(0,r.jsx)(n.li,{children:"Windows: Version 3.10 to 3.12"}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://docs.astral.sh/uv/getting-started/installation/",children:"uv"})}),"\n",(0,r.jsxs)(n.li,{children:["Sufficient infrastructure:","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Minimum: Dual-core CPU and 2 GB RAM"}),"\n",(0,r.jsx)(n.li,{children:"Recommended: Multi-core CPU and at least 4 GB RAM"}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Create a virtual environment with ",(0,r.jsx)(n.a,{href:"https://docs.astral.sh/uv/pip/environments",children:"uv"}),"."]}),"\n",(0,r.jsxs)(t,{children:[(0,r.jsx)("summary",{children:"Need help with virtual environments?"}),(0,r.jsx)(n.p,{children:"Virtual environments ensure Langflow is installed in an isolated, fresh environment.\nTo create a new virtual environment, do the following."}),(0,r.jsxs)(s.A,{children:[(0,r.jsx)(i.A,{value:"linux-macos",label:"Linux or macOS",default:!0,children:(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Navigate to where you want your virtual environment to be created, and then create it with ",(0,r.jsx)(n.code,{children:"uv"}),":"]}),"\n",(0,r.jsx)(u.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"uv ",props:{style:{color:"#FFA657"}}},{content:"venv VENV_NAME",props:{style:{color:"#A5D6FF"}}}]}],lang:"shell"},annotations:[]}]}),"\n",(0,r.jsxs)(n.p,{children:["Replace ",(0,r.jsx)(n.code,{children:"VENV_NAME"})," with a name for your virtual environment."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Start the virtual environment:"}),"\n",(0,r.jsx)(u.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"source ",props:{style:{color:"#79C0FF"}}},{content:"VENV_NAME/bin/activate",props:{style:{color:"#A5D6FF"}}}]}],lang:"shell"},annotations:[]}]}),"\n",(0,r.jsx)(n.p,{children:"Your shell's prompt changes to display that you're currently working in a virtual environment:"}),"\n",(0,r.jsx)(u.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"(VENV_NAME) \u279c langflow git:(main) \u2717",props:{}}]}],lang:"text"},annotations:[]}]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["To deactivate the virtual environment and return to your regular shell, type ",(0,r.jsx)(n.code,{children:"deactivate"}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["When activated, the virtual environment temporarily modifies your ",(0,r.jsx)(n.code,{children:"PATH"})," variable to prioritize packages installed within the virtual environment.\nTo avoid conflicts with other projects, it's a good idea to deactivate your virtual environment when you're done working in it."]}),"\n",(0,r.jsxs)(n.p,{children:["To delete the virtual environment, type ",(0,r.jsx)(n.code,{children:"rm -rf VENV_NAME"}),".\nThis completely removes the virtual environment directory and its contents."]}),"\n"]}),"\n"]})}),(0,r.jsx)(i.A,{value:"Windows",label:"Windows",children:(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Navigate to where you want your virtual environment to be created, and create it with ",(0,r.jsx)(n.code,{children:"uv"}),"."]}),"\n",(0,r.jsx)(u.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"uv ",props:{style:{color:"#FFA657"}}},{content:"venv VENV_NAME",props:{style:{color:"#A5D6FF"}}}]}],lang:"shell"},annotations:[]}]}),"\n",(0,r.jsxs)(n.p,{children:["Replace ",(0,r.jsx)(n.code,{children:"VENV_NAME"})," with a name for your virtual environment."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Start the virtual environment:"}),"\n",(0,r.jsx)(u.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"VENV_NAME\\Scripts\\activate",props:{style:{color:"#FFA657"}}}]}],lang:"shell"},annotations:[]}]}),"\n",(0,r.jsx)(n.p,{children:"Your shell's prompt changes to display that you're currently working in a virtual environment:"}),"\n",(0,r.jsx)(u.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"(VENV_NAME) PS C:/users/username/langflow-dir>",props:{}}]}],lang:"text"},annotations:[]}]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["To deactivate the virtual environment and return to your regular shell, type ",(0,r.jsx)(n.code,{children:"deactivate"}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["When activated, the virtual environment temporarily modifies your ",(0,r.jsx)(n.code,{children:"PATH"})," variable to prioritize packages installed within the virtual environment.\nTo avoid conflicts with other projects, it's a good idea to deactivate your virtual environment when you're done working in it."]}),"\n",(0,r.jsxs)(n.p,{children:["To delete the virtual environment, type ",(0,r.jsx)(n.code,{children:"Remove-Item VENV_NAME"}),".\nThis completely removes the virtual environment directory and its contents."]}),"\n"]}),"\n"]})})]})]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"In your virtual environment, install Langflow:"}),"\n",(0,r.jsx)(u.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"uv ",props:{style:{color:"#FFA657"}}},{content:"pip install langflow",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,r.jsxs)(n.p,{children:["To install a specific version of the Langflow package by adding the required version to the command, such as ",(0,r.jsx)(n.code,{children:"uv pip install langflow==1.4.22"}),"."]}),"\n",(0,r.jsxs)(t,{children:[(0,r.jsx)("summary",{children:"Reinstall or upgrade Langflow"}),(0,r.jsxs)(n.p,{children:["To reinstall Langflow and all of its dependencies, run ",(0,r.jsx)(n.code,{children:"uv pip install langflow --force-reinstall"}),"."]}),(0,r.jsxs)(n.p,{children:["To upgrade Langflow to the latest version, run ",(0,r.jsx)(n.code,{children:"uv pip install langflow -U"}),".\nHowever, the Langflow team recommends taking steps to backup your existing installation before you upgrade Langflow.\nFor more information, see ",(0,r.jsx)(n.a,{href:"/release-notes#prepare-to-upgrade",children:"Prepare to upgrade"}),"."]})]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Start Langflow:"}),"\n",(0,r.jsx)(u.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"uv ",props:{style:{color:"#FFA657"}}},{content:"run langflow run",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,r.jsx)(n.p,{children:"It can take a few minutes for Langflow to start."}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["To confirm that a local Langflow instance is running, navigate to the default Langflow URL ",(0,r.jsx)(n.code,{children:"http://127.0.0.1:7860"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Create your first flow with the ",(0,r.jsx)(n.a,{href:"/get-started-quickstart",children:"Quickstart"}),"."]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["For upgrade information, see the ",(0,r.jsx)(n.a,{href:"/release-notes",children:"Release notes"}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["For information about optional dependency groups and support for custom dependencies to extend Langflow OSS functionality, see ",(0,r.jsx)(n.a,{href:"/install-custom-dependencies",children:"Install custom dependencies"}),"."]}),"\n",(0,r.jsx)(n.h2,{id:"next-steps",children:"Next steps"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.a,{href:"/get-started-quickstart",children:"Quickstart"}),": Build and run your first flow in minutes."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.a,{href:"/concepts-flows",children:"Build flows"}),": Learn about building flows."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.a,{href:"/troubleshoot",children:"Troubleshoot Langflow"}),": Get help with common Langflow install and startup issues."]}),"\n"]})]})}function x(e={}){const{wrapper:n}={...(0,l.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(g,{...e})}):g(e)}function m(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}}}]); \ No newline at end of file diff --git a/assets/js/a99a45c9.63f33864.js b/assets/js/a99a45c9.0b0bb081.js similarity index 89% rename from assets/js/a99a45c9.63f33864.js rename to assets/js/a99a45c9.0b0bb081.js index cdd6914d76..34acbc5496 100644 --- a/assets/js/a99a45c9.63f33864.js +++ b/assets/js/a99a45c9.0b0bb081.js @@ -1 +1 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[38],{17886:(e,n,t)=>{t.d(n,{A:()=>d});t(96540);var r=t(64058),s=t(74848);function d({name:e,...n}){const t=r[e];return t?(0,s.jsx)(t,{...n}):null}},31929:(e,n,t)=>{t.d(n,{Ay:()=>o,RM:()=>i});var r=t(74848),s=t(28453),d=t(17886);const i=[];function l(e){const n={a:"a",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,r.jsxs)(n.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,r.jsx)(d.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Controls"})," in the ",(0,r.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function o(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(l,{...e})}):l(e)}},43559:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>h,contentTitle:()=>a,default:()=>x,frontMatter:()=>o,metadata:()=>r,toc:()=>c});const r=JSON.parse('{"id":"Components/bundles-openai","title":"OpenAI","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/bundles-openai.mdx","sourceDirName":"Components","slug":"/bundles-openai","permalink":"/bundles-openai","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"OpenAI","slug":"/bundles-openai"},"sidebar":"docs","previous":{"title":"Ollama","permalink":"/bundles-ollama"},"next":{"title":"OpenRouter","permalink":"/bundles-openrouter"}}');var s=t(74848),d=t(28453),i=t(17886),l=t(31929);const o={title:"OpenAI",slug:"/bundles-openai"},a=void 0,h={},c=[{value:"OpenAI text generation",id:"openai-text-generation",level:2},{value:"OpenAI text generation parameters",id:"openai-text-generation-parameters",level:3},...l.RM,{value:"OpenAI Embeddings",id:"openai-embeddings",level:2},{value:"OpenAI Embeddings parameters",id:"openai-embeddings-parameters",level:3},...l.RM,{value:"See also",id:"see-also",level:2}];function p(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",li:"li",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,d.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:[(0,s.jsx)(i.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(n.a,{href:"/components-bundle-components",children:(0,s.jsx)(n.strong,{children:"Bundles"})})," contain custom components that support specific third-party integrations with Langflow."]}),"\n",(0,s.jsxs)(n.p,{children:["This page describes the components that are available in the ",(0,s.jsx)(n.strong,{children:"OpenAI"})," bundle."]}),"\n",(0,s.jsxs)(n.p,{children:["For more information about OpenAI features and functionality used by OpenAI components, see the ",(0,s.jsx)(n.a,{href:"https://platform.openai.com/docs/overview",children:"OpenAI documentation"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"openai-text-generation",children:"OpenAI text generation"}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"OpenAI"})," component generates text using ",(0,s.jsx)(n.a,{href:"https://platform.openai.com/docs/models",children:"OpenAI's language models"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["It provides access to the same OpenAI models that are available in the core ",(0,s.jsx)(n.strong,{children:"Language Model"})," component, but the ",(0,s.jsx)(n.strong,{children:"OpenAI"})," component provides additional parameters for customizing the request to the OpenAI API."]}),"\n",(0,s.jsxs)(n.p,{children:["It can output either a ",(0,s.jsx)(n.strong,{children:"Model Response"})," (",(0,s.jsx)(n.a,{href:"/data-types#message",children:(0,s.jsx)(n.code,{children:"Message"})}),") or a ",(0,s.jsx)(n.strong,{children:"Language Model"})," (",(0,s.jsx)(n.a,{href:"/data-types#languagemodel",children:(0,s.jsx)(n.code,{children:"LanguageModel"})}),")."]}),"\n",(0,s.jsxs)(n.p,{children:["Use the ",(0,s.jsx)(n.strong,{children:"Language Model"})," output when you want to use a specific OpenAI model configuration as the LLM for another LLM-driven component, such as an ",(0,s.jsx)(n.strong,{children:"Agent"})," or ",(0,s.jsx)(n.strong,{children:"Smart Function"})," component."]}),"\n",(0,s.jsxs)(n.p,{children:["For more information, see ",(0,s.jsx)(n.a,{href:"/components-models",children:"Language model components"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"openai-text-generation-parameters",children:"OpenAI text generation parameters"}),"\n",(0,s.jsx)(l.Ay,{}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"api_key"}),(0,s.jsx)(n.td,{children:"SecretString"}),(0,s.jsx)(n.td,{children:"Input parameter. Your OpenAI API Key."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"model"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:'Input parameter. The name of the OpenAI model to use. Options include "gpt-3.5-turbo" and "gpt-4".'})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"max_tokens"}),(0,s.jsx)(n.td,{children:"Integer"}),(0,s.jsx)(n.td,{children:"Input parameter. The maximum number of tokens to generate. Set to 0 for unlimited tokens."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"temperature"}),(0,s.jsx)(n.td,{children:"Float"}),(0,s.jsx)(n.td,{children:"Input parameter. Controls randomness in the output. Range: [0.0, 1.0]. Default: 0.7."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"top_p"}),(0,s.jsx)(n.td,{children:"Float"}),(0,s.jsx)(n.td,{children:"Input parameter. Controls the nucleus sampling. Range: [0.0, 1.0]. Default: 1.0."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"frequency_penalty"}),(0,s.jsx)(n.td,{children:"Float"}),(0,s.jsx)(n.td,{children:"Input parameter. Controls the frequency penalty. Range: [0.0, 2.0]. Default: 0.0."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"presence_penalty"}),(0,s.jsx)(n.td,{children:"Float"}),(0,s.jsx)(n.td,{children:"Input parameter. Controls the presence penalty. Range: [0.0, 2.0]. Default: 0.0."})]})]})]}),"\n",(0,s.jsx)(n.h2,{id:"openai-embeddings",children:"OpenAI Embeddings"}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"OpenAI Embeddings"})," component uses ",(0,s.jsx)(n.a,{href:"https://platform.openai.com/docs/guides/embeddings",children:"OpenAI embedding models"})," for embedding generation."]}),"\n",(0,s.jsxs)(n.p,{children:["It provides access to the same OpenAI models that are available in the core ",(0,s.jsx)(n.strong,{children:"Embedding Model"})," component, but the ",(0,s.jsx)(n.strong,{children:"OpenAI Embeddings"})," component provides additional parameters for customizing the request to the OpenAI embedding API."]}),"\n",(0,s.jsxs)(n.p,{children:["For more information about using embedding model components in flows, see ",(0,s.jsx)(n.a,{href:"/components-embedding-models",children:"Embedding model components"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"openai-embeddings-parameters",children:"OpenAI Embeddings parameters"}),"\n",(0,s.jsx)(l.Ay,{}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"OpenAI API Key"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. The API key to use for accessing the OpenAI API."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Default Headers"}),(0,s.jsx)(n.td,{children:"Dict"}),(0,s.jsx)(n.td,{children:"Input parameter. The default headers for the HTTP requests."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Default Query"}),(0,s.jsx)(n.td,{children:"NestedDict"}),(0,s.jsx)(n.td,{children:"Input parameter. The default query parameters for the HTTP requests."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Allowed Special"}),(0,s.jsx)(n.td,{children:"List"}),(0,s.jsxs)(n.td,{children:["Input parameter. The special tokens allowed for processing. Default: ",(0,s.jsx)(n.code,{children:"[]"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Disallowed Special"}),(0,s.jsx)(n.td,{children:"List"}),(0,s.jsxs)(n.td,{children:["Input parameter. The special tokens disallowed for processing. Default: ",(0,s.jsx)(n.code,{children:'["all"]'}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Chunk Size"}),(0,s.jsx)(n.td,{children:"Integer"}),(0,s.jsxs)(n.td,{children:["Input parameter. The chunk size for processing. Default: ",(0,s.jsx)(n.code,{children:"1000"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Client"}),(0,s.jsx)(n.td,{children:"Any"}),(0,s.jsx)(n.td,{children:"Input parameter. The HTTP client for making requests."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Deployment"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsxs)(n.td,{children:["Input parameter. The deployment name for the model. Default: ",(0,s.jsx)(n.code,{children:"text-embedding-3-small"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Embedding Context Length"}),(0,s.jsx)(n.td,{children:"Integer"}),(0,s.jsxs)(n.td,{children:["Input parameter. The length of embedding context. Default: ",(0,s.jsx)(n.code,{children:"8191"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Max Retries"}),(0,s.jsx)(n.td,{children:"Integer"}),(0,s.jsxs)(n.td,{children:["Input parameter. The maximum number of retries for failed requests. Default: ",(0,s.jsx)(n.code,{children:"6"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Model"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsxs)(n.td,{children:["Input parameter. The name of the model to use. Default: ",(0,s.jsx)(n.code,{children:"text-embedding-3-small"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Model Kwargs"}),(0,s.jsx)(n.td,{children:"NestedDict"}),(0,s.jsx)(n.td,{children:"Input parameter. Additional keyword arguments for the model."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"OpenAI API Base"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. The base URL of the OpenAI API."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"OpenAI API Type"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. The type of the OpenAI API."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"OpenAI API Version"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. The version of the OpenAI API."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"OpenAI Organization"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. The organization associated with the API key."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"OpenAI Proxy"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. The proxy server for the requests."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Request Timeout"}),(0,s.jsx)(n.td,{children:"Float"}),(0,s.jsx)(n.td,{children:"Input parameter. The timeout for the HTTP requests."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Show Progress Bar"}),(0,s.jsx)(n.td,{children:"Boolean"}),(0,s.jsx)(n.td,{children:"Input parameter. Whether to show a progress bar for processing. Default: false."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Skip Empty"}),(0,s.jsx)(n.td,{children:"Boolean"}),(0,s.jsx)(n.td,{children:"Input parameter. Whether to skip empty inputs. Default: false."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"TikToken Enable"}),(0,s.jsx)(n.td,{children:"Boolean"}),(0,s.jsx)(n.td,{children:"Input parameter. Whether to enable TikToken. Default: true."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"TikToken Model Name"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. The name of the TikToken model."})]})]})]}),"\n",(0,s.jsx)(n.h2,{id:"see-also",children:"See also"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsxs)(n.a,{href:"/components-agents",children:[(0,s.jsx)(n.strong,{children:"Agent"})," component"]})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsxs)(n.a,{href:"/bundles-langchain#openai-tools-agent",children:["LangChain ",(0,s.jsx)(n.strong,{children:"OpenAI Tools Agent"})," component"]})}),"\n"]})]})}function x(e={}){const{wrapper:n}={...(0,d.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(p,{...e})}):p(e)}}}]); \ No newline at end of file +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[38],{17886:(e,n,t)=>{t.d(n,{A:()=>d});t(96540);var r=t(64058),s=t(74848);function d({name:e,...n}){const t=r[e];return t?(0,s.jsx)(t,{...n}):null}},31929:(e,n,t)=>{t.d(n,{Ay:()=>o,RM:()=>i});var r=t(74848),s=t(28453),d=t(17886);const i=[];function l(e){const n={a:"a",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,r.jsxs)(n.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,r.jsx)(d.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Controls"})," in the ",(0,r.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function o(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(l,{...e})}):l(e)}},43559:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>h,contentTitle:()=>a,default:()=>x,frontMatter:()=>o,metadata:()=>r,toc:()=>c});const r=JSON.parse('{"id":"Components/bundles-openai","title":"OpenAI","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/bundles-openai.mdx","sourceDirName":"Components","slug":"/bundles-openai","permalink":"/bundles-openai","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"OpenAI","slug":"/bundles-openai"},"sidebar":"docs","previous":{"title":"Ollama","permalink":"/bundles-ollama"},"next":{"title":"OpenRouter","permalink":"/bundles-openrouter"}}');var s=t(74848),d=t(28453),i=t(17886),l=t(31929);const o={title:"OpenAI",slug:"/bundles-openai"},a=void 0,h={},c=[{value:"OpenAI text generation",id:"openai-text-generation",level:2},{value:"OpenAI text generation parameters",id:"openai-text-generation-parameters",level:3},...l.RM,{value:"OpenAI Embeddings",id:"openai-embeddings",level:2},{value:"OpenAI Embeddings parameters",id:"openai-embeddings-parameters",level:3},...l.RM,{value:"See also",id:"see-also",level:2}];function p(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",li:"li",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,d.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:[(0,s.jsx)(i.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(n.a,{href:"/components-bundle-components",children:(0,s.jsx)(n.strong,{children:"Bundles"})})," contain custom components that support specific third-party integrations with Langflow."]}),"\n",(0,s.jsxs)(n.p,{children:["This page describes the components that are available in the ",(0,s.jsx)(n.strong,{children:"OpenAI"})," bundle."]}),"\n",(0,s.jsxs)(n.p,{children:["For more information about OpenAI features and functionality used by OpenAI components, see the ",(0,s.jsx)(n.a,{href:"https://platform.openai.com/docs/overview",children:"OpenAI documentation"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"openai-text-generation",children:"OpenAI text generation"}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"OpenAI"})," component generates text using ",(0,s.jsx)(n.a,{href:"https://platform.openai.com/docs/models",children:"OpenAI's language models"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["It provides access to the same OpenAI models that are available in the core ",(0,s.jsx)(n.strong,{children:"Language Model"})," component, but the ",(0,s.jsx)(n.strong,{children:"OpenAI"})," component provides additional parameters for customizing the request to the OpenAI API."]}),"\n",(0,s.jsxs)(n.p,{children:["It can output either a ",(0,s.jsx)(n.strong,{children:"Model Response"})," (",(0,s.jsx)(n.a,{href:"/data-types#message",children:(0,s.jsx)(n.code,{children:"Message"})}),") or a ",(0,s.jsx)(n.strong,{children:"Language Model"})," (",(0,s.jsx)(n.a,{href:"/data-types#languagemodel",children:(0,s.jsx)(n.code,{children:"LanguageModel"})}),")."]}),"\n",(0,s.jsxs)(n.p,{children:["Use the ",(0,s.jsx)(n.strong,{children:"Language Model"})," output when you want to use a specific OpenAI model configuration as the LLM for another LLM-driven component, such as an ",(0,s.jsx)(n.strong,{children:"Agent"})," or ",(0,s.jsx)(n.strong,{children:"Smart Function"})," component."]}),"\n",(0,s.jsxs)(n.p,{children:["For more information, see ",(0,s.jsx)(n.a,{href:"/components-models",children:"Language model components"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"openai-text-generation-parameters",children:"OpenAI text generation parameters"}),"\n",(0,s.jsx)(l.Ay,{}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"api_key"}),(0,s.jsx)(n.td,{children:"SecretString"}),(0,s.jsx)(n.td,{children:"Input parameter. Your OpenAI API Key."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"model"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:'Input parameter. The name of the OpenAI model to use. Options include "gpt-3.5-turbo" and "gpt-4".'})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"max_tokens"}),(0,s.jsx)(n.td,{children:"Integer"}),(0,s.jsx)(n.td,{children:"Input parameter. The maximum number of tokens to generate. Set to 0 for unlimited tokens."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"temperature"}),(0,s.jsx)(n.td,{children:"Float"}),(0,s.jsx)(n.td,{children:"Input parameter. Controls randomness in the output. Range: [0.0, 1.0]. Default: 0.7."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"top_p"}),(0,s.jsx)(n.td,{children:"Float"}),(0,s.jsx)(n.td,{children:"Input parameter. Controls the nucleus sampling. Range: [0.0, 1.0]. Default: 1.0."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"frequency_penalty"}),(0,s.jsx)(n.td,{children:"Float"}),(0,s.jsx)(n.td,{children:"Input parameter. Controls the frequency penalty. Range: [0.0, 2.0]. Default: 0.0."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"presence_penalty"}),(0,s.jsx)(n.td,{children:"Float"}),(0,s.jsx)(n.td,{children:"Input parameter. Controls the presence penalty. Range: [0.0, 2.0]. Default: 0.0."})]})]})]}),"\n",(0,s.jsx)(n.h2,{id:"openai-embeddings",children:"OpenAI Embeddings"}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"OpenAI Embeddings"})," component uses ",(0,s.jsx)(n.a,{href:"https://platform.openai.com/docs/guides/embeddings",children:"OpenAI embedding models"})," for embedding generation."]}),"\n",(0,s.jsxs)(n.p,{children:["It provides access to the same OpenAI models that are available in the core ",(0,s.jsx)(n.strong,{children:"Embedding Model"})," component, but the ",(0,s.jsx)(n.strong,{children:"OpenAI Embeddings"})," component provides additional parameters for customizing the request to the OpenAI embedding API."]}),"\n",(0,s.jsxs)(n.p,{children:["For more information about using embedding model components in flows, see ",(0,s.jsx)(n.a,{href:"/components-embedding-models",children:"Embedding model components"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"openai-embeddings-parameters",children:"OpenAI Embeddings parameters"}),"\n",(0,s.jsx)(l.Ay,{}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"OpenAI API Key"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. The API key to use for accessing the OpenAI API."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Default Headers"}),(0,s.jsx)(n.td,{children:"Dict"}),(0,s.jsx)(n.td,{children:"Input parameter. The default headers for the HTTP requests."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Default Query"}),(0,s.jsx)(n.td,{children:"NestedDict"}),(0,s.jsx)(n.td,{children:"Input parameter. The default query parameters for the HTTP requests."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Allowed Special"}),(0,s.jsx)(n.td,{children:"List"}),(0,s.jsxs)(n.td,{children:["Input parameter. The special tokens allowed for processing. Default: ",(0,s.jsx)(n.code,{children:"[]"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Disallowed Special"}),(0,s.jsx)(n.td,{children:"List"}),(0,s.jsxs)(n.td,{children:["Input parameter. The special tokens disallowed for processing. Default: ",(0,s.jsx)(n.code,{children:'["all"]'}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Chunk Size"}),(0,s.jsx)(n.td,{children:"Integer"}),(0,s.jsxs)(n.td,{children:["Input parameter. The chunk size for processing. Default: ",(0,s.jsx)(n.code,{children:"1000"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Client"}),(0,s.jsx)(n.td,{children:"Any"}),(0,s.jsx)(n.td,{children:"Input parameter. The HTTP client for making requests."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Deployment"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsxs)(n.td,{children:["Input parameter. The deployment name for the model. Default: ",(0,s.jsx)(n.code,{children:"text-embedding-3-small"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Embedding Context Length"}),(0,s.jsx)(n.td,{children:"Integer"}),(0,s.jsxs)(n.td,{children:["Input parameter. The length of embedding context. Default: ",(0,s.jsx)(n.code,{children:"8191"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Max Retries"}),(0,s.jsx)(n.td,{children:"Integer"}),(0,s.jsxs)(n.td,{children:["Input parameter. The maximum number of retries for failed requests. Default: ",(0,s.jsx)(n.code,{children:"6"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Model"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsxs)(n.td,{children:["Input parameter. The name of the model to use. Default: ",(0,s.jsx)(n.code,{children:"text-embedding-3-small"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Model Kwargs"}),(0,s.jsx)(n.td,{children:"NestedDict"}),(0,s.jsx)(n.td,{children:"Input parameter. Additional keyword arguments for the model."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"OpenAI API Base"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. The base URL of the OpenAI API."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"OpenAI API Type"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. The type of the OpenAI API."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"OpenAI API Version"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. The version of the OpenAI API."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"OpenAI Organization"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. The organization associated with the API key."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"OpenAI Proxy"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. The proxy server for the requests."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Request Timeout"}),(0,s.jsx)(n.td,{children:"Float"}),(0,s.jsx)(n.td,{children:"Input parameter. The timeout for the HTTP requests."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Show Progress Bar"}),(0,s.jsx)(n.td,{children:"Boolean"}),(0,s.jsxs)(n.td,{children:["Input parameter. Whether to show a progress bar for processing. Default: ",(0,s.jsx)(n.code,{children:"false"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Skip Empty"}),(0,s.jsx)(n.td,{children:"Boolean"}),(0,s.jsxs)(n.td,{children:["Input parameter. Whether to skip empty inputs. Default: ",(0,s.jsx)(n.code,{children:"false"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"TikToken Enable"}),(0,s.jsx)(n.td,{children:"Boolean"}),(0,s.jsxs)(n.td,{children:["Input parameter. Whether to enable TikToken. Default: ",(0,s.jsx)(n.code,{children:"true"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"TikToken Model Name"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. The name of the TikToken model."})]})]})]}),"\n",(0,s.jsx)(n.h2,{id:"see-also",children:"See also"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsxs)(n.a,{href:"/components-agents",children:[(0,s.jsx)(n.strong,{children:"Agent"})," component"]})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsxs)(n.a,{href:"/bundles-langchain#openai-tools-agent",children:["LangChain ",(0,s.jsx)(n.strong,{children:"OpenAI Tools Agent"})," component"]})}),"\n"]})]})}function x(e={}){const{wrapper:n}={...(0,d.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(p,{...e})}):p(e)}}}]); \ No newline at end of file diff --git a/assets/js/b1379b2b.57ba9dd6.js b/assets/js/b1379b2b.22cebc37.js similarity index 69% rename from assets/js/b1379b2b.57ba9dd6.js rename to assets/js/b1379b2b.22cebc37.js index 5951208167..416cb43fd3 100644 --- a/assets/js/b1379b2b.57ba9dd6.js +++ b/assets/js/b1379b2b.22cebc37.js @@ -1 +1 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[5663],{17886:(e,t,n)=>{n.d(t,{A:()=>o});n(96540);var r=n(64058),s=n(74848);function o({name:e,...t}){const n=r[e];return n?(0,s.jsx)(n,{...t}):null}},31929:(e,t,n)=>{n.d(t,{Ay:()=>i,RM:()=>a});var r=n(74848),s=n(28453),o=n(17886);const a=[];function c(e){const t={a:"a",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,r.jsxs)(t.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,r.jsx)(o.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Controls"})," in the ",(0,r.jsx)(t.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function i(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(c,{...e})}):c(e)}},50005:(e,t,n)=>{n.d(t,{Ay:()=>c,RM:()=>o});var r=n(74848),s=n(28453);const o=[];function a(e){const t={a:"a",code:"code",p:"p",...(0,s.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(t.p,{children:["Because Langflow is based on LangChain, vector store components use an instance of ",(0,r.jsx)(t.a,{href:"https://python.langchain.com/docs/integrations/vectorstores/",children:"LangChain vector store"})," to drive the underlying read and write functions.\nThese instances are provider-specific and configured according to the component's parameters, such as the connection string, index name, and schema."]}),"\n",(0,r.jsxs)(t.p,{children:["In component code, this is often instantiated as ",(0,r.jsx)(t.code,{children:"vector_store"}),", but some vector store components use a different name, such as the provider name."]}),"\n",(0,r.jsx)(t.p,{children:"Some LangChain classes don't expose all possible options as component parameters.\nDepending on the provider, these options might use default values or allow modification through environment variables, if they are supported in Langflow.\nFor information about specific options, see the LangChain API reference and vector store provider's documentation."})]})}function c(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}},62563:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>p,contentTitle:()=>u,default:()=>j,frontMatter:()=>l,metadata:()=>r,toc:()=>m});const r=JSON.parse('{"id":"Components/bundles-couchbase","title":"Couchbase","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/bundles-couchbase.mdx","sourceDirName":"Components","slug":"/bundles-couchbase","permalink":"/bundles-couchbase","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Couchbase","slug":"/bundles-couchbase"},"sidebar":"docs","previous":{"title":"Composio","permalink":"/integrations-composio"},"next":{"title":"DataStax","permalink":"/bundles-datastax"}}');var s=n(74848),o=n(28453),a=n(17886),c=n(31929),i=n(80223),d=n(90465),h=n(50005);const l={title:"Couchbase",slug:"/bundles-couchbase"},u=void 0,p={},m=[{value:"Couchbase vector store",id:"couchbase-vector-store",level:2},...h.RM,...d.RM,{value:"Couchbase parameters",id:"couchbase-parameters",level:3},...c.RM,...i.RM];function x(e){const t={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,o.R)(),...e.components},{Details:n}=t;return n||function(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(t.p,{children:[(0,s.jsx)(a.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(t.a,{href:"/components-bundle-components",children:(0,s.jsx)(t.strong,{children:"Bundles"})})," contain custom components that support specific third-party integrations with Langflow."]}),"\n",(0,s.jsxs)(t.p,{children:["This page describes the components that are available in the ",(0,s.jsx)(t.strong,{children:"Couchbase"})," bundle."]}),"\n",(0,s.jsx)(t.h2,{id:"couchbase-vector-store",children:"Couchbase vector store"}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.strong,{children:"Couchbase"})," component reads and writes to a Couchbase vector store using an instance of ",(0,s.jsx)(t.code,{children:"CouchbaseSearchVectorStore"}),"."]}),"\n",(0,s.jsxs)(n,{children:[(0,s.jsx)("summary",{children:"About vector store instances"}),(0,s.jsx)(h.Ay,{})]}),"\n",(0,s.jsx)(d.Ay,{}),"\n",(0,s.jsx)(t.admonition,{type:"tip",children:(0,s.jsxs)(t.p,{children:["For a tutorial using a vector database in a flow, see ",(0,s.jsx)(t.a,{href:"/chat-with-rag",children:"Create a vector RAG chatbot"}),"."]})}),"\n",(0,s.jsx)(t.h3,{id:"couchbase-parameters",children:"Couchbase parameters"}),"\n",(0,s.jsx)(t.p,{children:"You can inspect a vector store component's parameters to learn more about the inputs it accepts, the features it supports, and how to configure it."}),"\n",(0,s.jsx)(c.Ay,{}),"\n",(0,s.jsx)(i.Ay,{}),"\n",(0,s.jsxs)(t.p,{children:["For information about accepted values and functionality, see the ",(0,s.jsx)(t.a,{href:"https://docs.couchbase.com/home/index.html",children:"Couchbase documentation"})," or inspect ",(0,s.jsx)(t.a,{href:"/concepts-components#component-code",children:"component code"}),"."]}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Name"}),(0,s.jsx)(t.th,{children:"Type"}),(0,s.jsx)(t.th,{children:"Description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"couchbase_connection_string"}),(0,s.jsx)(t.td,{children:"SecretString"}),(0,s.jsx)(t.td,{children:"Input parameter. Couchbase Cluster connection string. Required."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"couchbase_username"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. Couchbase username for authentication. Required."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"couchbase_password"}),(0,s.jsx)(t.td,{children:"SecretString"}),(0,s.jsx)(t.td,{children:"Input parameter. Couchbase password for authentication. Required."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bucket_name"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. Name of the Couchbase bucket. Required."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"scope_name"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. Name of the Couchbase scope. Required."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"collection_name"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. Name of the Couchbase collection. Required."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"index_name"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. Name of the Couchbase index. Required."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"ingest_data"}),(0,s.jsx)(t.td,{children:"Data"}),(0,s.jsx)(t.td,{children:"Input parameter. The records to load into the vector store. Only relevant for writes."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"search_query"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. The query string for vector search. Only relevant for reads."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"cache_vector_store"}),(0,s.jsx)(t.td,{children:"Boolean"}),(0,s.jsx)(t.td,{children:"Input parameter. If true, the component caches the vector store in memory for faster reads. Default: Enabled (true)."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"embedding"}),(0,s.jsx)(t.td,{children:"Embeddings"}),(0,s.jsx)(t.td,{children:"Input parameter. The embedding function to use for the vector store."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"number_of_results"}),(0,s.jsx)(t.td,{children:"Integer"}),(0,s.jsx)(t.td,{children:"Input parameter. Maximum number of search results to return. Default: 4. Only relevant for reads."})]})]})]})]})}function j(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(x,{...e})}):x(e)}},80223:(e,t,n)=>{n.d(t,{Ay:()=>c,RM:()=>o});var r=n(74848),s=n(28453);const o=[];function a(e){const t={p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,r.jsxs)(t.p,{children:["Some parameters are conditional, and they are only available after you set other parameters or select specific options for other parameters.\nConditional parameters may not be visible on the ",(0,r.jsx)(t.strong,{children:"Controls"})," pane until you set the required dependencies."]})}function c(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}},90465:(e,t,n)=>{n.d(t,{Ay:()=>c,RM:()=>o});var r=n(74848),s=n(28453);const o=[];function a(e){const t={a:"a",code:"code",p:"p",...(0,s.R)(),...e.components};return(0,r.jsxs)(t.p,{children:["If you use a vector store component to query your vector database, it produces search results that you can pass to downstream components in your flow as a list of ",(0,r.jsx)(t.a,{href:"/data-types#data",children:(0,r.jsx)(t.code,{children:"Data"})})," objects or a tabular ",(0,r.jsx)(t.a,{href:"/data-types#dataframe",children:(0,r.jsx)(t.code,{children:"DataFrame"})}),".\nIf both types are supported, you can set the format near the vector store component's output port in the visual editor."]})}function c(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}}}]); \ No newline at end of file +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[5663],{17886:(e,t,n)=>{n.d(t,{A:()=>o});n(96540);var r=n(64058),s=n(74848);function o({name:e,...t}){const n=r[e];return n?(0,s.jsx)(n,{...t}):null}},31929:(e,t,n)=>{n.d(t,{Ay:()=>i,RM:()=>c});var r=n(74848),s=n(28453),o=n(17886);const c=[];function a(e){const t={a:"a",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,r.jsxs)(t.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,r.jsx)(o.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Controls"})," in the ",(0,r.jsx)(t.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function i(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}},50005:(e,t,n)=>{n.d(t,{Ay:()=>a,RM:()=>o});var r=n(74848),s=n(28453);const o=[];function c(e){const t={a:"a",code:"code",p:"p",...(0,s.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(t.p,{children:["Because Langflow is based on LangChain, vector store components use an instance of ",(0,r.jsx)(t.a,{href:"https://python.langchain.com/docs/integrations/vectorstores/",children:"LangChain vector store"})," to drive the underlying read and write functions.\nThese instances are provider-specific and configured according to the component's parameters, such as the connection string, index name, and schema."]}),"\n",(0,r.jsxs)(t.p,{children:["In component code, this is often instantiated as ",(0,r.jsx)(t.code,{children:"vector_store"}),", but some vector store components use a different name, such as the provider name."]}),"\n",(0,r.jsx)(t.p,{children:"Some LangChain classes don't expose all possible options as component parameters.\nDepending on the provider, these options might use default values or allow modification through environment variables, if they are supported in Langflow.\nFor information about specific options, see the LangChain API reference and vector store provider's documentation."})]})}function a(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(c,{...e})}):c(e)}},62563:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>p,contentTitle:()=>u,default:()=>j,frontMatter:()=>l,metadata:()=>r,toc:()=>m});const r=JSON.parse('{"id":"Components/bundles-couchbase","title":"Couchbase","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/bundles-couchbase.mdx","sourceDirName":"Components","slug":"/bundles-couchbase","permalink":"/bundles-couchbase","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Couchbase","slug":"/bundles-couchbase"},"sidebar":"docs","previous":{"title":"Composio","permalink":"/integrations-composio"},"next":{"title":"DataStax","permalink":"/bundles-datastax"}}');var s=n(74848),o=n(28453),c=n(17886),a=n(31929),i=n(80223),d=n(90465),h=n(50005);const l={title:"Couchbase",slug:"/bundles-couchbase"},u=void 0,p={},m=[{value:"Couchbase vector store",id:"couchbase-vector-store",level:2},...h.RM,...d.RM,{value:"Couchbase parameters",id:"couchbase-parameters",level:3},...a.RM,...i.RM];function x(e){const t={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,o.R)(),...e.components},{Details:n}=t;return n||function(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(t.p,{children:[(0,s.jsx)(c.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(t.a,{href:"/components-bundle-components",children:(0,s.jsx)(t.strong,{children:"Bundles"})})," contain custom components that support specific third-party integrations with Langflow."]}),"\n",(0,s.jsxs)(t.p,{children:["This page describes the components that are available in the ",(0,s.jsx)(t.strong,{children:"Couchbase"})," bundle."]}),"\n",(0,s.jsx)(t.h2,{id:"couchbase-vector-store",children:"Couchbase vector store"}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.strong,{children:"Couchbase"})," component reads and writes to a Couchbase vector store using an instance of ",(0,s.jsx)(t.code,{children:"CouchbaseSearchVectorStore"}),"."]}),"\n",(0,s.jsxs)(n,{children:[(0,s.jsx)("summary",{children:"About vector store instances"}),(0,s.jsx)(h.Ay,{})]}),"\n",(0,s.jsx)(d.Ay,{}),"\n",(0,s.jsx)(t.admonition,{type:"tip",children:(0,s.jsxs)(t.p,{children:["For a tutorial using a vector database in a flow, see ",(0,s.jsx)(t.a,{href:"/chat-with-rag",children:"Create a vector RAG chatbot"}),"."]})}),"\n",(0,s.jsx)(t.h3,{id:"couchbase-parameters",children:"Couchbase parameters"}),"\n",(0,s.jsx)(t.p,{children:"You can inspect a vector store component's parameters to learn more about the inputs it accepts, the features it supports, and how to configure it."}),"\n",(0,s.jsx)(a.Ay,{}),"\n",(0,s.jsx)(i.Ay,{}),"\n",(0,s.jsxs)(t.p,{children:["For information about accepted values and functionality, see the ",(0,s.jsx)(t.a,{href:"https://docs.couchbase.com/home/index.html",children:"Couchbase documentation"})," or inspect ",(0,s.jsx)(t.a,{href:"/concepts-components#component-code",children:"component code"}),"."]}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Name"}),(0,s.jsx)(t.th,{children:"Type"}),(0,s.jsx)(t.th,{children:"Description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"couchbase_connection_string"}),(0,s.jsx)(t.td,{children:"SecretString"}),(0,s.jsx)(t.td,{children:"Input parameter. Couchbase Cluster connection string. Required."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"couchbase_username"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. Couchbase username for authentication. Required."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"couchbase_password"}),(0,s.jsx)(t.td,{children:"SecretString"}),(0,s.jsx)(t.td,{children:"Input parameter. Couchbase password for authentication. Required."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bucket_name"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. Name of the Couchbase bucket. Required."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"scope_name"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. Name of the Couchbase scope. Required."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"collection_name"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. Name of the Couchbase collection. Required."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"index_name"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. Name of the Couchbase index. Required."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"ingest_data"}),(0,s.jsx)(t.td,{children:"Data"}),(0,s.jsx)(t.td,{children:"Input parameter. The records to load into the vector store. Only relevant for writes."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"search_query"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. The query string for vector search. Only relevant for reads."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"cache_vector_store"}),(0,s.jsx)(t.td,{children:"Boolean"}),(0,s.jsxs)(t.td,{children:["Input parameter. If ",(0,s.jsx)(t.code,{children:"true"}),", the component caches the vector store in memory for faster reads. Default: Enabled (",(0,s.jsx)(t.code,{children:"true"}),")."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"embedding"}),(0,s.jsx)(t.td,{children:"Embeddings"}),(0,s.jsx)(t.td,{children:"Input parameter. The embedding function to use for the vector store."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"number_of_results"}),(0,s.jsx)(t.td,{children:"Integer"}),(0,s.jsx)(t.td,{children:"Input parameter. Maximum number of search results to return. Default: 4. Only relevant for reads."})]})]})]})]})}function j(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(x,{...e})}):x(e)}},80223:(e,t,n)=>{n.d(t,{Ay:()=>a,RM:()=>o});var r=n(74848),s=n(28453);const o=[];function c(e){const t={p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,r.jsxs)(t.p,{children:["Some parameters are conditional, and they are only available after you set other parameters or select specific options for other parameters.\nConditional parameters may not be visible on the ",(0,r.jsx)(t.strong,{children:"Controls"})," pane until you set the required dependencies."]})}function a(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(c,{...e})}):c(e)}},90465:(e,t,n)=>{n.d(t,{Ay:()=>a,RM:()=>o});var r=n(74848),s=n(28453);const o=[];function c(e){const t={a:"a",code:"code",p:"p",...(0,s.R)(),...e.components};return(0,r.jsxs)(t.p,{children:["If you use a vector store component to query your vector database, it produces search results that you can pass to downstream components in your flow as a list of ",(0,r.jsx)(t.a,{href:"/data-types#data",children:(0,r.jsx)(t.code,{children:"Data"})})," objects or a tabular ",(0,r.jsx)(t.a,{href:"/data-types#dataframe",children:(0,r.jsx)(t.code,{children:"DataFrame"})}),".\nIf both types are supported, you can set the format near the vector store component's output port in the visual editor."]})}function a(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(c,{...e})}):c(e)}}}]); \ No newline at end of file diff --git a/assets/js/c76bd485.0f18789b.js b/assets/js/c76bd485.0f18789b.js deleted file mode 100644 index 72fafa5be1..0000000000 --- a/assets/js/c76bd485.0f18789b.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[3468],{17886:(e,t,n)=>{n.d(t,{A:()=>i});n(96540);var r=n(64058),s=n(74848);function i({name:e,...t}){const n=r[e];return n?(0,s.jsx)(n,{...t}):null}},31929:(e,t,n)=>{n.d(t,{Ay:()=>l,RM:()=>d});var r=n(74848),s=n(28453),i=n(17886);const d=[];function a(e){const t={a:"a",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,r.jsxs)(t.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,r.jsx)(i.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Controls"})," in the ",(0,r.jsx)(t.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function l(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}},60782:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>o,default:()=>x,frontMatter:()=>l,metadata:()=>r,toc:()=>h});const r=JSON.parse('{"id":"Components/bundles-mistralai","title":"MistralAI","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/bundles-mistralai.mdx","sourceDirName":"Components","slug":"/bundles-mistralai","permalink":"/bundles-mistralai","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"MistralAI","slug":"/bundles-mistralai"},"sidebar":"docs","previous":{"title":"Milvus","permalink":"/bundles-milvus"},"next":{"title":"MongoDB","permalink":"/bundles-mongodb"}}');var s=n(74848),i=n(28453),d=n(17886),a=n(31929);const l={title:"MistralAI",slug:"/bundles-mistralai"},o=void 0,c={},h=[{value:"MistralAI text generation",id:"mistralai-text-generation",level:2},{value:"MistralAI text generation parameters",id:"mistralai-text-generation-parameters",level:3},...a.RM,{value:"MistralAI Embeddings",id:"mistralai-embeddings",level:2},{value:"MistralAI Embeddings parameters",id:"mistralai-embeddings-parameters",level:3},...a.RM];function m(e){const t={a:"a",code:"code",h2:"h2",h3:"h3",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,i.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(t.p,{children:[(0,s.jsx)(d.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(t.a,{href:"/components-bundle-components",children:(0,s.jsx)(t.strong,{children:"Bundles"})})," contain custom components that support specific third-party integrations with Langflow."]}),"\n",(0,s.jsxs)(t.p,{children:["This page describes the components that are available in the ",(0,s.jsx)(t.strong,{children:"MistralAI"})," bundle."]}),"\n",(0,s.jsxs)(t.p,{children:["For more information about MistralAI features and functionality used by MistralAI components, see the ",(0,s.jsx)(t.a,{href:"https://docs.mistral.ai",children:"MistralAI documentation"}),"."]}),"\n",(0,s.jsx)(t.h2,{id:"mistralai-text-generation",children:"MistralAI text generation"}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.strong,{children:"MistralAI"})," component generates text using MistralAI LLMs."]}),"\n",(0,s.jsxs)(t.p,{children:["It can output either a ",(0,s.jsx)(t.strong,{children:"Model Response"})," (",(0,s.jsx)(t.a,{href:"/data-types#message",children:(0,s.jsx)(t.code,{children:"Message"})}),") or a ",(0,s.jsx)(t.strong,{children:"Language Model"})," (",(0,s.jsx)(t.a,{href:"/data-types#languagemodel",children:(0,s.jsx)(t.code,{children:"LanguageModel"})}),")."]}),"\n",(0,s.jsxs)(t.p,{children:["Use the ",(0,s.jsx)(t.strong,{children:"Language Model"})," output when you want to use a MistralAI model as the LLM for another LLM-driven component, such as an ",(0,s.jsx)(t.strong,{children:"Agent"})," or ",(0,s.jsx)(t.strong,{children:"Smart Function"})," component."]}),"\n",(0,s.jsxs)(t.p,{children:["For more information, see ",(0,s.jsx)(t.a,{href:"/components-models",children:"Language model components"}),"."]}),"\n",(0,s.jsx)(t.h3,{id:"mistralai-text-generation-parameters",children:"MistralAI text generation parameters"}),"\n",(0,s.jsx)(a.Ay,{}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Name"}),(0,s.jsx)(t.th,{children:"Type"}),(0,s.jsx)(t.th,{children:"Description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"max_tokens"}),(0,s.jsx)(t.td,{children:"Integer"}),(0,s.jsx)(t.td,{children:"Input parameter. The maximum number of tokens to generate. Set to 0 for unlimited tokens (advanced)."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"model_name"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsxs)(t.td,{children:["Input parameter. The name of the Mistral AI model to use. Options include ",(0,s.jsx)(t.code,{children:"open-mixtral-8x7b"}),", ",(0,s.jsx)(t.code,{children:"open-mixtral-8x22b"}),", ",(0,s.jsx)(t.code,{children:"mistral-small-latest"}),", ",(0,s.jsx)(t.code,{children:"mistral-medium-latest"}),", ",(0,s.jsx)(t.code,{children:"mistral-large-latest"}),", and ",(0,s.jsx)(t.code,{children:"codestral-latest"}),". Default: ",(0,s.jsx)(t.code,{children:"codestral-latest"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"mistral_api_base"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsxs)(t.td,{children:["Input parameter. The base URL of the Mistral API. Defaults to ",(0,s.jsx)(t.code,{children:"https://api.mistral.ai/v1"})," (advanced)."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"api_key"}),(0,s.jsx)(t.td,{children:"SecretString"}),(0,s.jsx)(t.td,{children:"Input parameter. The Mistral API Key to use for authentication."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"temperature"}),(0,s.jsx)(t.td,{children:"Float"}),(0,s.jsx)(t.td,{children:"Input parameter. Controls randomness in the output. Default: 0.5."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"max_retries"}),(0,s.jsx)(t.td,{children:"Integer"}),(0,s.jsx)(t.td,{children:"Input parameter. Maximum number of retries for API calls. Default: 5 (advanced)."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"timeout"}),(0,s.jsx)(t.td,{children:"Integer"}),(0,s.jsx)(t.td,{children:"Input parameter. Timeout for API calls in seconds. Default: 60 (advanced)."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"max_concurrent_requests"}),(0,s.jsx)(t.td,{children:"Integer"}),(0,s.jsx)(t.td,{children:"Input parameter. Maximum number of concurrent API requests. Default: 3 (advanced)."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"top_p"}),(0,s.jsx)(t.td,{children:"Float"}),(0,s.jsx)(t.td,{children:"Input parameter. Nucleus sampling parameter. Default: 1 (advanced)."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"random_seed"}),(0,s.jsx)(t.td,{children:"Integer"}),(0,s.jsx)(t.td,{children:"Input parameter. Seed for random number generation. Default: 1 (advanced)."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"safe_mode"}),(0,s.jsx)(t.td,{children:"Boolean"}),(0,s.jsx)(t.td,{children:"Input parameter. Enables safe mode for content generation (advanced)."})]})]})]}),"\n",(0,s.jsx)(t.h2,{id:"mistralai-embeddings",children:"MistralAI Embeddings"}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.strong,{children:"MistralAI Embeddings"})," component generates embeddings using MistralAI models."]}),"\n",(0,s.jsxs)(t.p,{children:["For more information about using embedding model components in flows, see ",(0,s.jsx)(t.a,{href:"/components-embedding-models",children:"Embedding model components"}),"."]}),"\n",(0,s.jsx)(t.h3,{id:"mistralai-embeddings-parameters",children:"MistralAI Embeddings parameters"}),"\n",(0,s.jsx)(a.Ay,{}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Name"}),(0,s.jsx)(t.th,{children:"Type"}),(0,s.jsx)(t.th,{children:"Description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"model"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:'Input parameter. The MistralAI model to use. Default: "mistral-embed".'})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"mistral_api_key"}),(0,s.jsx)(t.td,{children:"SecretString"}),(0,s.jsx)(t.td,{children:"Input parameter. The API key for authenticating with MistralAI."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"max_concurrent_requests"}),(0,s.jsx)(t.td,{children:"Integer"}),(0,s.jsx)(t.td,{children:"Input parameter. The maximum number of concurrent API requests. Default: 64."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"max_retries"}),(0,s.jsx)(t.td,{children:"Integer"}),(0,s.jsx)(t.td,{children:"Input parameter. The maximum number of retry attempts for failed requests. Default: 5."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"timeout"}),(0,s.jsx)(t.td,{children:"Integer"}),(0,s.jsx)(t.td,{children:"Input parameter. The request timeout in seconds. Default: 120."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"endpoint"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsxs)(t.td,{children:["Input parameter. The custom API endpoint URL. Default: ",(0,s.jsx)(t.code,{children:"https://api.mistral.ai/v1/"}),"."]})]})]})]})]})}function x(e={}){const{wrapper:t}={...(0,i.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(m,{...e})}):m(e)}}}]); \ No newline at end of file diff --git a/assets/js/c76bd485.ca115d4b.js b/assets/js/c76bd485.ca115d4b.js new file mode 100644 index 0000000000..c01e4cbddc --- /dev/null +++ b/assets/js/c76bd485.ca115d4b.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[3468],{17886:(e,t,n)=>{n.d(t,{A:()=>i});n(96540);var r=n(64058),s=n(74848);function i({name:e,...t}){const n=r[e];return n?(0,s.jsx)(n,{...t}):null}},31929:(e,t,n)=>{n.d(t,{Ay:()=>l,RM:()=>d});var r=n(74848),s=n(28453),i=n(17886);const d=[];function a(e){const t={a:"a",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,r.jsxs)(t.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,r.jsx)(i.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Controls"})," in the ",(0,r.jsx)(t.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function l(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}},60782:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>o,default:()=>x,frontMatter:()=>l,metadata:()=>r,toc:()=>h});const r=JSON.parse('{"id":"Components/bundles-mistralai","title":"MistralAI","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/bundles-mistralai.mdx","sourceDirName":"Components","slug":"/bundles-mistralai","permalink":"/bundles-mistralai","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"MistralAI","slug":"/bundles-mistralai"},"sidebar":"docs","previous":{"title":"Milvus","permalink":"/bundles-milvus"},"next":{"title":"MongoDB","permalink":"/bundles-mongodb"}}');var s=n(74848),i=n(28453),d=n(17886),a=n(31929);const l={title:"MistralAI",slug:"/bundles-mistralai"},o=void 0,c={},h=[{value:"MistralAI text generation",id:"mistralai-text-generation",level:2},{value:"MistralAI text generation parameters",id:"mistralai-text-generation-parameters",level:3},...a.RM,{value:"MistralAI Embeddings",id:"mistralai-embeddings",level:2},{value:"MistralAI Embeddings parameters",id:"mistralai-embeddings-parameters",level:3},...a.RM];function m(e){const t={a:"a",code:"code",h2:"h2",h3:"h3",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,i.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(t.p,{children:[(0,s.jsx)(d.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(t.a,{href:"/components-bundle-components",children:(0,s.jsx)(t.strong,{children:"Bundles"})})," contain custom components that support specific third-party integrations with Langflow."]}),"\n",(0,s.jsxs)(t.p,{children:["This page describes the components that are available in the ",(0,s.jsx)(t.strong,{children:"MistralAI"})," bundle."]}),"\n",(0,s.jsxs)(t.p,{children:["For more information about MistralAI features and functionality used by MistralAI components, see the ",(0,s.jsx)(t.a,{href:"https://docs.mistral.ai",children:"MistralAI documentation"}),"."]}),"\n",(0,s.jsx)(t.h2,{id:"mistralai-text-generation",children:"MistralAI text generation"}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.strong,{children:"MistralAI"})," component generates text using MistralAI LLMs."]}),"\n",(0,s.jsxs)(t.p,{children:["It can output either a ",(0,s.jsx)(t.strong,{children:"Model Response"})," (",(0,s.jsx)(t.a,{href:"/data-types#message",children:(0,s.jsx)(t.code,{children:"Message"})}),") or a ",(0,s.jsx)(t.strong,{children:"Language Model"})," (",(0,s.jsx)(t.a,{href:"/data-types#languagemodel",children:(0,s.jsx)(t.code,{children:"LanguageModel"})}),")."]}),"\n",(0,s.jsxs)(t.p,{children:["Use the ",(0,s.jsx)(t.strong,{children:"Language Model"})," output when you want to use a MistralAI model as the LLM for another LLM-driven component, such as an ",(0,s.jsx)(t.strong,{children:"Agent"})," or ",(0,s.jsx)(t.strong,{children:"Smart Function"})," component."]}),"\n",(0,s.jsxs)(t.p,{children:["For more information, see ",(0,s.jsx)(t.a,{href:"/components-models",children:"Language model components"}),"."]}),"\n",(0,s.jsx)(t.h3,{id:"mistralai-text-generation-parameters",children:"MistralAI text generation parameters"}),"\n",(0,s.jsx)(a.Ay,{}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Name"}),(0,s.jsx)(t.th,{children:"Type"}),(0,s.jsx)(t.th,{children:"Description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"max_tokens"}),(0,s.jsx)(t.td,{children:"Integer"}),(0,s.jsx)(t.td,{children:"Input parameter. The maximum number of tokens to generate. Set to 0 for unlimited tokens."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"model_name"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsxs)(t.td,{children:["Input parameter. The name of the Mistral AI model to use. Options include ",(0,s.jsx)(t.code,{children:"open-mixtral-8x7b"}),", ",(0,s.jsx)(t.code,{children:"open-mixtral-8x22b"}),", ",(0,s.jsx)(t.code,{children:"mistral-small-latest"}),", ",(0,s.jsx)(t.code,{children:"mistral-medium-latest"}),", ",(0,s.jsx)(t.code,{children:"mistral-large-latest"}),", and ",(0,s.jsx)(t.code,{children:"codestral-latest"}),". Default: ",(0,s.jsx)(t.code,{children:"codestral-latest"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"mistral_api_base"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsxs)(t.td,{children:["Input parameter. The base URL of the Mistral API. Defaults to ",(0,s.jsx)(t.code,{children:"https://api.mistral.ai/v1"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"api_key"}),(0,s.jsx)(t.td,{children:"SecretString"}),(0,s.jsx)(t.td,{children:"Input parameter. The Mistral API Key to use for authentication."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"temperature"}),(0,s.jsx)(t.td,{children:"Float"}),(0,s.jsx)(t.td,{children:"Input parameter. Controls randomness in the output. Default: 0.5."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"max_retries"}),(0,s.jsx)(t.td,{children:"Integer"}),(0,s.jsx)(t.td,{children:"Input parameter. Maximum number of retries for API calls. Default: 5."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"timeout"}),(0,s.jsx)(t.td,{children:"Integer"}),(0,s.jsx)(t.td,{children:"Input parameter. Timeout for API calls in seconds. Default: 60."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"max_concurrent_requests"}),(0,s.jsx)(t.td,{children:"Integer"}),(0,s.jsx)(t.td,{children:"Input parameter. Maximum number of concurrent API requests. Default: 3."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"top_p"}),(0,s.jsx)(t.td,{children:"Float"}),(0,s.jsx)(t.td,{children:"Input parameter. Nucleus sampling parameter. Default: 1."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"random_seed"}),(0,s.jsx)(t.td,{children:"Integer"}),(0,s.jsx)(t.td,{children:"Input parameter. Seed for random number generation. Default: 1."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"safe_mode"}),(0,s.jsx)(t.td,{children:"Boolean"}),(0,s.jsx)(t.td,{children:"Input parameter. Enables safe mode for content generation."})]})]})]}),"\n",(0,s.jsx)(t.h2,{id:"mistralai-embeddings",children:"MistralAI Embeddings"}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.strong,{children:"MistralAI Embeddings"})," component generates embeddings using MistralAI models."]}),"\n",(0,s.jsxs)(t.p,{children:["For more information about using embedding model components in flows, see ",(0,s.jsx)(t.a,{href:"/components-embedding-models",children:"Embedding model components"}),"."]}),"\n",(0,s.jsx)(t.h3,{id:"mistralai-embeddings-parameters",children:"MistralAI Embeddings parameters"}),"\n",(0,s.jsx)(a.Ay,{}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Name"}),(0,s.jsx)(t.th,{children:"Type"}),(0,s.jsx)(t.th,{children:"Description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"model"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:'Input parameter. The MistralAI model to use. Default: "mistral-embed".'})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"mistral_api_key"}),(0,s.jsx)(t.td,{children:"SecretString"}),(0,s.jsx)(t.td,{children:"Input parameter. The API key for authenticating with MistralAI."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"max_concurrent_requests"}),(0,s.jsx)(t.td,{children:"Integer"}),(0,s.jsx)(t.td,{children:"Input parameter. The maximum number of concurrent API requests. Default: 64."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"max_retries"}),(0,s.jsx)(t.td,{children:"Integer"}),(0,s.jsx)(t.td,{children:"Input parameter. The maximum number of retry attempts for failed requests. Default: 5."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"timeout"}),(0,s.jsx)(t.td,{children:"Integer"}),(0,s.jsx)(t.td,{children:"Input parameter. The request timeout in seconds. Default: 120."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"endpoint"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsxs)(t.td,{children:["Input parameter. The custom API endpoint URL. Default: ",(0,s.jsx)(t.code,{children:"https://api.mistral.ai/v1/"}),"."]})]})]})]})]})}function x(e={}){const{wrapper:t}={...(0,i.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(m,{...e})}):m(e)}}}]); \ No newline at end of file diff --git a/assets/js/cb17b4e0.ca8c8e8a.js b/assets/js/cb17b4e0.12b2633d.js similarity index 62% rename from assets/js/cb17b4e0.ca8c8e8a.js rename to assets/js/cb17b4e0.12b2633d.js index a83559026a..ae386607e3 100644 --- a/assets/js/cb17b4e0.ca8c8e8a.js +++ b/assets/js/cb17b4e0.12b2633d.js @@ -1 +1 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[4085],{1716:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>l,default:()=>u,frontMatter:()=>i,metadata:()=>s,toc:()=>h});const s=JSON.parse('{"id":"Components/bundles-deepseek","title":"DeepSeek","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/bundles-deepseek.mdx","sourceDirName":"Components","slug":"/bundles-deepseek","permalink":"/bundles-deepseek","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"DeepSeek","slug":"/bundles-deepseek"},"sidebar":"docs","previous":{"title":"DataStax","permalink":"/bundles-datastax"},"next":{"title":"Docling","permalink":"/integrations-docling"}}');var r=t(74848),d=t(28453),o=t(17886),a=t(31929);const i={title:"DeepSeek",slug:"/bundles-deepseek"},l=void 0,c={},h=[{value:"DeepSeek text generation",id:"deepseek-text-generation",level:2},{value:"DeepSeek text generation parameters",id:"deepseek-text-generation-parameters",level:3},...a.RM];function p(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,d.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(n.p,{children:[(0,r.jsx)(o.A,{name:"Blocks","aria-hidden":"true"})," ",(0,r.jsx)(n.a,{href:"/components-bundle-components",children:(0,r.jsx)(n.strong,{children:"Bundles"})})," contain custom components that support specific third-party integrations with Langflow."]}),"\n",(0,r.jsxs)(n.p,{children:["This page describes the components that are available in the ",(0,r.jsx)(n.strong,{children:"DeepSeek"})," bundle."]}),"\n",(0,r.jsxs)(n.p,{children:["For more information about DeepSeek features and functionality used by DeepSeek components, see the ",(0,r.jsx)(n.a,{href:"https://api-docs.deepseek.com/",children:"DeepSeek documentation"}),"."]}),"\n",(0,r.jsx)(n.h2,{id:"deepseek-text-generation",children:"DeepSeek text generation"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"DeepSeek"})," component generates text using DeepSeek's language models."]}),"\n",(0,r.jsxs)(n.p,{children:["It can output either a ",(0,r.jsx)(n.strong,{children:"Model Response"})," (",(0,r.jsx)(n.a,{href:"/data-types#message",children:(0,r.jsx)(n.code,{children:"Message"})}),") or a ",(0,r.jsx)(n.strong,{children:"Language Model"})," (",(0,r.jsx)(n.a,{href:"/data-types#languagemodel",children:(0,r.jsx)(n.code,{children:"LanguageModel"})}),")."]}),"\n",(0,r.jsxs)(n.p,{children:["Use the ",(0,r.jsx)(n.strong,{children:"Language Model"})," output when you want to use a DeepSeek model as the LLM for another LLM-driven component, such as an ",(0,r.jsx)(n.strong,{children:"Agent"})," or ",(0,r.jsx)(n.strong,{children:"Smart Function"})," component."]}),"\n",(0,r.jsxs)(n.p,{children:["For more information, see ",(0,r.jsx)(n.a,{href:"/components-models",children:"Language model components"}),"."]}),"\n",(0,r.jsx)(n.h3,{id:"deepseek-text-generation-parameters",children:"DeepSeek text generation parameters"}),"\n",(0,r.jsx)(a.Ay,{}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"max_tokens"}),(0,r.jsx)(n.td,{children:"Integer"}),(0,r.jsxs)(n.td,{children:["Input parameter. Maximum number of tokens to generate. Set to ",(0,r.jsx)(n.code,{children:"0"})," for unlimited. Range: ",(0,r.jsx)(n.code,{children:"0-128000"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"model_kwargs"}),(0,r.jsx)(n.td,{children:"Dictionary"}),(0,r.jsx)(n.td,{children:"Input parameter. Additional keyword arguments for the model."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"json_mode"}),(0,r.jsx)(n.td,{children:"Boolean"}),(0,r.jsx)(n.td,{children:"Input parameter. If true, outputs JSON regardless of passing a schema."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"model_name"}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsxs)(n.td,{children:["Input parameter. The DeepSeek model to use. Default: ",(0,r.jsx)(n.code,{children:"deepseek-chat"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"api_base"}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsxs)(n.td,{children:["Input parameter. Base URL for API requests. Default: ",(0,r.jsx)(n.code,{children:"https://api.deepseek.com"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"api_key"}),(0,r.jsx)(n.td,{children:"SecretString"}),(0,r.jsx)(n.td,{children:"Input parameter. Your DeepSeek API key for authentication."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"temperature"}),(0,r.jsx)(n.td,{children:"Float"}),(0,r.jsxs)(n.td,{children:["Input parameter. Controls randomness in responses. Range: ",(0,r.jsx)(n.code,{children:"[0.0, 2.0]"}),". Default: ",(0,r.jsx)(n.code,{children:"1.0"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"seed"}),(0,r.jsx)(n.td,{children:"Integer"}),(0,r.jsx)(n.td,{children:"Input parameter. Number initialized for random number generation. Use the same seed integer for more reproducible results, and use a different seed number for more random results."})]})]})]})]})}function u(e={}){const{wrapper:n}={...(0,d.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(p,{...e})}):p(e)}},17886:(e,n,t)=>{t.d(n,{A:()=>d});t(96540);var s=t(64058),r=t(74848);function d({name:e,...n}){const t=s[e];return t?(0,r.jsx)(t,{...n}):null}},31929:(e,n,t)=>{t.d(n,{Ay:()=>i,RM:()=>o});var s=t(74848),r=t(28453),d=t(17886);const o=[];function a(e){const n={a:"a",p:"p",strong:"strong",...(0,r.R)(),...e.components};return(0,s.jsxs)(n.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,s.jsx)(d.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Controls"})," in the ",(0,s.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function i(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(a,{...e})}):a(e)}}}]); \ No newline at end of file +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[4085],{1716:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>l,default:()=>u,frontMatter:()=>i,metadata:()=>s,toc:()=>h});const s=JSON.parse('{"id":"Components/bundles-deepseek","title":"DeepSeek","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/bundles-deepseek.mdx","sourceDirName":"Components","slug":"/bundles-deepseek","permalink":"/bundles-deepseek","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"DeepSeek","slug":"/bundles-deepseek"},"sidebar":"docs","previous":{"title":"DataStax","permalink":"/bundles-datastax"},"next":{"title":"Docling","permalink":"/integrations-docling"}}');var r=t(74848),d=t(28453),o=t(17886),a=t(31929);const i={title:"DeepSeek",slug:"/bundles-deepseek"},l=void 0,c={},h=[{value:"DeepSeek text generation",id:"deepseek-text-generation",level:2},{value:"DeepSeek text generation parameters",id:"deepseek-text-generation-parameters",level:3},...a.RM];function p(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,d.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(n.p,{children:[(0,r.jsx)(o.A,{name:"Blocks","aria-hidden":"true"})," ",(0,r.jsx)(n.a,{href:"/components-bundle-components",children:(0,r.jsx)(n.strong,{children:"Bundles"})})," contain custom components that support specific third-party integrations with Langflow."]}),"\n",(0,r.jsxs)(n.p,{children:["This page describes the components that are available in the ",(0,r.jsx)(n.strong,{children:"DeepSeek"})," bundle."]}),"\n",(0,r.jsxs)(n.p,{children:["For more information about DeepSeek features and functionality used by DeepSeek components, see the ",(0,r.jsx)(n.a,{href:"https://api-docs.deepseek.com/",children:"DeepSeek documentation"}),"."]}),"\n",(0,r.jsx)(n.h2,{id:"deepseek-text-generation",children:"DeepSeek text generation"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"DeepSeek"})," component generates text using DeepSeek's language models."]}),"\n",(0,r.jsxs)(n.p,{children:["It can output either a ",(0,r.jsx)(n.strong,{children:"Model Response"})," (",(0,r.jsx)(n.a,{href:"/data-types#message",children:(0,r.jsx)(n.code,{children:"Message"})}),") or a ",(0,r.jsx)(n.strong,{children:"Language Model"})," (",(0,r.jsx)(n.a,{href:"/data-types#languagemodel",children:(0,r.jsx)(n.code,{children:"LanguageModel"})}),")."]}),"\n",(0,r.jsxs)(n.p,{children:["Use the ",(0,r.jsx)(n.strong,{children:"Language Model"})," output when you want to use a DeepSeek model as the LLM for another LLM-driven component, such as an ",(0,r.jsx)(n.strong,{children:"Agent"})," or ",(0,r.jsx)(n.strong,{children:"Smart Function"})," component."]}),"\n",(0,r.jsxs)(n.p,{children:["For more information, see ",(0,r.jsx)(n.a,{href:"/components-models",children:"Language model components"}),"."]}),"\n",(0,r.jsx)(n.h3,{id:"deepseek-text-generation-parameters",children:"DeepSeek text generation parameters"}),"\n",(0,r.jsx)(a.Ay,{}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"max_tokens"}),(0,r.jsx)(n.td,{children:"Integer"}),(0,r.jsxs)(n.td,{children:["Input parameter. Maximum number of tokens to generate. Set to ",(0,r.jsx)(n.code,{children:"0"})," for unlimited. Range: ",(0,r.jsx)(n.code,{children:"0-128000"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"model_kwargs"}),(0,r.jsx)(n.td,{children:"Dictionary"}),(0,r.jsx)(n.td,{children:"Input parameter. Additional keyword arguments for the model."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"json_mode"}),(0,r.jsx)(n.td,{children:"Boolean"}),(0,r.jsxs)(n.td,{children:["Input parameter. If ",(0,r.jsx)(n.code,{children:"true"}),", outputs JSON regardless of passing a schema."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"model_name"}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsxs)(n.td,{children:["Input parameter. The DeepSeek model to use. Default: ",(0,r.jsx)(n.code,{children:"deepseek-chat"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"api_base"}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsxs)(n.td,{children:["Input parameter. Base URL for API requests. Default: ",(0,r.jsx)(n.code,{children:"https://api.deepseek.com"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"api_key"}),(0,r.jsx)(n.td,{children:"SecretString"}),(0,r.jsx)(n.td,{children:"Input parameter. Your DeepSeek API key for authentication."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"temperature"}),(0,r.jsx)(n.td,{children:"Float"}),(0,r.jsxs)(n.td,{children:["Input parameter. Controls randomness in responses. Range: ",(0,r.jsx)(n.code,{children:"[0.0, 2.0]"}),". Default: ",(0,r.jsx)(n.code,{children:"1.0"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"seed"}),(0,r.jsx)(n.td,{children:"Integer"}),(0,r.jsx)(n.td,{children:"Input parameter. Number initialized for random number generation. Use the same seed integer for more reproducible results, and use a different seed number for more random results."})]})]})]})]})}function u(e={}){const{wrapper:n}={...(0,d.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(p,{...e})}):p(e)}},17886:(e,n,t)=>{t.d(n,{A:()=>d});t(96540);var s=t(64058),r=t(74848);function d({name:e,...n}){const t=s[e];return t?(0,r.jsx)(t,{...n}):null}},31929:(e,n,t)=>{t.d(n,{Ay:()=>i,RM:()=>o});var s=t(74848),r=t(28453),d=t(17886);const o=[];function a(e){const n={a:"a",p:"p",strong:"strong",...(0,r.R)(),...e.components};return(0,s.jsxs)(n.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,s.jsx)(d.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Controls"})," in the ",(0,s.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function i(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(a,{...e})}):a(e)}}}]); \ No newline at end of file diff --git a/assets/js/cce672fb.2ad7cd3e.js b/assets/js/cce672fb.2ad7cd3e.js deleted file mode 100644 index 8b9c4cb0bf..0000000000 --- a/assets/js/cce672fb.2ad7cd3e.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[6311],{17886:(e,n,t)=>{t.d(n,{A:()=>r});t(96540);var o=t(64058),s=t(74848);function r({name:e,...n}){const t=o[e];return t?(0,s.jsx)(t,{...n}):null}},24770:(e,n,t)=>{t.d(n,{A:()=>o});const o=t.p+"assets/images/agent-example-add-chat-0fec77d5cd551fa755eb013c7aa5e1f0.png"},25194:(e,n,t)=>{t.d(n,{Ay:()=>i,RM:()=>r});var o=t(74848),s=t(28453);const r=[];function a(e){const n={code:"code",em:"em",p:"p",...(0,s.R)(),...e.components},{Details:t}=n;return t||function(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,o.jsxs)(t,{children:[(0,o.jsx)("summary",{children:"How do agents work?"}),(0,o.jsxs)(n.p,{children:["Agents extend Large Language Models (LLMs) by integrating ",(0,o.jsx)(n.em,{children:"tools"}),", which are functions that provide additional context and enable autonomous task execution.\nThese integrations make agents more specialized and powerful than standalone LLMs."]}),(0,o.jsx)(n.p,{children:"Whereas an LLM might generate acceptable, inert responses to general queries and tasks, an agent can leverage the integrated context and tools to provide more relevant responses and even take action.\nFor example, you might create an agent that can access your company's documentation, repositories, and other resources to help your team with tasks that require knowledge of your specific products, customers, and code."}),(0,o.jsx)(n.p,{children:"Agents use LLMs as a reasoning engine to process input, determine which actions to take to address the query, and then generate a response.\nThe response could be a typical text-based LLM response, or it could involve an action, like editing a file, running a script, or calling an external API."}),(0,o.jsxs)(n.p,{children:["In an agentic context, tools are functions that the agent can run to perform tasks or access external resources.\nA function is wrapped as a ",(0,o.jsx)(n.code,{children:"Tool"})," object with a common interface that the agent understands.\nAgents become aware of tools through tool registration, which is when the agent is provided a list of available tools typically at agent initialization.\nThe ",(0,o.jsx)(n.code,{children:"Tool"})," object's description tells the agent what the tool can do so that it can decide whether the tool is appropriate for a given request."]})]})}function i(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(a,{...e})}):a(e)}},31929:(e,n,t)=>{t.d(n,{Ay:()=>c,RM:()=>a});var o=t(74848),s=t(28453),r=t(17886);const a=[];function i(e){const n={a:"a",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,o.jsxs)(n.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,o.jsx)(r.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Controls"})," in the ",(0,o.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function c(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(i,{...e})}):i(e)}},65535:(e,n,t)=>{t.d(n,{A:()=>o});const o=t.p+"assets/images/agent-example-add-tools-a55635c0c740ce8a71bd7f1ecef2736f.png"},67800:(e,n,t)=>{t.r(n),t.d(n,{CH:()=>g,assets:()=>p,chCodeConfig:()=>u,contentTitle:()=>h,default:()=>f,frontMatter:()=>d,metadata:()=>o,toc:()=>m});const o=JSON.parse('{"id":"Agents/agents","title":"Use Langflow agents","description":"Langflow\'s Agent component is critical for building agent flows.","source":"@site/docs/Agents/agents.mdx","sourceDirName":"Agents","slug":"/agents","permalink":"/agents","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Use Langflow agents","slug":"/agents"},"sidebar":"docs","previous":{"title":"Import and export flows","permalink":"/concepts-flows-import"},"next":{"title":"Configure tools for agents","permalink":"/agents-tools"}}');var s=t(74848),r=t(28453),a=t(24754),i=t(17886),c=t(31929),l=t(25194);const d={title:"Use Langflow agents",slug:"/agents"},h=void 0,p={},g={annotations:a.hk,Code:a.Cy},u={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},m=[...l.RM,{value:"Use the Agent component in a flow",id:"use-the-agent-component-in-a-flow",level:2},{value:"Agent component parameters",id:"agent-component-parameters",level:2},...c.RM,{value:"Provider and model",id:"provider-and-model",level:3},{value:"Model provider API key",id:"model-provider-api-key",level:3},{value:"Agent instructions and input",id:"agent-instructions-and-input",level:3},{value:"Tools",id:"tools",level:3},{value:"Agent memory",id:"agent-memory",level:3},{value:"Additional parameters",id:"additional-parameters",level:3},...c.RM,{value:"Agent component output",id:"agent-component-output",level:2},{value:"See also",id:"see-also",level:2}];function x(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return g||j("CH",!1),g.Code||j("CH.Code",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n","\n",(0,s.jsxs)(n.p,{children:["Langflow's ",(0,s.jsxs)(n.a,{href:"/components-agents",children:[(0,s.jsx)(n.strong,{children:"Agent"})," component"]})," is critical for building agent flows.\nThis component provides everything you need to create an agent, including multiple Large Language Model (LLM) providers, tool calling, and custom instructions.\nIt simplifies agent configuration so you can focus on application development."]}),"\n",(0,s.jsx)(l.Ay,{}),"\n",(0,s.jsx)(n.h2,{id:"use-the-agent-component-in-a-flow",children:"Use the Agent component in a flow"}),"\n",(0,s.jsxs)(n.p,{children:["The following steps explain how to create an agent flow in Langflow from a blank flow.\nFor a prebuilt example, use the ",(0,s.jsx)(n.strong,{children:"Simple Agent"})," template or the ",(0,s.jsx)(n.a,{href:"/get-started-quickstart",children:"Langflow quickstart"}),"."]}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Click ",(0,s.jsx)(n.strong,{children:"New Flow"}),", and then click ",(0,s.jsx)(n.strong,{children:"Blank Flow"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Add an ",(0,s.jsx)(n.strong,{children:"Agent"})," component to your flow."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Enter a valid OpenAI API key."}),"\n",(0,s.jsxs)(n.p,{children:["The default model for the ",(0,s.jsx)(n.strong,{children:"Agent"})," component is an OpenAI model.\nIf you want to use a different provider, edit the ",(0,s.jsx)(n.strong,{children:"Model Provider"}),", ",(0,s.jsx)(n.strong,{children:"Model Name"}),", and ",(0,s.jsx)(n.strong,{children:"API Key"})," fields accordingly.\nFor more information, see ",(0,s.jsx)(n.a,{href:"#agent-component-parameters",children:"Agent component parameters"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Add ",(0,s.jsxs)(n.a,{href:"/components-io",children:[(0,s.jsx)(n.strong,{children:"Chat Input"})," and ",(0,s.jsx)(n.strong,{children:"Chat Output"})," components"]})," to your flow, and then connect them to the ",(0,s.jsx)(n.strong,{children:"Agent"})," component."]}),"\n",(0,s.jsxs)(n.p,{children:["At this point, you have created a basic LLM-based chat flow that you can test in the ",(0,s.jsx)(i.A,{name:"Play","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Playground"}),".\nHowever, this flow only chats with the LLM.\nTo enhance this flow and make it truly agentic, add some tools, as explained in the next steps."]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"A basic agent chat flow with Chat Input, Agent, and Chat Output components.",src:t(24770).A+"",width:"3704",height:"2572"})}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Add ",(0,s.jsx)(n.strong,{children:"News Search"}),", ",(0,s.jsx)(n.strong,{children:"URL"}),", and ",(0,s.jsx)(n.strong,{children:"Calculator"})," components to your flow."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Enable ",(0,s.jsx)(n.strong,{children:"Tool Mode"})," in the ",(0,s.jsx)(n.strong,{children:"News Search"}),", ",(0,s.jsx)(n.strong,{children:"URL"}),", and ",(0,s.jsx)(n.strong,{children:"Calculator"})," components:"]}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["Click the ",(0,s.jsx)(n.strong,{children:"News Search"})," component to expose the ",(0,s.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),", and then enable ",(0,s.jsx)(n.strong,{children:"Tool Mode"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:["Repeat for the ",(0,s.jsx)(n.strong,{children:"URL"})," and ",(0,s.jsx)(n.strong,{children:"Calculator"})," components."]}),"\n",(0,s.jsxs)(n.li,{children:["Connect the ",(0,s.jsx)(n.strong,{children:"Toolset"})," port for each tool component to the ",(0,s.jsx)(n.strong,{children:"Tools"})," port on the ",(0,s.jsx)(n.strong,{children:"Agent"})," component."]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Tool Mode"})," makes a component into a tool by modifying the component's inputs.\nWith ",(0,s.jsx)(n.strong,{children:"Tool Mode"})," enabled, a component can accept requests from an ",(0,s.jsx)(n.strong,{children:"Agent"})," component to use the component's available actions as tools."]}),"\n",(0,s.jsxs)(n.p,{children:["When in ",(0,s.jsx)(n.strong,{children:"Tool Mode"}),", a component has a ",(0,s.jsx)(n.strong,{children:"Toolset"})," port that you must connect to an ",(0,s.jsx)(n.strong,{children:"Agent"})," component's ",(0,s.jsx)(n.strong,{children:"Tools"})," port if you want to allow the agent to use that component's actions as tools."]}),"\n",(0,s.jsxs)(n.p,{children:["For more information, see ",(0,s.jsx)(n.a,{href:"/agents-tools",children:"Configure tools for agents"}),"."]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"A more complex agent chat flow where three components are connected to the Agent component as tools",src:t(65535).A+"",width:"3380",height:"3012"})}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Open the ",(0,s.jsx)(i.A,{name:"Play","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Playground"}),", and then ask the agent, ",(0,s.jsx)(n.code,{children:"What tools are you using to answer my questions?"})]}),"\n",(0,s.jsx)(n.p,{children:"The agent should respond with a list of the connected tools.\nIt may also include built-in tools."}),"\n",(0,s.jsx)(g.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"I use a combination of my built-in knowledge (up to June 2024) and a set of external tools to answer your questions. Here are the main types of tools I can use:",props:{}}]},{tokens:[{content:"Web Search & Content Fetching: I can fetch and summarize content from web pages, including crawling links recursively.",props:{}}]},{tokens:[{content:"News Search: I can search for recent news articles using Google News via RSS feeds.",props:{}}]},{tokens:[{content:"Calculator: I can perform arithmetic calculations and evaluate mathematical expressions.",props:{}}]},{tokens:[{content:"Date & Time: I can provide the current date and time in various time zones.",props:{}}]},{tokens:[{content:"These tools help me provide up-to-date information, perform calculations, and retrieve specific data from the internet when needed. If you have a specific question, let me know, and I'll use the most appropriate tool(s) to help!",props:{}}]}],lang:"text"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["To test a specific tool, ask the agent a question that uses one of the tools, such as ",(0,s.jsx)(n.code,{children:"Summarize today's tech news"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["To help you debug and test your flows, the ",(0,s.jsx)(n.strong,{children:"Playground"})," displays the agent's tool calls, the provided input, and the raw output the agent received before generating the summary.\nWith the given example, the agent should call the ",(0,s.jsx)(n.strong,{children:"News Search"})," component's ",(0,s.jsx)(n.code,{children:"search_news"})," action."]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:"You've successfully created a basic agent flow that uses some generic tools."}),"\n",(0,s.jsxs)(n.p,{children:["To continue building on this tutorial, try connecting other tool components or ",(0,s.jsx)(n.a,{href:"/mcp-client",children:"use Langflow as an MCP client"})," to support more complex and specialized tasks."]}),"\n",(0,s.jsxs)(n.p,{children:["For a multi-agent example, see ",(0,s.jsx)(n.a,{href:"/agents-tools#use-an-agent-as-a-tool",children:"Use an agent as a tool"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"agent-component-parameters",children:"Agent component parameters"}),"\n",(0,s.jsxs)(n.p,{children:["You can configure the ",(0,s.jsx)(n.strong,{children:"Agent"})," component to use your preferred provider and model, custom instructions, and tools."]}),"\n",(0,s.jsx)(c.Ay,{}),"\n",(0,s.jsx)(n.h3,{id:"provider-and-model",children:"Provider and model"}),"\n",(0,s.jsxs)(n.p,{children:["Use the ",(0,s.jsx)(n.strong,{children:"Model Provider"})," (",(0,s.jsx)(n.code,{children:"agent_llm"}),") and ",(0,s.jsx)(n.strong,{children:"Model Name"})," (",(0,s.jsx)(n.code,{children:"llm_model"}),") settings to select the model provider and LLM that you want the agent to use."]}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"Agent"})," component includes many models from several popular model providers.\nTo access other providers and models, set ",(0,s.jsx)(n.strong,{children:"Model Provider"})," to ",(0,s.jsx)(n.strong,{children:"Connect other models"}),", and then connect any ",(0,s.jsx)(n.a,{href:"/components-models",children:"language model component"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["If you need to generate embeddings in your flow, use an ",(0,s.jsx)(n.a,{href:"/components-embedding-models",children:"embedding model component"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"model-provider-api-key",children:"Model provider API key"}),"\n",(0,s.jsxs)(n.p,{children:["In the ",(0,s.jsx)(n.strong,{children:"API Key"})," field, enter a valid authentication key for your selected model provider, if you are using a built-in provider.\nFor example, to use the default OpenAI model, you must provide a valid OpenAI API key for an OpenAI account that has credits and permission to call OpenAI LLMs."]}),"\n",(0,s.jsxs)(n.p,{children:["You can enter the key directly, but it is recommended that you follow industry best practices for storing and referencing API keys.\nFor example, you can use a ",(0,s.jsx)(i.A,{name:"Globe","aria-hidden":"true"})," ",(0,s.jsx)(n.a,{href:"/configuration-global-variables",children:"global variable"})," or ",(0,s.jsx)(n.a,{href:"/environment-variables",children:"environment variables"}),".\nFor more information, see ",(0,s.jsx)(n.a,{href:"/api-keys-and-authentication#component-api-keys",children:"Add component API keys to Langflow"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["If you select ",(0,s.jsx)(n.strong,{children:"Connect other models"})," as the model provider, authentication is handled in the incoming language model component."]}),"\n",(0,s.jsx)(n.h3,{id:"agent-instructions-and-input",children:"Agent instructions and input"}),"\n",(0,s.jsxs)(n.p,{children:["In the ",(0,s.jsx)(n.strong,{children:"Agent Instructions"})," (",(0,s.jsx)(n.code,{children:"system_prompt"}),") field, you can provide custom instructions that you want the ",(0,s.jsx)(n.strong,{children:"Agent"})," component to use for every conversation."]}),"\n",(0,s.jsxs)(n.p,{children:["These instructions are applied in addition to the ",(0,s.jsx)(n.strong,{children:"Input"})," (",(0,s.jsx)(n.code,{children:"input_value"}),"), which can be entered directly or provided through another component, such as a ",(0,s.jsx)(n.strong,{children:"Chat Input"})," component."]}),"\n",(0,s.jsx)(n.h3,{id:"tools",children:"Tools"}),"\n",(0,s.jsx)(n.p,{children:"Agents are most useful when they have the appropriate tools available to complete requests."}),"\n",(0,s.jsxs)(n.p,{children:["An ",(0,s.jsx)(n.strong,{children:"Agent"})," component can use any Langflow component as a tool, including other agents and MCP servers."]}),"\n",(0,s.jsxs)(n.p,{children:["To attach a component as a tool, you must enable ",(0,s.jsx)(n.strong,{children:"Tool Mode"})," on the component that you want to attach, and then attach it to the ",(0,s.jsx)(n.strong,{children:"Agent"})," component's ",(0,s.jsx)(n.strong,{children:"Tools"})," port.\nFor more information, see ",(0,s.jsx)(n.a,{href:"/agents-tools",children:"Configure tools for agents"}),"."]}),"\n",(0,s.jsx)(n.admonition,{type:"tip",children:(0,s.jsxs)(n.p,{children:["To allow agents to use tools from MCP servers, use the ",(0,s.jsxs)(n.a,{href:"/components-agents#mcp-connection",children:[(0,s.jsx)(n.strong,{children:"MCP Tools"})," component"]}),"."]})}),"\n",(0,s.jsx)(n.h3,{id:"agent-memory",children:"Agent memory"}),"\n",(0,s.jsx)(n.p,{children:"Langflow agents have built-in chat memory that is enabled by default.\nThis memory allows them to retrieve and reference messages from previous conversations, maintaining a rolling context window for each chat session ID."}),"\n",(0,s.jsxs)(n.p,{children:["Chat memories are grouped by ",(0,s.jsxs)(n.a,{href:"/session-id",children:["session ID (",(0,s.jsx)(n.code,{children:"session_id"}),")"]}),".\nIt is recommended to use custom session IDs if you need to segregate chat memory for different users or applications that run the same flow."]}),"\n",(0,s.jsxs)(n.p,{children:["By default, the ",(0,s.jsx)(n.strong,{children:"Agent"})," component uses your Langflow installation's storage, and it retrieves a limited number of chat messages, which you can configure with the ",(0,s.jsx)(n.strong,{children:"Number of Chat History Messages"})," parameter."]}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"Message History"})," component isn't required for default chat memory, but it is required if you want to use external chat memory like Mem0.\nAdditionally, the ",(0,s.jsx)(n.strong,{children:"Message History"})," component provides more options for sorting, filtering, and limiting memories. Although, most of these options are built-in to the ",(0,s.jsx)(n.strong,{children:"Agent"})," component with default values."]}),"\n",(0,s.jsxs)(n.p,{children:["For more information, see ",(0,s.jsx)(n.a,{href:"/memory#store-chat-memory",children:"Store chat memory"})," and ",(0,s.jsxs)(n.a,{href:"/components-helpers#message-history",children:[(0,s.jsx)(n.strong,{children:"Message History"})," component"]}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"additional-parameters",children:"Additional parameters"}),"\n",(0,s.jsxs)(n.p,{children:["With the ",(0,s.jsx)(n.strong,{children:"Agent"})," component, the available parameters can change depending on the selected provider and model, including support for additional modes, arguments, or features like chat memory and temperature.\nFor example:"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Current Date"})," (",(0,s.jsx)(n.code,{children:"add_current_date_tool"}),"): When enabled (true), this setting adds a tool to the agent that can retrieve the current date."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Handle Parse Errors"})," (",(0,s.jsx)(n.code,{children:"handle_parsing_errors"}),"): When enabled (true), this setting allows the agent to fix errors, like typos, when analyzing user input."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Verbose"})," (",(0,s.jsx)(n.code,{children:"verbose"}),"): When enabled (true), this setting records detailed logging output for debugging and analysis."]}),"\n"]}),"\n",(0,s.jsx)(c.Ay,{}),"\n",(0,s.jsx)(n.h2,{id:"agent-component-output",children:"Agent component output"}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"Agent"})," component outputs a ",(0,s.jsx)(n.strong,{children:"Response"})," (",(0,s.jsx)(n.code,{children:"response"}),") that is ",(0,s.jsxs)(n.a,{href:"/data-types#message",children:[(0,s.jsx)(n.code,{children:"Message"})," data"]})," containing the agent's raw response to the query."]}),"\n",(0,s.jsxs)(n.p,{children:["Typically, this is passed to a ",(0,s.jsx)(n.strong,{children:"Chat Output"})," component to return the response in a human-readable format.\nIt can also be passed to other components if you need to process the response further before, or in addition to, returning it to the user."]}),"\n",(0,s.jsx)(n.h2,{id:"see-also",children:"See also"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsxs)(n.a,{href:"/components-agents",children:[(0,s.jsx)(n.strong,{children:"Agent"})," and ",(0,s.jsx)(n.strong,{children:"MCP Tools"})," components"]})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"/agents-tools",children:"Configure tools for agents"})}),"\n"]})]})}function f(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(x,{...e})}):x(e)}function j(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}}}]); \ No newline at end of file diff --git a/assets/js/cce672fb.3917f33f.js b/assets/js/cce672fb.3917f33f.js new file mode 100644 index 0000000000..2c2ab7e3f7 --- /dev/null +++ b/assets/js/cce672fb.3917f33f.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[6311],{17886:(e,n,t)=>{t.d(n,{A:()=>r});t(96540);var o=t(64058),s=t(74848);function r({name:e,...n}){const t=o[e];return t?(0,s.jsx)(t,{...n}):null}},24770:(e,n,t)=>{t.d(n,{A:()=>o});const o=t.p+"assets/images/agent-example-add-chat-0fec77d5cd551fa755eb013c7aa5e1f0.png"},25194:(e,n,t)=>{t.d(n,{Ay:()=>i,RM:()=>r});var o=t(74848),s=t(28453);const r=[];function a(e){const n={code:"code",em:"em",p:"p",...(0,s.R)(),...e.components},{Details:t}=n;return t||function(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,o.jsxs)(t,{children:[(0,o.jsx)("summary",{children:"How do agents work?"}),(0,o.jsxs)(n.p,{children:["Agents extend Large Language Models (LLMs) by integrating ",(0,o.jsx)(n.em,{children:"tools"}),", which are functions that provide additional context and enable autonomous task execution.\nThese integrations make agents more specialized and powerful than standalone LLMs."]}),(0,o.jsx)(n.p,{children:"Whereas an LLM might generate acceptable, inert responses to general queries and tasks, an agent can leverage the integrated context and tools to provide more relevant responses and even take action.\nFor example, you might create an agent that can access your company's documentation, repositories, and other resources to help your team with tasks that require knowledge of your specific products, customers, and code."}),(0,o.jsx)(n.p,{children:"Agents use LLMs as a reasoning engine to process input, determine which actions to take to address the query, and then generate a response.\nThe response could be a typical text-based LLM response, or it could involve an action, like editing a file, running a script, or calling an external API."}),(0,o.jsxs)(n.p,{children:["In an agentic context, tools are functions that the agent can run to perform tasks or access external resources.\nA function is wrapped as a ",(0,o.jsx)(n.code,{children:"Tool"})," object with a common interface that the agent understands.\nAgents become aware of tools through tool registration, which is when the agent is provided a list of available tools typically at agent initialization.\nThe ",(0,o.jsx)(n.code,{children:"Tool"})," object's description tells the agent what the tool can do so that it can decide whether the tool is appropriate for a given request."]})]})}function i(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(a,{...e})}):a(e)}},31929:(e,n,t)=>{t.d(n,{Ay:()=>l,RM:()=>a});var o=t(74848),s=t(28453),r=t(17886);const a=[];function i(e){const n={a:"a",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,o.jsxs)(n.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,o.jsx)(r.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Controls"})," in the ",(0,o.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function l(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(i,{...e})}):i(e)}},65535:(e,n,t)=>{t.d(n,{A:()=>o});const o=t.p+"assets/images/agent-example-add-tools-a55635c0c740ce8a71bd7f1ecef2736f.png"},67800:(e,n,t)=>{t.r(n),t.d(n,{CH:()=>g,assets:()=>p,chCodeConfig:()=>u,contentTitle:()=>h,default:()=>f,frontMatter:()=>c,metadata:()=>o,toc:()=>m});const o=JSON.parse('{"id":"Agents/agents","title":"Use Langflow agents","description":"Langflow\'s Agent component is critical for building agent flows.","source":"@site/docs/Agents/agents.mdx","sourceDirName":"Agents","slug":"/agents","permalink":"/agents","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Use Langflow agents","slug":"/agents"},"sidebar":"docs","previous":{"title":"Import and export flows","permalink":"/concepts-flows-import"},"next":{"title":"Configure tools for agents","permalink":"/agents-tools"}}');var s=t(74848),r=t(28453),a=t(24754),i=t(17886),l=t(31929),d=t(25194);const c={title:"Use Langflow agents",slug:"/agents"},h=void 0,p={},g={annotations:a.hk,Code:a.Cy},u={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},m=[...d.RM,{value:"Use the Agent component in a flow",id:"use-the-agent-component-in-a-flow",level:2},{value:"Agent component parameters",id:"agent-component-parameters",level:2},...l.RM,{value:"Provider and model",id:"provider-and-model",level:3},{value:"Model provider API key",id:"model-provider-api-key",level:3},{value:"Agent instructions and input",id:"agent-instructions-and-input",level:3},{value:"Tools",id:"tools",level:3},{value:"Agent memory",id:"agent-memory",level:3},{value:"Additional parameters",id:"additional-parameters",level:3},...l.RM,{value:"Agent component output",id:"agent-component-output",level:2},{value:"See also",id:"see-also",level:2}];function x(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return g||j("CH",!1),g.Code||j("CH.Code",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n","\n",(0,s.jsxs)(n.p,{children:["Langflow's ",(0,s.jsxs)(n.a,{href:"/components-agents",children:[(0,s.jsx)(n.strong,{children:"Agent"})," component"]})," is critical for building agent flows.\nThis component provides everything you need to create an agent, including multiple Large Language Model (LLM) providers, tool calling, and custom instructions.\nIt simplifies agent configuration so you can focus on application development."]}),"\n",(0,s.jsx)(d.Ay,{}),"\n",(0,s.jsx)(n.h2,{id:"use-the-agent-component-in-a-flow",children:"Use the Agent component in a flow"}),"\n",(0,s.jsxs)(n.p,{children:["The following steps explain how to create an agent flow in Langflow from a blank flow.\nFor a prebuilt example, use the ",(0,s.jsx)(n.strong,{children:"Simple Agent"})," template or the ",(0,s.jsx)(n.a,{href:"/get-started-quickstart",children:"Langflow quickstart"}),"."]}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Click ",(0,s.jsx)(n.strong,{children:"New Flow"}),", and then click ",(0,s.jsx)(n.strong,{children:"Blank Flow"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Add an ",(0,s.jsx)(n.strong,{children:"Agent"})," component to your flow."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Select the provider and model that you want to use.\nThe default model for the ",(0,s.jsx)(n.strong,{children:"Agent"})," component is an OpenAI model.\nIf you want to use a different provider, edit the ",(0,s.jsx)(n.strong,{children:"Model Provider"})," and ",(0,s.jsx)(n.strong,{children:"Model Name"})," fields accordingly.\nIf your preferred model isn't listed, type the complete model name into the ",(0,s.jsx)(n.strong,{children:"Model Name"})," field, and then select it from the ",(0,s.jsx)(n.strong,{children:"Model Name"})," menu.\nMake sure that the model is enabled/verified in your model provider account.\nFor more information, see ",(0,s.jsx)(n.a,{href:"#agent-component-parameters",children:"Agent component parameters"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Enter a valid credential for your selected model provider.\nMake sure that the credential has permission to call the selected model."}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Add ",(0,s.jsxs)(n.a,{href:"/components-io",children:[(0,s.jsx)(n.strong,{children:"Chat Input"})," and ",(0,s.jsx)(n.strong,{children:"Chat Output"})," components"]})," to your flow, and then connect them to the ",(0,s.jsx)(n.strong,{children:"Agent"})," component."]}),"\n",(0,s.jsxs)(n.p,{children:["At this point, you have created a basic LLM-based chat flow that you can test in the ",(0,s.jsx)(i.A,{name:"Play","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Playground"}),".\nHowever, this flow only chats with the LLM.\nTo enhance this flow and make it truly agentic, add some tools, as explained in the next steps."]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"A basic agent chat flow with Chat Input, Agent, and Chat Output components.",src:t(24770).A+"",width:"3704",height:"2572"})}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Add ",(0,s.jsx)(n.strong,{children:"News Search"}),", ",(0,s.jsx)(n.strong,{children:"URL"}),", and ",(0,s.jsx)(n.strong,{children:"Calculator"})," components to your flow."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Enable ",(0,s.jsx)(n.strong,{children:"Tool Mode"})," in the ",(0,s.jsx)(n.strong,{children:"News Search"}),", ",(0,s.jsx)(n.strong,{children:"URL"}),", and ",(0,s.jsx)(n.strong,{children:"Calculator"})," components:"]}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["Click the ",(0,s.jsx)(n.strong,{children:"News Search"})," component to expose the ",(0,s.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),", and then enable ",(0,s.jsx)(n.strong,{children:"Tool Mode"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:["Repeat for the ",(0,s.jsx)(n.strong,{children:"URL"})," and ",(0,s.jsx)(n.strong,{children:"Calculator"})," components."]}),"\n",(0,s.jsxs)(n.li,{children:["Connect the ",(0,s.jsx)(n.strong,{children:"Toolset"})," port for each tool component to the ",(0,s.jsx)(n.strong,{children:"Tools"})," port on the ",(0,s.jsx)(n.strong,{children:"Agent"})," component."]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Tool Mode"})," makes a component into a tool by modifying the component's inputs.\nWith ",(0,s.jsx)(n.strong,{children:"Tool Mode"})," enabled, a component can accept requests from an ",(0,s.jsx)(n.strong,{children:"Agent"})," component to use the component's available actions as tools."]}),"\n",(0,s.jsxs)(n.p,{children:["When in ",(0,s.jsx)(n.strong,{children:"Tool Mode"}),", a component has a ",(0,s.jsx)(n.strong,{children:"Toolset"})," port that you must connect to an ",(0,s.jsx)(n.strong,{children:"Agent"})," component's ",(0,s.jsx)(n.strong,{children:"Tools"})," port if you want to allow the agent to use that component's actions as tools."]}),"\n",(0,s.jsxs)(n.p,{children:["For more information, see ",(0,s.jsx)(n.a,{href:"/agents-tools",children:"Configure tools for agents"}),"."]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"A more complex agent chat flow where three components are connected to the Agent component as tools",src:t(65535).A+"",width:"3380",height:"3012"})}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Open the ",(0,s.jsx)(i.A,{name:"Play","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Playground"}),", and then ask the agent, ",(0,s.jsx)(n.code,{children:"What tools are you using to answer my questions?"})]}),"\n",(0,s.jsx)(n.p,{children:"The agent should respond with a list of the connected tools.\nIt may also include built-in tools."}),"\n",(0,s.jsx)(g.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"I use a combination of my built-in knowledge (up to June 2024) and a set of external tools to answer your questions. Here are the main types of tools I can use:",props:{}}]},{tokens:[{content:"Web Search & Content Fetching: I can fetch and summarize content from web pages, including crawling links recursively.",props:{}}]},{tokens:[{content:"News Search: I can search for recent news articles using Google News via RSS feeds.",props:{}}]},{tokens:[{content:"Calculator: I can perform arithmetic calculations and evaluate mathematical expressions.",props:{}}]},{tokens:[{content:"Date & Time: I can provide the current date and time in various time zones.",props:{}}]},{tokens:[{content:"These tools help me provide up-to-date information, perform calculations, and retrieve specific data from the internet when needed. If you have a specific question, let me know, and I'll use the most appropriate tool(s) to help!",props:{}}]}],lang:"text"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["To test a specific tool, ask the agent a question that uses one of the tools, such as ",(0,s.jsx)(n.code,{children:"Summarize today's tech news"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["To help you debug and test your flows, the ",(0,s.jsx)(n.strong,{children:"Playground"})," displays the agent's tool calls, the provided input, and the raw output the agent received before generating the summary.\nWith the given example, the agent should call the ",(0,s.jsx)(n.strong,{children:"News Search"})," component's ",(0,s.jsx)(n.code,{children:"search_news"})," action."]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:"You've successfully created a basic agent flow that uses some generic tools."}),"\n",(0,s.jsxs)(n.p,{children:["To continue building on this tutorial, try connecting other tool components or ",(0,s.jsx)(n.a,{href:"/mcp-client",children:"use Langflow as an MCP client"})," to support more complex and specialized tasks."]}),"\n",(0,s.jsxs)(n.p,{children:["For a multi-agent example, see ",(0,s.jsx)(n.a,{href:"/agents-tools#use-an-agent-as-a-tool",children:"Use an agent as a tool"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"agent-component-parameters",children:"Agent component parameters"}),"\n",(0,s.jsxs)(n.p,{children:["You can configure the ",(0,s.jsx)(n.strong,{children:"Agent"})," component to use your preferred provider and model, custom instructions, and tools."]}),"\n",(0,s.jsx)(l.Ay,{}),"\n",(0,s.jsx)(n.h3,{id:"provider-and-model",children:"Provider and model"}),"\n",(0,s.jsxs)(n.p,{children:["Use the ",(0,s.jsx)(n.strong,{children:"Model Provider"})," (",(0,s.jsx)(n.code,{children:"agent_llm"}),") and ",(0,s.jsx)(n.strong,{children:"Model Name"})," (",(0,s.jsx)(n.code,{children:"llm_model"}),") settings to select the model provider and LLM that you want the agent to use."]}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"Agent"})," component includes many models from several popular model providers.\nTo access other providers or models, you can do either of the following:"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["Set ",(0,s.jsx)(n.strong,{children:"Model Provider"})," to ",(0,s.jsx)(n.strong,{children:"Connect other models"}),", and then connect any ",(0,s.jsx)(n.a,{href:"/components-models",children:"language model component"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:["Select your preferred provider, type the complete model name into the ",(0,s.jsx)(n.strong,{children:"Model Name"})," field, and then select your custom option from the ",(0,s.jsx)(n.strong,{children:"Model Name"})," menu.\nMake sure that the model is enabled/verified in your model provider account."]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["If you need to generate embeddings in your flow, use an ",(0,s.jsx)(n.a,{href:"/components-embedding-models",children:"embedding model component"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"model-provider-api-key",children:"Model provider API key"}),"\n",(0,s.jsxs)(n.p,{children:["In the ",(0,s.jsx)(n.strong,{children:"API Key"})," field, enter a valid authentication key for your selected model provider, if you are using a built-in provider.\nFor example, to use the default OpenAI model, you must provide a valid OpenAI API key for an OpenAI account that has credits and permission to call OpenAI LLMs."]}),"\n",(0,s.jsxs)(n.p,{children:["You can enter the key directly, but it is recommended that you follow industry best practices for storing and referencing API keys.\nFor example, you can use a ",(0,s.jsx)(i.A,{name:"Globe","aria-hidden":"true"})," ",(0,s.jsx)(n.a,{href:"/configuration-global-variables",children:"global variable"})," or ",(0,s.jsx)(n.a,{href:"/environment-variables",children:"environment variables"}),".\nFor more information, see ",(0,s.jsx)(n.a,{href:"/api-keys-and-authentication#component-api-keys",children:"Add component API keys to Langflow"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["If you select ",(0,s.jsx)(n.strong,{children:"Connect other models"})," as the model provider, authentication is handled in the incoming language model component."]}),"\n",(0,s.jsx)(n.h3,{id:"agent-instructions-and-input",children:"Agent instructions and input"}),"\n",(0,s.jsxs)(n.p,{children:["In the ",(0,s.jsx)(n.strong,{children:"Agent Instructions"})," (",(0,s.jsx)(n.code,{children:"system_prompt"}),") field, you can provide custom instructions that you want the ",(0,s.jsx)(n.strong,{children:"Agent"})," component to use for every conversation."]}),"\n",(0,s.jsxs)(n.p,{children:["These instructions are applied in addition to the ",(0,s.jsx)(n.strong,{children:"Input"})," (",(0,s.jsx)(n.code,{children:"input_value"}),"), which can be entered directly or provided through another component, such as a ",(0,s.jsx)(n.strong,{children:"Chat Input"})," component."]}),"\n",(0,s.jsx)(n.h3,{id:"tools",children:"Tools"}),"\n",(0,s.jsx)(n.p,{children:"Agents are most useful when they have the appropriate tools available to complete requests."}),"\n",(0,s.jsxs)(n.p,{children:["An ",(0,s.jsx)(n.strong,{children:"Agent"})," component can use any Langflow component as a tool, including other agents and MCP servers."]}),"\n",(0,s.jsxs)(n.p,{children:["To attach a component as a tool, you must enable ",(0,s.jsx)(n.strong,{children:"Tool Mode"})," on the component that you want to attach, and then attach it to the ",(0,s.jsx)(n.strong,{children:"Agent"})," component's ",(0,s.jsx)(n.strong,{children:"Tools"})," port.\nFor more information, see ",(0,s.jsx)(n.a,{href:"/agents-tools",children:"Configure tools for agents"}),"."]}),"\n",(0,s.jsx)(n.admonition,{type:"tip",children:(0,s.jsxs)(n.p,{children:["To allow agents to use tools from MCP servers, use the ",(0,s.jsxs)(n.a,{href:"/components-agents#mcp-connection",children:[(0,s.jsx)(n.strong,{children:"MCP Tools"})," component"]}),"."]})}),"\n",(0,s.jsx)(n.h3,{id:"agent-memory",children:"Agent memory"}),"\n",(0,s.jsx)(n.p,{children:"Langflow agents have built-in chat memory that is enabled by default.\nThis memory allows them to retrieve and reference messages from previous conversations, maintaining a rolling context window for each chat session ID."}),"\n",(0,s.jsxs)(n.p,{children:["Chat memories are grouped by ",(0,s.jsxs)(n.a,{href:"/session-id",children:["session ID (",(0,s.jsx)(n.code,{children:"session_id"}),")"]}),".\nIt is recommended to use custom session IDs if you need to segregate chat memory for different users or applications that run the same flow."]}),"\n",(0,s.jsxs)(n.p,{children:["By default, the ",(0,s.jsx)(n.strong,{children:"Agent"})," component uses your Langflow installation's storage, and it retrieves a limited number of chat messages, which you can configure with the ",(0,s.jsx)(n.strong,{children:"Number of Chat History Messages"})," parameter."]}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"Message History"})," component isn't required for default chat memory, but it is required if you want to use external chat memory like Mem0.\nAdditionally, the ",(0,s.jsx)(n.strong,{children:"Message History"})," component provides more options for sorting, filtering, and limiting memories. Although, most of these options are built-in to the ",(0,s.jsx)(n.strong,{children:"Agent"})," component with default values."]}),"\n",(0,s.jsxs)(n.p,{children:["For more information, see ",(0,s.jsx)(n.a,{href:"/memory#store-chat-memory",children:"Store chat memory"})," and ",(0,s.jsxs)(n.a,{href:"/components-helpers#message-history",children:[(0,s.jsx)(n.strong,{children:"Message History"})," component"]}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"additional-parameters",children:"Additional parameters"}),"\n",(0,s.jsxs)(n.p,{children:["With the ",(0,s.jsx)(n.strong,{children:"Agent"})," component, the available parameters can change depending on the selected provider and model, including support for additional modes, arguments, or features like chat memory and temperature.\nFor example:"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Current Date"})," (",(0,s.jsx)(n.code,{children:"add_current_date_tool"}),"): When enabled (",(0,s.jsx)(n.code,{children:"true"}),"), this setting adds a tool to the agent that can retrieve the current date."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Handle Parse Errors"})," (",(0,s.jsx)(n.code,{children:"handle_parsing_errors"}),"): When enabled (",(0,s.jsx)(n.code,{children:"true"}),"), this setting allows the agent to fix errors, like typos, when analyzing user input."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Verbose"})," (",(0,s.jsx)(n.code,{children:"verbose"}),"): When enabled (",(0,s.jsx)(n.code,{children:"true"}),"), this setting records detailed logging output for debugging and analysis."]}),"\n"]}),"\n",(0,s.jsx)(l.Ay,{}),"\n",(0,s.jsx)(n.h2,{id:"agent-component-output",children:"Agent component output"}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"Agent"})," component outputs a ",(0,s.jsx)(n.strong,{children:"Response"})," (",(0,s.jsx)(n.code,{children:"response"}),") that is ",(0,s.jsxs)(n.a,{href:"/data-types#message",children:[(0,s.jsx)(n.code,{children:"Message"})," data"]})," containing the agent's raw response to the query."]}),"\n",(0,s.jsxs)(n.p,{children:["Typically, this is passed to a ",(0,s.jsx)(n.strong,{children:"Chat Output"})," component to return the response in a human-readable format.\nIt can also be passed to other components if you need to process the response further before, or in addition to, returning it to the user."]}),"\n",(0,s.jsx)(n.h2,{id:"see-also",children:"See also"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsxs)(n.a,{href:"/components-agents",children:[(0,s.jsx)(n.strong,{children:"Agent"})," and ",(0,s.jsx)(n.strong,{children:"MCP Tools"})," components"]})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"/agents-tools",children:"Configure tools for agents"})}),"\n"]})]})}function f(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(x,{...e})}):x(e)}function j(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}}}]); \ No newline at end of file diff --git a/assets/js/da1ad91e.b99c5979.js b/assets/js/da1ad91e.31b96a4d.js similarity index 80% rename from assets/js/da1ad91e.b99c5979.js rename to assets/js/da1ad91e.31b96a4d.js index 6dc29ec1db..45272645d9 100644 --- a/assets/js/da1ad91e.b99c5979.js +++ b/assets/js/da1ad91e.31b96a4d.js @@ -1 +1 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[8571],{10636:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>h,contentTitle:()=>d,default:()=>u,frontMatter:()=>c,metadata:()=>r,toc:()=>l});const r=JSON.parse('{"id":"Components/bundles-anthropic","title":"Anthropic","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/bundles-anthropic.mdx","sourceDirName":"Components","slug":"/bundles-anthropic","permalink":"/bundles-anthropic","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Anthropic","slug":"/bundles-anthropic"},"sidebar":"docs","previous":{"title":"Amazon","permalink":"/bundles-amazon"},"next":{"title":"Apify","permalink":"/integrations-apify"}}');var s=t(74848),o=t(28453),i=t(17886),a=t(31929);const c={title:"Anthropic",slug:"/bundles-anthropic"},d=void 0,h={},l=[{value:"Anthropic text generation",id:"anthropic-text-generation",level:2},{value:"Anthropic text generation parameters",id:"anthropic-text-generation-parameters",level:3},...a.RM];function p(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,o.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:[(0,s.jsx)(i.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(n.a,{href:"/components-bundle-components",children:(0,s.jsx)(n.strong,{children:"Bundles"})})," contain custom components that support specific third-party integrations with Langflow."]}),"\n",(0,s.jsxs)(n.p,{children:["This page describes the components that are available in the ",(0,s.jsx)(n.strong,{children:"Anthropic"})," bundle."]}),"\n",(0,s.jsxs)(n.p,{children:["For more information about Anthropic features and functionality used by Anthropic components, see the ",(0,s.jsx)(n.a,{href:"https://docs.anthropic.com/en/docs/intro",children:"Anthropic documentation"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"anthropic-text-generation",children:"Anthropic text generation"}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"Anthropic"})," component generates text using Anthropic Chat and Language models like Claude."]}),"\n",(0,s.jsxs)(n.p,{children:["It can output either a ",(0,s.jsx)(n.strong,{children:"Model Response"})," (",(0,s.jsx)(n.a,{href:"/data-types#message",children:(0,s.jsx)(n.code,{children:"Message"})}),") or a ",(0,s.jsx)(n.strong,{children:"Language Model"})," (",(0,s.jsx)(n.a,{href:"/data-types#languagemodel",children:(0,s.jsx)(n.code,{children:"LanguageModel"})}),").\nSpecifically, the ",(0,s.jsx)(n.strong,{children:"Language Model"})," output is an instance of ",(0,s.jsx)(n.a,{href:"https://python.langchain.com/docs/integrations/chat/anthropic/",children:(0,s.jsx)(n.code,{children:"ChatAnthropic"})})," configured according to the component's parameters."]}),"\n",(0,s.jsxs)(n.p,{children:["Use the ",(0,s.jsx)(n.strong,{children:"Language Model"})," output when you want to use an Anthropic model as the LLM for another LLM-driven component, such as an ",(0,s.jsx)(n.strong,{children:"Agent"})," or ",(0,s.jsx)(n.strong,{children:"Smart Function"})," component."]}),"\n",(0,s.jsxs)(n.p,{children:["For more information, see ",(0,s.jsx)(n.a,{href:"/components-models",children:"Language model components"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"anthropic-text-generation-parameters",children:"Anthropic text generation parameters"}),"\n",(0,s.jsx)(a.Ay,{}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"max_tokens"}),(0,s.jsx)(n.td,{children:"Integer"}),(0,s.jsxs)(n.td,{children:["Input parameter. The maximum number of tokens to generate. Set to 0 for unlimited tokens. Default: ",(0,s.jsx)(n.code,{children:"4096"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"model"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. The name of the Anthropic model to use. Options include various Claude 3 models."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"anthropic_api_key"}),(0,s.jsx)(n.td,{children:"SecretString"}),(0,s.jsx)(n.td,{children:"Input parameter. Your Anthropic API key for authentication."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"temperature"}),(0,s.jsx)(n.td,{children:"Float"}),(0,s.jsxs)(n.td,{children:["Input parameter. Controls randomness in the output. Default: ",(0,s.jsx)(n.code,{children:"0.1"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"anthropic_api_url"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsxs)(n.td,{children:["Input parameter. Endpoint of the Anthropic API. Defaults to ",(0,s.jsx)(n.code,{children:"https://api.anthropic.com"})," if not specified (advanced)."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"prefill"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. Prefill text to guide the model's response (advanced)."})]})]})]})]})}function u(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(p,{...e})}):p(e)}},17886:(e,n,t)=>{t.d(n,{A:()=>o});t(96540);var r=t(64058),s=t(74848);function o({name:e,...n}){const t=r[e];return t?(0,s.jsx)(t,{...n}):null}},31929:(e,n,t)=>{t.d(n,{Ay:()=>c,RM:()=>i});var r=t(74848),s=t(28453),o=t(17886);const i=[];function a(e){const n={a:"a",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,r.jsxs)(n.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,r.jsx)(o.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Controls"})," in the ",(0,r.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function c(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}}}]); \ No newline at end of file +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[8571],{10636:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>h,contentTitle:()=>d,default:()=>u,frontMatter:()=>c,metadata:()=>r,toc:()=>l});const r=JSON.parse('{"id":"Components/bundles-anthropic","title":"Anthropic","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/bundles-anthropic.mdx","sourceDirName":"Components","slug":"/bundles-anthropic","permalink":"/bundles-anthropic","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Anthropic","slug":"/bundles-anthropic"},"sidebar":"docs","previous":{"title":"Amazon","permalink":"/bundles-amazon"},"next":{"title":"Apify","permalink":"/integrations-apify"}}');var s=t(74848),o=t(28453),i=t(17886),a=t(31929);const c={title:"Anthropic",slug:"/bundles-anthropic"},d=void 0,h={},l=[{value:"Anthropic text generation",id:"anthropic-text-generation",level:2},{value:"Anthropic text generation parameters",id:"anthropic-text-generation-parameters",level:3},...a.RM];function p(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,o.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:[(0,s.jsx)(i.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(n.a,{href:"/components-bundle-components",children:(0,s.jsx)(n.strong,{children:"Bundles"})})," contain custom components that support specific third-party integrations with Langflow."]}),"\n",(0,s.jsxs)(n.p,{children:["This page describes the components that are available in the ",(0,s.jsx)(n.strong,{children:"Anthropic"})," bundle."]}),"\n",(0,s.jsxs)(n.p,{children:["For more information about Anthropic features and functionality used by Anthropic components, see the ",(0,s.jsx)(n.a,{href:"https://docs.anthropic.com/en/docs/intro",children:"Anthropic documentation"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"anthropic-text-generation",children:"Anthropic text generation"}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"Anthropic"})," component generates text using Anthropic Chat and Language models like Claude."]}),"\n",(0,s.jsxs)(n.p,{children:["It can output either a ",(0,s.jsx)(n.strong,{children:"Model Response"})," (",(0,s.jsx)(n.a,{href:"/data-types#message",children:(0,s.jsx)(n.code,{children:"Message"})}),") or a ",(0,s.jsx)(n.strong,{children:"Language Model"})," (",(0,s.jsx)(n.a,{href:"/data-types#languagemodel",children:(0,s.jsx)(n.code,{children:"LanguageModel"})}),").\nSpecifically, the ",(0,s.jsx)(n.strong,{children:"Language Model"})," output is an instance of ",(0,s.jsx)(n.a,{href:"https://python.langchain.com/docs/integrations/chat/anthropic/",children:(0,s.jsx)(n.code,{children:"ChatAnthropic"})})," configured according to the component's parameters."]}),"\n",(0,s.jsxs)(n.p,{children:["Use the ",(0,s.jsx)(n.strong,{children:"Language Model"})," output when you want to use an Anthropic model as the LLM for another LLM-driven component, such as an ",(0,s.jsx)(n.strong,{children:"Agent"})," or ",(0,s.jsx)(n.strong,{children:"Smart Function"})," component."]}),"\n",(0,s.jsxs)(n.p,{children:["For more information, see ",(0,s.jsx)(n.a,{href:"/components-models",children:"Language model components"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"anthropic-text-generation-parameters",children:"Anthropic text generation parameters"}),"\n",(0,s.jsx)(a.Ay,{}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"max_tokens"}),(0,s.jsx)(n.td,{children:"Integer"}),(0,s.jsxs)(n.td,{children:["Input parameter. The maximum number of tokens to generate. Set to 0 for unlimited tokens. Default: ",(0,s.jsx)(n.code,{children:"4096"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"model"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. The name of the Anthropic model to use. Options include various Claude 3 models."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"anthropic_api_key"}),(0,s.jsx)(n.td,{children:"SecretString"}),(0,s.jsx)(n.td,{children:"Input parameter. Your Anthropic API key for authentication."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"temperature"}),(0,s.jsx)(n.td,{children:"Float"}),(0,s.jsxs)(n.td,{children:["Input parameter. Controls randomness in the output. Default: ",(0,s.jsx)(n.code,{children:"0.1"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"anthropic_api_url"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsxs)(n.td,{children:["Input parameter. Endpoint of the Anthropic API. Defaults to ",(0,s.jsx)(n.code,{children:"https://api.anthropic.com"})," if not specified."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"prefill"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. Prefill text to guide the model's response."})]})]})]})]})}function u(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(p,{...e})}):p(e)}},17886:(e,n,t)=>{t.d(n,{A:()=>o});t(96540);var r=t(64058),s=t(74848);function o({name:e,...n}){const t=r[e];return t?(0,s.jsx)(t,{...n}):null}},31929:(e,n,t)=>{t.d(n,{Ay:()=>c,RM:()=>i});var r=t(74848),s=t(28453),o=t(17886);const i=[];function a(e){const n={a:"a",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,r.jsxs)(n.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,r.jsx)(o.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Controls"})," in the ",(0,r.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function c(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}}}]); \ No newline at end of file diff --git a/assets/js/db4f3bbd.0aa82d65.js b/assets/js/db4f3bbd.0aa82d65.js deleted file mode 100644 index 9db85c905e..0000000000 --- a/assets/js/db4f3bbd.0aa82d65.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[598],{11470:(e,o,t)=>{t.d(o,{A:()=>w});var n=t(96540),s=t(18215),l=t(23104),r=t(56347),c=t(205),a=t(57485),i=t(31682),d=t(70679);function p(e){return n.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,n.isValidElement)(e)&&function(e){const{props:o}=e;return!!o&&"object"==typeof o&&"value"in o}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function u(e){const{values:o,children:t}=e;return(0,n.useMemo)(()=>{const e=o??function(e){return p(e).map(({props:{value:e,label:o,attributes:t,default:n}})=>({value:e,label:o,attributes:t,default:n}))}(t);return function(e){const o=(0,i.XI)(e,(e,o)=>e.value===o.value);if(o.length>0)throw new Error(`Docusaurus error: Duplicate values "${o.map(e=>e.value).join(", ")}" found in . Every value needs to be unique.`)}(e),e},[o,t])}function h({value:e,tabValues:o}){return o.some(o=>o.value===e)}function f({queryString:e=!1,groupId:o}){const t=(0,r.W6)(),s=function({queryString:e=!1,groupId:o}){if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!o)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return o??null}({queryString:e,groupId:o});return[(0,a.aZ)(s),(0,n.useCallback)(e=>{if(!s)return;const o=new URLSearchParams(t.location.search);o.set(s,e),t.replace({...t.location,search:o.toString()})},[s,t])]}function m(e){const{defaultValue:o,queryString:t=!1,groupId:s}=e,l=u(e),[r,a]=(0,n.useState)(()=>function({defaultValue:e,tabValues:o}){if(0===o.length)throw new Error("Docusaurus error: the component requires at least one children component");if(e){if(!h({value:e,tabValues:o}))throw new Error(`Docusaurus error: The has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${o.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}const t=o.find(e=>e.default)??o[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:o,tabValues:l})),[i,p]=f({queryString:t,groupId:s}),[m,y]=function({groupId:e}){const o=function(e){return e?`docusaurus.tab.${e}`:null}(e),[t,s]=(0,d.Dv)(o);return[t,(0,n.useCallback)(e=>{o&&s.set(e)},[o,s])]}({groupId:s}),g=(()=>{const e=i??m;return h({value:e,tabValues:l})?e:null})();(0,c.A)(()=>{g&&a(g)},[g]);return{selectedValue:r,selectValue:(0,n.useCallback)(e=>{if(!h({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);a(e),p(e),y(e)},[p,y,l]),tabValues:l}}var y=t(92303);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var F=t(74848);function b({className:e,block:o,selectedValue:t,selectValue:n,tabValues:r}){const c=[],{blockElementScrollPositionUntilNextRender:a}=(0,l.a_)(),i=e=>{const o=e.currentTarget,s=c.indexOf(o),l=r[s].value;l!==t&&(a(o),n(l))},d=e=>{let o=null;switch(e.key){case"Enter":i(e);break;case"ArrowRight":{const t=c.indexOf(e.currentTarget)+1;o=c[t]??c[0];break}case"ArrowLeft":{const t=c.indexOf(e.currentTarget)-1;o=c[t]??c[c.length-1];break}}o?.focus()};return(0,F.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.A)("tabs",{"tabs--block":o},e),children:r.map(({value:e,label:o,attributes:n})=>(0,F.jsx)("li",{role:"tab",tabIndex:t===e?0:-1,"aria-selected":t===e,ref:e=>{c.push(e)},onKeyDown:d,onClick:i,...n,className:(0,s.A)("tabs__item",g.tabItem,n?.className,{"tabs__item--active":t===e}),children:o??e},e))})}function x({lazy:e,children:o,selectedValue:t}){const l=(Array.isArray(o)?o:[o]).filter(Boolean);if(e){const e=l.find(e=>e.props.value===t);return e?(0,n.cloneElement)(e,{className:(0,s.A)("margin-top--md",e.props.className)}):null}return(0,F.jsx)("div",{className:"margin-top--md",children:l.map((e,o)=>(0,n.cloneElement)(e,{key:o,hidden:e.props.value!==t}))})}function v(e){const o=m(e);return(0,F.jsxs)("div",{className:(0,s.A)("tabs-container",g.tabList),children:[(0,F.jsx)(b,{...o,...e}),(0,F.jsx)(x,{...o,...e})]})}function w(e){const o=(0,y.A)();return(0,F.jsx)(v,{...e,children:p(e.children)},String(o))}},19365:(e,o,t)=>{t.d(o,{A:()=>r});t(96540);var n=t(18215);const s={tabItem:"tabItem_Ymn6"};var l=t(74848);function r({children:e,hidden:o,className:t}){return(0,l.jsx)("div",{role:"tabpanel",className:(0,n.A)(s.tabItem,t),hidden:o,children:e})}},28453:(e,o,t)=>{t.d(o,{R:()=>r,x:()=>c});var n=t(96540);const s={},l=n.createContext(s);function r(e){const o=n.useContext(l);return n.useMemo(function(){return"function"==typeof e?e(o):{...o,...e}},[o,e])}function c(e){let o;return o=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),n.createElement(l.Provider,{value:o},e.children)}},74598:(e,o,t)=>{t.r(o),t.d(o,{CH:()=>u,assets:()=>p,chCodeConfig:()=>h,contentTitle:()=>d,default:()=>y,frontMatter:()=>i,metadata:()=>n,toc:()=>f});const n=JSON.parse('{"id":"Deployment/deployment-kubernetes-prod","title":"Deploy the Langflow production environment on Kubernetes","description":"The Langflow runtime Helm chart is tailored for deploying applications in a production environment. It is focused on stability, performance, isolation, and security to ensure that applications run reliably and efficiently.","source":"@site/docs/Deployment/deployment-kubernetes-prod.mdx","sourceDirName":"Deployment","slug":"/deployment-kubernetes-prod","permalink":"/deployment-kubernetes-prod","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Deploy the Langflow production environment on Kubernetes","slug":"/deployment-kubernetes-prod"},"sidebar":"docs","previous":{"title":"Deploy in development","permalink":"/deployment-kubernetes-dev"},"next":{"title":"Google Cloud Platform","permalink":"/deployment-gcp"}}');var s=t(74848),l=t(28453),r=t(24754),c=t(11470),a=t(19365);const i={title:"Deploy the Langflow production environment on Kubernetes",slug:"/deployment-kubernetes-prod"},d=void 0,p={},u={annotations:r.hk,Code:r.Cy},h={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},f=[{value:"Prerequisites",id:"prerequisites",level:2},{value:"Install the Langflow runtime Helm chart",id:"install-the-langflow-runtime-helm-chart",level:2},{value:"Access the Langflow runtime",id:"access-the-langflow-runtime",level:2},{value:"Configure secrets and environment variables",id:"configure-secrets-and-environment-variables",level:2},{value:"Set secrets",id:"set-secrets",level:3},{value:"Set the log level and other configuration variables",id:"set-the-log-level-and-other-configuration-variables",level:3},{value:"Configure scaling",id:"configure-scaling",level:2},{value:"See also",id:"see-also",level:2}];function m(e){const o={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,l.R)(),...e.components},{Details:t}=o;return u||g("CH",!1),u.Code||g("CH.Code",!0),t||g("Details",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n","\n",(0,s.jsxs)(o.p,{children:["The ",(0,s.jsx)(o.a,{href:"https://github.com/langflow-ai/langflow-helm-charts/blob/main/charts/langflow-runtime",children:"Langflow runtime Helm chart"})," is tailored for deploying applications in a production environment. It is focused on stability, performance, isolation, and security to ensure that applications run reliably and efficiently."]}),"\n",(0,s.jsxs)(o.admonition,{type:"important",children:[(0,s.jsxs)(o.p,{children:["For security reasons, the default Langflow runtime Helm chart sets ",(0,s.jsx)(o.a,{href:"https://github.com/langflow-ai/langflow-helm-charts/blob/main/charts/langflow-runtime/values.yaml#L46",children:(0,s.jsx)(o.code,{children:"readOnlyRootFilesystem: true"})}),". This setting prevents modifications to the container's root filesystem at runtime, which is a recommended security measure in production environments."]}),(0,s.jsxs)(o.p,{children:["If ",(0,s.jsx)(o.code,{children:"readOnlyRootFilesystem"})," is disabled (false), it degrades your deployment's security posture. Only disable this setting if you understand the security implications and you have implemented other security measures."]}),(0,s.jsxs)(o.p,{children:["For more information, see the ",(0,s.jsx)(o.a,{href:"https://kubernetes.io/docs/tasks/configure-pod-container/security-context/",children:"Kubernetes documentation"}),"."]})]}),"\n",(0,s.jsx)(o.h2,{id:"prerequisites",children:"Prerequisites"}),"\n",(0,s.jsxs)(o.ul,{children:["\n",(0,s.jsxs)(o.li,{children:["A ",(0,s.jsx)(o.a,{href:"https://kubernetes.io/docs/setup/",children:"Kubernetes"})," server"]}),"\n",(0,s.jsx)(o.li,{children:(0,s.jsx)(o.a,{href:"https://kubernetes.io/docs/tasks/tools/#kubectl",children:"kubectl"})}),"\n",(0,s.jsx)(o.li,{children:(0,s.jsx)(o.a,{href:"https://helm.sh/docs/intro/install/",children:"Helm"})}),"\n"]}),"\n",(0,s.jsx)(o.h2,{id:"install-the-langflow-runtime-helm-chart",children:"Install the Langflow runtime Helm chart"}),"\n",(0,s.jsxs)(o.ol,{children:["\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsx)(o.p,{children:"Add the repository to Helm:"}),"\n",(0,s.jsx)(u.Code,{codeConfig:h,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"helm ",props:{style:{color:"#FFA657"}}},{content:"repo add langflow https://langflow-ai.github.io/langflow-helm-charts",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"helm ",props:{style:{color:"#FFA657"}}},{content:"repo update",props:{style:{color:"#A5D6FF"}}}]}],lang:"shell"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Install the Langflow app with the default options in the ",(0,s.jsx)(o.code,{children:"langflow"})," namespace."]}),"\n",(0,s.jsxs)(c.A,{groupId:"",children:[(0,s.jsxs)(a.A,{value:"Install chart with custom image",label:"Install chart with custom image",default:!0,children:[(0,s.jsxs)(o.p,{children:["If you have a ",(0,s.jsx)(o.a,{href:"/deployment-docker#package-your-flow-as-a-docker-image",children:"custom image with packaged flows"}),", you can deploy Langflow by overriding the default ",(0,s.jsx)(o.a,{href:"https://github.com/langflow-ai/langflow-helm-charts/blob/main/charts/langflow-runtime/values.yaml",children:(0,s.jsx)(o.code,{children:"values.yaml"})})," with the ",(0,s.jsx)(o.code,{children:"--set"})," flag:"]}),(0,s.jsx)(u.Code,{codeConfig:h,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"helm ",props:{style:{color:"#FFA657"}}},{content:"install my-langflow-app langflow/langflow-runtime ",props:{style:{color:"#A5D6FF"}}},{content:"-n ",props:{style:{color:"#79C0FF"}}},{content:"langflow ",props:{style:{color:"#A5D6FF"}}},{content:"--create-namespace --set ",props:{style:{color:"#79C0FF"}}},{content:"image.repository=myuser/langflow-hello-world ",props:{style:{color:"#A5D6FF"}}},{content:"--set ",props:{style:{color:"#79C0FF"}}},{content:"image.tag=",props:{style:{color:"#A5D6FF"}}},{content:"1.0.0",props:{style:{color:"#79C0FF"}}}]}],lang:"shell"},annotations:[]}]})]}),(0,s.jsxs)(a.A,{value:"Install chart and download flow",label:"Install chart and download flow",children:[(0,s.jsxs)(o.p,{children:["Install the chart and download flows from a URL with the ",(0,s.jsx)(o.code,{children:"--set"})," flag:"]}),(0,s.jsx)(u.Code,{codeConfig:h,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"helm ",props:{style:{color:"#FFA657"}}},{content:"install my-langflow-app-with-flow langflow/langflow-runtime ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -n ",props:{style:{color:"#79C0FF"}}},{content:"langflow ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" --create-namespace \\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" --set ",props:{style:{color:"#79C0FF"}}},{content:"'downloadFlows.flows[0].url=https://raw.githubusercontent.com/langflow-ai/langflow/dev/tests/data/basic_example.json'",props:{style:{color:"#A5D6FF"}}}]}],lang:"shell"},annotations:[]}]}),(0,s.jsxs)(o.p,{children:["If your shell requires escaping square brackets, modify the ",(0,s.jsx)(o.code,{children:"--set"})," path as needed.\nFor example, ",(0,s.jsx)(o.code,{children:"--set 'downloadFlows.flows\\[0\\].url=https://raw.githubusercontent.com/langflow-ai/langflow/dev/tests/data/basic_example.json'"}),"."]})]})]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsx)(o.p,{children:"Check the status of the pods:"}),"\n",(0,s.jsx)(u.Code,{codeConfig:h,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"kubectl ",props:{style:{color:"#FFA657"}}},{content:"get pods ",props:{style:{color:"#A5D6FF"}}},{content:"-n ",props:{style:{color:"#79C0FF"}}},{content:"langflow",props:{style:{color:"#A5D6FF"}}}]}],lang:"shell"},annotations:[]}]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(o.h2,{id:"access-the-langflow-runtime",children:"Access the Langflow runtime"}),"\n",(0,s.jsxs)(o.ol,{children:["\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsx)(o.p,{children:"Get your service name:"}),"\n",(0,s.jsx)(u.Code,{codeConfig:h,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"kubectl ",props:{style:{color:"#FFA657"}}},{content:"get svc ",props:{style:{color:"#A5D6FF"}}},{content:"-n ",props:{style:{color:"#79C0FF"}}},{content:"langflow",props:{style:{color:"#A5D6FF"}}}]}],lang:"shell"},annotations:[]}]}),"\n",(0,s.jsxs)(o.p,{children:["The service name is your release name suffixed by ",(0,s.jsx)(o.code,{children:"-langflow-runtime"}),". For example, if you used ",(0,s.jsx)(o.code,{children:"helm install my-langflow-app-with-flow"}),", then the service name is ",(0,s.jsx)(o.code,{children:"my-langflow-app-with-flow-langflow-runtime"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsx)(o.p,{children:"Enable port forwarding to access Langflow from your local machine:"}),"\n",(0,s.jsx)(u.Code,{codeConfig:h,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"kubectl ",props:{style:{color:"#FFA657"}}},{content:"port-forward ",props:{style:{color:"#A5D6FF"}}},{content:"-n ",props:{style:{color:"#79C0FF"}}},{content:"langflow svc/my-langflow-app-with-flow-langflow-runtime 7860:",props:{style:{color:"#A5D6FF"}}},{content:"7860",props:{style:{color:"#79C0FF"}}}]}],lang:"shell"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Confirm you can access the API by calling ",(0,s.jsx)(o.code,{children:"http://localhost:7860/api/v1/flows/"}),":"]}),"\n",(0,s.jsx)(u.Code,{codeConfig:h,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-v ",props:{style:{color:"#79C0FF"}}},{content:"http://localhost:7860/api/v1/flows/",props:{style:{color:"#A5D6FF"}}}]}],lang:"shell"},annotations:[]}]}),"\n",(0,s.jsx)(o.p,{children:"A successful request returns a list of flows."}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsx)(o.p,{children:"Run a packaged flow.\nThe following example gets the first flow ID from the flows list, and then runs the flow:"}),"\n",(0,s.jsx)(u.Code,{codeConfig:h,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"# Get flow ID",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:"id",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"$(",props:{style:{color:"#A5D6FF"}}},{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-s",props:{style:{color:"#79C0FF"}}},{content:' "http://localhost:7860/api/v1/flows/" ',props:{style:{color:"#A5D6FF"}}},{content:"| ",props:{style:{color:"#FF7B72"}}},{content:"jq ",props:{style:{color:"#FFA657"}}},{content:"-r",props:{style:{color:"#79C0FF"}}},{content:" '.[0].id')",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"# Run flow",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:"POST ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:' "http://localhost:7860/api/v1/run/',props:{style:{color:"#A5D6FF"}}},{content:"$id",props:{style:{color:"#C9D1D9"}}},{content:'?stream=false" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:"'Content-Type: application/json' ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -d ",props:{style:{color:"#79C0FF"}}},{content:"'{",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "input_value": "Hello!",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "output_type": "chat",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "input_type": "chat"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" }'",props:{style:{color:"#A5D6FF"}}}]}],lang:"shell"},annotations:[]}]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(o.h2,{id:"configure-secrets-and-environment-variables",children:"Configure secrets and environment variables"}),"\n",(0,s.jsxs)(o.p,{children:["Use the ",(0,s.jsx)(o.code,{children:".env"})," section of the Langflow runtime Helm chart's ",(0,s.jsx)(o.a,{href:"https://github.com/langflow-ai/langflow-helm-charts/blob/main/charts/langflow-runtime/values.yaml",children:(0,s.jsx)(o.code,{children:"values.yaml"})})," file to define environment variables for your Langflow deployment.\nThis includes built-in ",(0,s.jsx)(o.a,{href:"/environment-variables",children:"Langflow environment variables"}),", as well as ",(0,s.jsx)(o.a,{href:"/configuration-global-variables",children:"global variables"})," used by your flows."]}),"\n",(0,s.jsxs)(o.p,{children:["Langflow can source global variables from your runtime environment, such as Kubernetes secrets referenced in ",(0,s.jsx)(o.code,{children:"values.yaml"}),".\nFor example, the Langflow runtime Helm chart's ",(0,s.jsx)(o.a,{href:"https://raw.githubusercontent.com/langflow-ai/langflow-helm-charts/refs/heads/main/examples/flows/basic-prompting-hello-world.json",children:"example flow JSON"})," uses a global variable that is a secret.\nIf you want to run this flow in your Langflow deployment on Kubernetes, you need to include the secret in your runtime configuration."]}),"\n",(0,s.jsx)(o.admonition,{type:"tip",children:(0,s.jsxs)(o.p,{children:["When you export flows as JSON files, it's recommended to omit secrets.\nWhether or not a secret is included depends on how you declare the secret in your flow and whether you use the ",(0,s.jsx)(o.strong,{children:"Save with my API keys"})," option.\nFor more information, see ",(0,s.jsx)(o.a,{href:"/concepts-flows-import",children:"Import and export flows"}),"."]})}),"\n",(0,s.jsx)(o.h3,{id:"set-secrets",children:"Set secrets"}),"\n",(0,s.jsx)(o.p,{children:"Kubernetes secrets are the recommended way to store sensitive values and credentials."}),"\n",(0,s.jsxs)(o.p,{children:["Use ",(0,s.jsx)(o.code,{children:"secretKeyRef"})," to reference a Kubernetes secret in ",(0,s.jsx)(o.code,{children:"values.yaml"}),":"]}),"\n",(0,s.jsx)(u.Code,{codeConfig:h,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"env",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" - ",props:{style:{color:"#C9D1D9"}}},{content:"name",props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"OPENAI_API_KEY",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" valueFrom",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" secretKeyRef",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"openai-credentials",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" key",props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"openai-key",props:{style:{color:"#A5D6FF"}}}]}],lang:"yaml"},annotations:[]}]}),"\n",(0,s.jsxs)(t,{children:[(0,s.jsxs)("summary",{children:["Create and set secrets with ",(0,s.jsx)(o.code,{children:"kubectl"})," and ",(0,s.jsx)(o.code,{children:"helm"})]}),(0,s.jsxs)(o.p,{children:["You can use ",(0,s.jsx)(o.code,{children:"kubectl"})," and ",(0,s.jsx)(o.code,{children:"helm"})," commands to create and set secrets:"]}),(0,s.jsxs)(o.ol,{children:["\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsx)(o.p,{children:"Create a secret:"}),"\n",(0,s.jsx)(u.Code,{codeConfig:h,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"kubectl ",props:{style:{color:"#FFA657"}}},{content:"create secret generic openai-credentials ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" --namespace ",props:{style:{color:"#79C0FF"}}},{content:"langflow ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" --from-literal=OPENAI_API_KEY=sk...",props:{style:{color:"#79C0FF"}}}]}],lang:"shell"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsx)(o.p,{children:"Verify the secret exists:"}),"\n",(0,s.jsx)(u.Code,{codeConfig:h,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"kubectl ",props:{style:{color:"#FFA657"}}},{content:"get secrets ",props:{style:{color:"#A5D6FF"}}},{content:"-n ",props:{style:{color:"#79C0FF"}}},{content:"langflow openai-credentials",props:{style:{color:"#A5D6FF"}}}]}],lang:"shell"},annotations:[]}]}),"\n",(0,s.jsx)(o.p,{children:"The result is encrypted."}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsx)(o.p,{children:"Upgrade the Helm release to use the secret:"}),"\n",(0,s.jsx)(u.Code,{codeConfig:h,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"helm ",props:{style:{color:"#FFA657"}}},{content:"upgrade my-langflow-app-image langflow/langflow-runtime ",props:{style:{color:"#A5D6FF"}}},{content:"-n ",props:{style:{color:"#79C0FF"}}},{content:"langflow ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" --reuse-values \\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" --set ",props:{style:{color:"#79C0FF"}}},{content:'"extraEnv[0].name=OPENAI_API_KEY" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" --set ",props:{style:{color:"#79C0FF"}}},{content:'"extraEnv[0].valueFrom.secretKeyRef.name=openai-credentials" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" --set ",props:{style:{color:"#79C0FF"}}},{content:'"extraEnv[0].valueFrom.secretKeyRef.key=OPENAI_API_KEY"',props:{style:{color:"#A5D6FF"}}}]}],lang:"shell"},annotations:[]}]}),"\n",(0,s.jsx)(o.p,{children:"Escape square brackets if required by your shell."}),"\n"]}),"\n"]})]}),"\n",(0,s.jsx)(o.h3,{id:"set-the-log-level-and-other-configuration-variables",children:"Set the log level and other configuration variables"}),"\n",(0,s.jsxs)(o.p,{children:["For non-sensitive variables, such as ",(0,s.jsx)(o.code,{children:"LANGFLOW_LOG_LEVEL"}),", you can set the value directly in ",(0,s.jsx)(o.code,{children:"values.yaml"}),":"]}),"\n",(0,s.jsx)(u.Code,{codeConfig:h,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"env",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" - ",props:{style:{color:"#C9D1D9"}}},{content:"name",props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"LANGFLOW_LOG_LEVEL",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" value",props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"INFO"',props:{style:{color:"#A5D6FF"}}}]}],lang:"yaml"},annotations:[]}]}),"\n",(0,s.jsx)(o.h2,{id:"configure-scaling",children:"Configure scaling"}),"\n",(0,s.jsxs)(o.p,{children:["Use ",(0,s.jsx)(o.code,{children:"replicaCount"})," and ",(0,s.jsx)(o.code,{children:"resources"})," in the Langflow runtime Helm chart's ",(0,s.jsx)(o.a,{href:"https://github.com/langflow-ai/langflow-helm-charts/blob/main/charts/langflow-runtime/values.yaml",children:(0,s.jsx)(o.code,{children:"values.yaml"})})," file to configure scaling:"]}),"\n",(0,s.jsxs)(o.ul,{children:["\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:[(0,s.jsx)(o.strong,{children:"Horizontal scaling"}),": Use ",(0,s.jsx)(o.code,{children:"replicaCount"})," to set the number of replicas for your Langflow deployment."]}),"\n",(0,s.jsx)(u.Code,{codeConfig:h,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"replicaCount",props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"3",props:{style:{color:"#79C0FF"}}}]}],lang:"yaml"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:[(0,s.jsx)(o.strong,{children:"Vertical scaling"}),": Use the ",(0,s.jsx)(o.code,{children:"resources"})," section to adjust pod resources depending on your application's needs."]}),"\n",(0,s.jsx)(u.Code,{codeConfig:h,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"resources",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" requests",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" memory",props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"2Gi"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" cpu",props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"1000m"',props:{style:{color:"#A5D6FF"}}}]}],lang:"yaml"},annotations:[]}]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(o.h2,{id:"see-also",children:"See also"}),"\n",(0,s.jsxs)(o.ul,{children:["\n",(0,s.jsx)(o.li,{children:(0,s.jsx)(o.a,{href:"/deployment-prod-best-practices",children:"Best practices for Langflow on Kubernetes"})}),"\n",(0,s.jsx)(o.li,{children:(0,s.jsx)(o.a,{href:"https://github.com/langflow-ai/langflow-helm-charts",children:"Langflow Helm Charts repository"})}),"\n"]})]})}function y(e={}){const{wrapper:o}={...(0,l.R)(),...e.components};return o?(0,s.jsx)(o,{...e,children:(0,s.jsx)(m,{...e})}):m(e)}function g(e,o){throw new Error("Expected "+(o?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}}}]); \ No newline at end of file diff --git a/assets/js/db4f3bbd.723b23a6.js b/assets/js/db4f3bbd.723b23a6.js new file mode 100644 index 0000000000..b89b44202a --- /dev/null +++ b/assets/js/db4f3bbd.723b23a6.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[598],{11470:(e,o,t)=>{t.d(o,{A:()=>w});var n=t(96540),s=t(18215),l=t(23104),r=t(56347),c=t(205),a=t(57485),i=t(31682),d=t(70679);function p(e){return n.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,n.isValidElement)(e)&&function(e){const{props:o}=e;return!!o&&"object"==typeof o&&"value"in o}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function h(e){const{values:o,children:t}=e;return(0,n.useMemo)(()=>{const e=o??function(e){return p(e).map(({props:{value:e,label:o,attributes:t,default:n}})=>({value:e,label:o,attributes:t,default:n}))}(t);return function(e){const o=(0,i.XI)(e,(e,o)=>e.value===o.value);if(o.length>0)throw new Error(`Docusaurus error: Duplicate values "${o.map(e=>e.value).join(", ")}" found in . Every value needs to be unique.`)}(e),e},[o,t])}function u({value:e,tabValues:o}){return o.some(o=>o.value===e)}function f({queryString:e=!1,groupId:o}){const t=(0,r.W6)(),s=function({queryString:e=!1,groupId:o}){if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!o)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return o??null}({queryString:e,groupId:o});return[(0,a.aZ)(s),(0,n.useCallback)(e=>{if(!s)return;const o=new URLSearchParams(t.location.search);o.set(s,e),t.replace({...t.location,search:o.toString()})},[s,t])]}function m(e){const{defaultValue:o,queryString:t=!1,groupId:s}=e,l=h(e),[r,a]=(0,n.useState)(()=>function({defaultValue:e,tabValues:o}){if(0===o.length)throw new Error("Docusaurus error: the component requires at least one children component");if(e){if(!u({value:e,tabValues:o}))throw new Error(`Docusaurus error: The has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${o.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}const t=o.find(e=>e.default)??o[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:o,tabValues:l})),[i,p]=f({queryString:t,groupId:s}),[m,y]=function({groupId:e}){const o=function(e){return e?`docusaurus.tab.${e}`:null}(e),[t,s]=(0,d.Dv)(o);return[t,(0,n.useCallback)(e=>{o&&s.set(e)},[o,s])]}({groupId:s}),g=(()=>{const e=i??m;return u({value:e,tabValues:l})?e:null})();(0,c.A)(()=>{g&&a(g)},[g]);return{selectedValue:r,selectValue:(0,n.useCallback)(e=>{if(!u({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);a(e),p(e),y(e)},[p,y,l]),tabValues:l}}var y=t(92303);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var F=t(74848);function b({className:e,block:o,selectedValue:t,selectValue:n,tabValues:r}){const c=[],{blockElementScrollPositionUntilNextRender:a}=(0,l.a_)(),i=e=>{const o=e.currentTarget,s=c.indexOf(o),l=r[s].value;l!==t&&(a(o),n(l))},d=e=>{let o=null;switch(e.key){case"Enter":i(e);break;case"ArrowRight":{const t=c.indexOf(e.currentTarget)+1;o=c[t]??c[0];break}case"ArrowLeft":{const t=c.indexOf(e.currentTarget)-1;o=c[t]??c[c.length-1];break}}o?.focus()};return(0,F.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.A)("tabs",{"tabs--block":o},e),children:r.map(({value:e,label:o,attributes:n})=>(0,F.jsx)("li",{role:"tab",tabIndex:t===e?0:-1,"aria-selected":t===e,ref:e=>{c.push(e)},onKeyDown:d,onClick:i,...n,className:(0,s.A)("tabs__item",g.tabItem,n?.className,{"tabs__item--active":t===e}),children:o??e},e))})}function x({lazy:e,children:o,selectedValue:t}){const l=(Array.isArray(o)?o:[o]).filter(Boolean);if(e){const e=l.find(e=>e.props.value===t);return e?(0,n.cloneElement)(e,{className:(0,s.A)("margin-top--md",e.props.className)}):null}return(0,F.jsx)("div",{className:"margin-top--md",children:l.map((e,o)=>(0,n.cloneElement)(e,{key:o,hidden:e.props.value!==t}))})}function v(e){const o=m(e);return(0,F.jsxs)("div",{className:(0,s.A)("tabs-container",g.tabList),children:[(0,F.jsx)(b,{...o,...e}),(0,F.jsx)(x,{...o,...e})]})}function w(e){const o=(0,y.A)();return(0,F.jsx)(v,{...e,children:p(e.children)},String(o))}},19365:(e,o,t)=>{t.d(o,{A:()=>r});t(96540);var n=t(18215);const s={tabItem:"tabItem_Ymn6"};var l=t(74848);function r({children:e,hidden:o,className:t}){return(0,l.jsx)("div",{role:"tabpanel",className:(0,n.A)(s.tabItem,t),hidden:o,children:e})}},28453:(e,o,t)=>{t.d(o,{R:()=>r,x:()=>c});var n=t(96540);const s={},l=n.createContext(s);function r(e){const o=n.useContext(l);return n.useMemo(function(){return"function"==typeof e?e(o):{...o,...e}},[o,e])}function c(e){let o;return o=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),n.createElement(l.Provider,{value:o},e.children)}},74598:(e,o,t)=>{t.r(o),t.d(o,{CH:()=>h,assets:()=>p,chCodeConfig:()=>u,contentTitle:()=>d,default:()=>y,frontMatter:()=>i,metadata:()=>n,toc:()=>f});const n=JSON.parse('{"id":"Deployment/deployment-kubernetes-prod","title":"Deploy the Langflow production environment on Kubernetes","description":"The Langflow runtime Helm chart is tailored for deploying applications in a production environment. It is focused on stability, performance, isolation, and security to ensure that applications run reliably and efficiently.","source":"@site/docs/Deployment/deployment-kubernetes-prod.mdx","sourceDirName":"Deployment","slug":"/deployment-kubernetes-prod","permalink":"/deployment-kubernetes-prod","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Deploy the Langflow production environment on Kubernetes","slug":"/deployment-kubernetes-prod"},"sidebar":"docs","previous":{"title":"Deploy in development","permalink":"/deployment-kubernetes-dev"},"next":{"title":"Google Cloud Platform","permalink":"/deployment-gcp"}}');var s=t(74848),l=t(28453),r=t(24754),c=t(11470),a=t(19365);const i={title:"Deploy the Langflow production environment on Kubernetes",slug:"/deployment-kubernetes-prod"},d=void 0,p={},h={annotations:r.hk,Code:r.Cy},u={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},f=[{value:"Prerequisites",id:"prerequisites",level:2},{value:"Install the Langflow runtime Helm chart",id:"install-the-langflow-runtime-helm-chart",level:2},{value:"Access the Langflow runtime",id:"access-the-langflow-runtime",level:2},{value:"Configure secrets and environment variables",id:"configure-secrets-and-environment-variables",level:2},{value:"Set secrets",id:"set-secrets",level:3},{value:"Set the log level and other configuration variables",id:"set-the-log-level-and-other-configuration-variables",level:3},{value:"Configure scaling",id:"configure-scaling",level:2},{value:"See also",id:"see-also",level:2}];function m(e){const o={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,l.R)(),...e.components},{Details:t}=o;return h||g("CH",!1),h.Code||g("CH.Code",!0),t||g("Details",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n","\n",(0,s.jsxs)(o.p,{children:["The ",(0,s.jsx)(o.a,{href:"https://github.com/langflow-ai/langflow-helm-charts/blob/main/charts/langflow-runtime",children:"Langflow runtime Helm chart"})," is tailored for deploying applications in a production environment. It is focused on stability, performance, isolation, and security to ensure that applications run reliably and efficiently."]}),"\n",(0,s.jsxs)(o.admonition,{type:"warning",children:[(0,s.jsxs)(o.p,{children:["For security reasons, the default Langflow runtime Helm chart sets ",(0,s.jsx)(o.a,{href:"https://github.com/langflow-ai/langflow-helm-charts/blob/main/charts/langflow-runtime/values.yaml#L46",children:(0,s.jsx)(o.code,{children:"readOnlyRootFilesystem: true"})}),". This setting prevents modifications to the container's root filesystem at runtime, which is a recommended security measure in production environments."]}),(0,s.jsxs)(o.p,{children:["If ",(0,s.jsx)(o.code,{children:"readOnlyRootFilesystem"})," is disabled (",(0,s.jsx)(o.code,{children:"false"}),"), it degrades your deployment's security posture. Only disable this setting if you understand the security implications and you have implemented other security measures."]}),(0,s.jsxs)(o.p,{children:["For more information, see the ",(0,s.jsx)(o.a,{href:"https://kubernetes.io/docs/tasks/configure-pod-container/security-context/",children:"Kubernetes documentation"}),"."]})]}),"\n",(0,s.jsx)(o.h2,{id:"prerequisites",children:"Prerequisites"}),"\n",(0,s.jsxs)(o.ul,{children:["\n",(0,s.jsxs)(o.li,{children:["A ",(0,s.jsx)(o.a,{href:"https://kubernetes.io/docs/setup/",children:"Kubernetes"})," server"]}),"\n",(0,s.jsx)(o.li,{children:(0,s.jsx)(o.a,{href:"https://kubernetes.io/docs/tasks/tools/#kubectl",children:"kubectl"})}),"\n",(0,s.jsx)(o.li,{children:(0,s.jsx)(o.a,{href:"https://helm.sh/docs/intro/install/",children:"Helm"})}),"\n"]}),"\n",(0,s.jsx)(o.h2,{id:"install-the-langflow-runtime-helm-chart",children:"Install the Langflow runtime Helm chart"}),"\n",(0,s.jsxs)(o.ol,{children:["\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsx)(o.p,{children:"Add the repository to Helm:"}),"\n",(0,s.jsx)(h.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"helm ",props:{style:{color:"#FFA657"}}},{content:"repo add langflow https://langflow-ai.github.io/langflow-helm-charts",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"helm ",props:{style:{color:"#FFA657"}}},{content:"repo update",props:{style:{color:"#A5D6FF"}}}]}],lang:"shell"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Install the Langflow app with the default options in the ",(0,s.jsx)(o.code,{children:"langflow"})," namespace."]}),"\n",(0,s.jsxs)(c.A,{groupId:"",children:[(0,s.jsxs)(a.A,{value:"Install chart with custom image",label:"Install chart with custom image",default:!0,children:[(0,s.jsxs)(o.p,{children:["If you have a ",(0,s.jsx)(o.a,{href:"/deployment-docker#package-your-flow-as-a-docker-image",children:"custom image with packaged flows"}),", you can deploy Langflow by overriding the default ",(0,s.jsx)(o.a,{href:"https://github.com/langflow-ai/langflow-helm-charts/blob/main/charts/langflow-runtime/values.yaml",children:(0,s.jsx)(o.code,{children:"values.yaml"})})," with the ",(0,s.jsx)(o.code,{children:"--set"})," flag:"]}),(0,s.jsx)(h.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"helm ",props:{style:{color:"#FFA657"}}},{content:"install my-langflow-app langflow/langflow-runtime ",props:{style:{color:"#A5D6FF"}}},{content:"-n ",props:{style:{color:"#79C0FF"}}},{content:"langflow ",props:{style:{color:"#A5D6FF"}}},{content:"--create-namespace --set ",props:{style:{color:"#79C0FF"}}},{content:"image.repository=myuser/langflow-hello-world ",props:{style:{color:"#A5D6FF"}}},{content:"--set ",props:{style:{color:"#79C0FF"}}},{content:"image.tag=",props:{style:{color:"#A5D6FF"}}},{content:"1.0.0",props:{style:{color:"#79C0FF"}}}]}],lang:"shell"},annotations:[]}]})]}),(0,s.jsxs)(a.A,{value:"Install chart and download flow",label:"Install chart and download flow",children:[(0,s.jsxs)(o.p,{children:["Install the chart and download flows from a URL with the ",(0,s.jsx)(o.code,{children:"--set"})," flag:"]}),(0,s.jsx)(h.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"helm ",props:{style:{color:"#FFA657"}}},{content:"install my-langflow-app-with-flow langflow/langflow-runtime ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -n ",props:{style:{color:"#79C0FF"}}},{content:"langflow ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" --create-namespace \\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" --set ",props:{style:{color:"#79C0FF"}}},{content:"'downloadFlows.flows[0].url=https://raw.githubusercontent.com/langflow-ai/langflow/dev/tests/data/basic_example.json'",props:{style:{color:"#A5D6FF"}}}]}],lang:"shell"},annotations:[]}]}),(0,s.jsxs)(o.p,{children:["If your shell requires escaping square brackets, modify the ",(0,s.jsx)(o.code,{children:"--set"})," path as needed.\nFor example, ",(0,s.jsx)(o.code,{children:"--set 'downloadFlows.flows\\[0\\].url=https://raw.githubusercontent.com/langflow-ai/langflow/dev/tests/data/basic_example.json'"}),"."]})]})]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsx)(o.p,{children:"Check the status of the pods:"}),"\n",(0,s.jsx)(h.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"kubectl ",props:{style:{color:"#FFA657"}}},{content:"get pods ",props:{style:{color:"#A5D6FF"}}},{content:"-n ",props:{style:{color:"#79C0FF"}}},{content:"langflow",props:{style:{color:"#A5D6FF"}}}]}],lang:"shell"},annotations:[]}]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(o.h2,{id:"access-the-langflow-runtime",children:"Access the Langflow runtime"}),"\n",(0,s.jsxs)(o.ol,{children:["\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsx)(o.p,{children:"Get your service name:"}),"\n",(0,s.jsx)(h.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"kubectl ",props:{style:{color:"#FFA657"}}},{content:"get svc ",props:{style:{color:"#A5D6FF"}}},{content:"-n ",props:{style:{color:"#79C0FF"}}},{content:"langflow",props:{style:{color:"#A5D6FF"}}}]}],lang:"shell"},annotations:[]}]}),"\n",(0,s.jsxs)(o.p,{children:["The service name is your release name suffixed by ",(0,s.jsx)(o.code,{children:"-langflow-runtime"}),". For example, if you used ",(0,s.jsx)(o.code,{children:"helm install my-langflow-app-with-flow"}),", then the service name is ",(0,s.jsx)(o.code,{children:"my-langflow-app-with-flow-langflow-runtime"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsx)(o.p,{children:"Enable port forwarding to access Langflow from your local machine:"}),"\n",(0,s.jsx)(h.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"kubectl ",props:{style:{color:"#FFA657"}}},{content:"port-forward ",props:{style:{color:"#A5D6FF"}}},{content:"-n ",props:{style:{color:"#79C0FF"}}},{content:"langflow svc/my-langflow-app-with-flow-langflow-runtime 7860:",props:{style:{color:"#A5D6FF"}}},{content:"7860",props:{style:{color:"#79C0FF"}}}]}],lang:"shell"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Confirm you can access the API by calling ",(0,s.jsx)(o.code,{children:"http://localhost:7860/api/v1/flows/"}),":"]}),"\n",(0,s.jsx)(h.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-v ",props:{style:{color:"#79C0FF"}}},{content:"http://localhost:7860/api/v1/flows/",props:{style:{color:"#A5D6FF"}}}]}],lang:"shell"},annotations:[]}]}),"\n",(0,s.jsx)(o.p,{children:"A successful request returns a list of flows."}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsx)(o.p,{children:"Run a packaged flow.\nThe following example gets the first flow ID from the flows list, and then runs the flow:"}),"\n",(0,s.jsx)(h.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"# Get flow ID",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:"id",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"$(",props:{style:{color:"#A5D6FF"}}},{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-s",props:{style:{color:"#79C0FF"}}},{content:' "http://localhost:7860/api/v1/flows/" ',props:{style:{color:"#A5D6FF"}}},{content:"| ",props:{style:{color:"#FF7B72"}}},{content:"jq ",props:{style:{color:"#FFA657"}}},{content:"-r",props:{style:{color:"#79C0FF"}}},{content:" '.[0].id')",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"# Run flow",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:"POST ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:' "http://localhost:7860/api/v1/run/',props:{style:{color:"#A5D6FF"}}},{content:"$id",props:{style:{color:"#C9D1D9"}}},{content:'?stream=false" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:"'Content-Type: application/json' ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -d ",props:{style:{color:"#79C0FF"}}},{content:"'{",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "input_value": "Hello!",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "output_type": "chat",',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' "input_type": "chat"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" }'",props:{style:{color:"#A5D6FF"}}}]}],lang:"shell"},annotations:[]}]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(o.h2,{id:"configure-secrets-and-environment-variables",children:"Configure secrets and environment variables"}),"\n",(0,s.jsxs)(o.p,{children:["Use the ",(0,s.jsx)(o.code,{children:".env"})," section of the Langflow runtime Helm chart's ",(0,s.jsx)(o.a,{href:"https://github.com/langflow-ai/langflow-helm-charts/blob/main/charts/langflow-runtime/values.yaml",children:(0,s.jsx)(o.code,{children:"values.yaml"})})," file to define environment variables for your Langflow deployment.\nThis includes built-in ",(0,s.jsx)(o.a,{href:"/environment-variables",children:"Langflow environment variables"}),", as well as ",(0,s.jsx)(o.a,{href:"/configuration-global-variables",children:"global variables"})," used by your flows."]}),"\n",(0,s.jsxs)(o.p,{children:["Langflow can source global variables from your runtime environment, such as Kubernetes secrets referenced in ",(0,s.jsx)(o.code,{children:"values.yaml"}),".\nFor example, the Langflow runtime Helm chart's ",(0,s.jsx)(o.a,{href:"https://raw.githubusercontent.com/langflow-ai/langflow-helm-charts/refs/heads/main/examples/flows/basic-prompting-hello-world.json",children:"example flow JSON"})," uses a global variable that is a secret.\nIf you want to run this flow in your Langflow deployment on Kubernetes, you need to include the secret in your runtime configuration."]}),"\n",(0,s.jsx)(o.admonition,{type:"tip",children:(0,s.jsxs)(o.p,{children:["When you export flows as JSON files, it's recommended to omit secrets.\nWhether or not a secret is included depends on how you declare the secret in your flow and whether you use the ",(0,s.jsx)(o.strong,{children:"Save with my API keys"})," option.\nFor more information, see ",(0,s.jsx)(o.a,{href:"/concepts-flows-import",children:"Import and export flows"}),"."]})}),"\n",(0,s.jsx)(o.h3,{id:"set-secrets",children:"Set secrets"}),"\n",(0,s.jsx)(o.p,{children:"Kubernetes secrets are the recommended way to store sensitive values and credentials."}),"\n",(0,s.jsxs)(o.p,{children:["Use ",(0,s.jsx)(o.code,{children:"secretKeyRef"})," to reference a Kubernetes secret in ",(0,s.jsx)(o.code,{children:"values.yaml"}),":"]}),"\n",(0,s.jsx)(h.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"env",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" - ",props:{style:{color:"#C9D1D9"}}},{content:"name",props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"OPENAI_API_KEY",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" valueFrom",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" secretKeyRef",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"openai-credentials",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" key",props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"openai-key",props:{style:{color:"#A5D6FF"}}}]}],lang:"yaml"},annotations:[]}]}),"\n",(0,s.jsxs)(t,{children:[(0,s.jsxs)("summary",{children:["Create and set secrets with ",(0,s.jsx)(o.code,{children:"kubectl"})," and ",(0,s.jsx)(o.code,{children:"helm"})]}),(0,s.jsxs)(o.p,{children:["You can use ",(0,s.jsx)(o.code,{children:"kubectl"})," and ",(0,s.jsx)(o.code,{children:"helm"})," commands to create and set secrets:"]}),(0,s.jsxs)(o.ol,{children:["\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsx)(o.p,{children:"Create a secret:"}),"\n",(0,s.jsx)(h.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"kubectl ",props:{style:{color:"#FFA657"}}},{content:"create secret generic openai-credentials ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" --namespace ",props:{style:{color:"#79C0FF"}}},{content:"langflow ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" --from-literal=OPENAI_API_KEY=sk...",props:{style:{color:"#79C0FF"}}}]}],lang:"shell"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsx)(o.p,{children:"Verify the secret exists:"}),"\n",(0,s.jsx)(h.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"kubectl ",props:{style:{color:"#FFA657"}}},{content:"get secrets ",props:{style:{color:"#A5D6FF"}}},{content:"-n ",props:{style:{color:"#79C0FF"}}},{content:"langflow openai-credentials",props:{style:{color:"#A5D6FF"}}}]}],lang:"shell"},annotations:[]}]}),"\n",(0,s.jsx)(o.p,{children:"The result is encrypted."}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsx)(o.p,{children:"Upgrade the Helm release to use the secret:"}),"\n",(0,s.jsx)(h.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"helm ",props:{style:{color:"#FFA657"}}},{content:"upgrade my-langflow-app-image langflow/langflow-runtime ",props:{style:{color:"#A5D6FF"}}},{content:"-n ",props:{style:{color:"#79C0FF"}}},{content:"langflow ",props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" --reuse-values \\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" --set ",props:{style:{color:"#79C0FF"}}},{content:'"extraEnv[0].name=OPENAI_API_KEY" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" --set ",props:{style:{color:"#79C0FF"}}},{content:'"extraEnv[0].valueFrom.secretKeyRef.name=openai-credentials" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" --set ",props:{style:{color:"#79C0FF"}}},{content:'"extraEnv[0].valueFrom.secretKeyRef.key=OPENAI_API_KEY"',props:{style:{color:"#A5D6FF"}}}]}],lang:"shell"},annotations:[]}]}),"\n",(0,s.jsx)(o.p,{children:"Escape square brackets if required by your shell."}),"\n"]}),"\n"]})]}),"\n",(0,s.jsx)(o.h3,{id:"set-the-log-level-and-other-configuration-variables",children:"Set the log level and other configuration variables"}),"\n",(0,s.jsxs)(o.p,{children:["For non-sensitive variables, such as ",(0,s.jsx)(o.code,{children:"LANGFLOW_LOG_LEVEL"}),", you can set the value directly in ",(0,s.jsx)(o.code,{children:"values.yaml"}),":"]}),"\n",(0,s.jsx)(h.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"env",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" - ",props:{style:{color:"#C9D1D9"}}},{content:"name",props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"LANGFLOW_LOG_LEVEL",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" value",props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"INFO"',props:{style:{color:"#A5D6FF"}}}]}],lang:"yaml"},annotations:[]}]}),"\n",(0,s.jsx)(o.h2,{id:"configure-scaling",children:"Configure scaling"}),"\n",(0,s.jsxs)(o.p,{children:["Use ",(0,s.jsx)(o.code,{children:"replicaCount"})," and ",(0,s.jsx)(o.code,{children:"resources"})," in the Langflow runtime Helm chart's ",(0,s.jsx)(o.a,{href:"https://github.com/langflow-ai/langflow-helm-charts/blob/main/charts/langflow-runtime/values.yaml",children:(0,s.jsx)(o.code,{children:"values.yaml"})})," file to configure scaling:"]}),"\n",(0,s.jsxs)(o.ul,{children:["\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:[(0,s.jsx)(o.strong,{children:"Horizontal scaling"}),": Use ",(0,s.jsx)(o.code,{children:"replicaCount"})," to set the number of replicas for your Langflow deployment."]}),"\n",(0,s.jsx)(h.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"replicaCount",props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"3",props:{style:{color:"#79C0FF"}}}]}],lang:"yaml"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:[(0,s.jsx)(o.strong,{children:"Vertical scaling"}),": Use the ",(0,s.jsx)(o.code,{children:"resources"})," section to adjust pod resources depending on your application's needs."]}),"\n",(0,s.jsx)(h.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"resources",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" requests",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" memory",props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"2Gi"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" cpu",props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"1000m"',props:{style:{color:"#A5D6FF"}}}]}],lang:"yaml"},annotations:[]}]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(o.h2,{id:"see-also",children:"See also"}),"\n",(0,s.jsxs)(o.ul,{children:["\n",(0,s.jsx)(o.li,{children:(0,s.jsx)(o.a,{href:"/deployment-prod-best-practices",children:"Best practices for Langflow on Kubernetes"})}),"\n",(0,s.jsx)(o.li,{children:(0,s.jsx)(o.a,{href:"https://github.com/langflow-ai/langflow-helm-charts",children:"Langflow Helm Charts repository"})}),"\n"]})]})}function y(e={}){const{wrapper:o}={...(0,l.R)(),...e.components};return o?(0,s.jsx)(o,{...e,children:(0,s.jsx)(m,{...e})}):m(e)}function g(e,o){throw new Error("Expected "+(o?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}}}]); \ No newline at end of file diff --git a/assets/js/e14655eb.8a1250af.js b/assets/js/e14655eb.8a1250af.js deleted file mode 100644 index 0a8f29bf78..0000000000 --- a/assets/js/e14655eb.8a1250af.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[2752],{2249:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>u,contentTitle:()=>p,default:()=>j,frontMatter:()=>h,metadata:()=>r,toc:()=>m});const r=JSON.parse('{"id":"Components/bundles-weaviate","title":"Weaviate","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/bundles-weaviate.mdx","sourceDirName":"Components","slug":"/bundles-weaviate","permalink":"/bundles-weaviate","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Weaviate","slug":"/bundles-weaviate"},"sidebar":"docs","previous":{"title":"Vertex AI","permalink":"/bundles-vertexai"},"next":{"title":"Wikipedia","permalink":"/bundles-wikipedia"}}');var s=n(74848),o=n(28453),a=n(17886),i=n(31929),c=n(80223),d=n(90465),l=n(50005);const h={title:"Weaviate",slug:"/bundles-weaviate"},p=void 0,u={},m=[{value:"Weaviate vector store",id:"weaviate-vector-store",level:2},...l.RM,...d.RM,{value:"Weaviate parameters",id:"weaviate-parameters",level:3},...i.RM,...c.RM];function x(e){const t={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,o.R)(),...e.components},{Details:n}=t;return n||function(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(t.p,{children:[(0,s.jsx)(a.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(t.a,{href:"/components-bundle-components",children:(0,s.jsx)(t.strong,{children:"Bundles"})})," contain custom components that support specific third-party integrations with Langflow."]}),"\n",(0,s.jsxs)(t.p,{children:["This page describes the components that are available in the ",(0,s.jsx)(t.strong,{children:"Weaviate"})," bundle."]}),"\n",(0,s.jsx)(t.h2,{id:"weaviate-vector-store",children:"Weaviate vector store"}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.strong,{children:"Weaviate"})," component reads and writes to Weaviate vector stores using an instance of ",(0,s.jsx)(t.code,{children:"Weaviate"})," vector store."]}),"\n",(0,s.jsxs)(n,{children:[(0,s.jsx)("summary",{children:"About vector store instances"}),(0,s.jsx)(l.Ay,{})]}),"\n",(0,s.jsx)(d.Ay,{}),"\n",(0,s.jsx)(t.admonition,{type:"tip",children:(0,s.jsxs)(t.p,{children:["For a tutorial using a vector database in a flow, see ",(0,s.jsx)(t.a,{href:"/chat-with-rag",children:"Create a vector RAG chatbot"}),"."]})}),"\n",(0,s.jsx)(t.h3,{id:"weaviate-parameters",children:"Weaviate parameters"}),"\n",(0,s.jsx)(t.p,{children:"You can inspect a vector store component's parameters to learn more about the inputs it accepts, the features it supports, and how to configure it."}),"\n",(0,s.jsx)(i.Ay,{}),"\n",(0,s.jsx)(c.Ay,{}),"\n",(0,s.jsxs)(t.p,{children:["For information about accepted values and functionality, see the ",(0,s.jsx)(t.a,{href:"https://weaviate.io/developers/weaviate",children:"Weaviate documentation"})," or inspect ",(0,s.jsx)(t.a,{href:"/concepts-components#component-code",children:"component code"}),"."]}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Name"}),(0,s.jsx)(t.th,{children:"Type"}),(0,s.jsx)(t.th,{children:"Description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"weaviate_url"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. The default instance URL."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"api_key"}),(0,s.jsx)(t.td,{children:"SecretString"}),(0,s.jsx)(t.td,{children:"Input parameter. The optional API key for authentication."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"index_name"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. The optional index name."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"text_key"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. The default text extraction key."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"input"}),(0,s.jsx)(t.td,{children:"Data or DataFrame"}),(0,s.jsx)(t.td,{children:"Input parameter. The document or record."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"cache_vector_store"}),(0,s.jsx)(t.td,{children:"Cache Vector Store"}),(0,s.jsx)(t.td,{children:"Input parameter. If true, the component caches the vector store in memory for faster reads. Default: Enabled (true)."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"embedding"}),(0,s.jsx)(t.td,{children:"Embeddings"}),(0,s.jsxs)(t.td,{children:["Input parameter. Connect an ",(0,s.jsx)(t.a,{href:"/components-embedding-models",children:"embedding model component"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"number_of_results"}),(0,s.jsx)(t.td,{children:"Integer"}),(0,s.jsxs)(t.td,{children:["Input parameter. The number of search results to return. Default: ",(0,s.jsx)(t.code,{children:"4"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"search_by_text"}),(0,s.jsx)(t.td,{children:"Boolean"}),(0,s.jsx)(t.td,{children:"Input parameter. Indicates whether to search by text. Default: Disabled (false)."})]})]})]})]})}function j(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(x,{...e})}):x(e)}},17886:(e,t,n)=>{n.d(t,{A:()=>o});n(96540);var r=n(64058),s=n(74848);function o({name:e,...t}){const n=r[e];return n?(0,s.jsx)(n,{...t}):null}},31929:(e,t,n)=>{n.d(t,{Ay:()=>c,RM:()=>a});var r=n(74848),s=n(28453),o=n(17886);const a=[];function i(e){const t={a:"a",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,r.jsxs)(t.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,r.jsx)(o.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Controls"})," in the ",(0,r.jsx)(t.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function c(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(i,{...e})}):i(e)}},50005:(e,t,n)=>{n.d(t,{Ay:()=>i,RM:()=>o});var r=n(74848),s=n(28453);const o=[];function a(e){const t={a:"a",code:"code",p:"p",...(0,s.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(t.p,{children:["Because Langflow is based on LangChain, vector store components use an instance of ",(0,r.jsx)(t.a,{href:"https://python.langchain.com/docs/integrations/vectorstores/",children:"LangChain vector store"})," to drive the underlying read and write functions.\nThese instances are provider-specific and configured according to the component's parameters, such as the connection string, index name, and schema."]}),"\n",(0,r.jsxs)(t.p,{children:["In component code, this is often instantiated as ",(0,r.jsx)(t.code,{children:"vector_store"}),", but some vector store components use a different name, such as the provider name."]}),"\n",(0,r.jsx)(t.p,{children:"Some LangChain classes don't expose all possible options as component parameters.\nDepending on the provider, these options might use default values or allow modification through environment variables, if they are supported in Langflow.\nFor information about specific options, see the LangChain API reference and vector store provider's documentation."})]})}function i(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}},80223:(e,t,n)=>{n.d(t,{Ay:()=>i,RM:()=>o});var r=n(74848),s=n(28453);const o=[];function a(e){const t={p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,r.jsxs)(t.p,{children:["Some parameters are conditional, and they are only available after you set other parameters or select specific options for other parameters.\nConditional parameters may not be visible on the ",(0,r.jsx)(t.strong,{children:"Controls"})," pane until you set the required dependencies."]})}function i(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}},90465:(e,t,n)=>{n.d(t,{Ay:()=>i,RM:()=>o});var r=n(74848),s=n(28453);const o=[];function a(e){const t={a:"a",code:"code",p:"p",...(0,s.R)(),...e.components};return(0,r.jsxs)(t.p,{children:["If you use a vector store component to query your vector database, it produces search results that you can pass to downstream components in your flow as a list of ",(0,r.jsx)(t.a,{href:"/data-types#data",children:(0,r.jsx)(t.code,{children:"Data"})})," objects or a tabular ",(0,r.jsx)(t.a,{href:"/data-types#dataframe",children:(0,r.jsx)(t.code,{children:"DataFrame"})}),".\nIf both types are supported, you can set the format near the vector store component's output port in the visual editor."]})}function i(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}}}]); \ No newline at end of file diff --git a/assets/js/e14655eb.cdefe05c.js b/assets/js/e14655eb.cdefe05c.js new file mode 100644 index 0000000000..be989403af --- /dev/null +++ b/assets/js/e14655eb.cdefe05c.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[2752],{2249:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>u,contentTitle:()=>p,default:()=>j,frontMatter:()=>h,metadata:()=>r,toc:()=>m});const r=JSON.parse('{"id":"Components/bundles-weaviate","title":"Weaviate","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/bundles-weaviate.mdx","sourceDirName":"Components","slug":"/bundles-weaviate","permalink":"/bundles-weaviate","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Weaviate","slug":"/bundles-weaviate"},"sidebar":"docs","previous":{"title":"Vertex AI","permalink":"/bundles-vertexai"},"next":{"title":"Wikipedia","permalink":"/bundles-wikipedia"}}');var s=n(74848),o=n(28453),a=n(17886),i=n(31929),c=n(80223),d=n(90465),l=n(50005);const h={title:"Weaviate",slug:"/bundles-weaviate"},p=void 0,u={},m=[{value:"Weaviate vector store",id:"weaviate-vector-store",level:2},...l.RM,...d.RM,{value:"Weaviate parameters",id:"weaviate-parameters",level:3},...i.RM,...c.RM];function x(e){const t={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,o.R)(),...e.components},{Details:n}=t;return n||function(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(t.p,{children:[(0,s.jsx)(a.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(t.a,{href:"/components-bundle-components",children:(0,s.jsx)(t.strong,{children:"Bundles"})})," contain custom components that support specific third-party integrations with Langflow."]}),"\n",(0,s.jsxs)(t.p,{children:["This page describes the components that are available in the ",(0,s.jsx)(t.strong,{children:"Weaviate"})," bundle."]}),"\n",(0,s.jsx)(t.h2,{id:"weaviate-vector-store",children:"Weaviate vector store"}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.strong,{children:"Weaviate"})," component reads and writes to Weaviate vector stores using an instance of ",(0,s.jsx)(t.code,{children:"Weaviate"})," vector store."]}),"\n",(0,s.jsxs)(n,{children:[(0,s.jsx)("summary",{children:"About vector store instances"}),(0,s.jsx)(l.Ay,{})]}),"\n",(0,s.jsx)(d.Ay,{}),"\n",(0,s.jsx)(t.admonition,{type:"tip",children:(0,s.jsxs)(t.p,{children:["For a tutorial using a vector database in a flow, see ",(0,s.jsx)(t.a,{href:"/chat-with-rag",children:"Create a vector RAG chatbot"}),"."]})}),"\n",(0,s.jsx)(t.h3,{id:"weaviate-parameters",children:"Weaviate parameters"}),"\n",(0,s.jsx)(t.p,{children:"You can inspect a vector store component's parameters to learn more about the inputs it accepts, the features it supports, and how to configure it."}),"\n",(0,s.jsx)(i.Ay,{}),"\n",(0,s.jsx)(c.Ay,{}),"\n",(0,s.jsxs)(t.p,{children:["For information about accepted values and functionality, see the ",(0,s.jsx)(t.a,{href:"https://weaviate.io/developers/weaviate",children:"Weaviate documentation"})," or inspect ",(0,s.jsx)(t.a,{href:"/concepts-components#component-code",children:"component code"}),"."]}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Name"}),(0,s.jsx)(t.th,{children:"Type"}),(0,s.jsx)(t.th,{children:"Description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"weaviate_url"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. The default instance URL."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"api_key"}),(0,s.jsx)(t.td,{children:"SecretString"}),(0,s.jsx)(t.td,{children:"Input parameter. The optional API key for authentication."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"index_name"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. The optional index name."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"text_key"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. The default text extraction key."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"input"}),(0,s.jsx)(t.td,{children:"Data or DataFrame"}),(0,s.jsx)(t.td,{children:"Input parameter. The document or record."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"cache_vector_store"}),(0,s.jsx)(t.td,{children:"Cache Vector Store"}),(0,s.jsxs)(t.td,{children:["Input parameter. If ",(0,s.jsx)(t.code,{children:"true"}),", the component caches the vector store in memory for faster reads. Default: Enabled (",(0,s.jsx)(t.code,{children:"true"}),")."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"embedding"}),(0,s.jsx)(t.td,{children:"Embeddings"}),(0,s.jsxs)(t.td,{children:["Input parameter. Connect an ",(0,s.jsx)(t.a,{href:"/components-embedding-models",children:"embedding model component"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"number_of_results"}),(0,s.jsx)(t.td,{children:"Integer"}),(0,s.jsxs)(t.td,{children:["Input parameter. The number of search results to return. Default: ",(0,s.jsx)(t.code,{children:"4"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"search_by_text"}),(0,s.jsx)(t.td,{children:"Boolean"}),(0,s.jsxs)(t.td,{children:["Input parameter. Indicates whether to search by text. Default: Disabled (",(0,s.jsx)(t.code,{children:"false"}),")."]})]})]})]})]})}function j(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(x,{...e})}):x(e)}},17886:(e,t,n)=>{n.d(t,{A:()=>o});n(96540);var r=n(64058),s=n(74848);function o({name:e,...t}){const n=r[e];return n?(0,s.jsx)(n,{...t}):null}},31929:(e,t,n)=>{n.d(t,{Ay:()=>c,RM:()=>a});var r=n(74848),s=n(28453),o=n(17886);const a=[];function i(e){const t={a:"a",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,r.jsxs)(t.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,r.jsx)(o.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Controls"})," in the ",(0,r.jsx)(t.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function c(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(i,{...e})}):i(e)}},50005:(e,t,n)=>{n.d(t,{Ay:()=>i,RM:()=>o});var r=n(74848),s=n(28453);const o=[];function a(e){const t={a:"a",code:"code",p:"p",...(0,s.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(t.p,{children:["Because Langflow is based on LangChain, vector store components use an instance of ",(0,r.jsx)(t.a,{href:"https://python.langchain.com/docs/integrations/vectorstores/",children:"LangChain vector store"})," to drive the underlying read and write functions.\nThese instances are provider-specific and configured according to the component's parameters, such as the connection string, index name, and schema."]}),"\n",(0,r.jsxs)(t.p,{children:["In component code, this is often instantiated as ",(0,r.jsx)(t.code,{children:"vector_store"}),", but some vector store components use a different name, such as the provider name."]}),"\n",(0,r.jsx)(t.p,{children:"Some LangChain classes don't expose all possible options as component parameters.\nDepending on the provider, these options might use default values or allow modification through environment variables, if they are supported in Langflow.\nFor information about specific options, see the LangChain API reference and vector store provider's documentation."})]})}function i(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}},80223:(e,t,n)=>{n.d(t,{Ay:()=>i,RM:()=>o});var r=n(74848),s=n(28453);const o=[];function a(e){const t={p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,r.jsxs)(t.p,{children:["Some parameters are conditional, and they are only available after you set other parameters or select specific options for other parameters.\nConditional parameters may not be visible on the ",(0,r.jsx)(t.strong,{children:"Controls"})," pane until you set the required dependencies."]})}function i(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}},90465:(e,t,n)=>{n.d(t,{Ay:()=>i,RM:()=>o});var r=n(74848),s=n(28453);const o=[];function a(e){const t={a:"a",code:"code",p:"p",...(0,s.R)(),...e.components};return(0,r.jsxs)(t.p,{children:["If you use a vector store component to query your vector database, it produces search results that you can pass to downstream components in your flow as a list of ",(0,r.jsx)(t.a,{href:"/data-types#data",children:(0,r.jsx)(t.code,{children:"Data"})})," objects or a tabular ",(0,r.jsx)(t.a,{href:"/data-types#dataframe",children:(0,r.jsx)(t.code,{children:"DataFrame"})}),".\nIf both types are supported, you can set the format near the vector store component's output port in the visual editor."]})}function i(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}}}]); \ No newline at end of file diff --git a/assets/js/e1a0f423.fa4f574e.js b/assets/js/e1a0f423.e7d0ae98.js similarity index 69% rename from assets/js/e1a0f423.fa4f574e.js rename to assets/js/e1a0f423.e7d0ae98.js index 176ea66919..af7c19defc 100644 --- a/assets/js/e1a0f423.fa4f574e.js +++ b/assets/js/e1a0f423.e7d0ae98.js @@ -1 +1 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[4341],{11470:(e,n,o)=>{o.d(n,{A:()=>j});var t=o(96540),s=o(18215),r=o(23104),l=o(56347),i=o(205),a=o(57485),c=o(31682),d=o(70679);function u(e){return t.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,t.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function h(e){const{values:n,children:o}=e;return(0,t.useMemo)(()=>{const e=n??function(e){return u(e).map(({props:{value:e,label:n,attributes:o,default:t}})=>({value:e,label:n,attributes:o,default:t}))}(o);return function(e){const n=(0,c.XI)(e,(e,n)=>e.value===n.value);if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map(e=>e.value).join(", ")}" found in . Every value needs to be unique.`)}(e),e},[n,o])}function p({value:e,tabValues:n}){return n.some(n=>n.value===e)}function g({queryString:e=!1,groupId:n}){const o=(0,l.W6)(),s=function({queryString:e=!1,groupId:n}){if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:e,groupId:n});return[(0,a.aZ)(s),(0,t.useCallback)(e=>{if(!s)return;const n=new URLSearchParams(o.location.search);n.set(s,e),o.replace({...o.location,search:n.toString()})},[s,o])]}function f(e){const{defaultValue:n,queryString:o=!1,groupId:s}=e,r=h(e),[l,a]=(0,t.useState)(()=>function({defaultValue:e,tabValues:n}){if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(e){if(!p({value:e,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${n.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}const o=n.find(e=>e.default)??n[0];if(!o)throw new Error("Unexpected error: 0 tabValues");return o.value}({defaultValue:n,tabValues:r})),[c,u]=g({queryString:o,groupId:s}),[f,m]=function({groupId:e}){const n=function(e){return e?`docusaurus.tab.${e}`:null}(e),[o,s]=(0,d.Dv)(n);return[o,(0,t.useCallback)(e=>{n&&s.set(e)},[n,s])]}({groupId:s}),w=(()=>{const e=c??f;return p({value:e,tabValues:r})?e:null})();(0,i.A)(()=>{w&&a(w)},[w]);return{selectedValue:l,selectValue:(0,t.useCallback)(e=>{if(!p({value:e,tabValues:r}))throw new Error(`Can't select invalid tab value=${e}`);a(e),u(e),m(e)},[u,m,r]),tabValues:r}}var m=o(92303);const w={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var y=o(74848);function x({className:e,block:n,selectedValue:o,selectValue:t,tabValues:l}){const i=[],{blockElementScrollPositionUntilNextRender:a}=(0,r.a_)(),c=e=>{const n=e.currentTarget,s=i.indexOf(n),r=l[s].value;r!==o&&(a(n),t(r))},d=e=>{let n=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const o=i.indexOf(e.currentTarget)+1;n=i[o]??i[0];break}case"ArrowLeft":{const o=i.indexOf(e.currentTarget)-1;n=i[o]??i[i.length-1];break}}n?.focus()};return(0,y.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.A)("tabs",{"tabs--block":n},e),children:l.map(({value:e,label:n,attributes:t})=>(0,y.jsx)("li",{role:"tab",tabIndex:o===e?0:-1,"aria-selected":o===e,ref:e=>{i.push(e)},onKeyDown:d,onClick:c,...t,className:(0,s.A)("tabs__item",w.tabItem,t?.className,{"tabs__item--active":o===e}),children:n??e},e))})}function v({lazy:e,children:n,selectedValue:o}){const r=(Array.isArray(n)?n:[n]).filter(Boolean);if(e){const e=r.find(e=>e.props.value===o);return e?(0,t.cloneElement)(e,{className:(0,s.A)("margin-top--md",e.props.className)}):null}return(0,y.jsx)("div",{className:"margin-top--md",children:r.map((e,n)=>(0,t.cloneElement)(e,{key:n,hidden:e.props.value!==o}))})}function b(e){const n=f(e);return(0,y.jsxs)("div",{className:(0,s.A)("tabs-container",w.tabList),children:[(0,y.jsx)(x,{...n,...e}),(0,y.jsx)(v,{...n,...e})]})}function j(e){const n=(0,m.A)();return(0,y.jsx)(b,{...e,children:u(e.children)},String(n))}},17886:(e,n,o)=>{o.d(n,{A:()=>r});o(96540);var t=o(64058),s=o(74848);function r({name:e,...n}){const o=t[e];return o?(0,s.jsx)(o,{...n}):null}},19365:(e,n,o)=>{o.d(n,{A:()=>l});o(96540);var t=o(18215);const s={tabItem:"tabItem_Ymn6"};var r=o(74848);function l({children:e,hidden:n,className:o}){return(0,r.jsx)("div",{role:"tabpanel",className:(0,t.A)(s.tabItem,o),hidden:n,children:e})}},91724:(e,n,o)=>{o.r(n),o.d(n,{CH:()=>p,assets:()=>h,chCodeConfig:()=>g,contentTitle:()=>u,default:()=>w,frontMatter:()=>d,metadata:()=>t,toc:()=>f});const t=JSON.parse('{"id":"Support/troubleshooting","title":"Troubleshoot Langflow","description":"This page provides troubleshooting advice for issues you might encounter when using Langflow or contributing to Langflow.","source":"@site/docs/Support/troubleshooting.mdx","sourceDirName":"Support","slug":"/troubleshoot","permalink":"/troubleshoot","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Troubleshoot Langflow","slug":"/troubleshoot"},"sidebar":"docs","previous":{"title":"Release notes","permalink":"/release-notes"},"next":{"title":"Get help and request enhancements","permalink":"/contributing-github-issues"}}');var s=o(74848),r=o(28453),l=o(24754),i=o(11470),a=o(19365),c=o(17886);const d={title:"Troubleshoot Langflow",slug:"/troubleshoot"},u=void 0,h={},p={annotations:l.hk,Code:l.Cy},g={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},f=[{value:"Missing components",id:"missing-components",level:2},{value:"No input in the Playground",id:"no-input-in-the-playground",level:2},{value:"Missing key, no key found, or invalid API key",id:"missing-key-no-key-found-or-invalid-api-key",level:2},{value:"Langflow installation issues",id:"langflow-installation-issues",level:2},{value:"Langflow installation freezes at pip dependency resolution",id:"langflow-installation-freezes-at-pip-dependency-resolution",level:3},{value:"Linux installation fails to build required package",id:"linux-installation-fails-to-build-required-package",level:3},{value:"Installation failure from webrtcvad package",id:"installation-failure-from-webrtcvad-package",level:3},{value:"C++ build tools required for Langflow Desktop on Windows",id:"c-build-tools-required-for-langflow-desktop-on-windows",level:3},{value:"Langflow startup issues",id:"langflow-startup-issues",level:2},{value:"No langflow.__main__ module",id:"no-langflow__main__-module",level:3},{value:"Langflow runTraceback",id:"langflow-runtraceback",level:3},{value:"Environment variables not available from terminal",id:"environment-variables-not-available-from-terminal",level:3},{value:"Access Langflow Desktop startup logs",id:"access-langflow-desktop-startup-logs",level:3},{value:"User not found or inactive when running multiple flows",id:"user-not-found-or-inactive-when-running-multiple-flows",level:3},{value:"Package is not installed",id:"package-is-not-installed",level:3},{value:"Langflow upgrade issues",id:"langflow-upgrade-issues",level:2},{value:"Something went wrong running migrations",id:"something-went-wrong-running-migrations",level:3},{value:"Langflow Desktop says it is running the latest version, but it is actually behind",id:"langflow-desktop-says-it-is-running-the-latest-version-but-it-is-actually-behind",level:3},{value:"Langflow uninstall issues",id:"langflow-uninstall-issues",level:2},{value:"Dot directory isn't deleted when uninstalling Langflow Desktop on macOS",id:"dot-directory-isnt-deleted-when-uninstalling-langflow-desktop-on-macos",level:3},{value:"Langflow MCP issues",id:"mcp",level:2},{value:"Claude for Desktop doesn't use MCP server tools correctly",id:"claude-for-desktop-doesnt-use-mcp-server-tools-correctly",level:3},{value:"MCP browser-based flows don't open a browser on Windows",id:"mcp-browser-based-flows-dont-open-a-browser-on-windows",level:3},{value:"Token length limit errors in Embedding Model components",id:"token-length-limit-errors-in-embedding-model-components",level:2},{value:"Custom components and integrations issues",id:"custom-components-and-integrations-issues",level:2},{value:"Custom components not appearing in the visual editor",id:"custom-components-not-appearing-in-the-visual-editor",level:3},{value:"See also",id:"see-also",level:2}];function m(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return p||y("CH",!1),p.Code||y("CH.Code",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n","\n",(0,s.jsx)(n.p,{children:"This page provides troubleshooting advice for issues you might encounter when using Langflow or contributing to Langflow."}),"\n",(0,s.jsx)(n.h2,{id:"missing-components",children:"Missing components"}),"\n",(0,s.jsx)(n.p,{children:"As Langflow development continues, components are often recategorized or deprecated for better alignment or to prepare for new components."}),"\n",(0,s.jsxs)(n.p,{children:["If a component appears to be missing from the ",(0,s.jsx)(c.A,{name:"Component","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Core components"})," and menus, try the following:"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(c.A,{name:"Search","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Search"})," for the component."]}),"\n",(0,s.jsxs)(n.li,{children:["Check other component categories and ",(0,s.jsx)(c.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(n.a,{href:"/components-bundle-components",children:(0,s.jsx)(n.strong,{children:"Bundles"})}),"."]}),"\n",(0,s.jsxs)(n.li,{children:["Check ",(0,s.jsx)(n.a,{href:"/concepts-components#legacy-components",children:"legacy components"}),", which are hidden by default."]}),"\n",(0,s.jsxs)(n.li,{children:["Check the ",(0,s.jsx)(n.a,{href:"https://github.com/langflow-ai/langflow/releases/latest",children:"Changelog"})," for component changes in recent releases."]}),"\n",(0,s.jsx)(n.li,{children:"Make sure the component isn't already present in your flow if it is a single-use component."}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["If you still cannot locate the component, see ",(0,s.jsx)(n.a,{href:"/contributing-github-issues",children:"Langflow GitHub Issues and Discussions"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"no-input-in-the-playground",children:"No input in the Playground"}),"\n",(0,s.jsxs)(n.p,{children:["If there is no message input field in the ",(0,s.jsx)(n.strong,{children:"Playground"}),", make sure your flow has a ",(0,s.jsxs)(n.a,{href:"/components-io#chat-io",children:[(0,s.jsx)(n.strong,{children:"Chat Input"})," component"]})," that is connected, directly or indirectly, to the ",(0,s.jsx)(n.strong,{children:"Input"})," port of a ",(0,s.jsx)(n.strong,{children:"Language Model"})," or ",(0,s.jsx)(n.strong,{children:"Agent"})," component."]}),"\n",(0,s.jsxs)(n.p,{children:["Because the ",(0,s.jsx)(n.strong,{children:"Playground"})," is designed for flows that use an LLM in a query-and-response format, such as chatbots and agents, a flow must have ",(0,s.jsx)(n.strong,{children:"Chat Input"}),", ",(0,s.jsx)(n.strong,{children:"Language Model"}),"/",(0,s.jsx)(n.strong,{children:"Agent"}),", and ",(0,s.jsx)(n.strong,{children:"Chat Output"})," components to be fully supported by the ",(0,s.jsx)(n.strong,{children:"Playground"})," chat interface."]}),"\n",(0,s.jsxs)(n.p,{children:["For more information, see ",(0,s.jsx)(n.a,{href:"/concepts-playground",children:"Test flows in the Playground"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"missing-key-no-key-found-or-invalid-api-key",children:"Missing key, no key found, or invalid API key"}),"\n",(0,s.jsx)(n.p,{children:"If you get an API key error when running a flow, try the following:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["For all components that require credentials, make sure those components have a valid credential in the component's settings, such as the ",(0,s.jsx)(n.strong,{children:"API Key"})," field."]}),"\n",(0,s.jsxs)(n.li,{children:["If you store your credentials in ",(0,s.jsx)(n.a,{href:"/configuration-global-variables",children:"Langflow global variables"}),", make sure you selected the correct global variable and that the variable contains a valid credential."]}),"\n",(0,s.jsx)(n.li,{children:"Make sure the provided credentials are active, have the required permissions, and, if applicable, have sufficient funds in the account to execute the required action. For example, model providers require credits to use their LLMs."}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"langflow-installation-issues",children:"Langflow installation issues"}),"\n",(0,s.jsx)(n.p,{children:"The following issues can occur when installing Langflow."}),"\n",(0,s.jsx)(n.h3,{id:"langflow-installation-freezes-at-pip-dependency-resolution",children:"Langflow installation freezes at pip dependency resolution"}),"\n",(0,s.jsxs)(n.p,{children:["Installing Langflow OSS with ",(0,s.jsx)(n.code,{children:"pip install langflow"})," slowly fails with this error message:"]}),"\n",(0,s.jsx)(p.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"pip is looking at multiple versions of <> to determine which version is compatible with other requirements. This could take a while.",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,s.jsxs)(n.p,{children:["To work around this issue, install Langflow with ",(0,s.jsx)(n.code,{children:"uv"})," instead of ",(0,s.jsx)(n.code,{children:"pip"}),", as explained in ",(0,s.jsx)(n.a,{href:"/get-started-installation#install-and-run-the-langflow-oss-python-package",children:"Install and run the Langflow OSS Python package"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"linux-installation-fails-to-build-required-package",children:"Linux installation fails to build required package"}),"\n",(0,s.jsx)(n.p,{children:"When you try to install Langflow OSS on Linux, installation fails because of outdated or missing packages:"}),"\n",(0,s.jsx)(p.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"Resolved ",props:{style:{color:"#FFA657"}}},{content:"455 ",props:{style:{color:"#79C0FF"}}},{content:"packages in ",props:{style:{color:"#A5D6FF"}}},{content:"18.92s",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" \xd7 ",props:{style:{color:"#FFA657"}}},{content:"Failed to build `",props:{style:{color:"#A5D6FF"}}},{content:"webrtcvad",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#A5D6FF"}}},{content:"2.0.10",props:{style:{color:"#79C0FF"}}},{content:"`",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" \u251c\u2500\u25b6",props:{style:{color:"#FFA657"}}},{content:" The build backend returned an error",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" \u2570\u2500\u25b6",props:{style:{color:"#FFA657"}}},{content:" Call to `setuptools.build_meta:__legacy__.build_wheel` ",props:{style:{color:"#A5D6FF"}}},{content:"failed",props:{style:{color:"#FFA657"}}},{content:" (exit status: ",props:{style:{color:"#A5D6FF"}}},{content:"1",props:{style:{color:"#79C0FF"}}},{content:")",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,s.jsx)(n.p,{children:"To resolve this error, install the required build dependencies, and then retry the Langflow installation:"}),"\n",(0,s.jsx)(p.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"sudo ",props:{style:{color:"#FFA657"}}},{content:"apt-get update",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"sudo ",props:{style:{color:"#FFA657"}}},{content:"apt-get install build-essential python3-dev",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,s.jsxs)(n.p,{children:["If upgrading your packages doesn't fix the issue, install ",(0,s.jsx)(n.code,{children:"gcc"})," separately, and then retry the Langflow installation:"]}),"\n",(0,s.jsx)(p.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"sudo ",props:{style:{color:"#FFA657"}}},{content:"apt-get install gcc",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,s.jsxs)(n.h3,{id:"installation-failure-from-webrtcvad-package",children:["Installation failure from ",(0,s.jsx)(n.code,{children:"webrtcvad"})," package"]}),"\n",(0,s.jsxs)(n.p,{children:["If you experience an error from the ",(0,s.jsx)(n.code,{children:"webrtcvad"})," package, run ",(0,s.jsx)(n.code,{children:"uv pip install webrtcvad-wheels"})," in your virtual environment, and then retry the Langflow installation."]}),"\n",(0,s.jsx)(n.h3,{id:"c-build-tools-required-for-langflow-desktop-on-windows",children:"C++ build tools required for Langflow Desktop on Windows"}),"\n",(0,s.jsxs)(n.p,{children:["Microsoft Windows installations of Langflow Desktop require a C++ compiler that may not be present on your system. If you receive a ",(0,s.jsx)(n.code,{children:"C++ Build Tools Required!"})," error, follow the on-screen prompt to install Microsoft C++ Build Tools, or ",(0,s.jsx)(n.a,{href:"https://visualstudio.microsoft.com/downloads/",children:"install Microsoft Visual Studio"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"langflow-startup-issues",children:"Langflow startup issues"}),"\n",(0,s.jsx)(n.p,{children:"The following issues can occur when attempting to start Langflow."}),"\n",(0,s.jsxs)(n.h3,{id:"no-langflow__main__-module",children:["No ",(0,s.jsx)(n.code,{children:"langflow.__main__"})," module"]}),"\n",(0,s.jsxs)(n.p,{children:["When you try to run Langflow with the command ",(0,s.jsx)(n.code,{children:"langflow run"}),", you encounter the following error:"]}),"\n",(0,s.jsx)(p.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:">",props:{style:{color:"#FF7B72"}}},{content:" No module named ",props:{style:{color:"#C9D1D9"}}},{content:"'langflow.__main__'",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,s.jsx)(n.p,{children:"To resolve this issue, try the following:"}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["Run ",(0,s.jsx)(n.code,{children:"uv run langflow run"})," instead of ",(0,s.jsx)(n.code,{children:"langflow run"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:["If that doesn't work, reinstall the latest Langflow version with ",(0,s.jsx)(n.code,{children:"uv pip install langflow -U"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:["If that doesn't work, reinstall Langflow and its dependencies with ",(0,s.jsx)(n.code,{children:"uv pip install langflow --pre -U --force-reinstall"}),"."]}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"langflow-runtraceback",children:"Langflow runTraceback"}),"\n",(0,s.jsxs)(n.p,{children:["When you try to run Langflow using the command ",(0,s.jsx)(n.code,{children:"langflow run"}),", you encounter the following error:"]}),"\n",(0,s.jsx)(p.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:">",props:{style:{color:"#FF7B72"}}},{content:" langflow runTraceback (",props:{style:{color:"#C9D1D9"}}},{content:"most ",props:{style:{color:"#FFA657"}}},{content:"recent call last",props:{style:{color:"#A5D6FF"}}},{content:"): File ",props:{style:{color:"#C9D1D9"}}},{content:'".../langflow"',props:{style:{color:"#A5D6FF"}}},{content:", line 5, ",props:{style:{color:"#C9D1D9"}}},{content:"in <",props:{style:{color:"#FF7B72"}}},{content:"module",props:{style:{color:"#C9D1D9"}}},{content:">",props:{style:{color:"#FF7B72"}}},{content:" from langflow.__main__ import mainModuleNotFoundError: No module named ",props:{style:{color:"#C9D1D9"}}},{content:"'langflow.__main__'",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,s.jsx)(n.p,{children:"There are two possible reasons for this error:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Multiple Langflow installations"}),": You installed Langflow using ",(0,s.jsx)(n.code,{children:"pip install langflow"})," but you already had a previous version of Langflow installed in your system. In this case, you might be running the wrong executable."]}),"\n",(0,s.jsxs)(n.p,{children:["To solve this issue, run the correct executable by running ",(0,s.jsx)(n.code,{children:"python -m langflow run"})," instead of ",(0,s.jsx)(n.code,{children:"langflow run"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["If that doesn't work, try uninstalling and reinstalling Langflow with ",(0,s.jsx)(n.code,{children:"uv pip install langflow --pre -U"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Version conflict during installation"}),": Some version conflicts might have occurred during the installation process. To resolve this issue, reinstall Langflow and its dependencies by running ",(0,s.jsx)(n.code,{children:"python -m pip install langflow --pre -U --force-reinstall"}),"."]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"environment-variables-not-available-from-terminal",children:"Environment variables not available from terminal"}),"\n",(0,s.jsxs)(n.p,{children:["Environment variables set in your terminal aren't automatically available to GUI-based applications like Langflow Desktop when launched through the Finder or the Start Menu.\nTo set environment variables for Langflow Desktop, see ",(0,s.jsx)(n.a,{href:"/environment-variables#set-environment-variables-for-langflow-desktop",children:"Set environment variables for Langflow Desktop"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"access-langflow-desktop-startup-logs",children:"Access Langflow Desktop startup logs"}),"\n",(0,s.jsxs)(n.p,{children:["If you encounter issues with Langflow Desktop, you might need to ",(0,s.jsx)(n.a,{href:"/logging#desktop-logs",children:"access Langflow Desktop startup logs"})," for debugging."]}),"\n",(0,s.jsx)(n.h3,{id:"user-not-found-or-inactive-when-running-multiple-flows",children:"User not found or inactive when running multiple flows"}),"\n",(0,s.jsxs)(n.p,{children:["When running multiple local Langflow OSS instances on different ports, such as ",(0,s.jsx)(n.code,{children:"localhost:7860"})," and ",(0,s.jsx)(n.code,{children:"localhost:7861"}),", you might see authentication errors in the logs.\nFor example:"]}),"\n",(0,s.jsx)(p.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"[07/22/25 10:57:07] INFO 2025-07-22 10:57:07 - INFO - utils - User not found or inactive.",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,s.jsx)(n.p,{children:"To resolve this error, use separate browser instances or browser profiles to access each Langflow instance."}),"\n",(0,s.jsx)(n.h3,{id:"package-is-not-installed",children:"Package is not installed"}),"\n",(0,s.jsx)(n.p,{children:"In Langflow OSS, you can follow the error message's instructions to install the missing dependency."}),"\n",(0,s.jsxs)(n.p,{children:["To manage dependencies in Langflow Desktop, see ",(0,s.jsx)(n.a,{href:"/install-custom-dependencies#langflow-desktop",children:"Install custom dependencies in Langflow Desktop"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"langflow-upgrade-issues",children:"Langflow upgrade issues"}),"\n",(0,s.jsx)(n.p,{children:"The following issues can occur when upgrading your Langflow version."}),"\n",(0,s.jsxs)(n.p,{children:["For information about managing Langflow versions, see ",(0,s.jsx)(n.a,{href:"/get-started-installation",children:"Install Langflow"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"something-went-wrong-running-migrations",children:"Something went wrong running migrations"}),"\n",(0,s.jsxs)(n.p,{children:["The following error can occur during Langflow upgrades when the new version can't override ",(0,s.jsx)(n.code,{children:"langflow-pre.db"})," in the Langflow cache folder:"]}),"\n",(0,s.jsx)(p.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:">",props:{style:{color:"#FF7B72"}}},{content:" Something went wrong running migrations. Please, run ",props:{style:{color:"#C9D1D9"}}},{content:"'langflow migration --fix'",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,s.jsxs)(n.p,{children:["To resolve this error, clear the cache by deleting the contents of your Langflow cache folder.\nThe filepath depends on your operating system, installation type, and configuration options.\nFor more information and default filepaths, see ",(0,s.jsx)(n.a,{href:"/memory",children:"Memory management options"}),"."]}),"\n",(0,s.jsx)(n.admonition,{type:"important",children:(0,s.jsx)(n.p,{children:"Clearing the cache erases your settings.\nIf you want to retain your settings files, create a backup of those files before clearing the cache folder."})}),"\n",(0,s.jsx)(n.h3,{id:"langflow-desktop-says-it-is-running-the-latest-version-but-it-is-actually-behind",children:"Langflow Desktop says it is running the latest version, but it is actually behind"}),"\n",(0,s.jsx)(n.p,{children:"If you are running Langflow Desktop version 1.4.2 or earlier, the UI might incorrectly report that you are on the latest version when a newer version is available."}),"\n",(0,s.jsx)(n.p,{children:"This happens because the automatic update feature in the UI was introduced in version 1.4.2.\nEarlier versions can't automatically detect or apply updates."}),"\n",(0,s.jsxs)(n.p,{children:["To resolve this issue, uninstall Langflow Desktop, and then ",(0,s.jsx)(n.a,{href:"https://langflow.org/desktop",children:"download and install the latest version of Langflow Desktop"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"langflow-uninstall-issues",children:"Langflow uninstall issues"}),"\n",(0,s.jsx)(n.p,{children:"The following issues can occur when uninstalling Langflow."}),"\n",(0,s.jsx)(n.h3,{id:"dot-directory-isnt-deleted-when-uninstalling-langflow-desktop-on-macos",children:"Dot directory isn't deleted when uninstalling Langflow Desktop on macOS"}),"\n",(0,s.jsxs)(n.p,{children:["On macOS, uninstalling Langflow Desktop deletes the ",(0,s.jsx)(n.code,{children:".app"})," file but doesn't delete files in ",(0,s.jsx)(n.code,{children:"~/.langflow"}),", which includes files generated during usage like cache and settings."]}),"\n",(0,s.jsx)(n.p,{children:"If you reinstall Langflow Desktop, it starts with the existing data from the previous installation."}),"\n",(0,s.jsxs)(n.p,{children:["To fully remove a Langflow Desktop macOS installation, you must also delete ",(0,s.jsx)(n.code,{children:"~/.langflow"}),":"]}),"\n",(0,s.jsx)(p.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"rm ",props:{style:{color:"#FFA657"}}},{content:"-rf ",props:{style:{color:"#79C0FF"}}},{content:".langflow",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,s.jsx)(n.h2,{id:"mcp",children:"Langflow MCP issues"}),"\n",(0,s.jsx)(n.p,{children:"The following issues can occur when using Langflow as an MCP server or client."}),"\n",(0,s.jsx)(n.h3,{id:"claude-for-desktop-doesnt-use-mcp-server-tools-correctly",children:"Claude for Desktop doesn't use MCP server tools correctly"}),"\n",(0,s.jsxs)(n.p,{children:["If Claude for Desktop doesn't use your server's tools correctly, try explicitly defining the path to your local ",(0,s.jsx)(n.code,{children:"uvx"})," or ",(0,s.jsx)(n.code,{children:"npx"})," executable file in the ",(0,s.jsx)(n.code,{children:"claude_desktop_config.json"})," configuration file:"]}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["To find your ",(0,s.jsx)(n.code,{children:"uvx"})," path, run ",(0,s.jsx)(n.code,{children:"which uvx"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["To find your ",(0,s.jsx)(n.code,{children:"npx"})," path, run ",(0,s.jsx)(n.code,{children:"which npx"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["In your ",(0,s.jsx)(n.code,{children:"claude_desktop_config.json"})," file, add the path to your Langflow MCP server configuration, as shown in the following examples."]}),"\n",(0,s.jsxs)(i.A,{children:[(0,s.jsx)(a.A,{value:"uvx",label:"uvx",default:!0,children:(0,s.jsx)(p.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"{",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "mcpServers"',props:{style:{color:"#7EE787"}}},{content:": {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "PROJECT_NAME"',props:{style:{color:"#7EE787"}}},{content:": {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "command"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"PATH_TO_UVX"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "args"',props:{style:{color:"#7EE787"}}},{content:": [",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "mcp-proxy"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "http://LANGFLOW_SERVER_ADDRESS/api/v1/mcp/project/PROJECT_ID/sse"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" ]",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" }",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" }",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]}],lang:"json"},annotations:[]}]})}),(0,s.jsx)(a.A,{value:"npx",label:"npx",children:(0,s.jsx)(p.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"{",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "mcpServers"',props:{style:{color:"#7EE787"}}},{content:": {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "PROJECT_NAME"',props:{style:{color:"#7EE787"}}},{content:": {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "command"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"PATH_TO_NPX"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "args"',props:{style:{color:"#7EE787"}}},{content:": [",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "-y"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "supergateway"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "--sse"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "http://LANGFLOW_SERVER_ADDRESS/api/v1/mcp/project/PROJECT_ID/sse"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" ]",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" }",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" }",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]}],lang:"json"},annotations:[]}]})})]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"mcp-browser-based-flows-dont-open-a-browser-on-windows",children:"MCP browser-based flows don't open a browser on Windows"}),"\n",(0,s.jsx)(n.p,{children:"This is a known issue when using MCP Tools with browser navigation actions, such as Playwright, on Windows: The agent can execute the tool successfully but the browser tab or window doesn't open."}),"\n",(0,s.jsx)(n.p,{children:"This issue occurs because the MCP server runs from a Python process, which prevents it from opening browser windows in WSL or Windows."}),"\n",(0,s.jsxs)(n.p,{children:["To work around this issue, use the standalone MCP server approach documented in the ",(0,s.jsx)(n.a,{href:"https://github.com/microsoft/playwright-mcp?tab=readme-ov-file#standalone-mcp-server",children:"Playwright MCP repository"}),".\nAfter the server is up and running, you can add it as an SSE server in Langflow.\nFor other browser navigation tools, see the provider's documentation for specific troubleshooting guidance."]}),"\n",(0,s.jsx)(n.h2,{id:"token-length-limit-errors-in-embedding-model-components",children:"Token length limit errors in Embedding Model components"}),"\n",(0,s.jsxs)(n.p,{children:["Token length errors can happen if your chunking strategy doesn't align with your embedding model's tokenization limits.\nFor more information, see ",(0,s.jsx)(n.a,{href:"/components-processing#chunk-size",children:"Tokenization errors due to chunk size"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"custom-components-and-integrations-issues",children:"Custom components and integrations issues"}),"\n",(0,s.jsx)(n.p,{children:"For troubleshooting advice for a third-party integration, see the information about that integration in the Langflow documentation and the provider's documentation."}),"\n",(0,s.jsxs)(n.p,{children:["If you are building a custom component, see ",(0,s.jsx)(n.a,{href:"/components-custom-components#error-handling-and-logging",children:"Error handling and logging for custom Python components"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"custom-components-not-appearing-in-the-visual-editor",children:"Custom components not appearing in the visual editor"}),"\n",(0,s.jsx)(n.p,{children:"If your custom components are not appearing in the Langflow visual editor, try the following troubleshooting steps:"}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Ensure your components follow the ",(0,s.jsx)(n.a,{href:"https://docs.langflow.org/components-custom-components#directory-structure-requirements",children:"required directory structure"}),"."]}),"\n",(0,s.jsx)(p.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"/your/custom/components/path/ # Base directory set by LANGFLOW_COMPONENTS_PATH",props:{}}]},{tokens:[{content:" \u2514\u2500\u2500 category_name/ # Required category subfolder that determines menu name",props:{}}]},{tokens:[{content:" \u251c\u2500\u2500 __init__.py # Required",props:{}}]},{tokens:[{content:" \u2514\u2500\u2500 custom_component.py # Component file",props:{}}]}],lang:"text"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Verify each category directory includes an ",(0,s.jsx)(n.code,{children:"__init__.py"})," file.\nThis is required for Python to recognize the directory as a module."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Use the command line argument instead of the environment variable for ",(0,s.jsx)(n.code,{children:"LANGFLOW_COMPONENTS_PATH"}),".\nIf you're using the ",(0,s.jsx)(n.code,{children:"LANGFLOW_COMPONENTS_PATH"})," environment variable and components aren't loading, try the ",(0,s.jsx)(n.code,{children:"--components-path"})," command line argument instead:"]}),"\n",(0,s.jsx)(p.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"uv ",props:{style:{color:"#FFA657"}}},{content:"run langflow run ",props:{style:{color:"#A5D6FF"}}},{content:"--components-path ",props:{style:{color:"#79C0FF"}}},{content:"/path/to/your/custom/components",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["If you continue to experience issues, please ",(0,s.jsx)(n.a,{href:"https://github.com/langflow-ai/langflow/issues",children:"report them on GitHub"})," with details about your directory structure and component setup."]}),"\n",(0,s.jsx)(n.h2,{id:"see-also",children:"See also"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"/contributing-github-issues",children:"Langflow GitHub Issues and Discussions"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"/contributing-telemetry",children:"Langflow telemetry"})}),"\n"]})]})}function w(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(m,{...e})}):m(e)}function y(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}}}]); \ No newline at end of file +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[4341],{11470:(e,n,o)=>{o.d(n,{A:()=>j});var t=o(96540),s=o(18215),r=o(23104),l=o(56347),i=o(205),a=o(57485),c=o(31682),d=o(70679);function u(e){return t.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,t.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function h(e){const{values:n,children:o}=e;return(0,t.useMemo)(()=>{const e=n??function(e){return u(e).map(({props:{value:e,label:n,attributes:o,default:t}})=>({value:e,label:n,attributes:o,default:t}))}(o);return function(e){const n=(0,c.XI)(e,(e,n)=>e.value===n.value);if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map(e=>e.value).join(", ")}" found in . Every value needs to be unique.`)}(e),e},[n,o])}function p({value:e,tabValues:n}){return n.some(n=>n.value===e)}function g({queryString:e=!1,groupId:n}){const o=(0,l.W6)(),s=function({queryString:e=!1,groupId:n}){if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:e,groupId:n});return[(0,a.aZ)(s),(0,t.useCallback)(e=>{if(!s)return;const n=new URLSearchParams(o.location.search);n.set(s,e),o.replace({...o.location,search:n.toString()})},[s,o])]}function f(e){const{defaultValue:n,queryString:o=!1,groupId:s}=e,r=h(e),[l,a]=(0,t.useState)(()=>function({defaultValue:e,tabValues:n}){if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(e){if(!p({value:e,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${n.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}const o=n.find(e=>e.default)??n[0];if(!o)throw new Error("Unexpected error: 0 tabValues");return o.value}({defaultValue:n,tabValues:r})),[c,u]=g({queryString:o,groupId:s}),[f,m]=function({groupId:e}){const n=function(e){return e?`docusaurus.tab.${e}`:null}(e),[o,s]=(0,d.Dv)(n);return[o,(0,t.useCallback)(e=>{n&&s.set(e)},[n,s])]}({groupId:s}),w=(()=>{const e=c??f;return p({value:e,tabValues:r})?e:null})();(0,i.A)(()=>{w&&a(w)},[w]);return{selectedValue:l,selectValue:(0,t.useCallback)(e=>{if(!p({value:e,tabValues:r}))throw new Error(`Can't select invalid tab value=${e}`);a(e),u(e),m(e)},[u,m,r]),tabValues:r}}var m=o(92303);const w={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var y=o(74848);function x({className:e,block:n,selectedValue:o,selectValue:t,tabValues:l}){const i=[],{blockElementScrollPositionUntilNextRender:a}=(0,r.a_)(),c=e=>{const n=e.currentTarget,s=i.indexOf(n),r=l[s].value;r!==o&&(a(n),t(r))},d=e=>{let n=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const o=i.indexOf(e.currentTarget)+1;n=i[o]??i[0];break}case"ArrowLeft":{const o=i.indexOf(e.currentTarget)-1;n=i[o]??i[i.length-1];break}}n?.focus()};return(0,y.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.A)("tabs",{"tabs--block":n},e),children:l.map(({value:e,label:n,attributes:t})=>(0,y.jsx)("li",{role:"tab",tabIndex:o===e?0:-1,"aria-selected":o===e,ref:e=>{i.push(e)},onKeyDown:d,onClick:c,...t,className:(0,s.A)("tabs__item",w.tabItem,t?.className,{"tabs__item--active":o===e}),children:n??e},e))})}function v({lazy:e,children:n,selectedValue:o}){const r=(Array.isArray(n)?n:[n]).filter(Boolean);if(e){const e=r.find(e=>e.props.value===o);return e?(0,t.cloneElement)(e,{className:(0,s.A)("margin-top--md",e.props.className)}):null}return(0,y.jsx)("div",{className:"margin-top--md",children:r.map((e,n)=>(0,t.cloneElement)(e,{key:n,hidden:e.props.value!==o}))})}function b(e){const n=f(e);return(0,y.jsxs)("div",{className:(0,s.A)("tabs-container",w.tabList),children:[(0,y.jsx)(x,{...n,...e}),(0,y.jsx)(v,{...n,...e})]})}function j(e){const n=(0,m.A)();return(0,y.jsx)(b,{...e,children:u(e.children)},String(n))}},17886:(e,n,o)=>{o.d(n,{A:()=>r});o(96540);var t=o(64058),s=o(74848);function r({name:e,...n}){const o=t[e];return o?(0,s.jsx)(o,{...n}):null}},19365:(e,n,o)=>{o.d(n,{A:()=>l});o(96540);var t=o(18215);const s={tabItem:"tabItem_Ymn6"};var r=o(74848);function l({children:e,hidden:n,className:o}){return(0,r.jsx)("div",{role:"tabpanel",className:(0,t.A)(s.tabItem,o),hidden:n,children:e})}},91724:(e,n,o)=>{o.r(n),o.d(n,{CH:()=>p,assets:()=>h,chCodeConfig:()=>g,contentTitle:()=>u,default:()=>w,frontMatter:()=>d,metadata:()=>t,toc:()=>f});const t=JSON.parse('{"id":"Support/troubleshooting","title":"Troubleshoot Langflow","description":"This page provides troubleshooting advice for issues you might encounter when using Langflow or contributing to Langflow.","source":"@site/docs/Support/troubleshooting.mdx","sourceDirName":"Support","slug":"/troubleshoot","permalink":"/troubleshoot","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Troubleshoot Langflow","slug":"/troubleshoot"},"sidebar":"docs","previous":{"title":"Release notes","permalink":"/release-notes"},"next":{"title":"Get help and request enhancements","permalink":"/contributing-github-issues"}}');var s=o(74848),r=o(28453),l=o(24754),i=o(11470),a=o(19365),c=o(17886);const d={title:"Troubleshoot Langflow",slug:"/troubleshoot"},u=void 0,h={},p={annotations:l.hk,Code:l.Cy},g={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},f=[{value:"Missing components",id:"missing-components",level:2},{value:"No input in the Playground",id:"no-input-in-the-playground",level:2},{value:"Missing key, no key found, or invalid API key",id:"missing-key-no-key-found-or-invalid-api-key",level:2},{value:"Langflow installation issues",id:"langflow-installation-issues",level:2},{value:"Langflow installation freezes at pip dependency resolution",id:"langflow-installation-freezes-at-pip-dependency-resolution",level:3},{value:"Linux installation fails to build required package",id:"linux-installation-fails-to-build-required-package",level:3},{value:"Installation failure from webrtcvad package",id:"installation-failure-from-webrtcvad-package",level:3},{value:"C++ build tools required for Langflow Desktop on Windows",id:"c-build-tools-required-for-langflow-desktop-on-windows",level:3},{value:"Langflow startup issues",id:"langflow-startup-issues",level:2},{value:"No langflow.__main__ module",id:"no-langflow__main__-module",level:3},{value:"Langflow runTraceback",id:"langflow-runtraceback",level:3},{value:"Environment variables not available from terminal",id:"environment-variables-not-available-from-terminal",level:3},{value:"Access Langflow Desktop startup logs",id:"access-langflow-desktop-startup-logs",level:3},{value:"User not found or inactive when running multiple flows",id:"user-not-found-or-inactive-when-running-multiple-flows",level:3},{value:"Package is not installed",id:"package-is-not-installed",level:3},{value:"Langflow upgrade issues",id:"langflow-upgrade-issues",level:2},{value:"Something went wrong running migrations",id:"something-went-wrong-running-migrations",level:3},{value:"Langflow Desktop says it is running the latest version, but it is actually behind",id:"langflow-desktop-says-it-is-running-the-latest-version-but-it-is-actually-behind",level:3},{value:"Langflow uninstall issues",id:"langflow-uninstall-issues",level:2},{value:"Dot directory isn't deleted when uninstalling Langflow Desktop on macOS",id:"dot-directory-isnt-deleted-when-uninstalling-langflow-desktop-on-macos",level:3},{value:"Langflow MCP issues",id:"mcp",level:2},{value:"Claude for Desktop doesn't use MCP server tools correctly",id:"claude-for-desktop-doesnt-use-mcp-server-tools-correctly",level:3},{value:"MCP browser-based flows don't open a browser on Windows",id:"mcp-browser-based-flows-dont-open-a-browser-on-windows",level:3},{value:"Token length limit errors in Embedding Model components",id:"token-length-limit-errors-in-embedding-model-components",level:2},{value:"Custom components and integrations issues",id:"custom-components-and-integrations-issues",level:2},{value:"Custom components not appearing in the visual editor",id:"custom-components-not-appearing-in-the-visual-editor",level:3},{value:"See also",id:"see-also",level:2}];function m(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return p||y("CH",!1),p.Code||y("CH.Code",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n","\n",(0,s.jsx)(n.p,{children:"This page provides troubleshooting advice for issues you might encounter when using Langflow or contributing to Langflow."}),"\n",(0,s.jsx)(n.h2,{id:"missing-components",children:"Missing components"}),"\n",(0,s.jsx)(n.p,{children:"As Langflow development continues, components are often recategorized or deprecated for better alignment or to prepare for new components."}),"\n",(0,s.jsxs)(n.p,{children:["If a component appears to be missing from the ",(0,s.jsx)(c.A,{name:"Component","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Core components"})," and menus, try the following:"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(c.A,{name:"Search","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Search"})," for the component."]}),"\n",(0,s.jsxs)(n.li,{children:["Check other component categories and ",(0,s.jsx)(c.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(n.a,{href:"/components-bundle-components",children:(0,s.jsx)(n.strong,{children:"Bundles"})}),"."]}),"\n",(0,s.jsxs)(n.li,{children:["Check ",(0,s.jsx)(n.a,{href:"/concepts-components#legacy-components",children:"legacy components"}),", which are hidden by default."]}),"\n",(0,s.jsxs)(n.li,{children:["Check the ",(0,s.jsx)(n.a,{href:"https://github.com/langflow-ai/langflow/releases/latest",children:"Changelog"})," for component changes in recent releases."]}),"\n",(0,s.jsx)(n.li,{children:"Make sure the component isn't already present in your flow if it is a single-use component."}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["If you still cannot locate the component, see ",(0,s.jsx)(n.a,{href:"/contributing-github-issues",children:"Langflow GitHub Issues and Discussions"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"no-input-in-the-playground",children:"No input in the Playground"}),"\n",(0,s.jsxs)(n.p,{children:["If there is no message input field in the ",(0,s.jsx)(n.strong,{children:"Playground"}),", make sure your flow has a ",(0,s.jsxs)(n.a,{href:"/components-io#chat-io",children:[(0,s.jsx)(n.strong,{children:"Chat Input"})," component"]})," that is connected, directly or indirectly, to the ",(0,s.jsx)(n.strong,{children:"Input"})," port of a ",(0,s.jsx)(n.strong,{children:"Language Model"})," or ",(0,s.jsx)(n.strong,{children:"Agent"})," component."]}),"\n",(0,s.jsxs)(n.p,{children:["Because the ",(0,s.jsx)(n.strong,{children:"Playground"})," is designed for flows that use an LLM in a query-and-response format, such as chatbots and agents, a flow must have ",(0,s.jsx)(n.strong,{children:"Chat Input"}),", ",(0,s.jsx)(n.strong,{children:"Language Model"}),"/",(0,s.jsx)(n.strong,{children:"Agent"}),", and ",(0,s.jsx)(n.strong,{children:"Chat Output"})," components to be fully supported by the ",(0,s.jsx)(n.strong,{children:"Playground"})," chat interface."]}),"\n",(0,s.jsxs)(n.p,{children:["For more information, see ",(0,s.jsx)(n.a,{href:"/concepts-playground",children:"Test flows in the Playground"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"missing-key-no-key-found-or-invalid-api-key",children:"Missing key, no key found, or invalid API key"}),"\n",(0,s.jsx)(n.p,{children:"If you get an API key error when running a flow, try the following:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["For all components that require credentials, make sure those components have a valid credential in the component's settings, such as the ",(0,s.jsx)(n.strong,{children:"API Key"})," field."]}),"\n",(0,s.jsxs)(n.li,{children:["If you store your credentials in ",(0,s.jsx)(n.a,{href:"/configuration-global-variables",children:"Langflow global variables"}),", make sure you selected the correct global variable and that the variable contains a valid credential."]}),"\n",(0,s.jsx)(n.li,{children:"Make sure the provided credentials are active, have the required permissions, and, if applicable, have sufficient funds in the account to execute the required action. For example, model providers require credits to use their LLMs."}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"langflow-installation-issues",children:"Langflow installation issues"}),"\n",(0,s.jsx)(n.p,{children:"The following issues can occur when installing Langflow."}),"\n",(0,s.jsx)(n.h3,{id:"langflow-installation-freezes-at-pip-dependency-resolution",children:"Langflow installation freezes at pip dependency resolution"}),"\n",(0,s.jsxs)(n.p,{children:["Installing Langflow OSS with ",(0,s.jsx)(n.code,{children:"pip install langflow"})," slowly fails with this error message:"]}),"\n",(0,s.jsx)(p.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"pip is looking at multiple versions of <> to determine which version is compatible with other requirements. This could take a while.",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,s.jsxs)(n.p,{children:["To work around this issue, install Langflow with ",(0,s.jsx)(n.code,{children:"uv"})," instead of ",(0,s.jsx)(n.code,{children:"pip"}),", as explained in ",(0,s.jsx)(n.a,{href:"/get-started-installation#install-and-run-the-langflow-oss-python-package",children:"Install and run the Langflow OSS Python package"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"linux-installation-fails-to-build-required-package",children:"Linux installation fails to build required package"}),"\n",(0,s.jsx)(n.p,{children:"When you try to install Langflow OSS on Linux, installation fails because of outdated or missing packages:"}),"\n",(0,s.jsx)(p.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"Resolved ",props:{style:{color:"#FFA657"}}},{content:"455 ",props:{style:{color:"#79C0FF"}}},{content:"packages in ",props:{style:{color:"#A5D6FF"}}},{content:"18.92s",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" \xd7 ",props:{style:{color:"#FFA657"}}},{content:"Failed to build `",props:{style:{color:"#A5D6FF"}}},{content:"webrtcvad",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"=",props:{style:{color:"#A5D6FF"}}},{content:"2.0.10",props:{style:{color:"#79C0FF"}}},{content:"`",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" \u251c\u2500\u25b6",props:{style:{color:"#FFA657"}}},{content:" The build backend returned an error",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" \u2570\u2500\u25b6",props:{style:{color:"#FFA657"}}},{content:" Call to `setuptools.build_meta:__legacy__.build_wheel` ",props:{style:{color:"#A5D6FF"}}},{content:"failed",props:{style:{color:"#FFA657"}}},{content:" (exit status: ",props:{style:{color:"#A5D6FF"}}},{content:"1",props:{style:{color:"#79C0FF"}}},{content:")",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,s.jsx)(n.p,{children:"To resolve this error, install the required build dependencies, and then retry the Langflow installation:"}),"\n",(0,s.jsx)(p.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"sudo ",props:{style:{color:"#FFA657"}}},{content:"apt-get update",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"sudo ",props:{style:{color:"#FFA657"}}},{content:"apt-get install build-essential python3-dev",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,s.jsxs)(n.p,{children:["If upgrading your packages doesn't fix the issue, install ",(0,s.jsx)(n.code,{children:"gcc"})," separately, and then retry the Langflow installation:"]}),"\n",(0,s.jsx)(p.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"sudo ",props:{style:{color:"#FFA657"}}},{content:"apt-get install gcc",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,s.jsxs)(n.h3,{id:"installation-failure-from-webrtcvad-package",children:["Installation failure from ",(0,s.jsx)(n.code,{children:"webrtcvad"})," package"]}),"\n",(0,s.jsxs)(n.p,{children:["If you experience an error from the ",(0,s.jsx)(n.code,{children:"webrtcvad"})," package, run ",(0,s.jsx)(n.code,{children:"uv pip install webrtcvad-wheels"})," in your virtual environment, and then retry the Langflow installation."]}),"\n",(0,s.jsx)(n.h3,{id:"c-build-tools-required-for-langflow-desktop-on-windows",children:"C++ build tools required for Langflow Desktop on Windows"}),"\n",(0,s.jsxs)(n.p,{children:["Microsoft Windows installations of Langflow Desktop require a C++ compiler that may not be present on your system. If you receive a ",(0,s.jsx)(n.code,{children:"C++ Build Tools Required!"})," error, follow the on-screen prompt to install Microsoft C++ Build Tools, or ",(0,s.jsx)(n.a,{href:"https://visualstudio.microsoft.com/downloads/",children:"install Microsoft Visual Studio"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"langflow-startup-issues",children:"Langflow startup issues"}),"\n",(0,s.jsx)(n.p,{children:"The following issues can occur when attempting to start Langflow."}),"\n",(0,s.jsxs)(n.h3,{id:"no-langflow__main__-module",children:["No ",(0,s.jsx)(n.code,{children:"langflow.__main__"})," module"]}),"\n",(0,s.jsxs)(n.p,{children:["When you try to run Langflow with the command ",(0,s.jsx)(n.code,{children:"langflow run"}),", you encounter the following error:"]}),"\n",(0,s.jsx)(p.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:">",props:{style:{color:"#FF7B72"}}},{content:" No module named ",props:{style:{color:"#C9D1D9"}}},{content:"'langflow.__main__'",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,s.jsx)(n.p,{children:"To resolve this issue, try the following:"}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["Run ",(0,s.jsx)(n.code,{children:"uv run langflow run"})," instead of ",(0,s.jsx)(n.code,{children:"langflow run"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:["If that doesn't work, reinstall the latest Langflow version with ",(0,s.jsx)(n.code,{children:"uv pip install langflow -U"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:["If that doesn't work, reinstall Langflow and its dependencies with ",(0,s.jsx)(n.code,{children:"uv pip install langflow --pre -U --force-reinstall"}),"."]}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"langflow-runtraceback",children:"Langflow runTraceback"}),"\n",(0,s.jsxs)(n.p,{children:["When you try to run Langflow using the command ",(0,s.jsx)(n.code,{children:"langflow run"}),", you encounter the following error:"]}),"\n",(0,s.jsx)(p.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:">",props:{style:{color:"#FF7B72"}}},{content:" langflow runTraceback (",props:{style:{color:"#C9D1D9"}}},{content:"most ",props:{style:{color:"#FFA657"}}},{content:"recent call last",props:{style:{color:"#A5D6FF"}}},{content:"): File ",props:{style:{color:"#C9D1D9"}}},{content:'".../langflow"',props:{style:{color:"#A5D6FF"}}},{content:", line 5, ",props:{style:{color:"#C9D1D9"}}},{content:"in <",props:{style:{color:"#FF7B72"}}},{content:"module",props:{style:{color:"#C9D1D9"}}},{content:">",props:{style:{color:"#FF7B72"}}},{content:" from langflow.__main__ import mainModuleNotFoundError: No module named ",props:{style:{color:"#C9D1D9"}}},{content:"'langflow.__main__'",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,s.jsx)(n.p,{children:"There are two possible reasons for this error:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Multiple Langflow installations"}),": You installed Langflow using ",(0,s.jsx)(n.code,{children:"pip install langflow"})," but you already had a previous version of Langflow installed in your system. In this case, you might be running the wrong executable."]}),"\n",(0,s.jsxs)(n.p,{children:["To solve this issue, run the correct executable by running ",(0,s.jsx)(n.code,{children:"python -m langflow run"})," instead of ",(0,s.jsx)(n.code,{children:"langflow run"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["If that doesn't work, try uninstalling and reinstalling Langflow with ",(0,s.jsx)(n.code,{children:"uv pip install langflow --pre -U"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Version conflict during installation"}),": Some version conflicts might have occurred during the installation process. To resolve this issue, reinstall Langflow and its dependencies by running ",(0,s.jsx)(n.code,{children:"python -m pip install langflow --pre -U --force-reinstall"}),"."]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"environment-variables-not-available-from-terminal",children:"Environment variables not available from terminal"}),"\n",(0,s.jsxs)(n.p,{children:["Environment variables set in your terminal aren't automatically available to GUI-based applications like Langflow Desktop when launched through the Finder or the Start Menu.\nTo set environment variables for Langflow Desktop, see ",(0,s.jsx)(n.a,{href:"/environment-variables#set-environment-variables-for-langflow-desktop",children:"Set environment variables for Langflow Desktop"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"access-langflow-desktop-startup-logs",children:"Access Langflow Desktop startup logs"}),"\n",(0,s.jsxs)(n.p,{children:["If you encounter issues with Langflow Desktop, you might need to ",(0,s.jsx)(n.a,{href:"/logging#desktop-logs",children:"access Langflow Desktop startup logs"})," for debugging."]}),"\n",(0,s.jsx)(n.h3,{id:"user-not-found-or-inactive-when-running-multiple-flows",children:"User not found or inactive when running multiple flows"}),"\n",(0,s.jsxs)(n.p,{children:["When running multiple local Langflow OSS instances on different ports, such as ",(0,s.jsx)(n.code,{children:"localhost:7860"})," and ",(0,s.jsx)(n.code,{children:"localhost:7861"}),", you might see authentication errors in the logs.\nFor example:"]}),"\n",(0,s.jsx)(p.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"[07/22/25 10:57:07] INFO 2025-07-22 10:57:07 - INFO - utils - User not found or inactive.",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,s.jsx)(n.p,{children:"To resolve this error, use separate browser instances or browser profiles to access each Langflow instance."}),"\n",(0,s.jsx)(n.h3,{id:"package-is-not-installed",children:"Package is not installed"}),"\n",(0,s.jsx)(n.p,{children:"In Langflow OSS, you can follow the error message's instructions to install the missing dependency."}),"\n",(0,s.jsxs)(n.p,{children:["To manage dependencies in Langflow Desktop, see ",(0,s.jsx)(n.a,{href:"/install-custom-dependencies#langflow-desktop",children:"Install custom dependencies in Langflow Desktop"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"langflow-upgrade-issues",children:"Langflow upgrade issues"}),"\n",(0,s.jsx)(n.p,{children:"The following issues can occur when upgrading your Langflow version."}),"\n",(0,s.jsxs)(n.p,{children:["For information about managing Langflow versions, see ",(0,s.jsx)(n.a,{href:"/get-started-installation",children:"Install Langflow"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"something-went-wrong-running-migrations",children:"Something went wrong running migrations"}),"\n",(0,s.jsxs)(n.p,{children:["The following error can occur during Langflow upgrades when the new version can't override ",(0,s.jsx)(n.code,{children:"langflow-pre.db"})," in the Langflow cache folder:"]}),"\n",(0,s.jsx)(p.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:">",props:{style:{color:"#FF7B72"}}},{content:" Something went wrong running migrations. Please, run ",props:{style:{color:"#C9D1D9"}}},{content:"'langflow migration --fix'",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,s.jsxs)(n.p,{children:["To resolve this error, clear the cache by deleting the contents of your Langflow cache folder.\nThe filepath depends on your operating system, installation type, and configuration options.\nFor more information and default filepaths, see ",(0,s.jsx)(n.a,{href:"/memory",children:"Memory management options"}),"."]}),"\n",(0,s.jsx)(n.admonition,{type:"danger",children:(0,s.jsx)(n.p,{children:"Clearing the cache erases your settings.\nIf you want to retain your settings files, create a backup of those files before clearing the cache folder."})}),"\n",(0,s.jsx)(n.h3,{id:"langflow-desktop-says-it-is-running-the-latest-version-but-it-is-actually-behind",children:"Langflow Desktop says it is running the latest version, but it is actually behind"}),"\n",(0,s.jsx)(n.p,{children:"If you are running Langflow Desktop version 1.4.2 or earlier, the UI might incorrectly report that you are on the latest version when a newer version is available."}),"\n",(0,s.jsx)(n.p,{children:"This happens because the automatic update feature in the UI was introduced in version 1.4.2.\nEarlier versions can't automatically detect or apply updates."}),"\n",(0,s.jsxs)(n.p,{children:["To resolve this issue, uninstall Langflow Desktop, and then ",(0,s.jsx)(n.a,{href:"https://langflow.org/desktop",children:"download and install the latest version of Langflow Desktop"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"langflow-uninstall-issues",children:"Langflow uninstall issues"}),"\n",(0,s.jsx)(n.p,{children:"The following issues can occur when uninstalling Langflow."}),"\n",(0,s.jsx)(n.h3,{id:"dot-directory-isnt-deleted-when-uninstalling-langflow-desktop-on-macos",children:"Dot directory isn't deleted when uninstalling Langflow Desktop on macOS"}),"\n",(0,s.jsxs)(n.p,{children:["On macOS, uninstalling Langflow Desktop deletes the ",(0,s.jsx)(n.code,{children:".app"})," file but doesn't delete files in ",(0,s.jsx)(n.code,{children:"~/.langflow"}),", which includes files generated during usage like cache and settings."]}),"\n",(0,s.jsx)(n.p,{children:"If you reinstall Langflow Desktop, it starts with the existing data from the previous installation."}),"\n",(0,s.jsxs)(n.p,{children:["To fully remove a Langflow Desktop macOS installation, you must also delete ",(0,s.jsx)(n.code,{children:"~/.langflow"}),":"]}),"\n",(0,s.jsx)(p.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"rm ",props:{style:{color:"#FFA657"}}},{content:"-rf ",props:{style:{color:"#79C0FF"}}},{content:".langflow",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,s.jsx)(n.h2,{id:"mcp",children:"Langflow MCP issues"}),"\n",(0,s.jsx)(n.p,{children:"The following issues can occur when using Langflow as an MCP server or client."}),"\n",(0,s.jsx)(n.h3,{id:"claude-for-desktop-doesnt-use-mcp-server-tools-correctly",children:"Claude for Desktop doesn't use MCP server tools correctly"}),"\n",(0,s.jsxs)(n.p,{children:["If Claude for Desktop doesn't use your server's tools correctly, try explicitly defining the path to your local ",(0,s.jsx)(n.code,{children:"uvx"})," or ",(0,s.jsx)(n.code,{children:"npx"})," executable file in the ",(0,s.jsx)(n.code,{children:"claude_desktop_config.json"})," configuration file:"]}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["To find your ",(0,s.jsx)(n.code,{children:"uvx"})," path, run ",(0,s.jsx)(n.code,{children:"which uvx"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["To find your ",(0,s.jsx)(n.code,{children:"npx"})," path, run ",(0,s.jsx)(n.code,{children:"which npx"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["In your ",(0,s.jsx)(n.code,{children:"claude_desktop_config.json"})," file, add the path to your Langflow MCP server configuration, as shown in the following examples."]}),"\n",(0,s.jsxs)(i.A,{children:[(0,s.jsx)(a.A,{value:"uvx",label:"uvx",default:!0,children:(0,s.jsx)(p.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"{",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "mcpServers"',props:{style:{color:"#7EE787"}}},{content:": {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "PROJECT_NAME"',props:{style:{color:"#7EE787"}}},{content:": {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "command"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"PATH_TO_UVX"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "args"',props:{style:{color:"#7EE787"}}},{content:": [",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "mcp-proxy"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "http://LANGFLOW_SERVER_ADDRESS/api/v1/mcp/project/PROJECT_ID/sse"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" ]",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" }",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" }",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]}],lang:"json"},annotations:[]}]})}),(0,s.jsx)(a.A,{value:"npx",label:"npx",children:(0,s.jsx)(p.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"{",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "mcpServers"',props:{style:{color:"#7EE787"}}},{content:": {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "PROJECT_NAME"',props:{style:{color:"#7EE787"}}},{content:": {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "command"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"PATH_TO_NPX"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "args"',props:{style:{color:"#7EE787"}}},{content:": [",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "-y"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "supergateway"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "--sse"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "http://LANGFLOW_SERVER_ADDRESS/api/v1/mcp/project/PROJECT_ID/sse"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" ]",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" }",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" }",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]}],lang:"json"},annotations:[]}]})})]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"mcp-browser-based-flows-dont-open-a-browser-on-windows",children:"MCP browser-based flows don't open a browser on Windows"}),"\n",(0,s.jsx)(n.p,{children:"This is a known issue when using MCP Tools with browser navigation actions, such as Playwright, on Windows: The agent can execute the tool successfully but the browser tab or window doesn't open."}),"\n",(0,s.jsx)(n.p,{children:"This issue occurs because the MCP server runs from a Python process, which prevents it from opening browser windows in WSL or Windows."}),"\n",(0,s.jsxs)(n.p,{children:["To work around this issue, use the standalone MCP server approach documented in the ",(0,s.jsx)(n.a,{href:"https://github.com/microsoft/playwright-mcp?tab=readme-ov-file#standalone-mcp-server",children:"Playwright MCP repository"}),".\nAfter the server is up and running, you can add it as an SSE server in Langflow.\nFor other browser navigation tools, see the provider's documentation for specific troubleshooting guidance."]}),"\n",(0,s.jsx)(n.h2,{id:"token-length-limit-errors-in-embedding-model-components",children:"Token length limit errors in Embedding Model components"}),"\n",(0,s.jsxs)(n.p,{children:["Token length errors can happen if your chunking strategy doesn't align with your embedding model's tokenization limits.\nFor more information, see ",(0,s.jsx)(n.a,{href:"/components-processing#chunk-size",children:"Tokenization errors due to chunk size"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"custom-components-and-integrations-issues",children:"Custom components and integrations issues"}),"\n",(0,s.jsx)(n.p,{children:"For troubleshooting advice for a third-party integration, see the information about that integration in the Langflow documentation and the provider's documentation."}),"\n",(0,s.jsxs)(n.p,{children:["If you are building a custom component, see ",(0,s.jsx)(n.a,{href:"/components-custom-components#error-handling-and-logging",children:"Error handling and logging for custom Python components"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"custom-components-not-appearing-in-the-visual-editor",children:"Custom components not appearing in the visual editor"}),"\n",(0,s.jsx)(n.p,{children:"If your custom components are not appearing in the Langflow visual editor, try the following troubleshooting steps:"}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Ensure your components follow the ",(0,s.jsx)(n.a,{href:"https://docs.langflow.org/components-custom-components#directory-structure-requirements",children:"required directory structure"}),"."]}),"\n",(0,s.jsx)(p.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"/your/custom/components/path/ # Base directory set by LANGFLOW_COMPONENTS_PATH",props:{}}]},{tokens:[{content:" \u2514\u2500\u2500 category_name/ # Required category subfolder that determines menu name",props:{}}]},{tokens:[{content:" \u251c\u2500\u2500 __init__.py # Required",props:{}}]},{tokens:[{content:" \u2514\u2500\u2500 custom_component.py # Component file",props:{}}]}],lang:"text"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Verify each category directory includes an ",(0,s.jsx)(n.code,{children:"__init__.py"})," file.\nThis is required for Python to recognize the directory as a module."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Use the command line argument instead of the environment variable for ",(0,s.jsx)(n.code,{children:"LANGFLOW_COMPONENTS_PATH"}),".\nIf you're using the ",(0,s.jsx)(n.code,{children:"LANGFLOW_COMPONENTS_PATH"})," environment variable and components aren't loading, try the ",(0,s.jsx)(n.code,{children:"--components-path"})," command line argument instead:"]}),"\n",(0,s.jsx)(p.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"uv ",props:{style:{color:"#FFA657"}}},{content:"run langflow run ",props:{style:{color:"#A5D6FF"}}},{content:"--components-path ",props:{style:{color:"#79C0FF"}}},{content:"/path/to/your/custom/components",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["If you continue to experience issues, please ",(0,s.jsx)(n.a,{href:"https://github.com/langflow-ai/langflow/issues",children:"report them on GitHub"})," with details about your directory structure and component setup."]}),"\n",(0,s.jsx)(n.h2,{id:"see-also",children:"See also"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"/contributing-github-issues",children:"Langflow GitHub Issues and Discussions"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"/contributing-telemetry",children:"Langflow telemetry"})}),"\n"]})]})}function w(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(m,{...e})}):m(e)}function y(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}}}]); \ No newline at end of file diff --git a/assets/js/e3230154.1666eb9f.js b/assets/js/e3230154.07df2314.js similarity index 81% rename from assets/js/e3230154.1666eb9f.js rename to assets/js/e3230154.07df2314.js index 91988cd60f..3cea23935a 100644 --- a/assets/js/e3230154.1666eb9f.js +++ b/assets/js/e3230154.07df2314.js @@ -1 +1 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[9648],{4595:(e,n,t)=>{t.d(n,{A:()=>s});const s=t.p+"assets/images/mcp-server-tools-ddc0f1dc04109b9f3daf6a2f380073c4.png"},11470:(e,n,t)=>{t.d(n,{A:()=>b});var s=t(96540),o=t(18215),r=t(23104),l=t(56347),i=t(205),c=t(57485),a=t(31682),d=t(70679);function h(e){return s.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,s.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function u(e){const{values:n,children:t}=e;return(0,s.useMemo)(()=>{const e=n??function(e){return h(e).map(({props:{value:e,label:n,attributes:t,default:s}})=>({value:e,label:n,attributes:t,default:s}))}(t);return function(e){const n=(0,a.XI)(e,(e,n)=>e.value===n.value);if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map(e=>e.value).join(", ")}" found in . Every value needs to be unique.`)}(e),e},[n,t])}function p({value:e,tabValues:n}){return n.some(n=>n.value===e)}function x({queryString:e=!1,groupId:n}){const t=(0,l.W6)(),o=function({queryString:e=!1,groupId:n}){if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:e,groupId:n});return[(0,c.aZ)(o),(0,s.useCallback)(e=>{if(!o)return;const n=new URLSearchParams(t.location.search);n.set(o,e),t.replace({...t.location,search:n.toString()})},[o,t])]}function j(e){const{defaultValue:n,queryString:t=!1,groupId:o}=e,r=u(e),[l,c]=(0,s.useState)(()=>function({defaultValue:e,tabValues:n}){if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(e){if(!p({value:e,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${n.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}const t=n.find(e=>e.default)??n[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:n,tabValues:r})),[a,h]=x({queryString:t,groupId:o}),[j,f]=function({groupId:e}){const n=function(e){return e?`docusaurus.tab.${e}`:null}(e),[t,o]=(0,d.Dv)(n);return[t,(0,s.useCallback)(e=>{n&&o.set(e)},[n,o])]}({groupId:o}),g=(()=>{const e=a??j;return p({value:e,tabValues:r})?e:null})();(0,i.A)(()=>{g&&c(g)},[g]);return{selectedValue:l,selectValue:(0,s.useCallback)(e=>{if(!p({value:e,tabValues:r}))throw new Error(`Can't select invalid tab value=${e}`);c(e),h(e),f(e)},[h,f,r]),tabValues:r}}var f=t(92303);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var m=t(74848);function v({className:e,block:n,selectedValue:t,selectValue:s,tabValues:l}){const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,r.a_)(),a=e=>{const n=e.currentTarget,o=i.indexOf(n),r=l[o].value;r!==t&&(c(n),s(r))},d=e=>{let n=null;switch(e.key){case"Enter":a(e);break;case"ArrowRight":{const t=i.indexOf(e.currentTarget)+1;n=i[t]??i[0];break}case"ArrowLeft":{const t=i.indexOf(e.currentTarget)-1;n=i[t]??i[i.length-1];break}}n?.focus()};return(0,m.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.A)("tabs",{"tabs--block":n},e),children:l.map(({value:e,label:n,attributes:s})=>(0,m.jsx)("li",{role:"tab",tabIndex:t===e?0:-1,"aria-selected":t===e,ref:e=>{i.push(e)},onKeyDown:d,onClick:a,...s,className:(0,o.A)("tabs__item",g.tabItem,s?.className,{"tabs__item--active":t===e}),children:n??e},e))})}function y({lazy:e,children:n,selectedValue:t}){const r=(Array.isArray(n)?n:[n]).filter(Boolean);if(e){const e=r.find(e=>e.props.value===t);return e?(0,s.cloneElement)(e,{className:(0,o.A)("margin-top--md",e.props.className)}):null}return(0,m.jsx)("div",{className:"margin-top--md",children:r.map((e,n)=>(0,s.cloneElement)(e,{key:n,hidden:e.props.value!==t}))})}function C(e){const n=j(e);return(0,m.jsxs)("div",{className:(0,o.A)("tabs-container",g.tabList),children:[(0,m.jsx)(v,{...n,...e}),(0,m.jsx)(y,{...n,...e})]})}function b(e){const n=(0,f.A)();return(0,m.jsx)(C,{...e,children:h(e.children)},String(n))}},17886:(e,n,t)=>{t.d(n,{A:()=>r});t(96540);var s=t(64058),o=t(74848);function r({name:e,...n}){const t=s[e];return t?(0,o.jsx)(t,{...n}):null}},19365:(e,n,t)=>{t.d(n,{A:()=>l});t(96540);var s=t(18215);const o={tabItem:"tabItem_Ymn6"};var r=t(74848);function l({children:e,hidden:n,className:t}){return(0,r.jsx)("div",{role:"tabpanel",className:(0,s.A)(o.tabItem,t),hidden:n,children:e})}},67577:(e,n,t)=>{t.d(n,{A:()=>s});const s=t.p+"assets/images/mcp-server-53850e4ac7599dec00dd7d01922ba79f.png"},93403:(e,n,t)=>{t.r(n),t.d(n,{CH:()=>p,assets:()=>u,chCodeConfig:()=>x,contentTitle:()=>h,default:()=>g,frontMatter:()=>d,metadata:()=>s,toc:()=>j});const s=JSON.parse('{"id":"Concepts/mcp-server","title":"Use Langflow as an MCP server","description":"Langflow integrates with the Model Context Protocol (MCP) as both an MCP server and an MCP client.","source":"@site/docs/Concepts/mcp-server.mdx","sourceDirName":"Concepts","slug":"/mcp-server","permalink":"/mcp-server","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Use Langflow as an MCP server","slug":"/mcp-server"},"sidebar":"docs","previous":{"title":"Use Langflow as an MCP client","permalink":"/mcp-client"},"next":{"title":"Connect an Astra DB MCP server to Langflow","permalink":"/mcp-component-astra"}}');var o=t(74848),r=t(28453),l=t(24754),i=t(11470),c=t(19365),a=t(17886);const d={title:"Use Langflow as an MCP server",slug:"/mcp-server"},h=void 0,u={},p={annotations:l.hk,Code:l.Cy},x={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},j=[{value:"Prerequisites",id:"prerequisites",level:2},{value:"Serve flows as MCP tools",id:"select-flows-to-serve",level:2},{value:"Edit flow tool names and descriptions",id:"edit-flow-tool-names-and-descriptions",level:3},{value:"Importance of tool names and descriptions",id:"importance-of-tool-names-and-descriptions",level:4},{value:"Connect clients to your Langflow MCP server",id:"connect-clients-to-use-the-servers-actions",level:2},{value:"MCP server authentication",id:"authentication",level:2},{value:"MCP server environment variables",id:"mcp-server-environment-variables",level:2},{value:"Deploy your Langflow MCP server externally",id:"deploy-your-server-externally",level:3},{value:"Use MCP Inspector to test and debug flows",id:"test-and-debug-flows",level:2},{value:"Troubleshoot Langflow MCP servers",id:"troubleshooting-mcp-server",level:2},{value:"See also",id:"see-also",level:2}];function f(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",h4:"h4",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,r.R)(),...e.components},{Details:s}=n;return p||m("CH",!1),p.Code||m("CH.Code",!0),s||m("Details",!0),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n","\n",(0,o.jsxs)(n.p,{children:["Langflow integrates with the ",(0,o.jsx)(n.a,{href:"https://modelcontextprotocol.io/introduction",children:"Model Context Protocol (MCP)"})," as both an MCP server and an MCP client."]}),"\n",(0,o.jsxs)(n.p,{children:["This page describes how to use Langflow as an MCP server that exposes your flows as ",(0,o.jsx)(n.a,{href:"https://modelcontextprotocol.io/docs/concepts/tools",children:"tools"})," that ",(0,o.jsx)(n.a,{href:"https://modelcontextprotocol.io/clients",children:"MCP clients"})," can use when generating responses."]}),"\n",(0,o.jsxs)(n.p,{children:["For information about using Langflow as an MCP client and managing MCP server connections within flows, see ",(0,o.jsx)(n.a,{href:"/mcp-client",children:"Use Langflow as an MCP client"}),"."]}),"\n",(0,o.jsx)(n.h2,{id:"prerequisites",children:"Prerequisites"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["A ",(0,o.jsx)(n.a,{href:"/concepts-flows#projects",children:"Langflow project"})," with at least one flow that has a ",(0,o.jsxs)(n.a,{href:"/components-io#chat-output",children:[(0,o.jsx)(n.strong,{children:"Chat Output"})," component"]}),"."]}),"\n",(0,o.jsxs)(n.p,{children:["The ",(0,o.jsx)(n.strong,{children:"Chat Output"})," component is required to use a flow as an MCP tool."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Any LTS version of ",(0,o.jsx)(n.a,{href:"https://docs.npmjs.com/downloading-and-installing-node-js-and-npm",children:"Node.js"})," installed on your computer if you want to use MCP Inspector to ",(0,o.jsx)(n.a,{href:"#test-and-debug-flows",children:"test and debug flows"}),"."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.a,{href:"https://ngrok.com/docs/getting-started/#1-install-ngrok",children:"ngrok installed"})," and an ",(0,o.jsx)(n.a,{href:"https://dashboard.ngrok.com/get-started/your-authtoken",children:"ngrok authtoken"})," if you want to ",(0,o.jsx)(n.a,{href:"/deployment-public-server",children:"deploy a public Langflow server"}),"."]}),"\n"]}),"\n"]}),"\n",(0,o.jsx)(n.h2,{id:"select-flows-to-serve",children:"Serve flows as MCP tools"}),"\n",(0,o.jsxs)(n.p,{children:["Each ",(0,o.jsx)(n.a,{href:"/concepts-flows#projects",children:"Langflow project"})," has an MCP server that exposes the project's flows as tools for use by MCP clients."]}),"\n",(0,o.jsx)(n.p,{children:"By default, all flows in a project are exposed as tools on the project's MCP server.\nYou can change the exposed flows and tool metadata by managing the MCP server settings:"}),"\n",(0,o.jsxs)(n.ol,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Click the ",(0,o.jsx)(n.strong,{children:"MCP Server"})," tab on the ",(0,o.jsxs)(n.a,{href:"/concepts-flows#projects",children:[(0,o.jsx)(n.strong,{children:"Projects"})," page"]}),", or, when editing a flow, click ",(0,o.jsx)(n.strong,{children:"Share"}),", and then select ",(0,o.jsx)(n.strong,{children:"MCP Server"}),"."]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.img,{alt:"MCP server projects page",src:t(67577).A+"",width:"4000",height:"2174"})}),"\n",(0,o.jsxs)(n.p,{children:["The ",(0,o.jsx)(n.strong,{children:"Flows/Tools"})," section lists the flows that are currently being served as tools on this MCP server."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["To toggle exposed flows, click ",(0,o.jsx)(a.A,{name:"Settings2","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Edit Tools"}),", and then select the flows that you want exposed as tools.\nTo prevent a flow from being used as a tool, clear the checkbox in the first column."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Close the ",(0,o.jsx)(n.strong,{children:"MCP Server Tools"})," dialog to save your changes."]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.img,{alt:"MCP Server Tools",src:t(4595).A+"",width:"4000",height:"2030"})}),"\n"]}),"\n"]}),"\n",(0,o.jsx)(n.h3,{id:"edit-flow-tool-names-and-descriptions",children:"Edit flow tool names and descriptions"}),"\n",(0,o.jsx)(n.p,{children:"Tool names and descriptions help MCP clients determine which actions your flows provide and when to use those actions.\nIt is recommended to provide clear, descriptive names and descriptions for all tools that you serve to MCP clients."}),"\n",(0,o.jsx)(n.p,{children:"To edit the names and descriptions of flow tools on a Langflow MCP server, do the following:"}),"\n",(0,o.jsxs)(n.ol,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Click the ",(0,o.jsx)(n.strong,{children:"MCP Server"})," tab on the ",(0,o.jsxs)(n.a,{href:"/concepts-flows#projects",children:[(0,o.jsx)(n.strong,{children:"Projects"})," page"]}),", or, when editing a flow, click ",(0,o.jsx)(n.strong,{children:"Share"}),", and then select ",(0,o.jsx)(n.strong,{children:"MCP Server"}),"."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Click ",(0,o.jsx)(a.A,{name:"Settings2","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Edit Tools"}),"."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Click the ",(0,o.jsx)(n.strong,{children:"Description"})," or ",(0,o.jsx)(n.strong,{children:"Tool"})," that you want to edit:"]}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Tool name"}),": Enter a name that makes it clear what the flow does when used as a tool by an agent."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Tool description"}),": Enter a description that completely and accurately describes the specific actions the flow performs."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Close the ",(0,o.jsx)(n.strong,{children:"MCP Server Tools"})," dialog to save your changes."]}),"\n"]}),"\n"]}),"\n",(0,o.jsx)(n.h4,{id:"importance-of-tool-names-and-descriptions",children:"Importance of tool names and descriptions"}),"\n",(0,o.jsx)(n.p,{children:"MCP clients use tool names and descriptions to determine which actions to use when generating responses."}),"\n",(0,o.jsx)(n.p,{children:"Because MCP clients treat your Langflow project as a single MCP server with all of your enabled flows listed as tools, unclear names and descriptions can cause the agent to select tools incorrectly or inconsistently."}),"\n",(0,o.jsxs)(n.p,{children:["For example, a flow's default tool name is the flow ID, such as ",(0,o.jsx)(n.code,{children:"adbbf8c7-0a34-493b-90ea-5e8b42f78b66"}),".\nThis provides no information to an agent about the type of flow or its purpose."]}),"\n",(0,o.jsx)(n.p,{children:"To provide more context about your flows, make sure to name and describe your flows clearly when configuring your Langflow project's MCP server."}),"\n",(0,o.jsx)(n.p,{children:"Think of these names and descriptions as function names and code comments.\nUse clear statements to describe the problems your flows solve."}),"\n",(0,o.jsxs)(s,{children:[(0,o.jsx)("summary",{children:"Example: Tool name and description usage"}),(0,o.jsxs)(n.p,{children:["For example, assume you create a flow based on the ",(0,o.jsx)(n.strong,{children:"Document Q&A"})," template that uses an LLM to chat about resumes, and then you give the flow the following name and description:"]}),(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Tool name"}),": ",(0,o.jsx)(n.code,{children:"document_qa_for_resume"})]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Tool description"}),": ",(0,o.jsx)(n.code,{children:"A flow for analyzing Emily's resume."})]}),"\n"]}),"\n"]}),(0,o.jsxs)(n.p,{children:["After connecting your Langflow MCP server to Cursor, you can ask Cursor about the resume, such as ",(0,o.jsx)(n.code,{children:"What job experience does Emily have?"}),".\nUsing the context provided by your tool name and description, the agent can decide to use the ",(0,o.jsx)(n.code,{children:"document_qa_for_resume"})," MCP tool to create a response about Emily's resume.\nIf necessary, the agent asks permission to use the flow tool before generating the response."]}),(0,o.jsxs)(n.p,{children:["If you ask about a different resume, such as ",(0,o.jsx)(n.code,{children:"What job experience does Alex have?"}),", the agent can decide that ",(0,o.jsx)(n.code,{children:"document_qa_for_resume"})," isn't relevant to this request, because the tool description specifies that the flow is for Emily's resume.\nIn this case, the agent might use another available tool, or it can inform you that it doesn't have access to information about Alex's.\nFor example:"]}),(0,o.jsx)(p.Code,{codeConfig:x,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"I notice you're asking about Alex's job experience.",props:{}}]},{tokens:[{content:"Based on the available tools, I can see there is a Document QA for Resume flow that's designed for analyzing resumes.",props:{}}]},{tokens:[{content:"However, the description mentions it's for \"Emily's resume\" not Alex's. I don't have access to Alex's resume or job experience information.",props:{}}]}],lang:"text"},annotations:[]}]})]}),"\n","\n",(0,o.jsx)(n.h2,{id:"connect-clients-to-use-the-servers-actions",children:"Connect clients to your Langflow MCP server"}),"\n",(0,o.jsx)(n.p,{children:"Langflow provides automatic installation and code snippets to help you deploy your Langflow MCP servers to your local MCP clients."}),"\n",(0,o.jsxs)(i.A,{children:[(0,o.jsxs)(c.A,{value:"JSON",label:"JSON",default:!0,children:[(0,o.jsxs)(n.p,{children:["The JSON option allows you to connect a Langflow MCP server to any local or remote MCP client.\nYou can modify this process for any ",(0,o.jsx)(n.a,{href:"https://modelcontextprotocol.io/clients",children:"MCP-compatible client"}),"."]}),(0,o.jsxs)(n.ol,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Install any ",(0,o.jsx)(n.a,{href:"https://modelcontextprotocol.io/clients",children:"MCP-compatible client"}),"."]}),"\n",(0,o.jsx)(n.p,{children:"These steps use Cursor as an example, but the process is generally the same for all clients, with slight differences in client-specific details like file names."}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:"In your client, add a new MCP server using the client's UI or configuration file."}),"\n",(0,o.jsxs)(n.p,{children:["For example, in Cursor, go to ",(0,o.jsx)(n.strong,{children:"Cursor Settings"}),", select ",(0,o.jsx)(n.strong,{children:"MCP"}),", and then click ",(0,o.jsx)(n.strong,{children:"Add New Global MCP Server"})," to open Cursor's global ",(0,o.jsx)(n.code,{children:"mcp.json"})," configuration file."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Recommended: Configure ",(0,o.jsx)(n.a,{href:"#authentication",children:"authentication"})," for your MCP server."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["In Langflow, on the ",(0,o.jsx)(n.strong,{children:"Projects"})," page, click the ",(0,o.jsx)(n.strong,{children:"MCP Server"})," tab."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Click the ",(0,o.jsx)(n.strong,{children:"JSON"})," tab, copy the code snippet for your operating system, and then paste it into your client's MCP configuration file.\nFor example:"]}),"\n",(0,o.jsx)(p.Code,{codeConfig:x,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"{",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "mcpServers"',props:{style:{color:"#7EE787"}}},{content:": {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "PROJECT_NAME"',props:{style:{color:"#7EE787"}}},{content:": {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "command"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"uvx"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "args"',props:{style:{color:"#7EE787"}}},{content:": [",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "mcp-proxy"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "http://LANGFLOW_SERVER_ADDRESS/api/v1/mcp/project/PROJECT_ID/sse"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" ]",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" }",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" }",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]}],lang:"json"},annotations:[]}]}),"\n",(0,o.jsxs)(n.p,{children:["The ",(0,o.jsx)(n.strong,{children:"MCP Server"})," tab automatically populates the ",(0,o.jsx)(n.code,{children:"PROJECT_NAME"}),", ",(0,o.jsx)(n.code,{children:"LANGFLOW_SERVER_ADDRESS"}),", and ",(0,o.jsx)(n.code,{children:"PROJECT_ID"})," values."]}),"\n",(0,o.jsxs)(n.p,{children:["The default Langflow server address is ",(0,o.jsx)(n.code,{children:"http://localhost:7860"}),".\nIf you are using a ",(0,o.jsx)(n.a,{href:"/deployment-public-server",children:"public Langflow server"}),", the server address is automatically included."]}),"\n",(0,o.jsxs)(n.p,{children:["If your Langflow server requires authentication, you must include your Langflow API key or OAuth settings in the configuration.\nFor more information, see ",(0,o.jsx)(n.a,{href:"#authentication",children:"MCP server authentication"}),"."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["To include other environment variables with your MCP server command, add an ",(0,o.jsx)(n.code,{children:"env"})," object with key-value pairs of environment variables:"]}),"\n",(0,o.jsx)(p.Code,{codeConfig:x,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"{",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "mcpServers"',props:{style:{color:"#7EE787"}}},{content:": {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "PROJECT_NAME"',props:{style:{color:"#7EE787"}}},{content:": {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "command"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"uvx"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "args"',props:{style:{color:"#7EE787"}}},{content:": [",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "mcp-proxy"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "http://LANGFLOW_SERVER_ADDRESS/api/v1/mcp/project/PROJECT_ID/sse"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" ],",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "env"',props:{style:{color:"#7EE787"}}},{content:": {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "KEY"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"VALUE"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" }",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" }",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" }",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]}],lang:"json"},annotations:[]}]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:"Save and close your client's MCP configuration file."}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:"Confirm that your Langflow MCP server is on the client's list of MCP servers.\nIf necessary, restart your client to apply the modified configuration file."}),"\n"]}),"\n"]})]}),(0,o.jsxs)(c.A,{value:"auto",label:"Auto install",children:[(0,o.jsx)(n.admonition,{type:"info",children:(0,o.jsxs)(n.p,{children:["The auto install option is available only for specific MCP clients.\nAuto install requires the client to be installed locally so Langflow can write to the client's configuration file.\nIf your client isn't supported, is installed remotely, or you need to pass additional environment variables, use the ",(0,o.jsx)(n.strong,{children:"JSON"})," option."]})}),(0,o.jsxs)(n.ol,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Install ",(0,o.jsx)(n.a,{href:"https://docs.cursor.com/get-started/installation",children:"Cursor"}),", ",(0,o.jsx)(n.a,{href:"https://claude.ai/download",children:"Claude"}),", or ",(0,o.jsx)(n.a,{href:"https://windsurf.com/download/editor",children:"Windsurf"})," on the same computer where your Langflow server is running."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Recommended: Configure ",(0,o.jsx)(n.a,{href:"#authentication",children:"authentication"})," for your MCP server."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["In Langflow, on the ",(0,o.jsx)(n.strong,{children:"Projects"})," page, click the ",(0,o.jsx)(n.strong,{children:"MCP Server"})," tab."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["On the ",(0,o.jsx)(n.strong,{children:"Auto install"})," tab, find your MCP client provider, and then click ",(0,o.jsx)(a.A,{name:"Plus","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Add"}),"."]}),"\n",(0,o.jsxs)(n.p,{children:["Your Langflow project's MCP server is automatically added to the configuration file for your local Cursor, Claude, or Windsurf client.\nFor example, with Cursor, the server configuration is added to the ",(0,o.jsx)(n.code,{children:"mcp.json"})," configuration file."]}),"\n",(0,o.jsx)(n.p,{children:"Langflow attempts to add this configuration even if the selected client isn't installed.\nTo verify the installation, check the available MCP servers in your client."}),"\n"]}),"\n"]})]})]}),"\n",(0,o.jsxs)(n.p,{children:["Once your MCP client is connected to your Langflow project's MCP server, your flows are registered as tools.\nCursor determines when to use tools based on your queries, and requests permissions when necessary.\nFor more information, see the MCP documentation for your client, such as ",(0,o.jsx)(n.a,{href:"https://docs.cursor.com/context/model-context-protocol",children:"Cursor's MCP documentation"}),"."]}),"\n",(0,o.jsx)(n.h2,{id:"authentication",children:"MCP server authentication"}),"\n",(0,o.jsxs)(n.p,{children:["Each ",(0,o.jsx)(n.a,{href:"/concepts-flows#projects",children:"Langflow project"})," has its own MCP server with its own MCP server authentication settings."]}),"\n",(0,o.jsxs)(n.p,{children:["To configure authentication for a Langflow MCP server, go to the ",(0,o.jsx)(n.strong,{children:"Projects"})," page in Langflow, click the ",(0,o.jsx)(n.strong,{children:"MCP Server"})," tab, click ",(0,o.jsx)(a.A,{name:"Fingerprint","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Edit Auth"}),", and then select your preferred authentication method:"]}),"\n",(0,o.jsxs)(i.A,{groupId:"auth-type",children:[(0,o.jsxs)(c.A,{value:"API key",label:"API key",children:[(0,o.jsxs)(n.p,{children:["When authenticating your MCP server with a Langflow API key, your project's MCP server ",(0,o.jsx)(n.strong,{children:"JSON"})," code snippets and ",(0,o.jsx)(n.strong,{children:"Auto install"})," configuration automatically include the ",(0,o.jsx)(n.code,{children:"--headers"})," and ",(0,o.jsx)(n.code,{children:"x-api-key"})," arguments."]}),(0,o.jsxs)(n.p,{children:["Click ",(0,o.jsx)(a.A,{name:"key","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Generate API key"})," to automatically insert a new Langflow API key into the code template.\nAlternatively, you can replace ",(0,o.jsx)(n.code,{children:"YOUR_API_KEY"})," with an existing Langflow API key."]})]}),(0,o.jsxs)(c.A,{value:"OAuth",label:"OAuth",children:[(0,o.jsxs)(n.p,{children:["When OAuth is enabled, Langflow automatically starts an ",(0,o.jsx)(n.a,{href:"https://pypi.org/project/mcp-composer",children:"MCP Composer"})," instance for your project, creating a secure client-side proxy between MCP clients and the ",(0,o.jsx)(n.code,{children:"mcp-proxy"})," on your server."]}),(0,o.jsx)(n.p,{children:"OAuth integration allows your Langflow MCP server to authenticate users and applications through any OAuth 2.0 compliant service. When users or applications connect to your MCP server, they are redirected to your chosen OAuth provider to authenticate. Upon successful authentication, they are granted access to your flows as MCP tools."}),(0,o.jsx)(n.p,{children:"Before configuring OAuth in Langflow, you must first set up an OAuth application with an external OAuth 2.0 service provider.\nYou must register your Langflow server as an OAuth client, and then obtain the required values to complete the configuration in Langflow."}),(0,o.jsxs)(n.p,{children:["The following table describes the required values.\n",(0,o.jsx)(n.a,{href:"https://github.com/settings/developers",children:"GitHub OAuth"})," is used for example purposes.\nBe sure to use the actual values from your own deployment.\nFor more information, see your OAuth provider's documentation."]}),(0,o.jsxs)(n.table,{children:[(0,o.jsx)(n.thead,{children:(0,o.jsxs)(n.tr,{children:[(0,o.jsx)(n.th,{children:"Field"}),(0,o.jsx)(n.th,{children:"Description"}),(0,o.jsx)(n.th,{children:"Source"}),(0,o.jsx)(n.th,{children:"Example"})]})}),(0,o.jsxs)(n.tbody,{children:[(0,o.jsxs)(n.tr,{children:[(0,o.jsx)(n.td,{children:(0,o.jsx)(n.strong,{children:"Host"})}),(0,o.jsx)(n.td,{children:"OAuth server host"}),(0,o.jsx)(n.td,{children:"MCP Composer default."}),(0,o.jsx)(n.td,{children:(0,o.jsx)(n.code,{children:"localhost"})})]}),(0,o.jsxs)(n.tr,{children:[(0,o.jsx)(n.td,{children:(0,o.jsx)(n.strong,{children:"Port"})}),(0,o.jsx)(n.td,{children:"OAuth server port"}),(0,o.jsx)(n.td,{children:"MCP Composer default."}),(0,o.jsx)(n.td,{children:(0,o.jsx)(n.code,{children:"9000"})})]}),(0,o.jsxs)(n.tr,{children:[(0,o.jsx)(n.td,{children:(0,o.jsx)(n.strong,{children:"Server URL"})}),(0,o.jsx)(n.td,{children:"Full OAuth server URL"}),(0,o.jsx)(n.td,{children:"Combines the MCP Composer default OAuth host and port."}),(0,o.jsx)(n.td,{children:(0,o.jsx)(n.code,{children:"http://localhost:9000"})})]}),(0,o.jsxs)(n.tr,{children:[(0,o.jsx)(n.td,{children:(0,o.jsx)(n.strong,{children:"Callback Path"})}),(0,o.jsx)(n.td,{children:"OAuth callback URL on your server"}),(0,o.jsx)(n.td,{children:"You define this address during OAuth app registration."}),(0,o.jsx)(n.td,{children:(0,o.jsx)(n.code,{children:"http://localhost:9000/auth/idaas/callback"})})]}),(0,o.jsxs)(n.tr,{children:[(0,o.jsx)(n.td,{children:(0,o.jsx)(n.strong,{children:"Client ID"})}),(0,o.jsx)(n.td,{children:"Your OAuth client identifier"}),(0,o.jsx)(n.td,{children:"From your OAuth provider."}),(0,o.jsx)(n.td,{children:(0,o.jsx)(n.code,{children:"Ov23li9vx2grVL61qjb"})})]}),(0,o.jsxs)(n.tr,{children:[(0,o.jsx)(n.td,{children:(0,o.jsx)(n.strong,{children:"Client Secret"})}),(0,o.jsx)(n.td,{children:"Your OAuth client secret"}),(0,o.jsx)(n.td,{children:"From your OAuth provider."}),(0,o.jsx)(n.td,{children:(0,o.jsx)(n.code,{children:"1234567890abcdef1234567890abcdef12345678"})})]}),(0,o.jsxs)(n.tr,{children:[(0,o.jsx)(n.td,{children:(0,o.jsx)(n.strong,{children:"Authorization URL"})}),(0,o.jsx)(n.td,{children:"OAuth authorization endpoint"}),(0,o.jsx)(n.td,{children:"From your OAuth provider."}),(0,o.jsx)(n.td,{children:(0,o.jsx)(n.code,{children:"https://github.com/login/oauth/authorize"})})]}),(0,o.jsxs)(n.tr,{children:[(0,o.jsx)(n.td,{children:(0,o.jsx)(n.strong,{children:"Token URL"})}),(0,o.jsx)(n.td,{children:"OAuth token endpoint for getting refresh tokens"}),(0,o.jsx)(n.td,{children:"From your OAuth provider."}),(0,o.jsx)(n.td,{children:(0,o.jsx)(n.code,{children:"https://github.com/login/oauth/access_token"})})]}),(0,o.jsxs)(n.tr,{children:[(0,o.jsx)(n.td,{children:(0,o.jsx)(n.strong,{children:"MCP Scope"})}),(0,o.jsx)(n.td,{children:"Scope for MCP operations"}),(0,o.jsxs)(n.td,{children:["You define this. As of Langflow 1.6, ",(0,o.jsx)(n.code,{children:"user"})," is the only available value."]}),(0,o.jsx)(n.td,{children:(0,o.jsx)(n.code,{children:"user"})})]}),(0,o.jsxs)(n.tr,{children:[(0,o.jsx)(n.td,{children:(0,o.jsx)(n.strong,{children:"Provider Scope"})}),(0,o.jsx)(n.td,{children:"OAuth provider scope"}),(0,o.jsxs)(n.td,{children:["You define this. As of Langflow 1.6, ",(0,o.jsx)(n.code,{children:"openid"})," is the only available value."]}),(0,o.jsx)(n.td,{children:(0,o.jsx)(n.code,{children:"openid"})})]})]})]}),(0,o.jsx)(n.p,{children:"To configure OAuth authentication:"}),(0,o.jsxs)(n.ol,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Select ",(0,o.jsx)(n.strong,{children:"OAuth"})," as the authentication type."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:"Configure the OAuth settings with the values from your OAuth deployment.\nAll values are required."}),"\n",(0,o.jsx)(n.p,{children:"The OAuth credentials are encrypted and stored securely in your Langflow database."}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Click ",(0,o.jsx)(n.strong,{children:"Save"}),"."]}),"\n",(0,o.jsxs)(n.p,{children:["Your MCP server's ",(0,o.jsx)(n.strong,{children:"JSON"})," code snippets and ",(0,o.jsx)(n.strong,{children:"Auto install"})," configuration are automatically updated with OAuth values. These are automatically used for new installations after enabling OAuth. However, you must manually update any existing installations, as explained in the next step."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:"If you already installed your Langflow MCP server in your MCP client, you must update your MCP client configuration to use the new OAuth settings after enabling OAuth on your MCP server.\nThe client update method depends on how you installed the server on the client:"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"Auto install"}),": Manually update your client's config file using the updated JSON snippet from the ",(0,o.jsx)(n.strong,{children:"JSON"})," tab, or repeat the steps in ",(0,o.jsx)(n.a,{href:"#connect-clients-to-use-the-servers-actions",children:"Auto-install"})," to re-install the client with the updated settings."]}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"JSON option"}),": Copy the updated JSON snippet from the ",(0,o.jsx)(n.strong,{children:"JSON"})," tab and replace your existing configuration."]}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"New connections"}),": Use either the ",(0,o.jsx)(n.strong,{children:"Auto install"})," or ",(0,o.jsx)(n.strong,{children:"JSON"})," option. The OAuth settings are included automatically."]}),"\n"]}),"\n"]}),"\n"]}),(0,o.jsxs)(n.p,{children:["After you enable OAuth and update your client configuration, an OAuth callback window opens each time your MCP client attempts to authenticate with the server.\nA successful authentication returns ",(0,o.jsx)(n.code,{children:"Authentication complete. You may close this window."}),"\nIf your client doesn't open the OAuth window, try restarting the client to retrieve the updated configuration."]})]}),(0,o.jsx)(c.A,{value:"None",label:"None",children:(0,o.jsx)(n.p,{children:"When no authentication is configured, your MCP server becomes a public endpoint that anyone can access without providing credentials.\nOnly use this option when Langflow is running in a trusted environment."})})]}),"\n",(0,o.jsx)(n.h2,{id:"mcp-server-environment-variables",children:"MCP server environment variables"}),"\n",(0,o.jsx)(n.p,{children:"The following environment variables set behaviors related to your Langflow projects' MCP servers:"}),"\n",(0,o.jsxs)(n.table,{children:[(0,o.jsx)(n.thead,{children:(0,o.jsxs)(n.tr,{children:[(0,o.jsx)(n.th,{children:"Variable"}),(0,o.jsx)(n.th,{children:"Format"}),(0,o.jsx)(n.th,{children:"Default"}),(0,o.jsx)(n.th,{children:"Description"})]})}),(0,o.jsxs)(n.tbody,{children:[(0,o.jsxs)(n.tr,{children:[(0,o.jsx)(n.td,{children:(0,o.jsx)(n.code,{children:"LANGFLOW_MCP_SERVER_ENABLED"})}),(0,o.jsx)(n.td,{children:"Boolean"}),(0,o.jsx)(n.td,{children:"True"}),(0,o.jsx)(n.td,{children:"Whether to initialize an MCP server for each of your Langflow projects. If false, Langflow doesn't initialize MCP servers."})]}),(0,o.jsxs)(n.tr,{children:[(0,o.jsx)(n.td,{children:(0,o.jsx)(n.code,{children:"LANGFLOW_MCP_SERVER_ENABLE_PROGRESS_NOTIFICATIONS"})}),(0,o.jsx)(n.td,{children:"Boolean"}),(0,o.jsx)(n.td,{children:"False"}),(0,o.jsx)(n.td,{children:"If true, Langflow MCP servers send progress notifications."})]}),(0,o.jsxs)(n.tr,{children:[(0,o.jsx)(n.td,{children:(0,o.jsx)(n.code,{children:"LANGFLOW_MCP_SERVER_TIMEOUT"})}),(0,o.jsx)(n.td,{children:"Integer"}),(0,o.jsx)(n.td,{children:(0,o.jsx)(n.code,{children:"20"})}),(0,o.jsx)(n.td,{children:"The number of seconds to wait before an MCP server operation expires due to poor connectivity or long-running requests."})]}),(0,o.jsxs)(n.tr,{children:[(0,o.jsx)(n.td,{children:(0,o.jsx)(n.code,{children:"LANGFLOW_MCP_MAX_SESSIONS_PER_SERVER"})}),(0,o.jsx)(n.td,{children:"Integer"}),(0,o.jsx)(n.td,{children:(0,o.jsx)(n.code,{children:"10"})}),(0,o.jsx)(n.td,{children:"Maximum number of MCP sessions to keep per unique server."})]})]})]}),"\n","\n",(0,o.jsx)(n.h3,{id:"deploy-your-server-externally",children:"Deploy your Langflow MCP server externally"}),"\n",(0,o.jsxs)(n.p,{children:["To deploy your Langflow MCP server externally, see ",(0,o.jsx)(n.a,{href:"/deployment-public-server",children:"Deploy a public Langflow server"}),"."]}),"\n",(0,o.jsx)(n.h2,{id:"test-and-debug-flows",children:"Use MCP Inspector to test and debug flows"}),"\n",(0,o.jsx)(n.admonition,{title:"Node prerequisite",type:"info",children:(0,o.jsxs)(n.p,{children:["MCP Inspector requires any LTS version of ",(0,o.jsx)(n.a,{href:"https://docs.npmjs.com/downloading-and-installing-node-js-and-npm",children:"Node.js"})," installed on your computer."]})}),"\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.a,{href:"https://modelcontextprotocol.io/docs/tools/inspector",children:"MCP Inspector"})," is a common tool for testing and debugging MCP servers.\nYou can use MCP Inspector to monitor your flows and get insights into how they are being consumed by the MCP server."]}),"\n",(0,o.jsxs)(n.ol,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:"Install MCP Inspector:"}),"\n",(0,o.jsx)(p.Code,{codeConfig:x,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"npx ",props:{style:{color:"#FFA657"}}},{content:"@modelcontextprotocol/inspector",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,o.jsxs)(n.p,{children:["For more information about configuring MCP Inspector, including specifying a proxy port, see the ",(0,o.jsx)(n.a,{href:"https://github.com/modelcontextprotocol/inspector",children:"MCP Inspector GitHub project"}),"."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Open a web browser and navigate to the MCP Inspector UI.\nThe default address is ",(0,o.jsx)(n.code,{children:"http://localhost:6274"}),"."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["In the MCP Inspector UI, enter the connection details for your Langflow project's MCP server.\nThe field values depend on your server's method of ",(0,o.jsx)(n.a,{href:"#authentication",children:"authentication"}),"."]}),"\n",(0,o.jsxs)(i.A,{groupId:"auth-type",children:[(0,o.jsx)(c.A,{value:"API key",label:"API key",default:!0,children:(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"Transport Type"}),": Select ",(0,o.jsx)(n.strong,{children:"STDIO"}),"."]}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"Command"}),": ",(0,o.jsx)(n.code,{children:"uvx"})]}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"Arguments"}),": Enter the following list of arguments, separated by spaces. Replace the values for ",(0,o.jsx)(n.code,{children:"YOUR_API_KEY"}),", ",(0,o.jsx)(n.code,{children:"LANGFLOW_SERVER_ADDRESS"}),", and ",(0,o.jsx)(n.code,{children:"PROJECT_ID"})," with the values from your Langflow MCP server. For example:","\n",(0,o.jsx)(p.Code,{codeConfig:x,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"mcp-proxy ",props:{style:{color:"#FFA657"}}},{content:"--headers ",props:{style:{color:"#79C0FF"}}},{content:"x-api-key YOUR_API_KEY http://LANGFLOW_SERVER_ADDRESS/api/v1/mcp/project/PROJECT_ID/sse",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n"]}),"\n"]})}),(0,o.jsx)(c.A,{value:"OAuth",label:"OAuth",children:(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"Transport Type"}),": Select ",(0,o.jsx)(n.strong,{children:"STDIO"}),"."]}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"Command"}),": ",(0,o.jsx)(n.code,{children:"uvx"})]}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"Arguments"}),": Enter the following list of arguments, separated by spaces. Replace the value for ",(0,o.jsx)(n.code,{children:"OAUTH_SERVER_URL"})," with the URL of your OAuth server. For example:","\n",(0,o.jsx)(p.Code,{codeConfig:x,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"mcp-composer ",props:{style:{color:"#FFA657"}}},{content:"--mode ",props:{style:{color:"#79C0FF"}}},{content:"stdio ",props:{style:{color:"#A5D6FF"}}},{content:"--sse-url ",props:{style:{color:"#79C0FF"}}},{content:"http://localhost:9000/sse ",props:{style:{color:"#A5D6FF"}}},{content:"--disable-composer-tools --client_auth_type ",props:{style:{color:"#79C0FF"}}},{content:"oauth",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n"]}),"\n"]})}),(0,o.jsx)(c.A,{value:"None",label:"None",children:(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"Transport Type"}),": Select ",(0,o.jsx)(n.strong,{children:"SSE"}),"."]}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"URL"}),": Enter the Langflow MCP server's ",(0,o.jsx)(n.code,{children:"sse"})," endpoint. For example:","\n",(0,o.jsx)(p.Code,{codeConfig:x,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"http://localhost:7860/api/v1/mcp/project/d359cbd4-6fa2-4002-9d53-fa05c645319c/sse",props:{style:{color:"#FFA657"}}}]}],lang:"bash"},annotations:[]}]}),"\n"]}),"\n"]})})]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Click ",(0,o.jsx)(n.strong,{children:"Connect"}),"."]}),"\n",(0,o.jsxs)(n.p,{children:["If the connection was successful, you should see your project's flows in the ",(0,o.jsx)(n.strong,{children:"Tools"})," tab.\nFrom this tab, you can monitor how your flows are being registered as tools by MCP, as well as test the tools with custom input values."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["To quit MCP Inspector, press ",(0,o.jsx)("kbd",{children:"Control+C"})," in the same terminal window where you started it."]}),"\n"]}),"\n"]}),"\n",(0,o.jsx)(n.h2,{id:"troubleshooting-mcp-server",children:"Troubleshoot Langflow MCP servers"}),"\n",(0,o.jsxs)(n.p,{children:["For troubleshooting advice for MCP servers and clients, see ",(0,o.jsx)(n.a,{href:"/troubleshoot#mcp",children:"Troubleshoot Langflow: MCP issues"}),"."]}),"\n",(0,o.jsx)(n.h2,{id:"see-also",children:"See also"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.a,{href:"/mcp-client",children:"Use Langflow as an MCP client"})}),"\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.a,{href:"/mcp-component-astra",children:"Use a DataStax Astra DB MCP server"})}),"\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.a,{href:"/environment-variables#mcp",children:"MCP server environment variables"})}),"\n"]})]})}function g(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(f,{...e})}):f(e)}function m(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}}}]); \ No newline at end of file +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[9648],{4595:(e,n,t)=>{t.d(n,{A:()=>s});const s=t.p+"assets/images/mcp-server-tools-ddc0f1dc04109b9f3daf6a2f380073c4.png"},11470:(e,n,t)=>{t.d(n,{A:()=>b});var s=t(96540),o=t(18215),r=t(23104),l=t(56347),i=t(205),c=t(57485),a=t(31682),d=t(70679);function h(e){return s.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,s.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function u(e){const{values:n,children:t}=e;return(0,s.useMemo)(()=>{const e=n??function(e){return h(e).map(({props:{value:e,label:n,attributes:t,default:s}})=>({value:e,label:n,attributes:t,default:s}))}(t);return function(e){const n=(0,a.XI)(e,(e,n)=>e.value===n.value);if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map(e=>e.value).join(", ")}" found in . Every value needs to be unique.`)}(e),e},[n,t])}function p({value:e,tabValues:n}){return n.some(n=>n.value===e)}function x({queryString:e=!1,groupId:n}){const t=(0,l.W6)(),o=function({queryString:e=!1,groupId:n}){if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:e,groupId:n});return[(0,c.aZ)(o),(0,s.useCallback)(e=>{if(!o)return;const n=new URLSearchParams(t.location.search);n.set(o,e),t.replace({...t.location,search:n.toString()})},[o,t])]}function j(e){const{defaultValue:n,queryString:t=!1,groupId:o}=e,r=u(e),[l,c]=(0,s.useState)(()=>function({defaultValue:e,tabValues:n}){if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(e){if(!p({value:e,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${n.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}const t=n.find(e=>e.default)??n[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:n,tabValues:r})),[a,h]=x({queryString:t,groupId:o}),[j,f]=function({groupId:e}){const n=function(e){return e?`docusaurus.tab.${e}`:null}(e),[t,o]=(0,d.Dv)(n);return[t,(0,s.useCallback)(e=>{n&&o.set(e)},[n,o])]}({groupId:o}),g=(()=>{const e=a??j;return p({value:e,tabValues:r})?e:null})();(0,i.A)(()=>{g&&c(g)},[g]);return{selectedValue:l,selectValue:(0,s.useCallback)(e=>{if(!p({value:e,tabValues:r}))throw new Error(`Can't select invalid tab value=${e}`);c(e),h(e),f(e)},[h,f,r]),tabValues:r}}var f=t(92303);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var m=t(74848);function v({className:e,block:n,selectedValue:t,selectValue:s,tabValues:l}){const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,r.a_)(),a=e=>{const n=e.currentTarget,o=i.indexOf(n),r=l[o].value;r!==t&&(c(n),s(r))},d=e=>{let n=null;switch(e.key){case"Enter":a(e);break;case"ArrowRight":{const t=i.indexOf(e.currentTarget)+1;n=i[t]??i[0];break}case"ArrowLeft":{const t=i.indexOf(e.currentTarget)-1;n=i[t]??i[i.length-1];break}}n?.focus()};return(0,m.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.A)("tabs",{"tabs--block":n},e),children:l.map(({value:e,label:n,attributes:s})=>(0,m.jsx)("li",{role:"tab",tabIndex:t===e?0:-1,"aria-selected":t===e,ref:e=>{i.push(e)},onKeyDown:d,onClick:a,...s,className:(0,o.A)("tabs__item",g.tabItem,s?.className,{"tabs__item--active":t===e}),children:n??e},e))})}function y({lazy:e,children:n,selectedValue:t}){const r=(Array.isArray(n)?n:[n]).filter(Boolean);if(e){const e=r.find(e=>e.props.value===t);return e?(0,s.cloneElement)(e,{className:(0,o.A)("margin-top--md",e.props.className)}):null}return(0,m.jsx)("div",{className:"margin-top--md",children:r.map((e,n)=>(0,s.cloneElement)(e,{key:n,hidden:e.props.value!==t}))})}function C(e){const n=j(e);return(0,m.jsxs)("div",{className:(0,o.A)("tabs-container",g.tabList),children:[(0,m.jsx)(v,{...n,...e}),(0,m.jsx)(y,{...n,...e})]})}function b(e){const n=(0,f.A)();return(0,m.jsx)(C,{...e,children:h(e.children)},String(n))}},17886:(e,n,t)=>{t.d(n,{A:()=>r});t(96540);var s=t(64058),o=t(74848);function r({name:e,...n}){const t=s[e];return t?(0,o.jsx)(t,{...n}):null}},19365:(e,n,t)=>{t.d(n,{A:()=>l});t(96540);var s=t(18215);const o={tabItem:"tabItem_Ymn6"};var r=t(74848);function l({children:e,hidden:n,className:t}){return(0,r.jsx)("div",{role:"tabpanel",className:(0,s.A)(o.tabItem,t),hidden:n,children:e})}},67577:(e,n,t)=>{t.d(n,{A:()=>s});const s=t.p+"assets/images/mcp-server-53850e4ac7599dec00dd7d01922ba79f.png"},93403:(e,n,t)=>{t.r(n),t.d(n,{CH:()=>p,assets:()=>u,chCodeConfig:()=>x,contentTitle:()=>h,default:()=>g,frontMatter:()=>d,metadata:()=>s,toc:()=>j});const s=JSON.parse('{"id":"Concepts/mcp-server","title":"Use Langflow as an MCP server","description":"Langflow integrates with the Model Context Protocol (MCP) as both an MCP server and an MCP client.","source":"@site/docs/Concepts/mcp-server.mdx","sourceDirName":"Concepts","slug":"/mcp-server","permalink":"/mcp-server","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Use Langflow as an MCP server","slug":"/mcp-server"},"sidebar":"docs","previous":{"title":"Use Langflow as an MCP client","permalink":"/mcp-client"},"next":{"title":"Connect an Astra DB MCP server to Langflow","permalink":"/mcp-component-astra"}}');var o=t(74848),r=t(28453),l=t(24754),i=t(11470),c=t(19365),a=t(17886);const d={title:"Use Langflow as an MCP server",slug:"/mcp-server"},h=void 0,u={},p={annotations:l.hk,Code:l.Cy},x={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},j=[{value:"Prerequisites",id:"prerequisites",level:2},{value:"Serve flows as MCP tools",id:"select-flows-to-serve",level:2},{value:"Edit flow tool names and descriptions",id:"edit-flow-tool-names-and-descriptions",level:3},{value:"Importance of tool names and descriptions",id:"importance-of-tool-names-and-descriptions",level:4},{value:"Connect clients to your Langflow MCP server",id:"connect-clients-to-use-the-servers-actions",level:2},{value:"MCP server authentication",id:"authentication",level:2},{value:"MCP server environment variables",id:"mcp-server-environment-variables",level:2},{value:"Deploy your Langflow MCP server externally",id:"deploy-your-server-externally",level:3},{value:"Use MCP Inspector to test and debug flows",id:"test-and-debug-flows",level:2},{value:"Troubleshoot Langflow MCP servers",id:"troubleshooting-mcp-server",level:2},{value:"See also",id:"see-also",level:2}];function f(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",h4:"h4",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,r.R)(),...e.components},{Details:s}=n;return p||m("CH",!1),p.Code||m("CH.Code",!0),s||m("Details",!0),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n","\n",(0,o.jsxs)(n.p,{children:["Langflow integrates with the ",(0,o.jsx)(n.a,{href:"https://modelcontextprotocol.io/introduction",children:"Model Context Protocol (MCP)"})," as both an MCP server and an MCP client."]}),"\n",(0,o.jsxs)(n.p,{children:["This page describes how to use Langflow as an MCP server that exposes your flows as ",(0,o.jsx)(n.a,{href:"https://modelcontextprotocol.io/docs/concepts/tools",children:"tools"})," that ",(0,o.jsx)(n.a,{href:"https://modelcontextprotocol.io/clients",children:"MCP clients"})," can use when generating responses."]}),"\n",(0,o.jsxs)(n.p,{children:["For information about using Langflow as an MCP client and managing MCP server connections within flows, see ",(0,o.jsx)(n.a,{href:"/mcp-client",children:"Use Langflow as an MCP client"}),"."]}),"\n",(0,o.jsx)(n.h2,{id:"prerequisites",children:"Prerequisites"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["A ",(0,o.jsx)(n.a,{href:"/concepts-flows#projects",children:"Langflow project"})," with at least one flow that has a ",(0,o.jsxs)(n.a,{href:"/components-io#chat-output",children:[(0,o.jsx)(n.strong,{children:"Chat Output"})," component"]}),"."]}),"\n",(0,o.jsxs)(n.p,{children:["The ",(0,o.jsx)(n.strong,{children:"Chat Output"})," component is required to use a flow as an MCP tool."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Any LTS version of ",(0,o.jsx)(n.a,{href:"https://docs.npmjs.com/downloading-and-installing-node-js-and-npm",children:"Node.js"})," installed on your computer if you want to use MCP Inspector to ",(0,o.jsx)(n.a,{href:"#test-and-debug-flows",children:"test and debug flows"}),"."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.a,{href:"https://ngrok.com/docs/getting-started/#1-install-ngrok",children:"ngrok installed"})," and an ",(0,o.jsx)(n.a,{href:"https://dashboard.ngrok.com/get-started/your-authtoken",children:"ngrok authtoken"})," if you want to ",(0,o.jsx)(n.a,{href:"/deployment-public-server",children:"deploy a public Langflow server"}),"."]}),"\n"]}),"\n"]}),"\n",(0,o.jsx)(n.h2,{id:"select-flows-to-serve",children:"Serve flows as MCP tools"}),"\n",(0,o.jsxs)(n.p,{children:["Each ",(0,o.jsx)(n.a,{href:"/concepts-flows#projects",children:"Langflow project"})," has an MCP server that exposes the project's flows as tools for use by MCP clients."]}),"\n",(0,o.jsx)(n.p,{children:"By default, all flows in a project are exposed as tools on the project's MCP server.\nYou can change the exposed flows and tool metadata by managing the MCP server settings:"}),"\n",(0,o.jsxs)(n.ol,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Click the ",(0,o.jsx)(n.strong,{children:"MCP Server"})," tab on the ",(0,o.jsxs)(n.a,{href:"/concepts-flows#projects",children:[(0,o.jsx)(n.strong,{children:"Projects"})," page"]}),", or, when editing a flow, click ",(0,o.jsx)(n.strong,{children:"Share"}),", and then select ",(0,o.jsx)(n.strong,{children:"MCP Server"}),"."]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.img,{alt:"MCP server projects page",src:t(67577).A+"",width:"4000",height:"2174"})}),"\n",(0,o.jsxs)(n.p,{children:["The ",(0,o.jsx)(n.strong,{children:"Flows/Tools"})," section lists the flows that are currently being served as tools on this MCP server."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["To toggle exposed flows, click ",(0,o.jsx)(a.A,{name:"Settings2","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Edit Tools"}),", and then select the flows that you want exposed as tools.\nTo prevent a flow from being used as a tool, clear the checkbox in the first column."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Close the ",(0,o.jsx)(n.strong,{children:"MCP Server Tools"})," dialog to save your changes."]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.img,{alt:"MCP Server Tools",src:t(4595).A+"",width:"4000",height:"2030"})}),"\n"]}),"\n"]}),"\n",(0,o.jsx)(n.h3,{id:"edit-flow-tool-names-and-descriptions",children:"Edit flow tool names and descriptions"}),"\n",(0,o.jsx)(n.p,{children:"Tool names and descriptions help MCP clients determine which actions your flows provide and when to use those actions.\nIt is recommended to provide clear, descriptive names and descriptions for all tools that you serve to MCP clients."}),"\n",(0,o.jsx)(n.p,{children:"To edit the names and descriptions of flow tools on a Langflow MCP server, do the following:"}),"\n",(0,o.jsxs)(n.ol,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Click the ",(0,o.jsx)(n.strong,{children:"MCP Server"})," tab on the ",(0,o.jsxs)(n.a,{href:"/concepts-flows#projects",children:[(0,o.jsx)(n.strong,{children:"Projects"})," page"]}),", or, when editing a flow, click ",(0,o.jsx)(n.strong,{children:"Share"}),", and then select ",(0,o.jsx)(n.strong,{children:"MCP Server"}),"."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Click ",(0,o.jsx)(a.A,{name:"Settings2","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Edit Tools"}),"."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Click the ",(0,o.jsx)(n.strong,{children:"Description"})," or ",(0,o.jsx)(n.strong,{children:"Tool"})," that you want to edit:"]}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Tool name"}),": Enter a name that makes it clear what the flow does when used as a tool by an agent."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Tool description"}),": Enter a description that completely and accurately describes the specific actions the flow performs."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Close the ",(0,o.jsx)(n.strong,{children:"MCP Server Tools"})," dialog to save your changes."]}),"\n"]}),"\n"]}),"\n",(0,o.jsx)(n.h4,{id:"importance-of-tool-names-and-descriptions",children:"Importance of tool names and descriptions"}),"\n",(0,o.jsx)(n.p,{children:"MCP clients use tool names and descriptions to determine which actions to use when generating responses."}),"\n",(0,o.jsx)(n.p,{children:"Because MCP clients treat your Langflow project as a single MCP server with all of your enabled flows listed as tools, unclear names and descriptions can cause the agent to select tools incorrectly or inconsistently."}),"\n",(0,o.jsxs)(n.p,{children:["For example, a flow's default tool name is the flow ID, such as ",(0,o.jsx)(n.code,{children:"adbbf8c7-0a34-493b-90ea-5e8b42f78b66"}),".\nThis provides no information to an agent about the type of flow or its purpose."]}),"\n",(0,o.jsx)(n.p,{children:"To provide more context about your flows, make sure to name and describe your flows clearly when configuring your Langflow project's MCP server."}),"\n",(0,o.jsx)(n.p,{children:"Think of these names and descriptions as function names and code comments.\nUse clear statements to describe the problems your flows solve."}),"\n",(0,o.jsxs)(s,{children:[(0,o.jsx)("summary",{children:"Example: Tool name and description usage"}),(0,o.jsxs)(n.p,{children:["For example, assume you create a flow based on the ",(0,o.jsx)(n.strong,{children:"Document Q&A"})," template that uses an LLM to chat about resumes, and then you give the flow the following name and description:"]}),(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Tool name"}),": ",(0,o.jsx)(n.code,{children:"document_qa_for_resume"})]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Tool description"}),": ",(0,o.jsx)(n.code,{children:"A flow for analyzing Emily's resume."})]}),"\n"]}),"\n"]}),(0,o.jsxs)(n.p,{children:["After connecting your Langflow MCP server to Cursor, you can ask Cursor about the resume, such as ",(0,o.jsx)(n.code,{children:"What job experience does Emily have?"}),".\nUsing the context provided by your tool name and description, the agent can decide to use the ",(0,o.jsx)(n.code,{children:"document_qa_for_resume"})," MCP tool to create a response about Emily's resume.\nIf necessary, the agent asks permission to use the flow tool before generating the response."]}),(0,o.jsxs)(n.p,{children:["If you ask about a different resume, such as ",(0,o.jsx)(n.code,{children:"What job experience does Alex have?"}),", the agent can decide that ",(0,o.jsx)(n.code,{children:"document_qa_for_resume"})," isn't relevant to this request, because the tool description specifies that the flow is for Emily's resume.\nIn this case, the agent might use another available tool, or it can inform you that it doesn't have access to information about Alex's.\nFor example:"]}),(0,o.jsx)(p.Code,{codeConfig:x,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"I notice you're asking about Alex's job experience.",props:{}}]},{tokens:[{content:"Based on the available tools, I can see there is a Document QA for Resume flow that's designed for analyzing resumes.",props:{}}]},{tokens:[{content:"However, the description mentions it's for \"Emily's resume\" not Alex's. I don't have access to Alex's resume or job experience information.",props:{}}]}],lang:"text"},annotations:[]}]})]}),"\n","\n",(0,o.jsx)(n.h2,{id:"connect-clients-to-use-the-servers-actions",children:"Connect clients to your Langflow MCP server"}),"\n",(0,o.jsx)(n.p,{children:"Langflow provides automatic installation and code snippets to help you deploy your Langflow MCP servers to your local MCP clients."}),"\n",(0,o.jsxs)(i.A,{children:[(0,o.jsxs)(c.A,{value:"JSON",label:"JSON",default:!0,children:[(0,o.jsxs)(n.p,{children:["The JSON option allows you to connect a Langflow MCP server to any local or remote MCP client.\nYou can modify this process for any ",(0,o.jsx)(n.a,{href:"https://modelcontextprotocol.io/clients",children:"MCP-compatible client"}),"."]}),(0,o.jsxs)(n.ol,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Install any ",(0,o.jsx)(n.a,{href:"https://modelcontextprotocol.io/clients",children:"MCP-compatible client"}),"."]}),"\n",(0,o.jsx)(n.p,{children:"These steps use Cursor as an example, but the process is generally the same for all clients, with slight differences in client-specific details like file names."}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:"In your client, add a new MCP server using the client's UI or configuration file."}),"\n",(0,o.jsxs)(n.p,{children:["For example, in Cursor, go to ",(0,o.jsx)(n.strong,{children:"Cursor Settings"}),", select ",(0,o.jsx)(n.strong,{children:"MCP"}),", and then click ",(0,o.jsx)(n.strong,{children:"Add New Global MCP Server"})," to open Cursor's global ",(0,o.jsx)(n.code,{children:"mcp.json"})," configuration file."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Recommended: Configure ",(0,o.jsx)(n.a,{href:"#authentication",children:"authentication"})," for your MCP server."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["In Langflow, on the ",(0,o.jsx)(n.strong,{children:"Projects"})," page, click the ",(0,o.jsx)(n.strong,{children:"MCP Server"})," tab."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Click the ",(0,o.jsx)(n.strong,{children:"JSON"})," tab, copy the code snippet for your operating system, and then paste it into your client's MCP configuration file.\nFor example:"]}),"\n",(0,o.jsx)(p.Code,{codeConfig:x,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"{",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "mcpServers"',props:{style:{color:"#7EE787"}}},{content:": {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "PROJECT_NAME"',props:{style:{color:"#7EE787"}}},{content:": {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "command"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"uvx"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "args"',props:{style:{color:"#7EE787"}}},{content:": [",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "mcp-proxy"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "http://LANGFLOW_SERVER_ADDRESS/api/v1/mcp/project/PROJECT_ID/sse"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" ]",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" }",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" }",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]}],lang:"json"},annotations:[]}]}),"\n",(0,o.jsxs)(n.p,{children:["The ",(0,o.jsx)(n.strong,{children:"MCP Server"})," tab automatically populates the ",(0,o.jsx)(n.code,{children:"PROJECT_NAME"}),", ",(0,o.jsx)(n.code,{children:"LANGFLOW_SERVER_ADDRESS"}),", and ",(0,o.jsx)(n.code,{children:"PROJECT_ID"})," values."]}),"\n",(0,o.jsxs)(n.p,{children:["The default Langflow server address is ",(0,o.jsx)(n.code,{children:"http://localhost:7860"}),".\nIf you are using a ",(0,o.jsx)(n.a,{href:"/deployment-public-server",children:"public Langflow server"}),", the server address is automatically included."]}),"\n",(0,o.jsxs)(n.p,{children:["If your Langflow server requires authentication, you must include your Langflow API key or OAuth settings in the configuration.\nFor more information, see ",(0,o.jsx)(n.a,{href:"#authentication",children:"MCP server authentication"}),"."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["To include other environment variables with your MCP server command, add an ",(0,o.jsx)(n.code,{children:"env"})," object with key-value pairs of environment variables:"]}),"\n",(0,o.jsx)(p.Code,{codeConfig:x,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"{",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "mcpServers"',props:{style:{color:"#7EE787"}}},{content:": {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "PROJECT_NAME"',props:{style:{color:"#7EE787"}}},{content:": {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "command"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"uvx"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "args"',props:{style:{color:"#7EE787"}}},{content:": [",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "mcp-proxy"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "http://LANGFLOW_SERVER_ADDRESS/api/v1/mcp/project/PROJECT_ID/sse"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" ],",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "env"',props:{style:{color:"#7EE787"}}},{content:": {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "KEY"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"VALUE"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" }",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" }",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" }",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]}],lang:"json"},annotations:[]}]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:"Save and close your client's MCP configuration file."}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:"Confirm that your Langflow MCP server is on the client's list of MCP servers.\nIf necessary, restart your client to apply the modified configuration file."}),"\n"]}),"\n"]})]}),(0,o.jsxs)(c.A,{value:"auto",label:"Auto install",children:[(0,o.jsx)(n.admonition,{type:"info",children:(0,o.jsxs)(n.p,{children:["The auto install option is available only for specific MCP clients.\nAuto install requires the client to be installed locally so Langflow can write to the client's configuration file.\nIf your client isn't supported, is installed remotely, or you need to pass additional environment variables, use the ",(0,o.jsx)(n.strong,{children:"JSON"})," option."]})}),(0,o.jsxs)(n.ol,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Install ",(0,o.jsx)(n.a,{href:"https://docs.cursor.com/get-started/installation",children:"Cursor"}),", ",(0,o.jsx)(n.a,{href:"https://claude.ai/download",children:"Claude"}),", or ",(0,o.jsx)(n.a,{href:"https://windsurf.com/download/editor",children:"Windsurf"})," on the same computer where your Langflow server is running."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Recommended: Configure ",(0,o.jsx)(n.a,{href:"#authentication",children:"authentication"})," for your MCP server."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["In Langflow, on the ",(0,o.jsx)(n.strong,{children:"Projects"})," page, click the ",(0,o.jsx)(n.strong,{children:"MCP Server"})," tab."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["On the ",(0,o.jsx)(n.strong,{children:"Auto install"})," tab, find your MCP client provider, and then click ",(0,o.jsx)(a.A,{name:"Plus","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Add"}),"."]}),"\n",(0,o.jsxs)(n.p,{children:["Your Langflow project's MCP server is automatically added to the configuration file for your local Cursor, Claude, or Windsurf client.\nFor example, with Cursor, the server configuration is added to the ",(0,o.jsx)(n.code,{children:"mcp.json"})," configuration file."]}),"\n",(0,o.jsx)(n.p,{children:"Langflow attempts to add this configuration even if the selected client isn't installed.\nTo verify the installation, check the available MCP servers in your client."}),"\n"]}),"\n"]})]})]}),"\n",(0,o.jsxs)(n.p,{children:["Once your MCP client is connected to your Langflow project's MCP server, your flows are registered as tools.\nCursor determines when to use tools based on your queries, and requests permissions when necessary.\nFor more information, see the MCP documentation for your client, such as ",(0,o.jsx)(n.a,{href:"https://docs.cursor.com/context/model-context-protocol",children:"Cursor's MCP documentation"}),"."]}),"\n",(0,o.jsx)(n.h2,{id:"authentication",children:"MCP server authentication"}),"\n",(0,o.jsxs)(n.p,{children:["Each ",(0,o.jsx)(n.a,{href:"/concepts-flows#projects",children:"Langflow project"})," has its own MCP server with its own MCP server authentication settings."]}),"\n",(0,o.jsxs)(n.p,{children:["To configure authentication for a Langflow MCP server, go to the ",(0,o.jsx)(n.strong,{children:"Projects"})," page in Langflow, click the ",(0,o.jsx)(n.strong,{children:"MCP Server"})," tab, click ",(0,o.jsx)(a.A,{name:"Fingerprint","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Edit Auth"}),", and then select your preferred authentication method:"]}),"\n",(0,o.jsxs)(i.A,{groupId:"auth-type",children:[(0,o.jsxs)(c.A,{value:"API key",label:"API key",children:[(0,o.jsxs)(n.p,{children:["When authenticating your MCP server with a Langflow API key, your project's MCP server ",(0,o.jsx)(n.strong,{children:"JSON"})," code snippets and ",(0,o.jsx)(n.strong,{children:"Auto install"})," configuration automatically include the ",(0,o.jsx)(n.code,{children:"--headers"})," and ",(0,o.jsx)(n.code,{children:"x-api-key"})," arguments."]}),(0,o.jsxs)(n.p,{children:["Click ",(0,o.jsx)(a.A,{name:"key","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Generate API key"})," to automatically insert a new Langflow API key into the code template.\nAlternatively, you can replace ",(0,o.jsx)(n.code,{children:"YOUR_API_KEY"})," with an existing Langflow API key."]})]}),(0,o.jsxs)(c.A,{value:"OAuth",label:"OAuth",children:[(0,o.jsxs)(n.p,{children:["When OAuth is enabled, Langflow automatically starts an ",(0,o.jsx)(n.a,{href:"https://pypi.org/project/mcp-composer",children:"MCP Composer"})," instance for your project, creating a secure client-side proxy between MCP clients and the ",(0,o.jsx)(n.code,{children:"mcp-proxy"})," on your server."]}),(0,o.jsx)(n.p,{children:"OAuth integration allows your Langflow MCP server to authenticate users and applications through any OAuth 2.0 compliant service. When users or applications connect to your MCP server, they are redirected to your chosen OAuth provider to authenticate. Upon successful authentication, they are granted access to your flows as MCP tools."}),(0,o.jsx)(n.p,{children:"Before configuring OAuth in Langflow, you must first set up an OAuth application with an external OAuth 2.0 service provider.\nYou must register your Langflow server as an OAuth client, and then obtain the required values to complete the configuration in Langflow."}),(0,o.jsxs)(n.p,{children:["The following table describes the required values.\n",(0,o.jsx)(n.a,{href:"https://github.com/settings/developers",children:"GitHub OAuth"})," is used for example purposes.\nBe sure to use the actual values from your own deployment.\nFor more information, see your OAuth provider's documentation."]}),(0,o.jsxs)(n.table,{children:[(0,o.jsx)(n.thead,{children:(0,o.jsxs)(n.tr,{children:[(0,o.jsx)(n.th,{children:"Field"}),(0,o.jsx)(n.th,{children:"Description"}),(0,o.jsx)(n.th,{children:"Source"}),(0,o.jsx)(n.th,{children:"Example"})]})}),(0,o.jsxs)(n.tbody,{children:[(0,o.jsxs)(n.tr,{children:[(0,o.jsx)(n.td,{children:(0,o.jsx)(n.strong,{children:"Host"})}),(0,o.jsx)(n.td,{children:"OAuth server host"}),(0,o.jsx)(n.td,{children:"MCP Composer default."}),(0,o.jsx)(n.td,{children:(0,o.jsx)(n.code,{children:"localhost"})})]}),(0,o.jsxs)(n.tr,{children:[(0,o.jsx)(n.td,{children:(0,o.jsx)(n.strong,{children:"Port"})}),(0,o.jsx)(n.td,{children:"OAuth server port"}),(0,o.jsx)(n.td,{children:"MCP Composer default."}),(0,o.jsx)(n.td,{children:(0,o.jsx)(n.code,{children:"9000"})})]}),(0,o.jsxs)(n.tr,{children:[(0,o.jsx)(n.td,{children:(0,o.jsx)(n.strong,{children:"Server URL"})}),(0,o.jsx)(n.td,{children:"Full OAuth server URL"}),(0,o.jsx)(n.td,{children:"Combines the MCP Composer default OAuth host and port."}),(0,o.jsx)(n.td,{children:(0,o.jsx)(n.code,{children:"http://localhost:9000"})})]}),(0,o.jsxs)(n.tr,{children:[(0,o.jsx)(n.td,{children:(0,o.jsx)(n.strong,{children:"Callback Path"})}),(0,o.jsx)(n.td,{children:"OAuth callback URL on your server"}),(0,o.jsx)(n.td,{children:"You define this address during OAuth app registration."}),(0,o.jsx)(n.td,{children:(0,o.jsx)(n.code,{children:"http://localhost:9000/auth/idaas/callback"})})]}),(0,o.jsxs)(n.tr,{children:[(0,o.jsx)(n.td,{children:(0,o.jsx)(n.strong,{children:"Client ID"})}),(0,o.jsx)(n.td,{children:"Your OAuth client identifier"}),(0,o.jsx)(n.td,{children:"From your OAuth provider."}),(0,o.jsx)(n.td,{children:(0,o.jsx)(n.code,{children:"Ov23li9vx2grVL61qjb"})})]}),(0,o.jsxs)(n.tr,{children:[(0,o.jsx)(n.td,{children:(0,o.jsx)(n.strong,{children:"Client Secret"})}),(0,o.jsx)(n.td,{children:"Your OAuth client secret"}),(0,o.jsx)(n.td,{children:"From your OAuth provider."}),(0,o.jsx)(n.td,{children:(0,o.jsx)(n.code,{children:"1234567890abcdef1234567890abcdef12345678"})})]}),(0,o.jsxs)(n.tr,{children:[(0,o.jsx)(n.td,{children:(0,o.jsx)(n.strong,{children:"Authorization URL"})}),(0,o.jsx)(n.td,{children:"OAuth authorization endpoint"}),(0,o.jsx)(n.td,{children:"From your OAuth provider."}),(0,o.jsx)(n.td,{children:(0,o.jsx)(n.code,{children:"https://github.com/login/oauth/authorize"})})]}),(0,o.jsxs)(n.tr,{children:[(0,o.jsx)(n.td,{children:(0,o.jsx)(n.strong,{children:"Token URL"})}),(0,o.jsx)(n.td,{children:"OAuth token endpoint for getting refresh tokens"}),(0,o.jsx)(n.td,{children:"From your OAuth provider."}),(0,o.jsx)(n.td,{children:(0,o.jsx)(n.code,{children:"https://github.com/login/oauth/access_token"})})]}),(0,o.jsxs)(n.tr,{children:[(0,o.jsx)(n.td,{children:(0,o.jsx)(n.strong,{children:"MCP Scope"})}),(0,o.jsx)(n.td,{children:"Scope for MCP operations"}),(0,o.jsxs)(n.td,{children:["You define this. As of Langflow 1.6, ",(0,o.jsx)(n.code,{children:"user"})," is the only available value."]}),(0,o.jsx)(n.td,{children:(0,o.jsx)(n.code,{children:"user"})})]}),(0,o.jsxs)(n.tr,{children:[(0,o.jsx)(n.td,{children:(0,o.jsx)(n.strong,{children:"Provider Scope"})}),(0,o.jsx)(n.td,{children:"OAuth provider scope"}),(0,o.jsxs)(n.td,{children:["You define this. As of Langflow 1.6, ",(0,o.jsx)(n.code,{children:"openid"})," is the only available value."]}),(0,o.jsx)(n.td,{children:(0,o.jsx)(n.code,{children:"openid"})})]})]})]}),(0,o.jsx)(n.p,{children:"To configure OAuth authentication:"}),(0,o.jsxs)(n.ol,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Select ",(0,o.jsx)(n.strong,{children:"OAuth"})," as the authentication type."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:"Configure the OAuth settings with the values from your OAuth deployment.\nAll values are required."}),"\n",(0,o.jsx)(n.p,{children:"The OAuth credentials are encrypted and stored securely in your Langflow database."}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Click ",(0,o.jsx)(n.strong,{children:"Save"}),"."]}),"\n",(0,o.jsxs)(n.p,{children:["Your MCP server's ",(0,o.jsx)(n.strong,{children:"JSON"})," code snippets and ",(0,o.jsx)(n.strong,{children:"Auto install"})," configuration are automatically updated with OAuth values. These are automatically used for new installations after enabling OAuth. However, you must manually update any existing installations, as explained in the next step."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:"If you already installed your Langflow MCP server in your MCP client, you must update your MCP client configuration to use the new OAuth settings after enabling OAuth on your MCP server.\nThe client update method depends on how you installed the server on the client:"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"Auto install"}),": Manually update your client's config file using the updated JSON snippet from the ",(0,o.jsx)(n.strong,{children:"JSON"})," tab, or repeat the steps in ",(0,o.jsx)(n.a,{href:"#connect-clients-to-use-the-servers-actions",children:"Auto-install"})," to re-install the client with the updated settings."]}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"JSON option"}),": Copy the updated JSON snippet from the ",(0,o.jsx)(n.strong,{children:"JSON"})," tab and replace your existing configuration."]}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"New connections"}),": Use either the ",(0,o.jsx)(n.strong,{children:"Auto install"})," or ",(0,o.jsx)(n.strong,{children:"JSON"})," option. The OAuth settings are included automatically."]}),"\n"]}),"\n"]}),"\n"]}),(0,o.jsxs)(n.p,{children:["After you enable OAuth and update your client configuration, an OAuth callback window opens each time your MCP client attempts to authenticate with the server.\nA successful authentication returns ",(0,o.jsx)(n.code,{children:"Authentication complete. You may close this window."}),"\nIf your client doesn't open the OAuth window, try restarting the client to retrieve the updated configuration."]})]}),(0,o.jsx)(c.A,{value:"None",label:"None",children:(0,o.jsx)(n.p,{children:"When no authentication is configured, your MCP server becomes a public endpoint that anyone can access without providing credentials.\nOnly use this option when Langflow is running in a trusted environment."})})]}),"\n",(0,o.jsx)(n.h2,{id:"mcp-server-environment-variables",children:"MCP server environment variables"}),"\n",(0,o.jsx)(n.p,{children:"The following environment variables set behaviors related to your Langflow projects' MCP servers:"}),"\n",(0,o.jsxs)(n.table,{children:[(0,o.jsx)(n.thead,{children:(0,o.jsxs)(n.tr,{children:[(0,o.jsx)(n.th,{children:"Variable"}),(0,o.jsx)(n.th,{children:"Format"}),(0,o.jsx)(n.th,{children:"Default"}),(0,o.jsx)(n.th,{children:"Description"})]})}),(0,o.jsxs)(n.tbody,{children:[(0,o.jsxs)(n.tr,{children:[(0,o.jsx)(n.td,{children:(0,o.jsx)(n.code,{children:"LANGFLOW_MCP_SERVER_ENABLED"})}),(0,o.jsx)(n.td,{children:"Boolean"}),(0,o.jsx)(n.td,{children:(0,o.jsx)(n.code,{children:"True"})}),(0,o.jsxs)(n.td,{children:["Whether to initialize an MCP server for each of your Langflow projects. If ",(0,o.jsx)(n.code,{children:"false"}),", Langflow doesn't initialize MCP servers."]})]}),(0,o.jsxs)(n.tr,{children:[(0,o.jsx)(n.td,{children:(0,o.jsx)(n.code,{children:"LANGFLOW_MCP_SERVER_ENABLE_PROGRESS_NOTIFICATIONS"})}),(0,o.jsx)(n.td,{children:"Boolean"}),(0,o.jsx)(n.td,{children:(0,o.jsx)(n.code,{children:"False"})}),(0,o.jsxs)(n.td,{children:["If ",(0,o.jsx)(n.code,{children:"true"}),", Langflow MCP servers send progress notifications."]})]}),(0,o.jsxs)(n.tr,{children:[(0,o.jsx)(n.td,{children:(0,o.jsx)(n.code,{children:"LANGFLOW_MCP_SERVER_TIMEOUT"})}),(0,o.jsx)(n.td,{children:"Integer"}),(0,o.jsx)(n.td,{children:(0,o.jsx)(n.code,{children:"20"})}),(0,o.jsx)(n.td,{children:"The number of seconds to wait before an MCP server operation expires due to poor connectivity or long-running requests."})]}),(0,o.jsxs)(n.tr,{children:[(0,o.jsx)(n.td,{children:(0,o.jsx)(n.code,{children:"LANGFLOW_MCP_MAX_SESSIONS_PER_SERVER"})}),(0,o.jsx)(n.td,{children:"Integer"}),(0,o.jsx)(n.td,{children:(0,o.jsx)(n.code,{children:"10"})}),(0,o.jsx)(n.td,{children:"Maximum number of MCP sessions to keep per unique server."})]})]})]}),"\n","\n",(0,o.jsx)(n.h3,{id:"deploy-your-server-externally",children:"Deploy your Langflow MCP server externally"}),"\n",(0,o.jsxs)(n.p,{children:["To deploy your Langflow MCP server externally, see ",(0,o.jsx)(n.a,{href:"/deployment-public-server",children:"Deploy a public Langflow server"}),"."]}),"\n",(0,o.jsx)(n.h2,{id:"test-and-debug-flows",children:"Use MCP Inspector to test and debug flows"}),"\n",(0,o.jsx)(n.admonition,{title:"Node prerequisite",type:"info",children:(0,o.jsxs)(n.p,{children:["MCP Inspector requires any LTS version of ",(0,o.jsx)(n.a,{href:"https://docs.npmjs.com/downloading-and-installing-node-js-and-npm",children:"Node.js"})," installed on your computer."]})}),"\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.a,{href:"https://modelcontextprotocol.io/docs/tools/inspector",children:"MCP Inspector"})," is a common tool for testing and debugging MCP servers.\nYou can use MCP Inspector to monitor your flows and get insights into how they are being consumed by the MCP server."]}),"\n",(0,o.jsxs)(n.ol,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:"Install MCP Inspector:"}),"\n",(0,o.jsx)(p.Code,{codeConfig:x,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"npx ",props:{style:{color:"#FFA657"}}},{content:"@modelcontextprotocol/inspector",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,o.jsxs)(n.p,{children:["For more information about configuring MCP Inspector, including specifying a proxy port, see the ",(0,o.jsx)(n.a,{href:"https://github.com/modelcontextprotocol/inspector",children:"MCP Inspector GitHub project"}),"."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Open a web browser and navigate to the MCP Inspector UI.\nThe default address is ",(0,o.jsx)(n.code,{children:"http://localhost:6274"}),"."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["In the MCP Inspector UI, enter the connection details for your Langflow project's MCP server.\nThe field values depend on your server's method of ",(0,o.jsx)(n.a,{href:"#authentication",children:"authentication"}),"."]}),"\n",(0,o.jsxs)(i.A,{groupId:"auth-type",children:[(0,o.jsx)(c.A,{value:"API key",label:"API key",default:!0,children:(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"Transport Type"}),": Select ",(0,o.jsx)(n.strong,{children:"STDIO"}),"."]}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"Command"}),": ",(0,o.jsx)(n.code,{children:"uvx"})]}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"Arguments"}),": Enter the following list of arguments, separated by spaces. Replace the values for ",(0,o.jsx)(n.code,{children:"YOUR_API_KEY"}),", ",(0,o.jsx)(n.code,{children:"LANGFLOW_SERVER_ADDRESS"}),", and ",(0,o.jsx)(n.code,{children:"PROJECT_ID"})," with the values from your Langflow MCP server. For example:","\n",(0,o.jsx)(p.Code,{codeConfig:x,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"mcp-proxy ",props:{style:{color:"#FFA657"}}},{content:"--headers ",props:{style:{color:"#79C0FF"}}},{content:"x-api-key YOUR_API_KEY http://LANGFLOW_SERVER_ADDRESS/api/v1/mcp/project/PROJECT_ID/sse",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n"]}),"\n"]})}),(0,o.jsx)(c.A,{value:"OAuth",label:"OAuth",children:(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"Transport Type"}),": Select ",(0,o.jsx)(n.strong,{children:"STDIO"}),"."]}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"Command"}),": ",(0,o.jsx)(n.code,{children:"uvx"})]}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"Arguments"}),": Enter the following list of arguments, separated by spaces. Replace the value for ",(0,o.jsx)(n.code,{children:"OAUTH_SERVER_URL"})," with the URL of your OAuth server. For example:","\n",(0,o.jsx)(p.Code,{codeConfig:x,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"mcp-composer ",props:{style:{color:"#FFA657"}}},{content:"--mode ",props:{style:{color:"#79C0FF"}}},{content:"stdio ",props:{style:{color:"#A5D6FF"}}},{content:"--sse-url ",props:{style:{color:"#79C0FF"}}},{content:"http://localhost:9000/sse ",props:{style:{color:"#A5D6FF"}}},{content:"--disable-composer-tools --client_auth_type ",props:{style:{color:"#79C0FF"}}},{content:"oauth",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n"]}),"\n"]})}),(0,o.jsx)(c.A,{value:"None",label:"None",children:(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"Transport Type"}),": Select ",(0,o.jsx)(n.strong,{children:"SSE"}),"."]}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"URL"}),": Enter the Langflow MCP server's ",(0,o.jsx)(n.code,{children:"sse"})," endpoint. For example:","\n",(0,o.jsx)(p.Code,{codeConfig:x,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"http://localhost:7860/api/v1/mcp/project/d359cbd4-6fa2-4002-9d53-fa05c645319c/sse",props:{style:{color:"#FFA657"}}}]}],lang:"bash"},annotations:[]}]}),"\n"]}),"\n"]})})]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Click ",(0,o.jsx)(n.strong,{children:"Connect"}),"."]}),"\n",(0,o.jsxs)(n.p,{children:["If the connection was successful, you should see your project's flows in the ",(0,o.jsx)(n.strong,{children:"Tools"})," tab.\nFrom this tab, you can monitor how your flows are being registered as tools by MCP, as well as test the tools with custom input values."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["To quit MCP Inspector, press ",(0,o.jsx)("kbd",{children:"Control+C"})," in the same terminal window where you started it."]}),"\n"]}),"\n"]}),"\n",(0,o.jsx)(n.h2,{id:"troubleshooting-mcp-server",children:"Troubleshoot Langflow MCP servers"}),"\n",(0,o.jsxs)(n.p,{children:["For troubleshooting advice for MCP servers and clients, see ",(0,o.jsx)(n.a,{href:"/troubleshoot#mcp",children:"Troubleshoot Langflow: MCP issues"}),"."]}),"\n",(0,o.jsx)(n.h2,{id:"see-also",children:"See also"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.a,{href:"/mcp-client",children:"Use Langflow as an MCP client"})}),"\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.a,{href:"/mcp-component-astra",children:"Use a DataStax Astra DB MCP server"})}),"\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.a,{href:"/environment-variables#mcp",children:"MCP server environment variables"})}),"\n"]})]})}function g(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(f,{...e})}):f(e)}function m(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}}}]); \ No newline at end of file diff --git a/assets/js/e6c6a4d2.7d25a990.js b/assets/js/e6c6a4d2.5a335c1f.js similarity index 55% rename from assets/js/e6c6a4d2.7d25a990.js rename to assets/js/e6c6a4d2.5a335c1f.js index 68018c9e04..ba44f82f21 100644 --- a/assets/js/e6c6a4d2.7d25a990.js +++ b/assets/js/e6c6a4d2.5a335c1f.js @@ -1 +1 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[8504],{28453:(e,t,n)=>{n.d(t,{R:()=>a,x:()=>l});var s=n(96540);const i={},o=s.createContext(i);function a(e){const t=s.useContext(o);return s.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:a(e.components),s.createElement(o.Provider,{value:t},e.children)}},94910:(e,t,n)=>{n.r(t),n.d(t,{contentTitle:()=>l,default:()=>d,frontMatter:()=>a,metadata:()=>s,toc:()=>r});const s=JSON.parse('{"type":"api","id":"experimental-run-flow","title":"Experimental Run Flow","description":"","slug":"/experimental-run-flow","frontMatter":{},"api":{"tags":["Base"],"description":"Executes a specified flow by ID with optional input values, output selection, tweaks, and streaming capability.\\n\\nThis endpoint supports running flows with caching to enhance performance and efficiency.\\n\\n### Parameters:\\n- `flow_id` (str): The unique identifier of the flow to be executed.\\n- `inputs` (List[InputValueRequest], optional): A list of inputs specifying the input values and components\\n for the flow. Each input can target specific components and provide custom values.\\n- `outputs` (List[str], optional): A list of output names to retrieve from the executed flow.\\n If not provided, all outputs are returned.\\n- `tweaks` (Optional[Tweaks], optional): A dictionary of tweaks to customize the flow execution.\\n The tweaks can be used to modify the flow\'s parameters and components.\\n Tweaks can be overridden by the input values.\\n- `stream` (bool, optional): Specifies whether the results should be streamed. Defaults to False.\\n- `session_id` (Union[None, str], optional): An optional session ID to utilize existing session data for the flow\\n execution.\\n- `api_key_user` (User): The user associated with the current API key. Automatically resolved from the API key.\\n\\n### Returns:\\nA `RunResponse` object containing the selected outputs (or all if not specified) of the executed flow\\nand the session ID.\\nThe structure of the response accommodates multiple inputs, providing a nested list of outputs for each input.\\n\\n### Raises:\\nHTTPException: Indicates issues with finding the specified flow, invalid input formats, or internal errors during\\nflow execution.\\n\\n### Example usage:\\n```json\\nPOST /run/flow_id\\nx-api-key: YOUR_API_KEY\\nPayload:\\n{\\n \\"inputs\\": [\\n {\\"components\\": [\\"component1\\"], \\"input_value\\": \\"value1\\"},\\n {\\"components\\": [\\"component3\\"], \\"input_value\\": \\"value2\\"}\\n ],\\n \\"outputs\\": [\\"Component Name\\", \\"component_id\\"],\\n \\"tweaks\\": {\\"parameter_name\\": \\"value\\", \\"Component Name\\": {\\"parameter_name\\": \\"value\\"}, \\"component_id\\": {\\"parameter_name\\": \\"value\\"}}\\n \\"stream\\": false\\n}\\n```\\n\\nThis endpoint facilitates complex flow executions with customized inputs, outputs, and configurations,\\ncatering to diverse application requirements.","operationId":"experimental_run_flow_api_v1_run_advanced__flow_id__post","security":[{"API key query":[]},{"API key header":[]}],"parameters":[{"name":"flow_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Flow Id"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"inputs":{"anyOf":[{"items":{"properties":{"components":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Components","default":[]},"input_value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Input Value"},"session":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session"},"type":{"anyOf":[{"type":"string","enum":["chat","text","any"]},{"type":"null"}],"title":"Type","description":"Defines on which components the input value should be applied. \'any\' applies to all input components.","default":"any"}},"additionalProperties":false,"type":"object","title":"InputValueRequest","examples":[{"components":["components_id","Component Name"],"input_value":"input_value","session":"session_id"},{"components":["Component Name"],"input_value":"input_value"},{"input_value":"input_value"},{"components":["Component Name"],"input_value":"input_value","session":"session_id"},{"input_value":"input_value","session":"session_id"},{"input_value":"input_value","type":"chat"},{"input_value":"{\\"key\\": \\"value\\"}","type":"json"}]},"type":"array"},{"type":"null"}],"title":"Inputs"},"outputs":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Outputs"},"tweaks":{"anyOf":[{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"object"}]},"type":"object","title":"Tweaks","description":"A dictionary of tweaks to adjust the flow\'s execution. Allows customizing flow behavior dynamically. All tweaks are overridden by the input values.","examples":[{"Component Name":{"parameter_name":"value"},"component_id":{"parameter_name":"value"},"parameter_name":"value"}]},{"type":"null"}]},"stream":{"type":"boolean","title":"Stream","default":false},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}},"type":"object","title":"Body_experimental_run_flow_api_v1_run_advanced__flow_id__post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"properties":{"outputs":{"anyOf":[{"items":{"properties":{"inputs":{"type":"object","title":"Inputs"},"outputs":{"items":{"anyOf":[{"properties":{"results":{"anyOf":[{},{"type":"null"}],"title":"Results"},"artifacts":{"anyOf":[{},{"type":"null"}],"title":"Artifacts"},"outputs":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Outputs"},"logs":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Logs"},"messages":{"anyOf":[{"items":{"properties":{"message":{"anyOf":[{"type":"string"},{"items":{"anyOf":[{"type":"string"},{"type":"object"}]},"type":"array"}],"title":"Message"},"sender":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender","default":"Machine"},"sender_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender Name","default":"AI"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"},"stream_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stream Url"},"component_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Component Id"},"files":{"items":{"properties":{"path":{"type":"string","title":"Path"},"name":{"type":"string","title":"Name"},"type":{"type":"string","title":"Type"}},"type":"object","required":["path","name","type"],"title":"File","description":"File schema."},"type":"array","title":"Files","default":[]},"type":{"type":"string","title":"Type"}},"type":"object","required":["message","type"],"title":"ChatOutputResponse","description":"Chat output response schema."},"type":"array"},{"type":"null"}],"title":"Messages"},"timedelta":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Timedelta"},"duration":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Duration"},"component_display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Component Display Name"},"component_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Component Id"},"used_frozen_result":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Used Frozen Result","default":false}},"type":"object","title":"ResultData"},{"type":"null"}]},"type":"array","title":"Outputs"}},"type":"object","title":"RunOutputs"},"type":"array"},{"type":"null"}],"title":"Outputs","default":[]},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}},"type":"object","title":"RunResponse","description":"Run response schema."}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"properties":{"detail":{"items":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"}}}}},"method":"post","path":"/api/v1/run/advanced/{flow_id}","securitySchemes":{"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"api/v1/login"}}},"API key query":{"type":"apiKey","in":"query","name":"x-api-key"},"API key header":{"type":"apiKey","in":"header","name":"x-api-key"}},"jsonRequestBodyExample":{"stream":false},"info":{"title":"Langflow","version":"1.5.1"},"postman":{"name":"Experimental Run Flow","description":{"content":"Executes a specified flow by ID with optional input values, output selection, tweaks, and streaming capability.\\n\\nThis endpoint supports running flows with caching to enhance performance and efficiency.\\n\\n### Parameters:\\n- `flow_id` (str): The unique identifier of the flow to be executed.\\n- `inputs` (List[InputValueRequest], optional): A list of inputs specifying the input values and components\\n for the flow. Each input can target specific components and provide custom values.\\n- `outputs` (List[str], optional): A list of output names to retrieve from the executed flow.\\n If not provided, all outputs are returned.\\n- `tweaks` (Optional[Tweaks], optional): A dictionary of tweaks to customize the flow execution.\\n The tweaks can be used to modify the flow\'s parameters and components.\\n Tweaks can be overridden by the input values.\\n- `stream` (bool, optional): Specifies whether the results should be streamed. Defaults to False.\\n- `session_id` (Union[None, str], optional): An optional session ID to utilize existing session data for the flow\\n execution.\\n- `api_key_user` (User): The user associated with the current API key. Automatically resolved from the API key.\\n\\n### Returns:\\nA `RunResponse` object containing the selected outputs (or all if not specified) of the executed flow\\nand the session ID.\\nThe structure of the response accommodates multiple inputs, providing a nested list of outputs for each input.\\n\\n### Raises:\\nHTTPException: Indicates issues with finding the specified flow, invalid input formats, or internal errors during\\nflow execution.\\n\\n### Example usage:\\n```json\\nPOST /run/flow_id\\nx-api-key: YOUR_API_KEY\\nPayload:\\n{\\n \\"inputs\\": [\\n {\\"components\\": [\\"component1\\"], \\"input_value\\": \\"value1\\"},\\n {\\"components\\": [\\"component3\\"], \\"input_value\\": \\"value2\\"}\\n ],\\n \\"outputs\\": [\\"Component Name\\", \\"component_id\\"],\\n \\"tweaks\\": {\\"parameter_name\\": \\"value\\", \\"Component Name\\": {\\"parameter_name\\": \\"value\\"}, \\"component_id\\": {\\"parameter_name\\": \\"value\\"}}\\n \\"stream\\": false\\n}\\n```\\n\\nThis endpoint facilitates complex flow executions with customized inputs, outputs, and configurations,\\ncatering to diverse application requirements.","type":"text/plain"},"url":{"path":["api","v1","run","advanced",":flow_id"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) ","type":"text/plain"},"type":"any","value":"","key":"flow_id"}]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"{\\n \\"inputs\\": [\\n {\\n \\"components\\": [\\n \\"\\",\\n \\"\\"\\n ],\\n \\"input_value\\": \\"\\",\\n \\"session\\": \\"\\",\\n \\"type\\": \\"\\"\\n },\\n {\\n \\"components\\": [\\n \\"\\",\\n \\"\\"\\n ],\\n \\"input_value\\": \\"\\",\\n \\"session\\": \\"\\",\\n \\"type\\": \\"\\"\\n }\\n ],\\n \\"outputs\\": [\\n \\"\\",\\n \\"\\"\\n ],\\n \\"tweaks\\": {\\n \\"Utca\\": \\"\\",\\n \\"aliquip_3a\\": \\"\\"\\n },\\n \\"stream\\": false,\\n \\"session_id\\": \\"\\"\\n}","options":{"raw":{"language":"json"}}},"auth":{"type":"apikey","apikey":[{"type":"any","value":"x-api-key","key":"key"},{"type":"any","value":"{{apiKey}}","key":"value"},{"type":"any","value":"query","key":"in"}]}}},"source":"@site/openapi.json","sourceDirName":".","permalink":"/api/experimental-run-flow","previous":{"title":"Webhook Run Flow","permalink":"/api/webhook-run-flow"},"next":{"title":"Process","permalink":"/api/process"}}');var i=n(74848),o=n(28453);const a={},l="Experimental Run Flow",r=[{value:"Parameters:",id:"parameters",level:3},{value:"Returns:",id:"returns",level:3},{value:"Raises:",id:"raises",level:3},{value:"Example usage:",id:"example-usage",level:3}];function p(e){const t={code:"code",h1:"h1",h3:"h3",header:"header",li:"li",p:"p",pre:"pre",ul:"ul",...(0,o.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.header,{children:(0,i.jsx)(t.h1,{id:"experimental-run-flow",children:"Experimental Run Flow"})}),"\n",(0,i.jsx)(t.p,{children:"Executes a specified flow by ID with optional input values, output selection, tweaks, and streaming capability."}),"\n",(0,i.jsx)(t.p,{children:"This endpoint supports running flows with caching to enhance performance and efficiency."}),"\n",(0,i.jsx)(t.h3,{id:"parameters",children:"Parameters:"}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"flow_id"})," (str): The unique identifier of the flow to be executed."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"inputs"})," (List[InputValueRequest], optional): A list of inputs specifying the input values and components\nfor the flow. Each input can target specific components and provide custom values."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"outputs"})," (List[str], optional): A list of output names to retrieve from the executed flow.\nIf not provided, all outputs are returned."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"tweaks"})," (Optional[Tweaks], optional): A dictionary of tweaks to customize the flow execution.\nThe tweaks can be used to modify the flow's parameters and components.\nTweaks can be overridden by the input values."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"stream"})," (bool, optional): Specifies whether the results should be streamed. Defaults to False."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"session_id"})," (Union[None, str], optional): An optional session ID to utilize existing session data for the flow\nexecution."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"api_key_user"})," (User): The user associated with the current API key. Automatically resolved from the API key."]}),"\n"]}),"\n",(0,i.jsx)(t.h3,{id:"returns",children:"Returns:"}),"\n",(0,i.jsxs)(t.p,{children:["A ",(0,i.jsx)(t.code,{children:"RunResponse"})," object containing the selected outputs (or all if not specified) of the executed flow\nand the session ID.\nThe structure of the response accommodates multiple inputs, providing a nested list of outputs for each input."]}),"\n",(0,i.jsx)(t.h3,{id:"raises",children:"Raises:"}),"\n",(0,i.jsx)(t.p,{children:"HTTPException: Indicates issues with finding the specified flow, invalid input formats, or internal errors during\nflow execution."}),"\n",(0,i.jsx)(t.h3,{id:"example-usage",children:"Example usage:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-json",children:'POST /run/flow_id\nx-api-key: YOUR_API_KEY\nPayload:\n{\n "inputs": [\n {"components": ["component1"], "input_value": "value1"},\n {"components": ["component3"], "input_value": "value2"}\n ],\n "outputs": ["Component Name", "component_id"],\n "tweaks": {"parameter_name": "value", "Component Name": {"parameter_name": "value"}, "component_id": {"parameter_name": "value"}}\n "stream": false\n}\n'})}),"\n",(0,i.jsx)(t.p,{children:"This endpoint facilitates complex flow executions with customized inputs, outputs, and configurations,\ncatering to diverse application requirements."}),"\n",(0,i.jsxs)("table",{style:{display:"table",width:"100%"},children:[(0,i.jsx)("thead",{children:(0,i.jsx)("tr",{children:(0,i.jsx)("th",{style:{textAlign:"left"},children:"Path Parameters"})})}),(0,i.jsx)("tbody",{children:(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsx)("code",{children:"flow_id"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" uuid"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" \u2014 "}),(0,i.jsx)("strong",{style:{fontSize:"var(--ifm-code-font-size)",color:"var(--openapi-required)"},children:" REQUIRED"})]})})})]}),"\n",(0,i.jsxs)("table",{style:{display:"table",width:"100%"},children:[(0,i.jsx)("thead",{children:(0,i.jsx)("tr",{children:(0,i.jsxs)("th",{style:{textAlign:"left"},children:[(0,i.jsx)("span",{children:"Request Body "}),(0,i.jsx)("div",{})]})})}),(0,i.jsxs)("tbody",{children:[(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsx)("code",{children:"inputs"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" Inputs"})]})}),(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsx)("code",{children:"outputs"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" Outputs"})]})}),(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsx)("code",{children:"tweaks"}),(0,i.jsx)("span",{style:{opacity:"0.6"}})]})}),(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsx)("code",{children:"stream"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" Stream"})]})}),(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsx)("code",{children:"session_id"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" Session Id"})]})})]})]}),"\n",(0,i.jsxs)("table",{style:{display:"table",width:"100%"},children:[(0,i.jsx)("thead",{children:(0,i.jsx)("tr",{children:(0,i.jsx)("th",{style:{textAlign:"left"},children:"Responses"})})}),(0,i.jsxs)("tbody",{children:[(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsxs)("div",{style:{display:"flex"},children:[(0,i.jsx)("div",{style:{marginRight:"var(--ifm-table-cell-padding)"},children:(0,i.jsx)("code",{children:"200"})}),(0,i.jsx)("div",{children:(0,i.jsx)(t.p,{children:"Successful Response"})})]}),(0,i.jsx)("div",{children:(0,i.jsxs)("table",{style:{display:"table",width:"100%",marginTop:"var(--ifm-table-cell-padding)",marginBottom:"0px"},children:[(0,i.jsx)("thead",{children:(0,i.jsx)("tr",{children:(0,i.jsxs)("th",{style:{textAlign:"left"},children:[(0,i.jsx)("span",{children:"Schema "}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" \u2014 "}),(0,i.jsx)("strong",{style:{fontSize:"var(--ifm-code-font-size)",color:"var(--openapi-optional)"},children:" OPTIONAL"}),(0,i.jsx)("div",{})]})})}),(0,i.jsxs)("tbody",{children:[(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsx)("code",{children:"outputs"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" Outputs"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" \u2014 "}),(0,i.jsx)("strong",{style:{fontSize:"var(--ifm-code-font-size)",color:"var(--openapi-optional)"},children:" OPTIONAL"})]})}),(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsx)("code",{children:"session_id"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" Session Id"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" \u2014 "}),(0,i.jsx)("strong",{style:{fontSize:"var(--ifm-code-font-size)",color:"var(--openapi-optional)"},children:" OPTIONAL"})]})})]})]})})]})}),(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsxs)("div",{style:{display:"flex"},children:[(0,i.jsx)("div",{style:{marginRight:"var(--ifm-table-cell-padding)"},children:(0,i.jsx)("code",{children:"422"})}),(0,i.jsx)("div",{children:(0,i.jsx)(t.p,{children:"Validation Error"})})]}),(0,i.jsx)("div",{children:(0,i.jsxs)("table",{style:{display:"table",width:"100%",marginTop:"var(--ifm-table-cell-padding)",marginBottom:"0px"},children:[(0,i.jsx)("thead",{children:(0,i.jsx)("tr",{children:(0,i.jsxs)("th",{style:{textAlign:"left"},children:[(0,i.jsx)("span",{children:"Schema "}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" \u2014 "}),(0,i.jsx)("strong",{style:{fontSize:"var(--ifm-code-font-size)",color:"var(--openapi-optional)"},children:" OPTIONAL"}),(0,i.jsx)("div",{})]})})}),(0,i.jsx)("tbody",{children:(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsx)("code",{children:"detail"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" object[]"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" \u2014 "}),(0,i.jsx)("strong",{style:{fontSize:"var(--ifm-code-font-size)",color:"var(--openapi-optional)"},children:" OPTIONAL"}),(0,i.jsx)("table",{style:{display:"table",width:"100%",marginTop:"var(--ifm-table-cell-padding)",marginBottom:"0px"},children:(0,i.jsxs)("tbody",{children:[(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsx)("code",{children:"loc"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" undefined[]"})]})}),(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsx)("code",{children:"msg"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" Message"})]})}),(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsx)("code",{children:"type"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" Error Type"})]})})]})})]})})})]})})]})})]})]})]})}function d(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(p,{...e})}):p(e)}}}]); \ No newline at end of file +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[8504],{28453:(e,t,n)=>{n.d(t,{R:()=>a,x:()=>l});var s=n(96540);const i={},o=s.createContext(i);function a(e){const t=s.useContext(o);return s.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:a(e.components),s.createElement(o.Provider,{value:t},e.children)}},94910:(e,t,n)=>{n.r(t),n.d(t,{contentTitle:()=>l,default:()=>d,frontMatter:()=>a,metadata:()=>s,toc:()=>r});const s=JSON.parse('{"type":"api","id":"experimental-run-flow","title":"Experimental Run Flow","description":"","slug":"/experimental-run-flow","frontMatter":{},"api":{"tags":["Base"],"description":"Executes a specified flow by ID with optional input values, output selection, tweaks, and streaming capability.\\n\\nThis endpoint supports running flows with caching to enhance performance and efficiency.\\n\\n### Parameters:\\n- `flow_id` (str): The unique identifier of the flow to be executed.\\n- `inputs` (List[InputValueRequest], optional): A list of inputs specifying the input values and components\\n for the flow. Each input can target specific components and provide custom values.\\n- `outputs` (List[str], optional): A list of output names to retrieve from the executed flow.\\n If not provided, all outputs are returned.\\n- `tweaks` (Optional[Tweaks], optional): A dictionary of tweaks to customize the flow execution.\\n The tweaks can be used to modify the flow\'s parameters and components.\\n Tweaks can be overridden by the input values.\\n- `stream` (bool, optional): Specifies whether the results should be streamed. Defaults to False.\\n- `session_id` (Union[None, str], optional): An optional session ID to utilize existing session data for the flow\\n execution.\\n- `api_key_user` (User): The user associated with the current API key. Automatically resolved from the API key.\\n\\n### Returns:\\nA `RunResponse` object containing the selected outputs (or all if not specified) of the executed flow\\nand the session ID.\\nThe structure of the response accommodates multiple inputs, providing a nested list of outputs for each input.\\n\\n### Raises:\\nHTTPException: Indicates issues with finding the specified flow, invalid input formats, or internal errors during\\nflow execution.\\n\\n### Example usage:\\n```json\\nPOST /run/flow_id\\nx-api-key: YOUR_API_KEY\\nPayload:\\n{\\n \\"inputs\\": [\\n {\\"components\\": [\\"component1\\"], \\"input_value\\": \\"value1\\"},\\n {\\"components\\": [\\"component3\\"], \\"input_value\\": \\"value2\\"}\\n ],\\n \\"outputs\\": [\\"Component Name\\", \\"component_id\\"],\\n \\"tweaks\\": {\\"parameter_name\\": \\"value\\", \\"Component Name\\": {\\"parameter_name\\": \\"value\\"}, \\"component_id\\": {\\"parameter_name\\": \\"value\\"}}\\n \\"stream\\": false\\n}\\n```\\n\\nThis endpoint facilitates complex flow executions with customized inputs, outputs, and configurations,\\ncatering to diverse application requirements.","operationId":"experimental_run_flow_api_v1_run_advanced__flow_id__post","security":[{"API key query":[]},{"API key header":[]}],"parameters":[{"name":"flow_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Flow Id"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"inputs":{"anyOf":[{"items":{"properties":{"components":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Components","default":[]},"input_value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Input Value"},"session":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session"},"type":{"anyOf":[{"type":"string","enum":["chat","text","any"]},{"type":"null"}],"title":"Type","description":"Defines on which components the input value should be applied. \'any\' applies to all input components.","default":"any"}},"additionalProperties":false,"type":"object","title":"InputValueRequest","examples":[{"components":["components_id","Component Name"],"input_value":"input_value","session":"session_id"},{"components":["Component Name"],"input_value":"input_value"},{"input_value":"input_value"},{"components":["Component Name"],"input_value":"input_value","session":"session_id"},{"input_value":"input_value","session":"session_id"},{"input_value":"input_value","type":"chat"},{"input_value":"{\\"key\\": \\"value\\"}","type":"json"}]},"type":"array"},{"type":"null"}],"title":"Inputs"},"outputs":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Outputs"},"tweaks":{"anyOf":[{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"object"}]},"type":"object","title":"Tweaks","description":"A dictionary of tweaks to adjust the flow\'s execution. Allows customizing flow behavior dynamically. All tweaks are overridden by the input values.","examples":[{"Component Name":{"parameter_name":"value"},"component_id":{"parameter_name":"value"},"parameter_name":"value"}]},{"type":"null"}]},"stream":{"type":"boolean","title":"Stream","default":false},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}},"type":"object","title":"Body_experimental_run_flow_api_v1_run_advanced__flow_id__post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"properties":{"outputs":{"anyOf":[{"items":{"properties":{"inputs":{"type":"object","title":"Inputs"},"outputs":{"items":{"anyOf":[{"properties":{"results":{"anyOf":[{},{"type":"null"}],"title":"Results"},"artifacts":{"anyOf":[{},{"type":"null"}],"title":"Artifacts"},"outputs":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Outputs"},"logs":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Logs"},"messages":{"anyOf":[{"items":{"properties":{"message":{"anyOf":[{"type":"string"},{"items":{"anyOf":[{"type":"string"},{"type":"object"}]},"type":"array"}],"title":"Message"},"sender":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender","default":"Machine"},"sender_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender Name","default":"AI"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"},"stream_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stream Url"},"component_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Component Id"},"files":{"items":{"properties":{"path":{"type":"string","title":"Path"},"name":{"type":"string","title":"Name"},"type":{"type":"string","title":"Type"}},"type":"object","required":["path","name","type"],"title":"File","description":"File schema."},"type":"array","title":"Files","default":[]},"type":{"type":"string","title":"Type"}},"type":"object","required":["message","type"],"title":"ChatOutputResponse","description":"Chat output response schema."},"type":"array"},{"type":"null"}],"title":"Messages"},"timedelta":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Timedelta"},"duration":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Duration"},"component_display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Component Display Name"},"component_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Component Id"},"used_frozen_result":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Used Frozen Result","default":false}},"type":"object","title":"ResultData"},{"type":"null"}]},"type":"array","title":"Outputs"}},"type":"object","title":"RunOutputs"},"type":"array"},{"type":"null"}],"title":"Outputs","default":[]},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}},"type":"object","title":"RunResponse","description":"Run response schema."}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"properties":{"detail":{"items":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"}}}}},"method":"post","path":"/api/v1/run/advanced/{flow_id}","securitySchemes":{"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"api/v1/login"}}},"API key query":{"type":"apiKey","in":"query","name":"x-api-key"},"API key header":{"type":"apiKey","in":"header","name":"x-api-key"}},"jsonRequestBodyExample":{"stream":false},"info":{"title":"Langflow","version":"1.5.1"},"postman":{"name":"Experimental Run Flow","description":{"content":"Executes a specified flow by ID with optional input values, output selection, tweaks, and streaming capability.\\n\\nThis endpoint supports running flows with caching to enhance performance and efficiency.\\n\\n### Parameters:\\n- `flow_id` (str): The unique identifier of the flow to be executed.\\n- `inputs` (List[InputValueRequest], optional): A list of inputs specifying the input values and components\\n for the flow. Each input can target specific components and provide custom values.\\n- `outputs` (List[str], optional): A list of output names to retrieve from the executed flow.\\n If not provided, all outputs are returned.\\n- `tweaks` (Optional[Tweaks], optional): A dictionary of tweaks to customize the flow execution.\\n The tweaks can be used to modify the flow\'s parameters and components.\\n Tweaks can be overridden by the input values.\\n- `stream` (bool, optional): Specifies whether the results should be streamed. Defaults to False.\\n- `session_id` (Union[None, str], optional): An optional session ID to utilize existing session data for the flow\\n execution.\\n- `api_key_user` (User): The user associated with the current API key. Automatically resolved from the API key.\\n\\n### Returns:\\nA `RunResponse` object containing the selected outputs (or all if not specified) of the executed flow\\nand the session ID.\\nThe structure of the response accommodates multiple inputs, providing a nested list of outputs for each input.\\n\\n### Raises:\\nHTTPException: Indicates issues with finding the specified flow, invalid input formats, or internal errors during\\nflow execution.\\n\\n### Example usage:\\n```json\\nPOST /run/flow_id\\nx-api-key: YOUR_API_KEY\\nPayload:\\n{\\n \\"inputs\\": [\\n {\\"components\\": [\\"component1\\"], \\"input_value\\": \\"value1\\"},\\n {\\"components\\": [\\"component3\\"], \\"input_value\\": \\"value2\\"}\\n ],\\n \\"outputs\\": [\\"Component Name\\", \\"component_id\\"],\\n \\"tweaks\\": {\\"parameter_name\\": \\"value\\", \\"Component Name\\": {\\"parameter_name\\": \\"value\\"}, \\"component_id\\": {\\"parameter_name\\": \\"value\\"}}\\n \\"stream\\": false\\n}\\n```\\n\\nThis endpoint facilitates complex flow executions with customized inputs, outputs, and configurations,\\ncatering to diverse application requirements.","type":"text/plain"},"url":{"path":["api","v1","run","advanced",":flow_id"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) ","type":"text/plain"},"type":"any","value":"","key":"flow_id"}]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"{\\n \\"inputs\\": [\\n {\\n \\"components\\": [\\n \\"\\",\\n \\"\\"\\n ],\\n \\"input_value\\": \\"\\",\\n \\"session\\": \\"\\",\\n \\"type\\": \\"\\"\\n },\\n {\\n \\"components\\": [\\n \\"\\",\\n \\"\\"\\n ],\\n \\"input_value\\": \\"\\",\\n \\"session\\": \\"\\",\\n \\"type\\": \\"\\"\\n }\\n ],\\n \\"outputs\\": [\\n \\"\\",\\n \\"\\"\\n ],\\n \\"tweaks\\": {\\n \\"quis_baa\\": \\"\\",\\n \\"consectetur_c5\\": \\"\\"\\n },\\n \\"stream\\": false,\\n \\"session_id\\": \\"\\"\\n}","options":{"raw":{"language":"json"}}},"auth":{"type":"apikey","apikey":[{"type":"any","value":"x-api-key","key":"key"},{"type":"any","value":"{{apiKey}}","key":"value"},{"type":"any","value":"query","key":"in"}]}}},"source":"@site/openapi.json","sourceDirName":".","permalink":"/api/experimental-run-flow","previous":{"title":"Webhook Run Flow","permalink":"/api/webhook-run-flow"},"next":{"title":"Process","permalink":"/api/process"}}');var i=n(74848),o=n(28453);const a={},l="Experimental Run Flow",r=[{value:"Parameters:",id:"parameters",level:3},{value:"Returns:",id:"returns",level:3},{value:"Raises:",id:"raises",level:3},{value:"Example usage:",id:"example-usage",level:3}];function p(e){const t={code:"code",h1:"h1",h3:"h3",header:"header",li:"li",p:"p",pre:"pre",ul:"ul",...(0,o.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.header,{children:(0,i.jsx)(t.h1,{id:"experimental-run-flow",children:"Experimental Run Flow"})}),"\n",(0,i.jsx)(t.p,{children:"Executes a specified flow by ID with optional input values, output selection, tweaks, and streaming capability."}),"\n",(0,i.jsx)(t.p,{children:"This endpoint supports running flows with caching to enhance performance and efficiency."}),"\n",(0,i.jsx)(t.h3,{id:"parameters",children:"Parameters:"}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"flow_id"})," (str): The unique identifier of the flow to be executed."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"inputs"})," (List[InputValueRequest], optional): A list of inputs specifying the input values and components\nfor the flow. Each input can target specific components and provide custom values."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"outputs"})," (List[str], optional): A list of output names to retrieve from the executed flow.\nIf not provided, all outputs are returned."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"tweaks"})," (Optional[Tweaks], optional): A dictionary of tweaks to customize the flow execution.\nThe tweaks can be used to modify the flow's parameters and components.\nTweaks can be overridden by the input values."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"stream"})," (bool, optional): Specifies whether the results should be streamed. Defaults to False."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"session_id"})," (Union[None, str], optional): An optional session ID to utilize existing session data for the flow\nexecution."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"api_key_user"})," (User): The user associated with the current API key. Automatically resolved from the API key."]}),"\n"]}),"\n",(0,i.jsx)(t.h3,{id:"returns",children:"Returns:"}),"\n",(0,i.jsxs)(t.p,{children:["A ",(0,i.jsx)(t.code,{children:"RunResponse"})," object containing the selected outputs (or all if not specified) of the executed flow\nand the session ID.\nThe structure of the response accommodates multiple inputs, providing a nested list of outputs for each input."]}),"\n",(0,i.jsx)(t.h3,{id:"raises",children:"Raises:"}),"\n",(0,i.jsx)(t.p,{children:"HTTPException: Indicates issues with finding the specified flow, invalid input formats, or internal errors during\nflow execution."}),"\n",(0,i.jsx)(t.h3,{id:"example-usage",children:"Example usage:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-json",children:'POST /run/flow_id\nx-api-key: YOUR_API_KEY\nPayload:\n{\n "inputs": [\n {"components": ["component1"], "input_value": "value1"},\n {"components": ["component3"], "input_value": "value2"}\n ],\n "outputs": ["Component Name", "component_id"],\n "tweaks": {"parameter_name": "value", "Component Name": {"parameter_name": "value"}, "component_id": {"parameter_name": "value"}}\n "stream": false\n}\n'})}),"\n",(0,i.jsx)(t.p,{children:"This endpoint facilitates complex flow executions with customized inputs, outputs, and configurations,\ncatering to diverse application requirements."}),"\n",(0,i.jsxs)("table",{style:{display:"table",width:"100%"},children:[(0,i.jsx)("thead",{children:(0,i.jsx)("tr",{children:(0,i.jsx)("th",{style:{textAlign:"left"},children:"Path Parameters"})})}),(0,i.jsx)("tbody",{children:(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsx)("code",{children:"flow_id"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" uuid"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" \u2014 "}),(0,i.jsx)("strong",{style:{fontSize:"var(--ifm-code-font-size)",color:"var(--openapi-required)"},children:" REQUIRED"})]})})})]}),"\n",(0,i.jsxs)("table",{style:{display:"table",width:"100%"},children:[(0,i.jsx)("thead",{children:(0,i.jsx)("tr",{children:(0,i.jsxs)("th",{style:{textAlign:"left"},children:[(0,i.jsx)("span",{children:"Request Body "}),(0,i.jsx)("div",{})]})})}),(0,i.jsxs)("tbody",{children:[(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsx)("code",{children:"inputs"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" Inputs"})]})}),(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsx)("code",{children:"outputs"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" Outputs"})]})}),(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsx)("code",{children:"tweaks"}),(0,i.jsx)("span",{style:{opacity:"0.6"}})]})}),(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsx)("code",{children:"stream"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" Stream"})]})}),(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsx)("code",{children:"session_id"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" Session Id"})]})})]})]}),"\n",(0,i.jsxs)("table",{style:{display:"table",width:"100%"},children:[(0,i.jsx)("thead",{children:(0,i.jsx)("tr",{children:(0,i.jsx)("th",{style:{textAlign:"left"},children:"Responses"})})}),(0,i.jsxs)("tbody",{children:[(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsxs)("div",{style:{display:"flex"},children:[(0,i.jsx)("div",{style:{marginRight:"var(--ifm-table-cell-padding)"},children:(0,i.jsx)("code",{children:"200"})}),(0,i.jsx)("div",{children:(0,i.jsx)(t.p,{children:"Successful Response"})})]}),(0,i.jsx)("div",{children:(0,i.jsxs)("table",{style:{display:"table",width:"100%",marginTop:"var(--ifm-table-cell-padding)",marginBottom:"0px"},children:[(0,i.jsx)("thead",{children:(0,i.jsx)("tr",{children:(0,i.jsxs)("th",{style:{textAlign:"left"},children:[(0,i.jsx)("span",{children:"Schema "}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" \u2014 "}),(0,i.jsx)("strong",{style:{fontSize:"var(--ifm-code-font-size)",color:"var(--openapi-optional)"},children:" OPTIONAL"}),(0,i.jsx)("div",{})]})})}),(0,i.jsxs)("tbody",{children:[(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsx)("code",{children:"outputs"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" Outputs"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" \u2014 "}),(0,i.jsx)("strong",{style:{fontSize:"var(--ifm-code-font-size)",color:"var(--openapi-optional)"},children:" OPTIONAL"})]})}),(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsx)("code",{children:"session_id"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" Session Id"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" \u2014 "}),(0,i.jsx)("strong",{style:{fontSize:"var(--ifm-code-font-size)",color:"var(--openapi-optional)"},children:" OPTIONAL"})]})})]})]})})]})}),(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsxs)("div",{style:{display:"flex"},children:[(0,i.jsx)("div",{style:{marginRight:"var(--ifm-table-cell-padding)"},children:(0,i.jsx)("code",{children:"422"})}),(0,i.jsx)("div",{children:(0,i.jsx)(t.p,{children:"Validation Error"})})]}),(0,i.jsx)("div",{children:(0,i.jsxs)("table",{style:{display:"table",width:"100%",marginTop:"var(--ifm-table-cell-padding)",marginBottom:"0px"},children:[(0,i.jsx)("thead",{children:(0,i.jsx)("tr",{children:(0,i.jsxs)("th",{style:{textAlign:"left"},children:[(0,i.jsx)("span",{children:"Schema "}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" \u2014 "}),(0,i.jsx)("strong",{style:{fontSize:"var(--ifm-code-font-size)",color:"var(--openapi-optional)"},children:" OPTIONAL"}),(0,i.jsx)("div",{})]})})}),(0,i.jsx)("tbody",{children:(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsx)("code",{children:"detail"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" object[]"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" \u2014 "}),(0,i.jsx)("strong",{style:{fontSize:"var(--ifm-code-font-size)",color:"var(--openapi-optional)"},children:" OPTIONAL"}),(0,i.jsx)("table",{style:{display:"table",width:"100%",marginTop:"var(--ifm-table-cell-padding)",marginBottom:"0px"},children:(0,i.jsxs)("tbody",{children:[(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsx)("code",{children:"loc"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" undefined[]"})]})}),(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsx)("code",{children:"msg"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" Message"})]})}),(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsx)("code",{children:"type"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" Error Type"})]})})]})})]})})})]})})]})})]})]})]})}function d(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(p,{...e})}):p(e)}}}]); \ No newline at end of file diff --git a/assets/js/e82d58ff.11b79781.js b/assets/js/e82d58ff.11b79781.js new file mode 100644 index 0000000000..b1d10fb064 --- /dev/null +++ b/assets/js/e82d58ff.11b79781.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[5657],{17835:(e,n,s)=>{s.d(n,{A:()=>t});const t=s.p+"assets/images/assemblyai-components-b88c7c97e04114bf658898f7fc633e23.png"},17886:(e,n,s)=>{s.d(n,{A:()=>l});s(96540);var t=s(64058),i=s(74848);function l({name:e,...n}){const s=t[e];return s?(0,i.jsx)(s,{...n}):null}},28618:(e,n,s)=>{s.d(n,{A:()=>t});const t=s.p+"assets/files/AssemblyAI_Flow-368be24ae9542f0b8b5253cc9d97b42f.json"},91044:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>c,contentTitle:()=>a,default:()=>p,frontMatter:()=>o,metadata:()=>t,toc:()=>h});const t=JSON.parse('{"id":"Integrations/integrations-assemblyai","title":"AssemblyAI","description":"The AssemblyAI components allow you to apply powerful Speech AI models to your app for tasks like:","source":"@site/docs/Integrations/integrations-assemblyai.mdx","sourceDirName":"Integrations","slug":"/integrations-assemblyai","permalink":"/integrations-assemblyai","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"AssemblyAI","slug":"/integrations-assemblyai"},"sidebar":"docs","previous":{"title":"arXiv","permalink":"/bundles-arxiv"},"next":{"title":"Azure","permalink":"/bundles-azure"}}');var i=s(74848),l=s(28453),r=s(17886);const o={title:"AssemblyAI",slug:"/integrations-assemblyai"},a=void 0,c={},h=[{value:"Prerequisites",id:"prerequisites",level:2},{value:"Components",id:"components",level:2},{value:"AssemblyAI Start Transcript",id:"assemblyai-start-transcript",level:3},{value:"AssemblyAI Poll Transcript",id:"assemblyai-poll-transcript",level:3},{value:"AssemblyAI Get Subtitles",id:"assemblyai-get-subtitles",level:3},{value:"AssemblyAI LeMUR",id:"assemblyai-lemur",level:3},{value:"AssemblyAI List Transcripts",id:"assemblyai-list-transcripts",level:3},{value:"Flow Process",id:"flow-process",level:2},{value:"Run the Transcription and Speech AI Flow",id:"run-the-transcription-and-speech-ai-flow",level:2},{value:"Customization",id:"customization",level:2},{value:"Troubleshooting",id:"troubleshooting",level:2}];function d(e){const n={a:"a",code:"code",em:"em",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,l.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.p,{children:"The AssemblyAI components allow you to apply powerful Speech AI models to your app for tasks like:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Transcribing audio and video files"}),"\n",(0,i.jsx)(n.li,{children:"Formatting transcripts"}),"\n",(0,i.jsx)(n.li,{children:"Generating subtitles"}),"\n",(0,i.jsx)(n.li,{children:"Applying LLMs to audio files"}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["For more information about AssemblyAI features and functionality used by AssemblyAI components, see the ",(0,i.jsx)(n.a,{href:"https://www.assemblyai.com/docs",children:"AssemblyAI API Docs"}),"."]}),"\n",(0,i.jsx)(n.h2,{id:"prerequisites",children:"Prerequisites"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["An ",(0,i.jsx)(n.a,{href:"https://www.assemblyai.com/dashboard/signup",children:"AssemblyAI account"})," and an AssemblyAI API key."]}),"\n",(0,i.jsxs)(n.p,{children:["Enter the key in the ",(0,i.jsx)(n.em,{children:"AssemblyAI API Key"})," field in all Langflow components that require the AssemblyAI key."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Optional: To use LeMUR, you need a paid AssemblyAI account because LeMUR isn't included in the free account."}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"components",children:"Components"}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"AssemblyAI components",src:s(17835).A+"",width:"1494",height:"1048"})}),"\n",(0,i.jsx)(n.h3,{id:"assemblyai-start-transcript",children:"AssemblyAI Start Transcript"}),"\n",(0,i.jsx)(n.p,{children:"This component allows you to submit an audio or video file for transcription."}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Tip"}),": You can freeze the path of this component to only submit the file once."]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Input"}),":"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"AssemblyAI API Key: Your API key."}),"\n",(0,i.jsx)(n.li,{children:"Audio File: The audio or video file to transcribe."}),"\n",(0,i.jsxs)(n.li,{children:["Speech Model (Optional): Select the class of models. Default is ",(0,i.jsx)(n.em,{children:"Best"}),". See ",(0,i.jsx)(n.a,{href:"https://www.assemblyai.com/docs/speech-to-text/speech-recognition#select-the-speech-model-with-best-and-nano",children:"speech models"})," for more info."]}),"\n",(0,i.jsx)(n.li,{children:"Automatic Language Detection (Optional): Enable automatic language detection."}),"\n",(0,i.jsxs)(n.li,{children:["Language (Optional): The language of the audio file. Can be set manually if automatic language detection is disabled.\nSee ",(0,i.jsx)(n.a,{href:"https://www.assemblyai.com/docs/getting-started/supported-languages",children:"supported languages"})," for a list of supported language codes."]}),"\n",(0,i.jsx)(n.li,{children:"Enable Speaker Labels (Optional): Detect speakers in an audio file and what each speaker said."}),"\n",(0,i.jsx)(n.li,{children:"Expected Number of Speakers (Optional): Set the expected number of speakers, if Speaker Labels is enabled."}),"\n",(0,i.jsxs)(n.li,{children:["Audio File URL (Optional): The URL of the audio or video file to transcribe. Can be used instead of ",(0,i.jsx)(n.em,{children:"Audio File"}),"."]}),"\n",(0,i.jsxs)(n.li,{children:["Punctuate (Optional): Apply punctuation. Default is ",(0,i.jsx)(n.code,{children:"true"}),"."]}),"\n",(0,i.jsxs)(n.li,{children:["Format Text (Optional): Apply casing and text formatting. Default is ",(0,i.jsx)(n.code,{children:"true"}),"."]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Output"}),":"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Transcript ID: The id of the transcript"}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"assemblyai-poll-transcript",children:"AssemblyAI Poll Transcript"}),"\n",(0,i.jsx)(n.p,{children:"This components allows you to poll the transcripts. It checks the status of the transcript every few seconds until the transcription is completed."}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Input"}),":"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"AssemblyAI API Key: Your API key."}),"\n",(0,i.jsx)(n.li,{children:"Polling Interval (Optional): The polling interval in seconds. Default is 3."}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Output"}),":"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Transcription Result: The AssemblyAI JSON response of a completed transcript. Contains the text and other info."}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"assemblyai-get-subtitles",children:"AssemblyAI Get Subtitles"}),"\n",(0,i.jsx)(n.p,{children:"This component allows you to generate subtitles in SRT or VTT format."}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Input"}),":"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"AssemblyAI API Key: Your API key."}),"\n",(0,i.jsxs)(n.li,{children:["Transcription Result: The output of the ",(0,i.jsx)(n.strong,{children:"Poll Transcript"})," component."]}),"\n",(0,i.jsx)(n.li,{children:"Subtitle Format: The format of the captions (SRT or VTT)."}),"\n",(0,i.jsx)(n.li,{children:"Character per Caption (Optional): The maximum number of characters per caption (0 for no limit)."}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Output"}),":"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["Subtitles: A JSON response with the ",(0,i.jsx)(n.code,{children:"subtitles"})," field containing the captions in SRT or VTT format."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"assemblyai-lemur",children:"AssemblyAI LeMUR"}),"\n",(0,i.jsxs)(n.p,{children:["This component allows you to apply Large Language Models to spoken data using the ",(0,i.jsx)(n.a,{href:"https://www.assemblyai.com/docs/lemur",children:"AssemblyAI LeMUR framework"}),"."]}),"\n",(0,i.jsx)(n.p,{children:"LeMUR automatically ingests the transcript as additional context, making it easy to apply LLMs to audio data. You can use it for tasks like summarizing audio, extracting insights, or asking questions."}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Input"}),":"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"AssemblyAI API Key: Your API key."}),"\n",(0,i.jsxs)(n.li,{children:["Transcription Result: The output of the ",(0,i.jsx)(n.strong,{children:"Poll Transcript"})," component."]}),"\n",(0,i.jsxs)(n.li,{children:["Input Prompt: The text to prompt the model. You can type your prompt in this field or connect it to a ",(0,i.jsx)(n.strong,{children:"Prompt Template"})," component."]}),"\n",(0,i.jsx)(n.li,{children:"Final Model: The model that is used for the final prompt after compression is performed. Default is Claude 3.5 Sonnet."}),"\n",(0,i.jsx)(n.li,{children:"Temperature (Optional): The temperature to use for the model. Default is 0.0."}),"\n",(0,i.jsx)(n.li,{children:"Max Output Size (Optional): Max output size in tokens, up to 4000. Default is 2000."}),"\n",(0,i.jsxs)(n.li,{children:['Endpoint (Optional): The LeMUR endpoint to use. Default is "task". For "summary" and "question-answer", no prompt input is needed. See ',(0,i.jsx)(n.a,{href:"https://www.assemblyai.com/docs/api-reference/lemur/",children:"LeMUR API docs"})," for more info."]}),"\n",(0,i.jsxs)(n.li,{children:["Questions (Optional): Comma-separated list of your questions. Only used if ",(0,i.jsx)(n.em,{children:"Endpoint"}),' is "question-answer".']}),"\n",(0,i.jsxs)(n.li,{children:["Transcript IDs (Optional): Comma-separated list of transcript IDs. LeMUR can perform actions over multiple transcripts. If provided, the ",(0,i.jsx)(n.em,{children:"Transcription Result"})," is ignored."]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Output"}),":"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"LeMUR Response: The generated LLM response."}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"assemblyai-list-transcripts",children:"AssemblyAI List Transcripts"}),"\n",(0,i.jsx)(n.p,{children:"This component can be used as a standalone component to list all previously generated transcripts."}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Input"}),":"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"AssemblyAI API Key: Your API key."}),"\n",(0,i.jsx)(n.li,{children:"Limit (Optional): Maximum number of transcripts to retrieve. Default is 20, use 0 for all."}),"\n",(0,i.jsx)(n.li,{children:"Filter (Optional): Filter by transcript status."}),"\n",(0,i.jsx)(n.li,{children:"Created On (Optional): Only get transcripts created on this date (YYYY-MM-DD)."}),"\n",(0,i.jsx)(n.li,{children:"Throttled Only (Optional): Only get throttled transcripts, overrides the status filter"}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Output"}),":"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Transcript List: A list of all transcripts with info such as the transcript ID, the status, and the data."}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"flow-process",children:"Flow Process"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsx)(n.li,{children:"The user inputs an audio or video file."}),"\n",(0,i.jsx)(n.li,{children:"The user can also input an LLM prompt. In this example, we want to generate a summary of the transcript."}),"\n",(0,i.jsx)(n.li,{children:"The flow submits the audio file for transcription."}),"\n",(0,i.jsx)(n.li,{children:"The flow checks the status of the transcript every few seconds until transcription is completed."}),"\n",(0,i.jsx)(n.li,{children:"The flow parses the transcription result and outputs the transcribed text."}),"\n",(0,i.jsx)(n.li,{children:"The flow also generates subtitles."}),"\n",(0,i.jsx)(n.li,{children:"The flow applies the LLM prompt to generate a summary."}),"\n",(0,i.jsx)(n.li,{children:"As a standalone component, all transcripts can be listed."}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"run-the-transcription-and-speech-ai-flow",children:"Run the Transcription and Speech AI Flow"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Build the flow manually or import a pre-build JSON file:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["Recommended: ",(0,i.jsx)(n.a,{target:"_blank","data-noBrokenLinkCheck":!0,href:s(28618).A+"",children:"Download the AssemblyAI Transcription and Speech AI flow JSON"}),", and then ",(0,i.jsx)(n.a,{href:"/concepts-flows-import",children:"import the flow"})," into Langflow."]}),"\n",(0,i.jsx)(n.li,{children:"Create a blank flow, and then add the previously described components to your flow, connecting them as shown in the flow diagram."}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Input your AssemblyAI API key in all components that require the key (",(0,i.jsx)(n.strong,{children:"Start Transcript"}),", ",(0,i.jsx)(n.strong,{children:"Poll Transcript"}),", ",(0,i.jsx)(n.strong,{children:"Get Subtitles"}),", ",(0,i.jsx)(n.strong,{children:"LeMUR"}),", ",(0,i.jsx)(n.strong,{children:"List Transcripts"}),")."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Select an audio or video file for the ",(0,i.jsx)(n.strong,{children:"Start Transcript"})," component."]}),"\n",(0,i.jsxs)(n.p,{children:["Optional: After adding a file to the ",(0,i.jsx)(n.strong,{children:"Start Transcript"})," component, run and ",(0,i.jsx)(n.a,{href:"/concepts-components#freeze-a-component",children:"freeze the component"})," so you only submit the file once, no matter how many times you run the flow.\nTo do this, click ",(0,i.jsx)(r.A,{name:"Play","aria-hidden":"true"})," ",(0,i.jsx)(n.strong,{children:"Run component"})," to preload the file, and then click ",(0,i.jsx)(r.A,{name:"Ellipsis","aria-hidden":"true"})," ",(0,i.jsx)(n.strong,{children:"Show More"})," and select ",(0,i.jsx)(n.strong,{children:"Freeze"})," to lock the result.\nSubsequent flow runs use the frozen component's cached output."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Test the transcription by clicking ",(0,i.jsx)(r.A,{name:"Play","aria-hidden":"true"})," ",(0,i.jsx)(n.strong,{children:"Run component"})," on the ",(0,i.jsx)(n.strong,{children:"Parser"})," component. Make sure that the specified template is ",(0,i.jsx)(n.code,{children:"{text}"}),"."]}),"\n",(0,i.jsxs)(n.p,{children:["Running one component runs all upstream components as well as the selected component and then stops the flow run.\nIn this case, the ",(0,i.jsx)(n.strong,{children:"Start Transcript"})," and ",(0,i.jsx)(n.strong,{children:"Poll Transcript"})," components are upstream from the ",(0,i.jsx)(n.strong,{children:"Parser"})," component.\nIf you froze the ",(0,i.jsx)(n.strong,{children:"Start Transcript"})," component, the flow sends the cached output from ",(0,i.jsx)(n.strong,{children:"Start Transcript"}),", runs the ",(0,i.jsx)(n.strong,{children:"Poll Transcript"})," component, to get the transcription result.\nCheck the flow logs or inspect the output of the ",(0,i.jsx)(n.strong,{children:"Parser"})," component to see the transcribed text result."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["To generate subtitles and run the full flow, click ",(0,i.jsx)(r.A,{name:"Play","aria-hidden":"true"})," ",(0,i.jsx)(n.strong,{children:"Run component"})," on the ",(0,i.jsx)(n.strong,{children:"List Transcript"})," component."]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"customization",children:"Customization"}),"\n",(0,i.jsx)(n.p,{children:"The flow can be customized by:"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["Modifying the parameters in the ",(0,i.jsx)(n.strong,{children:"Start Transcript"})," component."]}),"\n",(0,i.jsxs)(n.li,{children:["Modifying the subtitle format in the ",(0,i.jsx)(n.strong,{children:"Get Subtitles"})," component."]}),"\n",(0,i.jsxs)(n.li,{children:["Modifying the LLM prompt for input of the ",(0,i.jsx)(n.strong,{children:"LeMUR"})," component."]}),"\n",(0,i.jsxs)(n.li,{children:["Modifying the LLM parameters (e.g., temperature) in the ",(0,i.jsx)(n.strong,{children:"LeMUR"})," component."]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"troubleshooting",children:"Troubleshooting"}),"\n",(0,i.jsx)(n.p,{children:"If you encounter issues:"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsx)(n.li,{children:"Ensure the API key is correctly set in all components that require the key."}),"\n",(0,i.jsx)(n.li,{children:"To use LeMUR, you need to upgrade your AssemblyAI account, since this isn't included in the free account."}),"\n",(0,i.jsx)(n.li,{children:"Verify that all components are properly connected in the flow."}),"\n",(0,i.jsx)(n.li,{children:"Review the Langflow logs for any error messages."}),"\n",(0,i.jsxs)(n.li,{children:["Check the ",(0,i.jsx)(n.a,{href:"https://www.assemblyai.com/docs/",children:"AssemblyAI API documentation"}),"."]}),"\n",(0,i.jsxs)(n.li,{children:["Contact ",(0,i.jsx)(n.a,{href:"https://www.assemblyai.com/contact/support",children:"AssemblyAI support"}),"."]}),"\n"]})]})}function p(e={}){const{wrapper:n}={...(0,l.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}}}]); \ No newline at end of file diff --git a/assets/js/e82d58ff.41285f40.js b/assets/js/e82d58ff.41285f40.js deleted file mode 100644 index 6c083c2c78..0000000000 --- a/assets/js/e82d58ff.41285f40.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[5657],{17835:(e,n,s)=>{s.d(n,{A:()=>t});const t=s.p+"assets/images/assemblyai-components-b88c7c97e04114bf658898f7fc633e23.png"},17886:(e,n,s)=>{s.d(n,{A:()=>l});s(96540);var t=s(64058),i=s(74848);function l({name:e,...n}){const s=t[e];return s?(0,i.jsx)(s,{...n}):null}},28618:(e,n,s)=>{s.d(n,{A:()=>t});const t=s.p+"assets/files/AssemblyAI_Flow-368be24ae9542f0b8b5253cc9d97b42f.json"},91044:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>c,contentTitle:()=>a,default:()=>p,frontMatter:()=>o,metadata:()=>t,toc:()=>h});const t=JSON.parse('{"id":"Integrations/integrations-assemblyai","title":"AssemblyAI","description":"The AssemblyAI components allow you to apply powerful Speech AI models to your app for tasks like:","source":"@site/docs/Integrations/integrations-assemblyai.mdx","sourceDirName":"Integrations","slug":"/integrations-assemblyai","permalink":"/integrations-assemblyai","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"AssemblyAI","slug":"/integrations-assemblyai"},"sidebar":"docs","previous":{"title":"arXiv","permalink":"/bundles-arxiv"},"next":{"title":"Azure","permalink":"/bundles-azure"}}');var i=s(74848),l=s(28453),r=s(17886);const o={title:"AssemblyAI",slug:"/integrations-assemblyai"},a=void 0,c={},h=[{value:"Prerequisites",id:"prerequisites",level:2},{value:"Components",id:"components",level:2},{value:"AssemblyAI Start Transcript",id:"assemblyai-start-transcript",level:3},{value:"AssemblyAI Poll Transcript",id:"assemblyai-poll-transcript",level:3},{value:"AssemblyAI Get Subtitles",id:"assemblyai-get-subtitles",level:3},{value:"AssemblyAI LeMUR",id:"assemblyai-lemur",level:3},{value:"AssemblyAI List Transcripts",id:"assemblyai-list-transcripts",level:3},{value:"Flow Process",id:"flow-process",level:2},{value:"Run the Transcription and Speech AI Flow",id:"run-the-transcription-and-speech-ai-flow",level:2},{value:"Customization",id:"customization",level:2},{value:"Troubleshooting",id:"troubleshooting",level:2}];function d(e){const n={a:"a",code:"code",em:"em",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,l.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.p,{children:"The AssemblyAI components allow you to apply powerful Speech AI models to your app for tasks like:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Transcribing audio and video files"}),"\n",(0,i.jsx)(n.li,{children:"Formatting transcripts"}),"\n",(0,i.jsx)(n.li,{children:"Generating subtitles"}),"\n",(0,i.jsx)(n.li,{children:"Applying LLMs to audio files"}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["For more information about AssemblyAI features and functionality used by AssemblyAI components, see the ",(0,i.jsx)(n.a,{href:"https://www.assemblyai.com/docs",children:"AssemblyAI API Docs"}),"."]}),"\n",(0,i.jsx)(n.h2,{id:"prerequisites",children:"Prerequisites"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["An ",(0,i.jsx)(n.a,{href:"https://www.assemblyai.com/dashboard/signup",children:"AssemblyAI account"})," and an AssemblyAI API key."]}),"\n",(0,i.jsxs)(n.p,{children:["Enter the key in the ",(0,i.jsx)(n.em,{children:"AssemblyAI API Key"})," field in all Langflow components that require the AssemblyAI key."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Optional: To use LeMUR, you need a paid AssemblyAI account because LeMUR isn't included in the free account."}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"components",children:"Components"}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"AssemblyAI components",src:s(17835).A+"",width:"1494",height:"1048"})}),"\n",(0,i.jsx)(n.h3,{id:"assemblyai-start-transcript",children:"AssemblyAI Start Transcript"}),"\n",(0,i.jsx)(n.p,{children:"This component allows you to submit an audio or video file for transcription."}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Tip"}),": You can freeze the path of this component to only submit the file once."]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Input"}),":"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"AssemblyAI API Key: Your API key."}),"\n",(0,i.jsx)(n.li,{children:"Audio File: The audio or video file to transcribe."}),"\n",(0,i.jsxs)(n.li,{children:["Speech Model (Optional): Select the class of models. Default is ",(0,i.jsx)(n.em,{children:"Best"}),". See ",(0,i.jsx)(n.a,{href:"https://www.assemblyai.com/docs/speech-to-text/speech-recognition#select-the-speech-model-with-best-and-nano",children:"speech models"})," for more info."]}),"\n",(0,i.jsx)(n.li,{children:"Automatic Language Detection (Optional): Enable automatic language detection."}),"\n",(0,i.jsxs)(n.li,{children:["Language (Optional): The language of the audio file. Can be set manually if automatic language detection is disabled.\nSee ",(0,i.jsx)(n.a,{href:"https://www.assemblyai.com/docs/getting-started/supported-languages",children:"supported languages"})," for a list of supported language codes."]}),"\n",(0,i.jsx)(n.li,{children:"Enable Speaker Labels (Optional): Detect speakers in an audio file and what each speaker said."}),"\n",(0,i.jsx)(n.li,{children:"Expected Number of Speakers (Optional): Set the expected number of speakers, if Speaker Labels is enabled."}),"\n",(0,i.jsxs)(n.li,{children:["Audio File URL (Optional): The URL of the audio or video file to transcribe. Can be used instead of ",(0,i.jsx)(n.em,{children:"Audio File"}),"."]}),"\n",(0,i.jsx)(n.li,{children:"Punctuate (Optional): Apply punctuation. Default is true."}),"\n",(0,i.jsx)(n.li,{children:"Format Text (Optional): Apply casing and text formatting. Default is true."}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Output"}),":"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Transcript ID: The id of the transcript"}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"assemblyai-poll-transcript",children:"AssemblyAI Poll Transcript"}),"\n",(0,i.jsx)(n.p,{children:"This components allows you to poll the transcripts. It checks the status of the transcript every few seconds until the transcription is completed."}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Input"}),":"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"AssemblyAI API Key: Your API key."}),"\n",(0,i.jsx)(n.li,{children:"Polling Interval (Optional): The polling interval in seconds. Default is 3."}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Output"}),":"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Transcription Result: The AssemblyAI JSON response of a completed transcript. Contains the text and other info."}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"assemblyai-get-subtitles",children:"AssemblyAI Get Subtitles"}),"\n",(0,i.jsx)(n.p,{children:"This component allows you to generate subtitles in SRT or VTT format."}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Input"}),":"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"AssemblyAI API Key: Your API key."}),"\n",(0,i.jsxs)(n.li,{children:["Transcription Result: The output of the ",(0,i.jsx)(n.strong,{children:"Poll Transcript"})," component."]}),"\n",(0,i.jsx)(n.li,{children:"Subtitle Format: The format of the captions (SRT or VTT)."}),"\n",(0,i.jsx)(n.li,{children:"Character per Caption (Optional): The maximum number of characters per caption (0 for no limit)."}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Output"}),":"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["Subtitles: A JSON response with the ",(0,i.jsx)(n.code,{children:"subtitles"})," field containing the captions in SRT or VTT format."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"assemblyai-lemur",children:"AssemblyAI LeMUR"}),"\n",(0,i.jsxs)(n.p,{children:["This component allows you to apply Large Language Models to spoken data using the ",(0,i.jsx)(n.a,{href:"https://www.assemblyai.com/docs/lemur",children:"AssemblyAI LeMUR framework"}),"."]}),"\n",(0,i.jsx)(n.p,{children:"LeMUR automatically ingests the transcript as additional context, making it easy to apply LLMs to audio data. You can use it for tasks like summarizing audio, extracting insights, or asking questions."}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Input"}),":"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"AssemblyAI API Key: Your API key."}),"\n",(0,i.jsxs)(n.li,{children:["Transcription Result: The output of the ",(0,i.jsx)(n.strong,{children:"Poll Transcript"})," component."]}),"\n",(0,i.jsxs)(n.li,{children:["Input Prompt: The text to prompt the model. You can type your prompt in this field or connect it to a ",(0,i.jsx)(n.strong,{children:"Prompt Template"})," component."]}),"\n",(0,i.jsx)(n.li,{children:"Final Model: The model that is used for the final prompt after compression is performed. Default is Claude 3.5 Sonnet."}),"\n",(0,i.jsx)(n.li,{children:"Temperature (Optional): The temperature to use for the model. Default is 0.0."}),"\n",(0,i.jsx)(n.li,{children:"Max Output Size (Optional): Max output size in tokens, up to 4000. Default is 2000."}),"\n",(0,i.jsxs)(n.li,{children:['Endpoint (Optional): The LeMUR endpoint to use. Default is "task". For "summary" and "question-answer", no prompt input is needed. See ',(0,i.jsx)(n.a,{href:"https://www.assemblyai.com/docs/api-reference/lemur/",children:"LeMUR API docs"})," for more info."]}),"\n",(0,i.jsxs)(n.li,{children:["Questions (Optional): Comma-separated list of your questions. Only used if ",(0,i.jsx)(n.em,{children:"Endpoint"}),' is "question-answer".']}),"\n",(0,i.jsxs)(n.li,{children:["Transcript IDs (Optional): Comma-separated list of transcript IDs. LeMUR can perform actions over multiple transcripts. If provided, the ",(0,i.jsx)(n.em,{children:"Transcription Result"})," is ignored."]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Output"}),":"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"LeMUR Response: The generated LLM response."}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"assemblyai-list-transcripts",children:"AssemblyAI List Transcripts"}),"\n",(0,i.jsx)(n.p,{children:"This component can be used as a standalone component to list all previously generated transcripts."}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Input"}),":"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"AssemblyAI API Key: Your API key."}),"\n",(0,i.jsx)(n.li,{children:"Limit (Optional): Maximum number of transcripts to retrieve. Default is 20, use 0 for all."}),"\n",(0,i.jsx)(n.li,{children:"Filter (Optional): Filter by transcript status."}),"\n",(0,i.jsx)(n.li,{children:"Created On (Optional): Only get transcripts created on this date (YYYY-MM-DD)."}),"\n",(0,i.jsx)(n.li,{children:"Throttled Only (Optional): Only get throttled transcripts, overrides the status filter"}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Output"}),":"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Transcript List: A list of all transcripts with info such as the transcript ID, the status, and the data."}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"flow-process",children:"Flow Process"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsx)(n.li,{children:"The user inputs an audio or video file."}),"\n",(0,i.jsx)(n.li,{children:"The user can also input an LLM prompt. In this example, we want to generate a summary of the transcript."}),"\n",(0,i.jsx)(n.li,{children:"The flow submits the audio file for transcription."}),"\n",(0,i.jsx)(n.li,{children:"The flow checks the status of the transcript every few seconds until transcription is completed."}),"\n",(0,i.jsx)(n.li,{children:"The flow parses the transcription result and outputs the transcribed text."}),"\n",(0,i.jsx)(n.li,{children:"The flow also generates subtitles."}),"\n",(0,i.jsx)(n.li,{children:"The flow applies the LLM prompt to generate a summary."}),"\n",(0,i.jsx)(n.li,{children:"As a standalone component, all transcripts can be listed."}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"run-the-transcription-and-speech-ai-flow",children:"Run the Transcription and Speech AI Flow"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Build the flow manually or import a pre-build JSON file:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["Recommended: ",(0,i.jsx)(n.a,{target:"_blank","data-noBrokenLinkCheck":!0,href:s(28618).A+"",children:"Download the AssemblyAI Transcription and Speech AI flow JSON"}),", and then ",(0,i.jsx)(n.a,{href:"/concepts-flows-import",children:"import the flow"})," into Langflow."]}),"\n",(0,i.jsx)(n.li,{children:"Create a blank flow, and then add the previously described components to your flow, connecting them as shown in the flow diagram."}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Input your AssemblyAI API key in all components that require the key (",(0,i.jsx)(n.strong,{children:"Start Transcript"}),", ",(0,i.jsx)(n.strong,{children:"Poll Transcript"}),", ",(0,i.jsx)(n.strong,{children:"Get Subtitles"}),", ",(0,i.jsx)(n.strong,{children:"LeMUR"}),", ",(0,i.jsx)(n.strong,{children:"List Transcripts"}),")."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Select an audio or video file for the ",(0,i.jsx)(n.strong,{children:"Start Transcript"})," component."]}),"\n",(0,i.jsxs)(n.p,{children:["Optional: After adding a file to the ",(0,i.jsx)(n.strong,{children:"Start Transcript"})," component, run and ",(0,i.jsx)(n.a,{href:"/concepts-components#freeze-a-component",children:"freeze the component"})," so you only submit the file once, no matter how many times you run the flow.\nTo do this, click ",(0,i.jsx)(r.A,{name:"Play","aria-hidden":"true"})," ",(0,i.jsx)(n.strong,{children:"Run component"})," to preload the file, and then click ",(0,i.jsx)(r.A,{name:"Ellipsis","aria-hidden":"true"})," ",(0,i.jsx)(n.strong,{children:"Show More"})," and select ",(0,i.jsx)(n.strong,{children:"Freeze"})," to lock the result.\nSubsequent flow runs use the frozen component's cached output."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Test the transcription by clicking ",(0,i.jsx)(r.A,{name:"Play","aria-hidden":"true"})," ",(0,i.jsx)(n.strong,{children:"Run component"})," on the ",(0,i.jsx)(n.strong,{children:"Parser"})," component. Make sure that the specified template is ",(0,i.jsx)(n.code,{children:"{text}"}),"."]}),"\n",(0,i.jsxs)(n.p,{children:["Running one component runs all upstream components as well as the selected component and then stops the flow run.\nIn this case, the ",(0,i.jsx)(n.strong,{children:"Start Transcript"})," and ",(0,i.jsx)(n.strong,{children:"Poll Transcript"})," components are upstream from the ",(0,i.jsx)(n.strong,{children:"Parser"})," component.\nIf you froze the ",(0,i.jsx)(n.strong,{children:"Start Transcript"})," component, the flow sends the cached output from ",(0,i.jsx)(n.strong,{children:"Start Transcript"}),", runs the ",(0,i.jsx)(n.strong,{children:"Poll Transcript"})," component, to get the transcription result.\nCheck the flow logs or inspect the output of the ",(0,i.jsx)(n.strong,{children:"Parser"})," component to see the transcribed text result."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["To generate subtitles and run the full flow, click ",(0,i.jsx)(r.A,{name:"Play","aria-hidden":"true"})," ",(0,i.jsx)(n.strong,{children:"Run component"})," on the ",(0,i.jsx)(n.strong,{children:"List Transcript"})," component."]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"customization",children:"Customization"}),"\n",(0,i.jsx)(n.p,{children:"The flow can be customized by:"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["Modifying the parameters in the ",(0,i.jsx)(n.strong,{children:"Start Transcript"})," component."]}),"\n",(0,i.jsxs)(n.li,{children:["Modifying the subtitle format in the ",(0,i.jsx)(n.strong,{children:"Get Subtitles"})," component."]}),"\n",(0,i.jsxs)(n.li,{children:["Modifying the LLM prompt for input of the ",(0,i.jsx)(n.strong,{children:"LeMUR"})," component."]}),"\n",(0,i.jsxs)(n.li,{children:["Modifying the LLM parameters (e.g., temperature) in the ",(0,i.jsx)(n.strong,{children:"LeMUR"})," component."]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"troubleshooting",children:"Troubleshooting"}),"\n",(0,i.jsx)(n.p,{children:"If you encounter issues:"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsx)(n.li,{children:"Ensure the API key is correctly set in all components that require the key."}),"\n",(0,i.jsx)(n.li,{children:"To use LeMUR, you need to upgrade your AssemblyAI account, since this isn't included in the free account."}),"\n",(0,i.jsx)(n.li,{children:"Verify that all components are properly connected in the flow."}),"\n",(0,i.jsx)(n.li,{children:"Review the Langflow logs for any error messages."}),"\n",(0,i.jsxs)(n.li,{children:["Check the ",(0,i.jsx)(n.a,{href:"https://www.assemblyai.com/docs/",children:"AssemblyAI API documentation"}),"."]}),"\n",(0,i.jsxs)(n.li,{children:["Contact ",(0,i.jsx)(n.a,{href:"https://www.assemblyai.com/contact/support",children:"AssemblyAI support"}),"."]}),"\n"]})]})}function p(e={}){const{wrapper:n}={...(0,l.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}}}]); \ No newline at end of file diff --git a/assets/js/ef9aa223.03019f6d.js b/assets/js/ef9aa223.03019f6d.js deleted file mode 100644 index ea0e10a001..0000000000 --- a/assets/js/ef9aa223.03019f6d.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[6224],{7089:(e,t,n)=>{n.r(t),n.d(t,{CH:()=>g,assets:()=>j,chCodeConfig:()=>f,contentTitle:()=>m,default:()=>v,frontMatter:()=>u,metadata:()=>r,toc:()=>y});const r=JSON.parse('{"id":"Components/bundles-datastax","title":"DataStax","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/bundles-datastax.mdx","sourceDirName":"Components","slug":"/bundles-datastax","permalink":"/bundles-datastax","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"DataStax","slug":"/bundles-datastax"},"sidebar":"docs","previous":{"title":"Couchbase","permalink":"/bundles-couchbase"},"next":{"title":"DeepSeek","permalink":"/bundles-deepseek"}}');var s=n(74848),a=n(28453),i=n(24754),o=n(17886),d=n(31929),c=n(80223),l=n(90465),h=n(50005),p=n(27027),x=n(36813);const u={title:"DataStax",slug:"/bundles-datastax"},m=void 0,j={},g={annotations:i.hk,Code:i.Cy},f={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},y=[{value:"Astra DB",id:"astra-db",level:2},...h.RM,{value:"Astra DB parameters",id:"astra-db-parameters",level:3},...d.RM,...c.RM,{value:"Astra DB examples",id:"astra-db-examples",level:3},...p.RM,{value:"Astra DB output",id:"astra-db-output",level:3},...l.RM,{value:"Astra DB CQL",id:"astra-db-cql",level:2},{value:"Astra DB CQL parameters",id:"astra-db-cql-parameters",level:3},...d.RM,{value:"Astra DB Tool",id:"astra-db-tool",level:2},{value:"Astra DB Tool parameters",id:"astra-db-tool-parameters",level:3},{value:"Define tool-specific parameters",id:"define-tool-specific-parameters",level:3},{value:"Astra DB Graph",id:"astra-db-graph",level:2},...l.RM,{value:"Astra DB Graph parameters",id:"astra-db-graph-parameters",level:3},...d.RM,...c.RM,{value:"Graph RAG",id:"graph-rag",level:2},{value:"Graph RAG parameters",id:"graph-rag-parameters",level:3},...d.RM,...c.RM,{value:"Hyper-Converged Database (HCD)",id:"hyper-converged-database-hcd",level:2},...h.RM,...l.RM,{value:"HCD parameters",id:"hcd-parameters",level:3},...d.RM,...c.RM,{value:"Other DataStax components",id:"other-datastax-components",level:2},{value:"Astra DB Chat Memory",id:"astra-db-chat-memory",level:3},{value:"Astra DB Chat Memory parameters",id:"astra-db-chat-memory-parameters",level:4},...d.RM,{value:"Assistants API",id:"assistants-api",level:3},{value:"Environment variables",id:"environment-variables",level:2},{value:"Legacy DataStax components",id:"legacy-datastax-components",level:2},...x.RM,{value:"See also",id:"see-also",level:2}];function b(e){const t={a:"a",admonition:"admonition",code:"code",em:"em",h2:"h2",h3:"h3",h4:"h4",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,a.R)(),...e.components},{Details:r}=t;return g||w("CH",!1),g.Code||w("CH.Code",!0),r||w("Details",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n","\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)(o.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(t.a,{href:"/components-bundle-components",children:(0,s.jsx)(t.strong,{children:"Bundles"})})," contain custom components that support specific third-party integrations with Langflow."]}),"\n",(0,s.jsxs)(t.p,{children:["This page describes the components that are available in the ",(0,s.jsx)(t.strong,{children:"DataStax"})," bundle, including components that read and write to Astra DB databases."]}),"\n",(0,s.jsx)(t.h2,{id:"astra-db",children:"Astra DB"}),"\n",(0,s.jsxs)(t.admonition,{type:"important",children:[(0,s.jsxs)(t.p,{children:["It is recommended that you create any databases, keyspaces, and collections you need before configuring the ",(0,s.jsx)(t.strong,{children:"Astra DB"})," component."]}),(0,s.jsxs)(t.p,{children:["You can create new databases and collections through this component, but this is only possible in the Langflow visual editor (not at runtime), and you must wait while the database or collection initializes before proceeding with flow configuration.\nAdditionally, not all database and collection configuration options are available through the ",(0,s.jsx)(t.strong,{children:"Astra DB"})," component, such as hybrid search options, PCU groups, vectorize integration management, and multi-region deployments."]})]}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.strong,{children:"Astra DB"})," component reads and writes to Astra DB Serverless databases, using an instance of ",(0,s.jsx)(t.code,{children:"AstraDBVectorStore"})," to call the Data API and DevOps API."]}),"\n",(0,s.jsxs)(r,{children:[(0,s.jsx)("summary",{children:"About vector store instances"}),(0,s.jsx)(h.Ay,{})]}),"\n",(0,s.jsx)(t.h3,{id:"astra-db-parameters",children:"Astra DB parameters"}),"\n",(0,s.jsx)(t.p,{children:"You can inspect a vector store component's parameters to learn more about the inputs it accepts, the features it supports, and how to configure it."}),"\n",(0,s.jsx)(d.Ay,{}),"\n",(0,s.jsx)(c.Ay,{}),"\n",(0,s.jsxs)(t.p,{children:["For information about accepted values and functionality, see the ",(0,s.jsx)(t.a,{href:"https://docs.datastax.com/en/astra-db-serverless/index.html",children:"Astra DB Serverless documentation"})," or inspect ",(0,s.jsx)(t.a,{href:"/concepts-components#component-code",children:"component code"}),"."]}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Name"}),(0,s.jsx)(t.th,{children:"Display Name"}),(0,s.jsx)(t.th,{children:"Info"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"token"}),(0,s.jsx)(t.td,{children:"Astra DB Application Token"}),(0,s.jsx)(t.td,{children:"Input parameter. An Astra application token with permission to access your vector database. Once the connection is verified, additional fields are populated with your existing databases and collections. If you want to create a database through this component, the application token must have Organization Administrator permissions."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"environment"}),(0,s.jsx)(t.td,{children:"Environment"}),(0,s.jsxs)(t.td,{children:["Input parameter. The environment for the Astra DB API endpoint. Typically always ",(0,s.jsx)(t.code,{children:"prod"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"database_name"}),(0,s.jsx)(t.td,{children:"Database"}),(0,s.jsxs)(t.td,{children:["Input parameter. The name of the database that you want this component to connect to. Or, you can select ",(0,s.jsx)(t.strong,{children:"New Database"})," to create a new database, and then wait for the database to initialize before setting the remaining parameters."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"endpoint"}),(0,s.jsx)(t.td,{children:"Astra DB API Endpoint"}),(0,s.jsxs)(t.td,{children:["Input parameter. For multi-region databases, select the API endpoint for your nearest datacenter. To get the list of regions for a multi-region database, see ",(0,s.jsx)(t.a,{href:"https://docs.datastax.com/en/astra-db-serverless/databases/manage-regions.html#list-db-regions",children:"List database regions"}),". This field is automatically populated when you select a database, and it defaults to the primary region's endpoint."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"keyspace"}),(0,s.jsx)(t.td,{children:"Keyspace"}),(0,s.jsxs)(t.td,{children:["Input parameter. The keyspace in your database that contains the collection specified in ",(0,s.jsx)(t.code,{children:"collection_name"}),". Default: ",(0,s.jsx)(t.code,{children:"default_keyspace"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"collection_name"}),(0,s.jsx)(t.td,{children:"Collection"}),(0,s.jsxs)(t.td,{children:["Input parameter. The name of the collection that you want to use with this flow. Or, select ",(0,s.jsx)(t.strong,{children:"New Collection"})," to create a new collection with limited configuration options. To ensure your collection is configured with the correct embedding provider and search capabilities, it is recommended to create the collection in the Astra Portal or with the Data API ",(0,s.jsx)(t.em,{children:"before"})," configuring this component. For more information, see ",(0,s.jsx)(t.a,{href:"https://docs.datastax.com/en/astra-db-serverless/databases/manage-collections.html",children:"Manage collections in Astra DB Serverless"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"embedding_model"}),(0,s.jsx)(t.td,{children:"Embedding Model"}),(0,s.jsxs)(t.td,{children:["Input parameter. Attach an ",(0,s.jsx)(t.a,{href:"/components-embedding-models",children:"embedding model component"})," to generate embeddings. Only available if the specified collection doesn't have a ",(0,s.jsx)(t.a,{href:"https://docs.datastax.com/en/astra-db-serverless/databases/embedding-generation.html",children:"vectorize integration"}),". If a vectorize integration exists, the component automatically uses the collection's integrated model."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"ingest_data"}),(0,s.jsx)(t.td,{children:"Ingest Data"}),(0,s.jsxs)(t.td,{children:["Input parameter. The documents to load into the specified collection. Accepts ",(0,s.jsx)(t.code,{children:"Data"})," or ",(0,s.jsx)(t.code,{children:"DataFrame"})," input."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"search_query"}),(0,s.jsx)(t.td,{children:"Search Query"}),(0,s.jsx)(t.td,{children:"Input parameter. The query string for vector search."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"cache_vector_store"}),(0,s.jsx)(t.td,{children:"Cache Vector Store"}),(0,s.jsx)(t.td,{children:"Input parameter. Whether to cache the vector store in Langflow memory for faster reads. Default: Enabled (true)."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"search_method"}),(0,s.jsx)(t.td,{children:"Search Method"}),(0,s.jsxs)(t.td,{children:["Input parameter. The search methods to use, either ",(0,s.jsx)(t.code,{children:"Hybrid Search"})," or ",(0,s.jsx)(t.code,{children:"Vector Search"}),". Your collection must be configured to support the chosen option, and the default depends on what your collection supports. All vector-enabled collections in Astra DB Serverless (Vector) databases support vector search, but hybrid search requires that you set specific collection settings when creating the collection. These options are only available when creating a collection programmatically. For more information, see ",(0,s.jsx)(t.a,{href:"https://docs.datastax.com/en/astra-db-serverless/databases/about-search.html",children:"Ways to find data in Astra DB Serverless"})," and ",(0,s.jsx)(t.a,{href:"https://docs.datastax.com/en/astra-db-serverless/api-reference/collection-methods/create-collection.html#example-hybrid",children:"Create a collection that supports hybrid search"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"reranker"}),(0,s.jsx)(t.td,{children:"Reranker"}),(0,s.jsxs)(t.td,{children:["Input parameter. The re-ranker model to use for hybrid search, depending on the collection configuration. This parameter is only available for collections that support hybrid search. To determine if a collection supports hybrid search, ",(0,s.jsx)(t.a,{href:"https://docs.datastax.com/en/astra-db-serverless/api-reference/collection-methods/list-collection-metadata.html",children:"get collection metadata"}),", and then check that ",(0,s.jsx)(t.code,{children:"lexical"})," and ",(0,s.jsx)(t.code,{children:"rerank"})," both have ",(0,s.jsx)(t.code,{children:'"enabled": true'}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"lexical_terms"}),(0,s.jsx)(t.td,{children:"Lexical Terms"}),(0,s.jsxs)(t.td,{children:["Input parameter. A space-separated string of keywords for hybrid search, like ",(0,s.jsx)(t.code,{children:"features, data, attributes, characteristics"}),". This parameter is only available if the collection supports hybrid search. For more information, see the ",(0,s.jsx)(t.a,{href:"#astra-db-examples",children:"Hybrid search example"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"number_of_results"}),(0,s.jsx)(t.td,{children:"Number of Search Results"}),(0,s.jsx)(t.td,{children:"Input parameter. The number of search results to return. Default: 4."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"search_type"}),(0,s.jsx)(t.td,{children:"Search Type"}),(0,s.jsxs)(t.td,{children:["Input parameter. The search type to use, either ",(0,s.jsx)(t.code,{children:"Similarity"})," (default), ",(0,s.jsx)(t.code,{children:"Similarity with score threshold"}),", and ",(0,s.jsx)(t.code,{children:"MMR (Max Marginal Relevance)"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"search_score_threshold"}),(0,s.jsx)(t.td,{children:"Search Score Threshold"}),(0,s.jsxs)(t.td,{children:["Input parameter. The minimum similarity score threshold for vector search results with the ",(0,s.jsx)(t.code,{children:"Similarity with score threshold"})," search type. Default: 0."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"advanced_search_filter"}),(0,s.jsx)(t.td,{children:"Search Metadata Filter"}),(0,s.jsx)(t.td,{children:"Input parameter. An optional dictionary of metadata filters to apply in addition to vector or hybrid search."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"autodetect_collection"}),(0,s.jsx)(t.td,{children:"Autodetect Collection"}),(0,s.jsx)(t.td,{children:"Input parameter. Whether to automatically fetch a list of available collections after providing an application token and API endpoint."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"content_field"}),(0,s.jsx)(t.td,{children:"Content Field"}),(0,s.jsx)(t.td,{children:"Input parameter. For writes, this parameter specifies the name of the field in the documents that contains text strings for which you want to generate embeddings."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"deletion_field"}),(0,s.jsx)(t.td,{children:"Deletion Based On Field"}),(0,s.jsx)(t.td,{children:"Input parameter. When provided, documents in the target collection with metadata field values matching the input metadata field value are deleted before new records are loaded. Use this setting for writes with upserts (overwrites)."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"ignore_invalid_documents"}),(0,s.jsx)(t.td,{children:"Ignore Invalid Documents"}),(0,s.jsx)(t.td,{children:"Input parameter. Whether to ignore invalid documents during writes. If disabled (false), then an error is raised for invalid documents. Default: Enabled (true)."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"astradb_vectorstore_kwargs"}),(0,s.jsx)(t.td,{children:"AstraDBVectorStore Parameters"}),(0,s.jsxs)(t.td,{children:["Input parameter. An optional dictionary of additional parameters for the ",(0,s.jsx)(t.code,{children:"AstraDBVectorStore"})," instance."]})]})]})]}),"\n",(0,s.jsx)(t.h3,{id:"astra-db-examples",children:"Astra DB examples"}),"\n",(0,s.jsxs)(r,{children:[(0,s.jsx)("summary",{children:"Example: Vector RAG"}),(0,s.jsx)(p.Ay,{})]}),"\n",(0,s.jsxs)(r,{children:[(0,s.jsx)("summary",{children:"Example: Hybrid search"}),(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.strong,{children:"Astra DB"})," component supports the Data API's ",(0,s.jsx)(t.a,{href:"https://docs.datastax.com/en/astra-db-serverless/databases/hybrid-search.html",children:"hybrid search"})," feature.\nHybrid search performs a vector similarity search and a lexical search, compares the results of both searches, and then returns the most relevant results overall."]}),(0,s.jsxs)(t.p,{children:["To use hybrid search through the ",(0,s.jsx)(t.strong,{children:"Astra DB"})," component, do the following:"]}),(0,s.jsxs)(t.ol,{children:["\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["Use the Data API to ",(0,s.jsx)(t.a,{href:"https://docs.datastax.com/en/astra-db-serverless/api-reference/collection-methods/create-collection.html#example-hybrid",children:"create a collection that supports hybrid search"})," if you don't already have one."]}),"\n",(0,s.jsxs)(t.p,{children:["Although you can create a collection through the ",(0,s.jsx)(t.strong,{children:"Astra DB"})," component, you have more control and insight into the collection settings when using the Data API for this operation."]}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["Create a flow based on the ",(0,s.jsx)(t.strong,{children:"Hybrid Search RAG"})," template, which includes an ",(0,s.jsx)(t.strong,{children:"Astra DB"})," component that is pre-configured for hybrid search."]}),"\n",(0,s.jsxs)(t.p,{children:["After loading the template, check for ",(0,s.jsx)(t.strong,{children:"Upgrade available"})," alerts on the components.\nIf any components have an upgrade pending, upgrade and reconnect them before continuing."]}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["In the ",(0,s.jsx)(t.strong,{children:"Language Model"})," components, add your OpenAI API key.\nIf you want to use a different provider or model, see ",(0,s.jsx)(t.a,{href:"/components-models",children:"Language model components"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["Delete the ",(0,s.jsx)(t.strong,{children:"Language Model"})," component that is connected to the ",(0,s.jsx)(t.strong,{children:"Structured Output"})," component's ",(0,s.jsx)(t.strong,{children:"Input Message"})," port, and then connect the ",(0,s.jsx)(t.strong,{children:"Chat Input"})," component to that port."]}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["Configure the ",(0,s.jsx)(t.strong,{children:"Astra DB"})," vector store component:"]}),"\n",(0,s.jsxs)(t.ol,{children:["\n",(0,s.jsx)(t.li,{children:"Enter your Astra DB application token."}),"\n",(0,s.jsxs)(t.li,{children:["In the ",(0,s.jsx)(t.strong,{children:"Database"})," field, select your database."]}),"\n",(0,s.jsxs)(t.li,{children:["In the ",(0,s.jsx)(t.strong,{children:"Collection"})," field, select your collection with hybrid search enabled."]}),"\n"]}),"\n",(0,s.jsx)(t.p,{children:"Once you select a collection that supports hybrid search, the other parameters automatically update to allow hybrid search options."}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["Connect the first ",(0,s.jsx)(t.strong,{children:"Parser"})," component's ",(0,s.jsx)(t.strong,{children:"Parsed Text"})," output to the ",(0,s.jsx)(t.strong,{children:"Astra DB"})," component's ",(0,s.jsx)(t.strong,{children:"Lexical Terms"})," input.\nThis input only appears after connecting a collection that support hybrid search with reranking."]}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["Update the ",(0,s.jsx)(t.strong,{children:"Structured Output"})," template:"]}),"\n",(0,s.jsxs)(t.ol,{children:["\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["Click the ",(0,s.jsx)(t.strong,{children:"Structured Output"})," component to expose the ",(0,s.jsx)(t.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),", and then click ",(0,s.jsx)(o.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,s.jsx)(t.strong,{children:"Controls"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["Find the ",(0,s.jsx)(t.strong,{children:"Format Instructions"})," row, click ",(0,s.jsx)(o.A,{name:"Expand","aria-hidden":"true"})," ",(0,s.jsx)(t.strong,{children:"Expand"}),", and then replace the prompt with the following text:"]}),"\n",(0,s.jsx)(g.Code,{codeConfig:f,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"You are a database query planner that takes a user's requests, and then converts to a search against the subject matter in question.",props:{}}]},{tokens:[{content:"You should convert the query into:",props:{}}]},{tokens:[{content:"1. A list of keywords to use against a Lucene text analyzer index, no more than 4. Strictly unigrams.",props:{}}]},{tokens:[{content:"2. A question to use as the basis for a QA embedding engine.",props:{}}]},{tokens:[{content:"Avoid common keywords associated with the user's subject matter.",props:{}}]}],lang:"text"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["Click ",(0,s.jsx)(t.strong,{children:"Finish Editing"}),", and then click ",(0,s.jsx)(t.strong,{children:"Close"})," to save your changes to the component."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["Open the ",(0,s.jsx)(t.strong,{children:"Playground"}),", and then enter a natural language question that you would ask about your database."]}),"\n",(0,s.jsxs)(t.p,{children:["In this example, your input is sent to both the ",(0,s.jsx)(t.strong,{children:"Astra DB"})," and ",(0,s.jsx)(t.strong,{children:"Structured Output"})," components:"]}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["The input sent directly to the ",(0,s.jsx)(t.strong,{children:"Astra DB"})," component's ",(0,s.jsx)(t.strong,{children:"Search Query"})," port is used as a string for similarity search.\nAn embedding is generated from the query string using the collection's Astra DB vectorize integration."]}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["The input sent to the ",(0,s.jsx)(t.strong,{children:"Structured Output"})," component is processed by the ",(0,s.jsx)(t.strong,{children:"Structured Output"}),", ",(0,s.jsx)(t.strong,{children:"Language Model"}),", and ",(0,s.jsx)(t.strong,{children:"Parser"})," components to extract space-separated ",(0,s.jsx)(t.code,{children:"keywords"})," used for the lexical search portion of the hybrid search."]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(t.p,{children:["The complete hybrid search query is executed against your database using the Data API's ",(0,s.jsx)(t.code,{children:"find_and_rerank"})," command.\nThe API's response is output as a ",(0,s.jsx)(t.code,{children:"DataFrame"})," that is transformed into a text string ",(0,s.jsx)(t.code,{children:"Message"})," by another ",(0,s.jsx)(t.strong,{children:"Parser"})," component.\nFinally, the ",(0,s.jsx)(t.strong,{children:"Chat Output"})," component prints the ",(0,s.jsx)(t.code,{children:"Message"})," response to the ",(0,s.jsx)(t.strong,{children:"Playground"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["Optional: Exit the ",(0,s.jsx)(t.strong,{children:"Playground"}),", and then click ",(0,s.jsx)(o.A,{name:"TextSearch","aria-hidden":"true"})," ",(0,s.jsx)(t.strong,{children:"Inspect Output"})," on each individual component to understand how lexical keywords were constructed and view the raw response from the Data API.\nThis is helpful for debugging flows where a certain component isn't receiving input as expected from another component."]}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)(t.strong,{children:"Structured Output component"}),": The output is the ",(0,s.jsx)(t.code,{children:"Data"})," object produced by applying the output schema to the LLM's response to the input message and format instructions.\nThe following example is based on the aforementioned instructions for keyword extraction:"]}),"\n",(0,s.jsx)(g.Code,{codeConfig:f,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"1. Keywords: features, data, attributes, characteristics",props:{}}]},{tokens:[{content:"2. Question: What characteristics can be identified in my data?",props:{}}]}],lang:"text"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)(t.strong,{children:"Parser component"}),": The output is the string of keywords extracted from the structured output ",(0,s.jsx)(t.code,{children:"Data"}),", and then used as lexical terms for the hybrid search."]}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)(t.strong,{children:"Astra DB component"}),": The output is the ",(0,s.jsx)(t.code,{children:"DataFrame"})," containing the results of the hybrid search as returned by the Data API."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]})]}),"\n",(0,s.jsx)(t.h3,{id:"astra-db-output",children:"Astra DB output"}),"\n",(0,s.jsx)(l.Ay,{}),"\n",(0,s.jsxs)(r,{children:[(0,s.jsx)("summary",{children:"Vector Store Connection port"}),(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.strong,{children:"Astra DB"})," component has an additional ",(0,s.jsx)(t.strong,{children:"Vector Store Connection"})," output.\nThis output can only connect to a ",(0,s.jsx)(t.code,{children:"VectorStore"})," input port, and it was intended for use with dedicated Graph RAG components."]}),(0,s.jsxs)(t.p,{children:["The only non-legacy component that supports this input is the ",(0,s.jsxs)(t.a,{href:"#graph-rag",children:[(0,s.jsx)(t.strong,{children:"Graph RAG"})," component"]}),", which can be a Graph RAG extension to the ",(0,s.jsx)(t.strong,{children:"Astra DB"})," component.\nInstead, use the ",(0,s.jsx)(t.strong,{children:"Astra DB Graph"})," component that includes both the vector store connection and Graph RAG functionality."]})]}),"\n",(0,s.jsx)(t.h2,{id:"astra-db-cql",children:"Astra DB CQL"}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.strong,{children:"Astra DB CQL"})," component allows agents to query data from CQL tables in Astra DB."]}),"\n",(0,s.jsxs)(t.p,{children:["The output is a list of ",(0,s.jsx)(t.a,{href:"/data-types#data",children:(0,s.jsx)(t.code,{children:"Data"})})," objects containing the query results from the Astra DB CQL table. Each Data object contains the document fields specified by the projection fields. Limited by the ",(0,s.jsx)(t.code,{children:"number_of_results"})," parameter."]}),"\n",(0,s.jsx)(t.h3,{id:"astra-db-cql-parameters",children:"Astra DB CQL parameters"}),"\n",(0,s.jsx)(d.Ay,{}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Name"}),(0,s.jsx)(t.th,{children:"Type"}),(0,s.jsx)(t.th,{children:"Description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Tool Name"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. The name used to reference the tool in the agent's prompt."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Tool Description"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. A brief description of the tool to guide the model in using it."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Keyspace"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. The name of the keyspace."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Table Name"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. The name of the Astra DB CQL table to query."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Token"}),(0,s.jsx)(t.td,{children:"SecretString"}),(0,s.jsx)(t.td,{children:"Input parameter. The authentication token for Astra DB."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"API Endpoint"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. The Astra DB API endpoint."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Projection Fields"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:'Input parameter. The attributes to return, separated by commas. Default: "*".'})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Partition Keys"}),(0,s.jsx)(t.td,{children:"Dict"}),(0,s.jsx)(t.td,{children:"Input parameter. Required parameters that the model must fill to query the tool."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Clustering Keys"}),(0,s.jsx)(t.td,{children:"Dict"}),(0,s.jsxs)(t.td,{children:["Input parameter. Optional parameters the model can fill to refine the query. Required parameters should be marked with an exclamation mark, for example, ",(0,s.jsx)(t.code,{children:"!customer_id"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Static Filters"}),(0,s.jsx)(t.td,{children:"Dict"}),(0,s.jsx)(t.td,{children:"Input parameter. Attribute-value pairs used to filter query results."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Limit"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. The number of records to return."})]})]})]}),"\n",(0,s.jsx)(t.h2,{id:"astra-db-tool",children:"Astra DB Tool"}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.strong,{children:"Astra DB Tool"})," component enables searching data in Astra DB collections, including hybrid search, vector search, and regular filter-based search.\nSpecialized searches require that the collection is pre-configured with the required parameters."]}),"\n",(0,s.jsxs)(t.p,{children:["Outputs a list of ",(0,s.jsx)(t.a,{href:"/data-types#data",children:(0,s.jsx)(t.code,{children:"Data"})})," objects containing the query results from Astra DB. Each ",(0,s.jsx)(t.code,{children:"Data"})," object contains the document fields specified by the projection attributes. Limited by the ",(0,s.jsx)(t.code,{children:"number_of_results"})," parameter and the upper limit of the Astra DB Data API, depending on the type of search."]}),"\n",(0,s.jsxs)(t.p,{children:["You can use the component to execute queries directly as isolated steps in a flow, or you can connect it as a ",(0,s.jsx)(t.a,{href:"/agents-tools",children:"tool for an agent"})," to allow the agent to query data from Astra DB collections as needed to respond to user queries.\nFor more information, see ",(0,s.jsx)(t.a,{href:"/agents",children:"Use Langflow agents"}),"."]}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.img,{alt:"Astra DB Tool component connected as a tool to an Agent component",src:n(68335).A+"",width:"4000",height:"2742"})}),"\n",(0,s.jsx)(t.h3,{id:"astra-db-tool-parameters",children:"Astra DB Tool parameters"}),"\n",(0,s.jsxs)(t.p,{children:["The following parameters are for the ",(0,s.jsx)(t.strong,{children:"Astra DB Tool"})," component overall."]}),"\n",(0,s.jsxs)(t.p,{children:["The values for ",(0,s.jsx)(t.strong,{children:"Collection Name"}),", ",(0,s.jsx)(t.strong,{children:"Astra DB Application Token"}),", and ",(0,s.jsx)(t.strong,{children:"Astra DB API Endpoint"})," are found in your Astra DB deployment. For more information, see the ",(0,s.jsx)(t.a,{href:"https://docs.datastax.com/en/astra-db-serverless/databases/create-database.html",children:"Astra DB Serverless documentation"}),"."]}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Name"}),(0,s.jsx)(t.th,{children:"Type"}),(0,s.jsx)(t.th,{children:"Description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Tool Name"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. The name used to reference the tool in the agent's prompt."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Tool Description"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. A brief description of the tool. This helps the model decide when to use it."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Keyspace Name"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsxs)(t.td,{children:["Input parameter. The name of the keyspace in Astra DB. Default: ",(0,s.jsx)(t.code,{children:"default_keyspace"})]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Collection Name"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. The name of the Astra DB collection to query."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Token"}),(0,s.jsx)(t.td,{children:"SecretString"}),(0,s.jsx)(t.td,{children:"Input parameter. The authentication token for accessing Astra DB."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"API Endpoint"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. The Astra DB API endpoint."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Projection Fields"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsxs)(t.td,{children:["Input parameter. Comma-separated list of attributes to return from matching documents. The default is the default projection, ",(0,s.jsx)(t.code,{children:"*"}),", which returns all attributes except reserved fields like ",(0,s.jsx)(t.code,{children:"$vector"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Tool Parameters"}),(0,s.jsx)(t.td,{children:"Dict"}),(0,s.jsxs)(t.td,{children:["Input parameter. ",(0,s.jsxs)(t.a,{href:"https://docs.datastax.com/en/astra-db-serverless/api-reference/document-methods/find-many.html#parameters",children:["Astra DB Data API ",(0,s.jsx)(t.code,{children:"find"})," filters"]})," that become tools for an agent. These Filters ",(0,s.jsx)(t.em,{children:"may"})," be used in a search, if the agent selects them. See ",(0,s.jsx)(t.a,{href:"#define-tool-specific-parameters",children:"Define tool-specific parameters"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Static Filters"}),(0,s.jsx)(t.td,{children:"Dict"}),(0,s.jsxs)(t.td,{children:["Input parameter. Attribute-value pairs used to filter query results. Equivalent to ",(0,s.jsxs)(t.a,{href:"https://docs.datastax.com/en/astra-db-serverless/api-reference/document-methods/find-many.html#parameters",children:["Astra DB Data API ",(0,s.jsx)(t.code,{children:"find"})," filters"]}),". ",(0,s.jsx)(t.strong,{children:"Static Filters"})," are included with ",(0,s.jsx)(t.em,{children:"every"})," query. Use ",(0,s.jsx)(t.strong,{children:"Static Filters"})," without semantic search to perform a regular filter search."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Number of Results"}),(0,s.jsx)(t.td,{children:"Int"}),(0,s.jsx)(t.td,{children:"Input parameter. The maximum number of documents to return."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Semantic Search"}),(0,s.jsx)(t.td,{children:"Boolean"}),(0,s.jsxs)(t.td,{children:["Input parameter. Whether to run a similarity search by generating a vector embedding from the chat input and following the ",(0,s.jsx)(t.strong,{children:"Semantic Search Instruction"}),". Default: false. If true, you must attach an ",(0,s.jsx)(t.a,{href:"/components-embedding-models",children:"embedding model component"})," or have vectorize pre-enabled on your collection."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Use Astra DB Vectorize"}),(0,s.jsx)(t.td,{children:"Boolean"}),(0,s.jsx)(t.td,{children:"Input parameter. Whether to use the Astra DB vectorize feature for embedding generation when running a semantic search. Default: false. If true, you must have vectorize pre-enabled on your collection."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Embedding Model"}),(0,s.jsx)(t.td,{children:"Embedding"}),(0,s.jsxs)(t.td,{children:["Input parameter. A port to attach an embedding model component to generate a vector from input text for semantic search. This can be used when ",(0,s.jsx)(t.strong,{children:"Semantic Search"})," is true, with or without vectorize. Be sure to use a model that aligns with the dimensions of the embeddings already present in the collection."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Semantic Search Instruction"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsxs)(t.td,{children:["Input parameter. The query to use for similarity search. Default: ",(0,s.jsx)(t.code,{children:'"Find documents similar to the query."'}),". This instruction is used to guide the model in performing semantic search."]})]})]})]}),"\n",(0,s.jsx)(t.h3,{id:"define-tool-specific-parameters",children:"Define tool-specific parameters"}),"\n",(0,s.jsxs)(t.admonition,{type:"tip",children:[(0,s.jsxs)(t.p,{children:[(0,s.jsx)(t.strong,{children:"Tool Parameters"})," are small functions that you create within the ",(0,s.jsx)(t.strong,{children:"Astra DB Tool"})," component.\nThey give the LLM pre-defined ways to interact with the data in your collection."]}),(0,s.jsx)(t.p,{children:"Without these filters, the LLM has no concept of the data in your collection or which attributes are important."}),(0,s.jsx)(t.p,{children:"At runtime, the LLM can decide which filters are relevant to the current query."}),(0,s.jsxs)(t.p,{children:["Filters in ",(0,s.jsx)(t.strong,{children:"Tool Parameters"})," aren't always applied.\nIf you want to enforce filters for ",(0,s.jsx)(t.em,{children:"every"})," query, use the ",(0,s.jsx)(t.strong,{children:"Static Filters"})," parameter.\nYou can use both ",(0,s.jsx)(t.strong,{children:"Tool Parameters"})," and ",(0,s.jsx)(t.strong,{children:"Static Filters"})," to set some required filters and some optional filters."]})]}),"\n",(0,s.jsxs)(t.p,{children:["In the ",(0,s.jsx)(t.strong,{children:"Astra DB Tool"})," component's ",(0,s.jsx)(t.strong,{children:"Tool Parameters"})," field, you can create filters to query documents in your collection."]}),"\n",(0,s.jsxs)(t.p,{children:["When used in ",(0,s.jsx)(t.strong,{children:"Tool Mode"})," with an agent, these filters tell the agent which document attributes are most important, which are required in searches, and which operators to use on certain attributes.\nThe filters become available as parameters that the LLM can use when calling the tool, with a better understanding of each parameter provided by the ",(0,s.jsx)(t.strong,{children:"Description"})," field."]}),"\n",(0,s.jsxs)(t.p,{children:["In the ",(0,s.jsx)(t.strong,{children:"Tool Parameters"})," pane, click ",(0,s.jsx)(o.A,{name:"Plus","aria-hidden":"true"})," ",(0,s.jsx)(t.strong,{children:"Add a new row"}),", and then edit each cell in the row.\nFor example, the following filter allows an LLM to filter by unique ",(0,s.jsx)(t.code,{children:"customer_id"})," values:"]}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsxs)(t.li,{children:["Name: ",(0,s.jsx)(t.code,{children:"customer_id"})]}),"\n",(0,s.jsx)(t.li,{children:"Attribute Name: Leave empty if the attribute matches the field name in the database."}),"\n",(0,s.jsxs)(t.li,{children:["Description: ",(0,s.jsx)(t.code,{children:'"The unique identifier of the customer to filter by"'}),"."]}),"\n",(0,s.jsxs)(t.li,{children:["Is Metadata: Select ",(0,s.jsx)(t.strong,{children:"False"})," unless the value is stored in the metadata field."]}),"\n",(0,s.jsxs)(t.li,{children:["Is Mandatory: Set to ",(0,s.jsx)(t.strong,{children:"True"})," to make the filter required."]}),"\n",(0,s.jsxs)(t.li,{children:["Is Timestamp: For this example, select ",(0,s.jsx)(t.strong,{children:"False"})," because the value is an ID, not a timestamp."]}),"\n",(0,s.jsxs)(t.li,{children:["Operator: ",(0,s.jsx)(t.code,{children:"$eq"})," to look for an exact match."]}),"\n"]}),"\n",(0,s.jsxs)(t.p,{children:["The following fields are available for each row in the ",(0,s.jsx)(t.strong,{children:"Tool Parameters"})," pane:"]}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Parameter"}),(0,s.jsx)(t.th,{children:"Description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Name"}),(0,s.jsx)(t.td,{children:"The name of the parameter that is exposed to the LLM. It can be the same as the underlying field name or a more descriptive label. The LLM uses this name, along with the description, to infer what value to provide during execution."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Attribute Name"}),(0,s.jsxs)(t.td,{children:["When the parameter name shown to the LLM differs from the actual field or property in the database, use this setting to map the user-facing name to the correct attribute. For example, to apply a range filter to the timestamp field, define two separate parameters, such as ",(0,s.jsx)(t.code,{children:"start_date"})," and ",(0,s.jsx)(t.code,{children:"end_date"}),", that both reference the same timestamp attribute."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Description"}),(0,s.jsxs)(t.td,{children:["Provides instructions to the LLM on how the parameter should be used. Clear and specific guidance helps the LLM provide valid input. For example, if a field such as ",(0,s.jsx)(t.code,{children:"specialty"})," is stored in lowercase, the description should indicate that the input must be lowercase."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Is Metadata"}),(0,s.jsxs)(t.td,{children:["When loading data using LangChain or Langflow, additional attributes may be stored under a metadata object. If the target attribute is stored this way, enable this option. It adjusts the query by generating a filter in the format: ",(0,s.jsx)(t.code,{children:'{"metadata.": ""}'})]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Is Timestamp"}),(0,s.jsx)(t.td,{children:"For date or time-based filters, enable this option to automatically convert values to the timestamp format that the Astrapy client expects. This ensures compatibility with the underlying API without requiring manual formatting."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Operator"}),(0,s.jsxs)(t.td,{children:["Defines the filtering logic applied to the attribute. You can use any valid ",(0,s.jsx)(t.a,{href:"https://docs.datastax.com/en/astra-db-serverless/api-reference/filter-operator-collections.html",children:"Data API filter operator"}),". For example, to filter a time range on the timestamp attribute, use two parameters: one with the ",(0,s.jsx)(t.code,{children:"$gt"}),' operator for "greater than", and another with the ',(0,s.jsx)(t.code,{children:"$lt"}),' operator for "less than".']})]})]})]}),"\n",(0,s.jsx)(t.h2,{id:"astra-db-graph",children:"Astra DB Graph"}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.strong,{children:"Astra DB Graph"})," component uses ",(0,s.jsx)(t.code,{children:"AstraDBGraphVectorStore"}),", an instance of ",(0,s.jsx)(t.a,{href:"https://python.langchain.com/api_reference/community/graph_vectorstores.html",children:"LangChain graph vector store"}),", for graph traversal and graph-based document retrieval in an Astra DB collection. It also supports writing to the vector store.\nFor more information, see ",(0,s.jsx)(t.a,{href:"https://docs.datastax.com/en/astra-db-serverless/tutorials/graph-rag.html",children:"Build a Graph RAG system with LangChain and GraphRetriever"}),"."]}),"\n",(0,s.jsx)(l.Ay,{}),"\n",(0,s.jsx)(t.h3,{id:"astra-db-graph-parameters",children:"Astra DB Graph parameters"}),"\n",(0,s.jsx)(t.p,{children:"You can inspect a vector store component's parameters to learn more about the inputs it accepts, the features it supports, and how to configure it."}),"\n",(0,s.jsx)(d.Ay,{}),"\n",(0,s.jsx)(c.Ay,{}),"\n",(0,s.jsxs)(t.p,{children:["For information about accepted values and functionality, see the ",(0,s.jsx)(t.a,{href:"https://docs.datastax.com/en/astra-db-serverless/index.html",children:"Astra DB Serverless documentation"})," or inspect ",(0,s.jsx)(t.a,{href:"/concepts-components#component-code",children:"component code"}),"."]}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Name"}),(0,s.jsx)(t.th,{children:"Display Name"}),(0,s.jsx)(t.th,{children:"Info"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"token"}),(0,s.jsx)(t.td,{children:"Astra DB Application Token"}),(0,s.jsx)(t.td,{children:"Input parameter. An Astra application token with permission to access your vector database. Once the connection is verified, additional fields are populated with your existing databases and collections. If you want to create a database through this component, the application token must have Organization Administrator permissions."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"api_endpoint"}),(0,s.jsx)(t.td,{children:"API Endpoint"}),(0,s.jsx)(t.td,{children:"Input parameter. Your database's API endpoint."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"keyspace"}),(0,s.jsx)(t.td,{children:"Keyspace"}),(0,s.jsxs)(t.td,{children:["Input parameter. The keyspace in your database that contains the collection specified in ",(0,s.jsx)(t.code,{children:"collection_name"}),". Default: ",(0,s.jsx)(t.code,{children:"default_keyspace"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"collection_name"}),(0,s.jsx)(t.td,{children:"Collection"}),(0,s.jsx)(t.td,{children:"Input parameter. The name of the collection that you want to use with this flow. For write operations, if a matching collection doesn't exist, a new one is created."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"metadata_incoming_links_key"}),(0,s.jsx)(t.td,{children:"Metadata Incoming Links Key"}),(0,s.jsx)(t.td,{children:"Input parameter. The metadata key for the incoming links in the vector store."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"ingest_data"}),(0,s.jsx)(t.td,{children:"Ingest Data"}),(0,s.jsx)(t.td,{children:"Input parameter. Records to load into the vector store. Only relevant for writes."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"search_input"}),(0,s.jsx)(t.td,{children:"Search Query"}),(0,s.jsx)(t.td,{children:"Input parameter. Query string for similarity search. Only relevant for reads."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"cache_vector_store"}),(0,s.jsx)(t.td,{children:"Cache Vector Store"}),(0,s.jsx)(t.td,{children:"Input parameter. Whether to cache the vector store in Langflow memory for faster reads. Default: Enabled (true)."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"embedding_model"}),(0,s.jsx)(t.td,{children:"Embedding Model"}),(0,s.jsxs)(t.td,{children:["Input parameter. Attach an ",(0,s.jsx)(t.a,{href:"/components-embedding-models",children:"embedding model component"})," to generate embeddings. If the collection has a ",(0,s.jsx)(t.a,{href:"https://docs.datastax.com/en/astra-db-serverless/databases/embedding-generation.html",children:"vectorize integration"}),", don't attach an embedding model component."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"metric"}),(0,s.jsx)(t.td,{children:"Metric"}),(0,s.jsxs)(t.td,{children:["Input parameter. The metrics to use for similarity search calculations, either ",(0,s.jsx)(t.code,{children:"cosine"})," (default), ",(0,s.jsx)(t.code,{children:"dot_product"}),", or ",(0,s.jsx)(t.code,{children:"euclidean"}),". This is a collection setting."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"batch_size"}),(0,s.jsx)(t.td,{children:"Batch Size"}),(0,s.jsx)(t.td,{children:"Input parameter. Optional number of records to process in a single batch."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bulk_insert_batch_concurrency"}),(0,s.jsx)(t.td,{children:"Bulk Insert Batch Concurrency"}),(0,s.jsx)(t.td,{children:"Input parameter. Optional concurrency level for bulk write operations."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bulk_insert_overwrite_concurrency"}),(0,s.jsx)(t.td,{children:"Bulk Insert Overwrite Concurrency"}),(0,s.jsx)(t.td,{children:"Input parameter. Optional concurrency level for bulk write operations that allow upserts (overwriting existing records)."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bulk_delete_concurrency"}),(0,s.jsx)(t.td,{children:"Bulk Delete Concurrency"}),(0,s.jsx)(t.td,{children:"Input parameter. Optional concurrency level for bulk delete operations."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"setup_mode"}),(0,s.jsx)(t.td,{children:"Setup Mode"}),(0,s.jsxs)(t.td,{children:["Input parameter. Configuration mode for setting up the vector store, either ",(0,s.jsx)(t.code,{children:"Sync"})," (default) or ",(0,s.jsx)(t.code,{children:"Off"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"pre_delete_collection"}),(0,s.jsx)(t.td,{children:"Pre Delete Collection"}),(0,s.jsx)(t.td,{children:"Input parameter. Whether to delete the collection before creating a new one. Default: Disabled (false)."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"metadata_indexing_include"}),(0,s.jsx)(t.td,{children:"Metadata Indexing Include"}),(0,s.jsxs)(t.td,{children:["Input parameter. A list of metadata fields to index if you want to enable ",(0,s.jsx)(t.a,{href:"https://docs.datastax.com/en/astra-db-serverless/api-reference/collection-indexes.html",children:"selective indexing"})," ",(0,s.jsx)(t.em,{children:"only"})," when creating a collection. Doesn't apply to existing collections. Only one ",(0,s.jsx)(t.code,{children:"*_indexing_*"})," parameter can be set per collection. If all ",(0,s.jsx)(t.code,{children:"*_indexing_*"})," parameters are unset, then all fields are indexed (default indexing)."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"metadata_indexing_exclude"}),(0,s.jsx)(t.td,{children:"Metadata Indexing Exclude"}),(0,s.jsxs)(t.td,{children:["Input parameter. A list of metadata fields to exclude from indexing if you want to enable selective indexing ",(0,s.jsx)(t.em,{children:"only"})," when creating a collection. Doesn't apply to existing collections. Only one ",(0,s.jsx)(t.code,{children:"*_indexing_*"})," parameter can be set per collection. If all ",(0,s.jsx)(t.code,{children:"*_indexing_*"})," parameters are unset, then all fields are indexed (default indexing)."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"collection_indexing_policy"}),(0,s.jsx)(t.td,{children:"Collection Indexing Policy"}),(0,s.jsxs)(t.td,{children:["Input parameter. A dictionary to define the indexing policy if you want to enable selective indexing ",(0,s.jsx)(t.em,{children:"only"})," when creating a collection. Doesn't apply to existing collections. Only one ",(0,s.jsx)(t.code,{children:"*_indexing_*"})," parameter can be set per collection. If all ",(0,s.jsx)(t.code,{children:"*_indexing_*"})," parameters are unset, then all fields are indexed (default indexing). The ",(0,s.jsx)(t.code,{children:"collection_indexing_policy"})," dictionary is used when you need to set indexing on subfields or a complex indexing definition that isn't compatible as a list."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"number_of_results"}),(0,s.jsx)(t.td,{children:"Number of Results"}),(0,s.jsx)(t.td,{children:"Input parameter. Number of search results to return. Default: 4. Only relevant to reads."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"search_type"}),(0,s.jsx)(t.td,{children:"Search Type"}),(0,s.jsxs)(t.td,{children:["Input parameter. Search type to use, either ",(0,s.jsx)(t.code,{children:"Similarity"}),", ",(0,s.jsx)(t.code,{children:"Similarity with score threshold"}),", or ",(0,s.jsx)(t.code,{children:"MMR (Max Marginal Relevance)"}),", ",(0,s.jsx)(t.code,{children:"Graph Traversal"}),", or ",(0,s.jsx)(t.code,{children:"MMR (Max Marginal Relevance) Graph Traversal"})," (default). Only relevant to reads."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"search_score_threshold"}),(0,s.jsx)(t.td,{children:"Search Score Threshold"}),(0,s.jsxs)(t.td,{children:["Input parameter. Minimum similarity score threshold for search results if the ",(0,s.jsx)(t.code,{children:"search_type"})," is ",(0,s.jsx)(t.code,{children:"Similarity with score threshold"}),". Default: 0."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"search_filter"}),(0,s.jsx)(t.td,{children:"Search Metadata Filter"}),(0,s.jsx)(t.td,{children:"Input parameter. Optional dictionary of metadata filters to apply in addition to vector search."})]})]})]}),"\n",(0,s.jsx)(t.h2,{id:"graph-rag",children:"Graph RAG"}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.strong,{children:"Graph RAG"})," component uses an instance of ",(0,s.jsx)(t.a,{href:"https://datastax.github.io/graph-rag/reference/langchain_graph_retriever/",children:(0,s.jsx)(t.code,{children:"GraphRetriever"})})," for Graph RAG traversal enabling graph-based document retrieval in an Astra DB vector store.\nFor more information, see the ",(0,s.jsx)(t.a,{href:"https://datastax.github.io/graph-rag/",children:"DataStax Graph RAG documentation"}),"."]}),"\n",(0,s.jsx)(t.admonition,{type:"info",children:(0,s.jsxs)(t.p,{children:["This component can be a Graph RAG extension for the ",(0,s.jsxs)(t.a,{href:"#astra-db",children:[(0,s.jsx)(t.strong,{children:"Astra DB"})," vector store component"]}),".\nHowever, the ",(0,s.jsxs)(t.a,{href:"#astra-db-graph",children:[(0,s.jsx)(t.strong,{children:"Astra DB Graph"})," component"]})," includes both the vector store connection and Graph RAG functionality."]})}),"\n",(0,s.jsx)(t.h3,{id:"graph-rag-parameters",children:"Graph RAG parameters"}),"\n",(0,s.jsx)(t.p,{children:"You can inspect a vector store component's parameters to learn more about the inputs it accepts, the features it supports, and how to configure it."}),"\n",(0,s.jsx)(d.Ay,{}),"\n",(0,s.jsx)(c.Ay,{}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Name"}),(0,s.jsx)(t.th,{children:"Display Name"}),(0,s.jsx)(t.th,{children:"Info"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"embedding_model"}),(0,s.jsx)(t.td,{children:"Embedding Model"}),(0,s.jsxs)(t.td,{children:["Input parameter. Specify the embedding model to use. Not required if the connected vector store has a ",(0,s.jsx)(t.a,{href:"https://docs.datastax.com/en/astra-db-serverless/databases/embedding-generation.html",children:"vectorize integration"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"vector_store"}),(0,s.jsx)(t.td,{children:"Vector Store Connection"}),(0,s.jsxs)(t.td,{children:["Input parameter. An instance of ",(0,s.jsx)(t.code,{children:"AstraDbVectorStore"})," inherited from the ",(0,s.jsxs)(t.a,{href:"#astra-db",children:[(0,s.jsx)(t.strong,{children:"Astra DB"})," component"]}),"'s ",(0,s.jsx)(t.strong,{children:"Vector Store Connection"})," output."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"edge_definition"}),(0,s.jsx)(t.td,{children:"Edge Definition"}),(0,s.jsxs)(t.td,{children:["Input parameter. ",(0,s.jsx)(t.a,{href:"https://datastax.github.io/graph-rag/reference/graph_retriever/edges/",children:"Edge definition"})," for the graph traversal."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"strategy"}),(0,s.jsx)(t.td,{children:"Traversal Strategies"}),(0,s.jsx)(t.td,{children:"Input parameter. The strategy to use for graph traversal. Strategy options are dynamically loaded from available strategies."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"search_query"}),(0,s.jsx)(t.td,{children:"Search Query"}),(0,s.jsx)(t.td,{children:"Input parameter. The query to search for in the vector store."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"graphrag_strategy_kwargs"}),(0,s.jsx)(t.td,{children:"Strategy Parameters"}),(0,s.jsxs)(t.td,{children:["Input parameter. Optional dictionary of additional parameters for the ",(0,s.jsx)(t.a,{href:"https://datastax.github.io/graph-rag/reference/graph_retriever/strategies/",children:"retrieval strategy"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"search_results"}),(0,s.jsxs)(t.td,{children:[(0,s.jsx)(t.strong,{children:"Search Results"})," or ",(0,s.jsx)(t.strong,{children:"DataFrame"})]}),(0,s.jsxs)(t.td,{children:["Output parameter. The results of the graph-based document retrieval as a list of ",(0,s.jsx)(t.a,{href:"/data-types#data",children:(0,s.jsx)(t.code,{children:"Data"})})," objects or as a tabular ",(0,s.jsx)(t.a,{href:"/data-types#dataframe",children:(0,s.jsx)(t.code,{children:"DataFrame"})}),". You can set the desired output type near the component's output port."]})]})]})]}),"\n",(0,s.jsx)(t.h2,{id:"hyper-converged-database-hcd",children:"Hyper-Converged Database (HCD)"}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.strong,{children:"Hyper-Converged Database (HCD)"})," component uses your cluster's Data API server to read and write to your HCD vector store.\nBecause the underlying functions call the Data API, which originated from Astra DB, the component uses an instance of ",(0,s.jsx)(t.code,{children:"AstraDBVectorStore"}),"."]}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.img,{alt:"A flow using the HCD component to load vector data.",src:n(42638).A+"",width:"2294",height:"1684"})}),"\n",(0,s.jsxs)(r,{children:[(0,s.jsx)("summary",{children:"About vector store instances"}),(0,s.jsx)(h.Ay,{})]}),"\n",(0,s.jsx)(l.Ay,{}),"\n",(0,s.jsxs)(t.p,{children:["For more information about HCD, see ",(0,s.jsx)(t.a,{href:"https://docs.datastax.com/en/hyper-converged-database/1.2/get-started/get-started-hcd.html",children:"Get started with HCD 1.2"})," and ",(0,s.jsx)(t.a,{href:"https://docs.datastax.com/en/hyper-converged-database/1.2/api-reference/dataapiclient.html",children:"Get started with the Data API in HCD 1.2"}),"."]}),"\n",(0,s.jsx)(t.h3,{id:"hcd-parameters",children:"HCD parameters"}),"\n",(0,s.jsx)(t.p,{children:"You can inspect a vector store component's parameters to learn more about the inputs it accepts, the features it supports, and how to configure it."}),"\n",(0,s.jsx)(d.Ay,{}),"\n",(0,s.jsx)(c.Ay,{}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Name"}),(0,s.jsx)(t.th,{children:"Display Name"}),(0,s.jsx)(t.th,{children:"Info"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"collection_name"}),(0,s.jsx)(t.td,{children:"Collection Name"}),(0,s.jsx)(t.td,{children:"Input parameter. The name of a vector store collection in HCD. For write operations, if the collection doesn't exist, then a new one is created. Required."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"username"}),(0,s.jsx)(t.td,{children:"HCD Username"}),(0,s.jsxs)(t.td,{children:["Input parameter. Username for authenticating to your HCD deployment. Default: ",(0,s.jsx)(t.code,{children:"hcd-superuser"}),". Required."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"password"}),(0,s.jsx)(t.td,{children:"HCD Password"}),(0,s.jsx)(t.td,{children:"Input parameter. Password for authenticating to your HCD deployment. Required."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"api_endpoint"}),(0,s.jsx)(t.td,{children:"HCD API Endpoint"}),(0,s.jsxs)(t.td,{children:["Input parameter. Your deployment's HCD Data API endpoint, formatted as ",(0,s.jsx)(t.code,{children:"http[s]://CLUSTER_HOST:GATEWAY_PORT"})," where ",(0,s.jsx)(t.code,{children:"CLUSTER_HOST"})," is the IP address of any node in your cluster and ",(0,s.jsx)(t.code,{children:"GATEWAY_PORT"})," is the port number for your API gateway service. For example, ",(0,s.jsx)(t.code,{children:"http://192.0.2.250:8181"}),". Required."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"ingest_data"}),(0,s.jsx)(t.td,{children:"Ingest Data"}),(0,s.jsx)(t.td,{children:"Input parameter. Records to load into the vector store. Only relevant for writes."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"search_input"}),(0,s.jsx)(t.td,{children:"Search Input"}),(0,s.jsx)(t.td,{children:"Input parameter. Query string for similarity search. Only relevant for reads."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"namespace"}),(0,s.jsx)(t.td,{children:"Namespace"}),(0,s.jsxs)(t.td,{children:["Input parameter. The namespace in HCD that contains or will contain the collection specified in ",(0,s.jsx)(t.code,{children:"collection_name"}),". Default: ",(0,s.jsx)(t.code,{children:"default_namespace"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"ca_certificate"}),(0,s.jsx)(t.td,{children:"CA Certificate"}),(0,s.jsx)(t.td,{children:"Input parameter. Optional CA certificate for TLS connections to HCD."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"metric"}),(0,s.jsx)(t.td,{children:"Metric"}),(0,s.jsxs)(t.td,{children:["Input parameter. The metrics to use for similarity search calculations, either ",(0,s.jsx)(t.code,{children:"cosine"}),", ",(0,s.jsx)(t.code,{children:"dot_product"}),", or ",(0,s.jsx)(t.code,{children:"euclidean"}),". This is a collection setting. If calling an existing collection, leave unset to use the collection's metric. If a write operation creates a new collection, specify the desired similarity metric setting."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"batch_size"}),(0,s.jsx)(t.td,{children:"Batch Size"}),(0,s.jsx)(t.td,{children:"Input parameter. Optional number of records to process in a single batch."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bulk_insert_batch_concurrency"}),(0,s.jsx)(t.td,{children:"Bulk Insert Batch Concurrency"}),(0,s.jsx)(t.td,{children:"Input parameter. Optional concurrency level for bulk write operations."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bulk_insert_overwrite_concurrency"}),(0,s.jsx)(t.td,{children:"Bulk Insert Overwrite Concurrency"}),(0,s.jsx)(t.td,{children:"Input parameter. Optional concurrency level for bulk write operations that allow upserts (overwriting existing records)."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bulk_delete_concurrency"}),(0,s.jsx)(t.td,{children:"Bulk Delete Concurrency"}),(0,s.jsx)(t.td,{children:"Input parameter. Optional concurrency level for bulk delete operations."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"setup_mode"}),(0,s.jsx)(t.td,{children:"Setup Mode"}),(0,s.jsxs)(t.td,{children:["Input parameter. Configuration mode for setting up the vector store, either ",(0,s.jsx)(t.code,{children:"Sync"})," (default), ",(0,s.jsx)(t.code,{children:"Async"}),", or ",(0,s.jsx)(t.code,{children:"Off"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"pre_delete_collection"}),(0,s.jsx)(t.td,{children:"Pre Delete Collection"}),(0,s.jsx)(t.td,{children:"Input parameter. Whether to delete the collection before creating a new one."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"metadata_indexing_include"}),(0,s.jsx)(t.td,{children:"Metadata Indexing Include"}),(0,s.jsxs)(t.td,{children:["Input parameter. A list of metadata fields to index if you want to enable ",(0,s.jsx)(t.a,{href:"https://docs.datastax.com/en/hyper-converged-database/1.2/api-reference/collection-indexes.html",children:"selective indexing"})," ",(0,s.jsx)(t.em,{children:"only"})," when creating a collection. Doesn't apply to existing collections. Only one ",(0,s.jsx)(t.code,{children:"*_indexing_*"})," parameter can be set per collection. If all ",(0,s.jsx)(t.code,{children:"*_indexing_*"})," parameters are unset, then all fields are indexed (default indexing)."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"metadata_indexing_exclude"}),(0,s.jsx)(t.td,{children:"Metadata Indexing Exclude"}),(0,s.jsxs)(t.td,{children:["Input parameter. A list of metadata fields to exclude from indexing if you want to enable selective indexing ",(0,s.jsx)(t.em,{children:"only"})," when creating a collection. Doesn't apply to existing collections. Only one ",(0,s.jsx)(t.code,{children:"*_indexing_*"})," parameter can be set per collection. If all ",(0,s.jsx)(t.code,{children:"*_indexing_*"})," parameters are unset, then all fields are indexed (default indexing)."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"collection_indexing_policy"}),(0,s.jsx)(t.td,{children:"Collection Indexing Policy"}),(0,s.jsxs)(t.td,{children:["Input parameter. A dictionary to define the indexing policy if you want to enable selective indexing ",(0,s.jsx)(t.em,{children:"only"})," when creating a collection. Doesn't apply to existing collections. Only one ",(0,s.jsx)(t.code,{children:"*_indexing_*"})," parameter can be set per collection. If all ",(0,s.jsx)(t.code,{children:"*_indexing_*"})," parameters are unset, then all fields are indexed (default indexing). The ",(0,s.jsx)(t.code,{children:"collection_indexing_policy"})," dictionary is used when you need to set indexing on subfields or a complex indexing definition that isn't compatible as a list."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"embedding"}),(0,s.jsx)(t.td,{children:"Embedding or Astra Vectorize"}),(0,s.jsxs)(t.td,{children:["Input parameter. The embedding model to use by attaching an ",(0,s.jsx)(t.strong,{children:"Embedding Model"})," component. This component doesn't support additional vectorize authentication headers, so it isn't possible to use a vectorize integration with this component, even if you have enabled one on an existing HCD collection."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"number_of_results"}),(0,s.jsx)(t.td,{children:"Number of Results"}),(0,s.jsx)(t.td,{children:"Input parameter. Number of search results to return. Default: 4. Only relevant to reads."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"search_type"}),(0,s.jsx)(t.td,{children:"Search Type"}),(0,s.jsxs)(t.td,{children:["Input parameter. Search type to use, either ",(0,s.jsx)(t.code,{children:"Similarity"})," (default), ",(0,s.jsx)(t.code,{children:"Similarity with score threshold"}),", or ",(0,s.jsx)(t.code,{children:"MMR (Max Marginal Relevance)"}),". Only relevant to reads."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"search_score_threshold"}),(0,s.jsx)(t.td,{children:"Search Score Threshold"}),(0,s.jsxs)(t.td,{children:["Input parameter. Minimum similarity score threshold for search results if the ",(0,s.jsx)(t.code,{children:"search_type"})," is ",(0,s.jsx)(t.code,{children:"Similarity with score threshold"}),". Default: 0."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"search_filter"}),(0,s.jsx)(t.td,{children:"Search Metadata Filter"}),(0,s.jsx)(t.td,{children:"Input parameter. Optional dictionary of metadata filters to apply in addition to vector search."})]})]})]}),"\n",(0,s.jsx)(t.h2,{id:"other-datastax-components",children:"Other DataStax components"}),"\n",(0,s.jsxs)(t.p,{children:["The following components are also included in the ",(0,s.jsx)(t.strong,{children:"DataStax"})," bundle."]}),"\n",(0,s.jsx)(t.h3,{id:"astra-db-chat-memory",children:"Astra DB Chat Memory"}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.strong,{children:"Astra DB Chat Memory"})," component retrieves and stores chat messages using an Astra DB database."]}),"\n",(0,s.jsxs)(t.p,{children:["Chat memories are passed between memory storage components as the ",(0,s.jsx)(t.a,{href:"/data-types#memory",children:(0,s.jsx)(t.code,{children:"Memory"})})," data type.\nSpecifically, the component creates an instance of ",(0,s.jsx)(t.code,{children:"AstraDBChatMessageHistory"}),", which is a LangChain chat message history class that uses Astra DB for storage."]}),"\n",(0,s.jsxs)(t.admonition,{type:"important",children:[(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.strong,{children:"Astra DB Chat Memory"})," component isn't recommended for most memory storage because memories tend to be long JSON objects or strings, often exceeding the maximum size of a document or object supported by Astra DB."]}),(0,s.jsxs)(t.p,{children:["However, Langflow's ",(0,s.jsx)(t.strong,{children:"Agent"})," component includes built-in chat memory that is enabled by default.\nYour agentic flows don't need an external database to store chat memory.\nFor more information, see ",(0,s.jsx)(t.a,{href:"/memory",children:"Memory management options"}),"."]})]}),"\n",(0,s.jsxs)(t.p,{children:["For more information about using external chat memory in flows, see the ",(0,s.jsxs)(t.a,{href:"/components-helpers#message-history",children:[(0,s.jsx)(t.strong,{children:"Message History"})," component"]}),"."]}),"\n",(0,s.jsx)(t.h4,{id:"astra-db-chat-memory-parameters",children:"Astra DB Chat Memory parameters"}),"\n",(0,s.jsx)(d.Ay,{}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Name"}),(0,s.jsx)(t.th,{children:"Type"}),(0,s.jsx)(t.th,{children:"Description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"collection_name"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. The name of the Astra DB collection for storing messages. Required."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"token"}),(0,s.jsx)(t.td,{children:"SecretString"}),(0,s.jsx)(t.td,{children:"Input parameter. The authentication token for Astra DB access. Required."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"api_endpoint"}),(0,s.jsx)(t.td,{children:"SecretString"}),(0,s.jsx)(t.td,{children:"Input parameter. The API endpoint URL for the Astra DB service. Required."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"namespace"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. The optional namespace within Astra DB for the collection."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"session_id"}),(0,s.jsx)(t.td,{children:"MessageText"}),(0,s.jsx)(t.td,{children:"Input parameter. The unique identifier for the chat session. Uses the current session ID if not provided."})]})]})]}),"\n",(0,s.jsx)(t.h3,{id:"assistants-api",children:"Assistants API"}),"\n",(0,s.jsx)(t.p,{children:"The following DataStax components are used to create and manage Assistants API functions in a flow:"}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsx)(t.li,{children:(0,s.jsx)(t.strong,{children:"Astra Assistant Agent"})}),"\n",(0,s.jsx)(t.li,{children:(0,s.jsx)(t.strong,{children:"Create Assistant"})}),"\n",(0,s.jsx)(t.li,{children:(0,s.jsx)(t.strong,{children:"Create Assistant Thread"})}),"\n",(0,s.jsx)(t.li,{children:(0,s.jsx)(t.strong,{children:"Get Assistant Name"})}),"\n",(0,s.jsx)(t.li,{children:(0,s.jsx)(t.strong,{children:"List Assistants"})}),"\n",(0,s.jsx)(t.li,{children:(0,s.jsx)(t.strong,{children:"Run Assistant"})}),"\n"]}),"\n",(0,s.jsx)(t.h2,{id:"environment-variables",children:"Environment variables"}),"\n",(0,s.jsx)(t.p,{children:"The following DataStax components are used to load and retrieve environment variables in a flow:"}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsx)(t.li,{children:(0,s.jsx)(t.strong,{children:"Dotenv"})}),"\n",(0,s.jsx)(t.li,{children:(0,s.jsx)(t.strong,{children:"Get Environment Variable"})}),"\n"]}),"\n",(0,s.jsx)(t.h2,{id:"legacy-datastax-components",children:"Legacy DataStax components"}),"\n","\n",(0,s.jsx)(x.Ay,{}),"\n",(0,s.jsx)(t.p,{children:"The following DataStax components are in legacy status:"}),"\n",(0,s.jsxs)(r,{children:[(0,s.jsx)("summary",{children:"Astra Vectorize"}),(0,s.jsxs)(t.p,{children:["This component was deprecated in Langflow version 1.1.2.\nReplace it with the ",(0,s.jsxs)(t.a,{href:"#astra-db",children:[(0,s.jsx)(t.strong,{children:"Astra DB"})," component"]}),"."]}),(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.strong,{children:"Astra DB Vectorize"})," component was used to generate embeddings with Astra DB's vectorize feature in conjunction with an ",(0,s.jsx)(t.strong,{children:"Astra DB"})," component."]}),(0,s.jsxs)(t.p,{children:["The vectorize functionality is now built into the ",(0,s.jsx)(t.strong,{children:"Astra DB"})," component.\nYou no longer need a separate component for vectorize embedding generation."]})]}),"\n",(0,s.jsx)(t.h2,{id:"see-also",children:"See also"}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsx)(t.li,{children:(0,s.jsxs)(t.a,{href:"/bundles-cassandra",children:[(0,s.jsx)(t.strong,{children:"Cassandra"})," bundle"]})}),"\n",(0,s.jsx)(t.li,{children:(0,s.jsx)(t.a,{href:"/chat-with-rag",children:"Create a vector RAG chatbot"})}),"\n"]})]})}function v(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(b,{...e})}):b(e)}function w(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}},7685:(e,t,n)=>{n.d(t,{A:()=>r});const r=n.p+"assets/images/vector-store-document-ingestion-6157311fb4d16e7f944d55254f0cc0e2.png"},17886:(e,t,n)=>{n.d(t,{A:()=>a});n(96540);var r=n(64058),s=n(74848);function a({name:e,...t}){const n=r[e];return n?(0,s.jsx)(n,{...t}):null}},27027:(e,t,n)=>{n.d(t,{Ay:()=>d,RM:()=>i});var r=n(74848),s=n(28453),a=n(17886);const i=[];function o(e){const t={a:"a",admonition:"admonition",code:"code",em:"em",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,s.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.admonition,{type:"tip",children:(0,r.jsxs)(t.p,{children:["For a tutorial that uses vector data in a flow, see ",(0,r.jsx)(t.a,{href:"/chat-with-rag",children:"Create a vector RAG chatbot"}),"."]})}),"\n",(0,r.jsx)(t.p,{children:"The following example demonstrates how to use vector store components in flows alongside related components like embedding model and language model components.\nThese steps walk through important configuration details, functionality, and best practices for using these components effectively.\nThis is only one example; it isn't a prescriptive guide to all possible use cases or configurations."}),"\n",(0,r.jsxs)(t.ol,{children:["\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Create a flow with the ",(0,r.jsx)(t.strong,{children:"Vector Store RAG"})," template."]}),"\n",(0,r.jsxs)(t.p,{children:["This template has two subflows.\nThe ",(0,r.jsx)(t.strong,{children:"Load Data"})," subflow loads embeddings and content into a vector database, and the ",(0,r.jsx)(t.strong,{children:"Retriever"})," subflow runs a vector search to retrieve relevant context based on a user's query."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Configure the database connection for both ",(0,r.jsxs)(t.a,{href:"/bundles-datastax#astra-db",children:[(0,r.jsx)(t.strong,{children:"Astra DB"})," components"]}),", or replace them with another pair of vector store components of your choice.\nMake sure the components connect to the same vector store, and that the component in the ",(0,r.jsx)(t.strong,{children:"Retriever"})," subflow is able to run a similarity search."]}),"\n",(0,r.jsxs)(t.p,{children:["The parameters you set in each vector store component depend on the component's role in your flow.\nIn this example, the ",(0,r.jsx)(t.strong,{children:"Load Data"})," subflow ",(0,r.jsx)(t.em,{children:"writes"})," to the vector store, whereas the ",(0,r.jsx)(t.strong,{children:"Retriever"})," subflow ",(0,r.jsx)(t.em,{children:"reads"})," from the vector store.\nTherefore, search-related parameters are only relevant to the ",(0,r.jsx)(t.strong,{children:"Vector Search"})," component in the ",(0,r.jsx)(t.strong,{children:"Retriever"})," subflow."]}),"\n",(0,r.jsx)(t.p,{children:"For information about specific parameters, see the documentation for your chosen vector store component."}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsx)(t.p,{children:"To configure the embedding model, do one of the following:"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.strong,{children:"Use an OpenAI model"}),": In both ",(0,r.jsx)(t.strong,{children:"OpenAI Embeddings"})," components, enter your OpenAI API key.\nYou can use the default model or select a different OpenAI embedding model."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.strong,{children:"Use another provider"}),": Replace the ",(0,r.jsx)(t.strong,{children:"OpenAI Embeddings"})," components with another pair of ",(0,r.jsx)(t.a,{href:"/components-embedding-models",children:"embedding model components"})," of your choice, and then configure the parameters and credentials accordingly."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.strong,{children:"Use Astra DB vectorize"}),": If you are using an Astra DB vector store that has a vectorize integration, you can remove both ",(0,r.jsx)(t.strong,{children:"OpenAI Embeddings"})," components.\nIf you do this, the vectorize integration automatically generates embeddings from the ",(0,r.jsx)(t.strong,{children:"Ingest Data"})," (in the ",(0,r.jsx)(t.strong,{children:"Load Data"})," subflow) and ",(0,r.jsx)(t.strong,{children:"Search Query"})," (in the ",(0,r.jsx)(t.strong,{children:"Retriever"})," subflow)."]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(t.admonition,{type:"tip",children:(0,r.jsx)(t.p,{children:"If your vector store already contains embeddings, make sure your embedding model components use the same model as your previous embeddings.\nMixing embedding models in the same vector store can produce inaccurate search results."})}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Recommended: In the ",(0,r.jsxs)(t.a,{href:"/components-processing#split-text",children:[(0,r.jsx)(t.strong,{children:"Split Text"})," component"]}),", optimize the chunking settings for your embedding model.\nFor example, if your embedding model has a token limit of 512, then the ",(0,r.jsx)(t.strong,{children:"Chunk Size"})," parameter must not exceed that limit."]}),"\n",(0,r.jsxs)(t.p,{children:["Additionally, because the ",(0,r.jsx)(t.strong,{children:"Retriever"})," subflow passes the chat input directly to the vector store component for vector search, make sure that your chat input string doesn't exceed your embedding model's limits.\nFor this example, you can enter a query that is within the limits; however, in a production environment, you might need to implement additional checks or preprocessing steps to ensure compliance.\nFor example, use additional components to prepare the chat input before running the vector search, or enforce chat input limits in your application code."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["In the ",(0,r.jsx)(t.strong,{children:"Language Model"})," component, enter your OpenAI API key, or select a different provider and model to use for the chat portion of the flow."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Run the ",(0,r.jsx)(t.strong,{children:"Load Data"})," subflow to populate your vector store.\nIn the ",(0,r.jsx)(t.strong,{children:"File"})," component, select one or more files, and then click ",(0,r.jsx)(a.A,{name:"Play","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Run component"})," on the vector store component in the ",(0,r.jsx)(t.strong,{children:"Load Data"})," subflow."]}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Load Data"})," subflow loads files from your local machine, chunks them, generates embeddings for the chunks, and then stores the chunks and their embeddings in the vector database."]}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.img,{alt:"Embedding data into a vector store",src:n(7685).A+"",width:"4000",height:"2512"})}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Load Data"})," subflow is separate from the ",(0,r.jsx)(t.strong,{children:"Retriever"})," subflow because you probably won't run it every time you use the chat.\nYou can run the ",(0,r.jsx)(t.strong,{children:"Load Data"})," subflow as needed to preload or update the data in your vector store.\nThen, your chat interactions only use the components that are necessary for chat."]}),"\n",(0,r.jsxs)(t.p,{children:["If your vector store already contains data that you want to use for vector search, then you don't need to run the ",(0,r.jsx)(t.strong,{children:"Load Data"})," subflow."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Open the ",(0,r.jsx)(t.strong,{children:"Playground"})," and start chatting to run the ",(0,r.jsx)(t.strong,{children:"Retriever"})," subflow."]}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Retriever"})," subflow generates an embedding from chat input, runs a vector search to retrieve similar content from your vector store, parses the search results into supplemental context for the LLM, and then uses the LLM to generate a natural language response to your query.\nThe LLM uses the vector search results along with its internal training data and tools, such as basic web search and datetime information, to produce the response."]}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.img,{alt:"Retrieval from a vector store",src:n(67719).A+"",width:"4000",height:"1324"})}),"\n",(0,r.jsxs)(t.p,{children:["To avoid passing the entire block of raw search results to the LLM, the ",(0,r.jsx)(t.strong,{children:"Parser"})," component extracts ",(0,r.jsx)(t.code,{children:"text"})," strings from the search results ",(0,r.jsx)(t.code,{children:"Data"})," object, and then passes them to the ",(0,r.jsx)(t.strong,{children:"Prompt Template"})," component in ",(0,r.jsx)(t.code,{children:"Message"})," format.\nFrom there, the strings and other template content are compiled into natural language instructions for the LLM."]}),"\n",(0,r.jsxs)(t.p,{children:["You can use other components for this transformation, such as the ",(0,r.jsx)(t.strong,{children:"Data Operations"})," component, depending on how you want to use the search results."]}),"\n",(0,r.jsxs)(t.p,{children:["To view the raw search results, click ",(0,r.jsx)(a.A,{name:"TextSearch","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Inspect output"})," on the vector store component after running the ",(0,r.jsx)(t.strong,{children:"Retriever"})," subflow."]}),"\n"]}),"\n"]})]})}function d(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(o,{...e})}):o(e)}},31929:(e,t,n)=>{n.d(t,{Ay:()=>d,RM:()=>i});var r=n(74848),s=n(28453),a=n(17886);const i=[];function o(e){const t={a:"a",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,r.jsxs)(t.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,r.jsx)(a.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Controls"})," in the ",(0,r.jsx)(t.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function d(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(o,{...e})}):o(e)}},36813:(e,t,n)=>{n.d(t,{Ay:()=>d,RM:()=>i});var r=n(74848),s=n(28453),a=n(17886);const i=[];function o(e){const t={a:"a",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(t.p,{children:["Legacy components are longer supported and can be removed in a future release.\nYou can continue to use them in existing flows, but it is recommended that you replace them with supported components as soon as possible.\nSuggested replacements are included in the ",(0,r.jsx)(t.strong,{children:"Legacy"})," banner on components in your flows.\nThey are also given in release notes and Langflow documentation whenever possible."]}),"\n",(0,r.jsxs)(t.p,{children:["If you aren't sure how to replace a legacy component, ",(0,r.jsx)(a.A,{name:"Search","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Search"})," for components by provider, service, or component name.\nThe component may have been deprecated in favor of a completely new component, a similar component, or a new version of the same component in a different category."]}),"\n",(0,r.jsxs)(t.p,{children:["If there is no obvious replacement, consider whether another component can be adapted to your use case.\nFor example, many ",(0,r.jsx)(a.A,{name:"Component","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Core components"})," provide generic functionality that can support multiple providers and use cases, such as the ",(0,r.jsxs)(t.a,{href:"/components-data#api-request",children:[(0,r.jsx)(t.strong,{children:"API Request"})," component"]}),"."]}),"\n",(0,r.jsxs)(t.p,{children:["If neither of these options are viable, you could use the legacy component's code to create your own custom component, or ",(0,r.jsx)(t.a,{href:"/contributing-github-issues",children:"start a discussion"})," about the legacy component."]}),"\n",(0,r.jsxs)(t.p,{children:["To discourage use of legacy components in new flows, these components are hidden by default.\nIn the visual editor, you can click ",(0,r.jsx)(a.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Component settings"})," to toggle the ",(0,r.jsx)(t.strong,{children:"Legacy"})," filter."]})]})}function d(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(o,{...e})}):o(e)}},42638:(e,t,n)=>{n.d(t,{A:()=>r});const r=n.p+"assets/images/component-hcd-example-flow-b82057600ce5e9e4a0f7ea0a61dcbf7f.png"},50005:(e,t,n)=>{n.d(t,{Ay:()=>o,RM:()=>a});var r=n(74848),s=n(28453);const a=[];function i(e){const t={a:"a",code:"code",p:"p",...(0,s.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(t.p,{children:["Because Langflow is based on LangChain, vector store components use an instance of ",(0,r.jsx)(t.a,{href:"https://python.langchain.com/docs/integrations/vectorstores/",children:"LangChain vector store"})," to drive the underlying read and write functions.\nThese instances are provider-specific and configured according to the component's parameters, such as the connection string, index name, and schema."]}),"\n",(0,r.jsxs)(t.p,{children:["In component code, this is often instantiated as ",(0,r.jsx)(t.code,{children:"vector_store"}),", but some vector store components use a different name, such as the provider name."]}),"\n",(0,r.jsx)(t.p,{children:"Some LangChain classes don't expose all possible options as component parameters.\nDepending on the provider, these options might use default values or allow modification through environment variables, if they are supported in Langflow.\nFor information about specific options, see the LangChain API reference and vector store provider's documentation."})]})}function o(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(i,{...e})}):i(e)}},67719:(e,t,n)=>{n.d(t,{A:()=>r});const r=n.p+"assets/images/vector-store-retrieval-af7257d77ff0259ab1a0980641d464ce.png"},68335:(e,t,n)=>{n.d(t,{A:()=>r});const r=n.p+"assets/images/component-astra-db-json-tool-117aff566c0df01a555264bb128b3693.png"},80223:(e,t,n)=>{n.d(t,{Ay:()=>o,RM:()=>a});var r=n(74848),s=n(28453);const a=[];function i(e){const t={p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,r.jsxs)(t.p,{children:["Some parameters are conditional, and they are only available after you set other parameters or select specific options for other parameters.\nConditional parameters may not be visible on the ",(0,r.jsx)(t.strong,{children:"Controls"})," pane until you set the required dependencies."]})}function o(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(i,{...e})}):i(e)}},90465:(e,t,n)=>{n.d(t,{Ay:()=>o,RM:()=>a});var r=n(74848),s=n(28453);const a=[];function i(e){const t={a:"a",code:"code",p:"p",...(0,s.R)(),...e.components};return(0,r.jsxs)(t.p,{children:["If you use a vector store component to query your vector database, it produces search results that you can pass to downstream components in your flow as a list of ",(0,r.jsx)(t.a,{href:"/data-types#data",children:(0,r.jsx)(t.code,{children:"Data"})})," objects or a tabular ",(0,r.jsx)(t.a,{href:"/data-types#dataframe",children:(0,r.jsx)(t.code,{children:"DataFrame"})}),".\nIf both types are supported, you can set the format near the vector store component's output port in the visual editor."]})}function o(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(i,{...e})}):i(e)}}}]); \ No newline at end of file diff --git a/assets/js/ef9aa223.c12d2563.js b/assets/js/ef9aa223.c12d2563.js new file mode 100644 index 0000000000..3776d291ad --- /dev/null +++ b/assets/js/ef9aa223.c12d2563.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[6224],{7089:(e,t,n)=>{n.r(t),n.d(t,{CH:()=>g,assets:()=>j,chCodeConfig:()=>f,contentTitle:()=>m,default:()=>v,frontMatter:()=>u,metadata:()=>r,toc:()=>y});const r=JSON.parse('{"id":"Components/bundles-datastax","title":"DataStax","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/bundles-datastax.mdx","sourceDirName":"Components","slug":"/bundles-datastax","permalink":"/bundles-datastax","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"DataStax","slug":"/bundles-datastax"},"sidebar":"docs","previous":{"title":"Couchbase","permalink":"/bundles-couchbase"},"next":{"title":"DeepSeek","permalink":"/bundles-deepseek"}}');var s=n(74848),a=n(28453),i=n(24754),o=n(17886),d=n(31929),c=n(80223),l=n(90465),h=n(50005),p=n(27027),x=n(36813);const u={title:"DataStax",slug:"/bundles-datastax"},m=void 0,j={},g={annotations:i.hk,Code:i.Cy},f={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},y=[{value:"Astra DB",id:"astra-db",level:2},...h.RM,{value:"Astra DB parameters",id:"astra-db-parameters",level:3},...d.RM,...c.RM,{value:"Astra DB examples",id:"astra-db-examples",level:3},...p.RM,{value:"Astra DB output",id:"astra-db-output",level:3},...l.RM,{value:"Astra DB CQL",id:"astra-db-cql",level:2},{value:"Astra DB CQL parameters",id:"astra-db-cql-parameters",level:3},...d.RM,{value:"Astra DB Tool",id:"astra-db-tool",level:2},{value:"Astra DB Tool parameters",id:"astra-db-tool-parameters",level:3},{value:"Define tool-specific parameters",id:"define-tool-specific-parameters",level:3},{value:"Astra DB Graph",id:"astra-db-graph",level:2},...l.RM,{value:"Astra DB Graph parameters",id:"astra-db-graph-parameters",level:3},...d.RM,...c.RM,{value:"Graph RAG",id:"graph-rag",level:2},{value:"Graph RAG parameters",id:"graph-rag-parameters",level:3},...d.RM,...c.RM,{value:"Hyper-Converged Database (HCD)",id:"hyper-converged-database-hcd",level:2},...h.RM,...l.RM,{value:"HCD parameters",id:"hcd-parameters",level:3},...d.RM,...c.RM,{value:"Other DataStax components",id:"other-datastax-components",level:2},{value:"Astra DB Chat Memory",id:"astra-db-chat-memory",level:3},{value:"Astra DB Chat Memory parameters",id:"astra-db-chat-memory-parameters",level:4},...d.RM,{value:"Assistants API",id:"assistants-api",level:3},{value:"Environment variables",id:"environment-variables",level:2},{value:"Legacy DataStax components",id:"legacy-datastax-components",level:2},...x.RM,{value:"See also",id:"see-also",level:2}];function b(e){const t={a:"a",admonition:"admonition",code:"code",em:"em",h2:"h2",h3:"h3",h4:"h4",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,a.R)(),...e.components},{Details:r}=t;return g||w("CH",!1),g.Code||w("CH.Code",!0),r||w("Details",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n","\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)(o.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(t.a,{href:"/components-bundle-components",children:(0,s.jsx)(t.strong,{children:"Bundles"})})," contain custom components that support specific third-party integrations with Langflow."]}),"\n",(0,s.jsxs)(t.p,{children:["This page describes the components that are available in the ",(0,s.jsx)(t.strong,{children:"DataStax"})," bundle, including components that read and write to Astra DB databases."]}),"\n",(0,s.jsx)(t.h2,{id:"astra-db",children:"Astra DB"}),"\n",(0,s.jsxs)(t.admonition,{type:"warning",children:[(0,s.jsxs)(t.p,{children:["It is recommended that you create any databases, keyspaces, and collections you need before configuring the ",(0,s.jsx)(t.strong,{children:"Astra DB"})," component."]}),(0,s.jsxs)(t.p,{children:["You can create new databases and collections through this component, but this is only possible in the Langflow visual editor (not at runtime), and you must wait while the database or collection initializes before proceeding with flow configuration.\nAdditionally, not all database and collection configuration options are available through the ",(0,s.jsx)(t.strong,{children:"Astra DB"})," component, such as hybrid search options, PCU groups, vectorize integration management, and multi-region deployments."]})]}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.strong,{children:"Astra DB"})," component reads and writes to Astra DB Serverless databases, using an instance of ",(0,s.jsx)(t.code,{children:"AstraDBVectorStore"})," to call the Data API and DevOps API."]}),"\n",(0,s.jsxs)(r,{children:[(0,s.jsx)("summary",{children:"About vector store instances"}),(0,s.jsx)(h.Ay,{})]}),"\n",(0,s.jsx)(t.h3,{id:"astra-db-parameters",children:"Astra DB parameters"}),"\n",(0,s.jsx)(t.p,{children:"You can inspect a vector store component's parameters to learn more about the inputs it accepts, the features it supports, and how to configure it."}),"\n",(0,s.jsx)(d.Ay,{}),"\n",(0,s.jsx)(c.Ay,{}),"\n",(0,s.jsxs)(t.p,{children:["For information about accepted values and functionality, see the ",(0,s.jsx)(t.a,{href:"https://docs.datastax.com/en/astra-db-serverless/index.html",children:"Astra DB Serverless documentation"})," or inspect ",(0,s.jsx)(t.a,{href:"/concepts-components#component-code",children:"component code"}),"."]}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Name"}),(0,s.jsx)(t.th,{children:"Display Name"}),(0,s.jsx)(t.th,{children:"Info"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"token"}),(0,s.jsx)(t.td,{children:"Astra DB Application Token"}),(0,s.jsx)(t.td,{children:"Input parameter. An Astra application token with permission to access your vector database. Once the connection is verified, additional fields are populated with your existing databases and collections. If you want to create a database through this component, the application token must have Organization Administrator permissions."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"environment"}),(0,s.jsx)(t.td,{children:"Environment"}),(0,s.jsxs)(t.td,{children:["Input parameter. The environment for the Astra DB API endpoint. Typically always ",(0,s.jsx)(t.code,{children:"prod"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"database_name"}),(0,s.jsx)(t.td,{children:"Database"}),(0,s.jsxs)(t.td,{children:["Input parameter. The name of the database that you want this component to connect to. Or, you can select ",(0,s.jsx)(t.strong,{children:"New Database"})," to create a new database, and then wait for the database to initialize before setting the remaining parameters."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"endpoint"}),(0,s.jsx)(t.td,{children:"Astra DB API Endpoint"}),(0,s.jsxs)(t.td,{children:["Input parameter. For multi-region databases, select the API endpoint for your nearest datacenter. To get the list of regions for a multi-region database, see ",(0,s.jsx)(t.a,{href:"https://docs.datastax.com/en/astra-db-serverless/databases/manage-regions.html#list-db-regions",children:"List database regions"}),". This field is automatically populated when you select a database, and it defaults to the primary region's endpoint."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"keyspace"}),(0,s.jsx)(t.td,{children:"Keyspace"}),(0,s.jsxs)(t.td,{children:["Input parameter. The keyspace in your database that contains the collection specified in ",(0,s.jsx)(t.code,{children:"collection_name"}),". Default: ",(0,s.jsx)(t.code,{children:"default_keyspace"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"collection_name"}),(0,s.jsx)(t.td,{children:"Collection"}),(0,s.jsxs)(t.td,{children:["Input parameter. The name of the collection that you want to use with this flow. Or, select ",(0,s.jsx)(t.strong,{children:"New Collection"})," to create a new collection with limited configuration options. To ensure your collection is configured with the correct embedding provider and search capabilities, it is recommended to create the collection in the Astra Portal or with the Data API ",(0,s.jsx)(t.em,{children:"before"})," configuring this component. For more information, see ",(0,s.jsx)(t.a,{href:"https://docs.datastax.com/en/astra-db-serverless/databases/manage-collections.html",children:"Manage collections in Astra DB Serverless"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"embedding_model"}),(0,s.jsx)(t.td,{children:"Embedding Model"}),(0,s.jsxs)(t.td,{children:["Input parameter. Attach an ",(0,s.jsx)(t.a,{href:"/components-embedding-models",children:"embedding model component"})," to generate embeddings. Only available if the specified collection doesn't have a ",(0,s.jsx)(t.a,{href:"https://docs.datastax.com/en/astra-db-serverless/databases/embedding-generation.html",children:"vectorize integration"}),". If a vectorize integration exists, the component automatically uses the collection's integrated model."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"ingest_data"}),(0,s.jsx)(t.td,{children:"Ingest Data"}),(0,s.jsxs)(t.td,{children:["Input parameter. The documents to load into the specified collection. Accepts ",(0,s.jsx)(t.code,{children:"Data"})," or ",(0,s.jsx)(t.code,{children:"DataFrame"})," input."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"search_query"}),(0,s.jsx)(t.td,{children:"Search Query"}),(0,s.jsx)(t.td,{children:"Input parameter. The query string for vector search."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"cache_vector_store"}),(0,s.jsx)(t.td,{children:"Cache Vector Store"}),(0,s.jsxs)(t.td,{children:["Input parameter. Whether to cache the vector store in Langflow memory for faster reads. Default: Enabled (",(0,s.jsx)(t.code,{children:"true"}),")."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"search_method"}),(0,s.jsx)(t.td,{children:"Search Method"}),(0,s.jsxs)(t.td,{children:["Input parameter. The search methods to use, either ",(0,s.jsx)(t.code,{children:"Hybrid Search"})," or ",(0,s.jsx)(t.code,{children:"Vector Search"}),". Your collection must be configured to support the chosen option, and the default depends on what your collection supports. All vector-enabled collections in Astra DB Serverless (Vector) databases support vector search, but hybrid search requires that you set specific collection settings when creating the collection. These options are only available when creating a collection programmatically. For more information, see ",(0,s.jsx)(t.a,{href:"https://docs.datastax.com/en/astra-db-serverless/databases/about-search.html",children:"Ways to find data in Astra DB Serverless"})," and ",(0,s.jsx)(t.a,{href:"https://docs.datastax.com/en/astra-db-serverless/api-reference/collection-methods/create-collection.html#example-hybrid",children:"Create a collection that supports hybrid search"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"reranker"}),(0,s.jsx)(t.td,{children:"Reranker"}),(0,s.jsxs)(t.td,{children:["Input parameter. The re-ranker model to use for hybrid search, depending on the collection configuration. This parameter is only available for collections that support hybrid search. To determine if a collection supports hybrid search, ",(0,s.jsx)(t.a,{href:"https://docs.datastax.com/en/astra-db-serverless/api-reference/collection-methods/list-collection-metadata.html",children:"get collection metadata"}),", and then check that ",(0,s.jsx)(t.code,{children:"lexical"})," and ",(0,s.jsx)(t.code,{children:"rerank"})," both have ",(0,s.jsx)(t.code,{children:'"enabled": true'}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"lexical_terms"}),(0,s.jsx)(t.td,{children:"Lexical Terms"}),(0,s.jsxs)(t.td,{children:["Input parameter. A space-separated string of keywords for hybrid search, like ",(0,s.jsx)(t.code,{children:"features, data, attributes, characteristics"}),". This parameter is only available if the collection supports hybrid search. For more information, see the ",(0,s.jsx)(t.a,{href:"#astra-db-examples",children:"Hybrid search example"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"number_of_results"}),(0,s.jsx)(t.td,{children:"Number of Search Results"}),(0,s.jsx)(t.td,{children:"Input parameter. The number of search results to return. Default: 4."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"search_type"}),(0,s.jsx)(t.td,{children:"Search Type"}),(0,s.jsxs)(t.td,{children:["Input parameter. The search type to use, either ",(0,s.jsx)(t.code,{children:"Similarity"})," (default), ",(0,s.jsx)(t.code,{children:"Similarity with score threshold"}),", and ",(0,s.jsx)(t.code,{children:"MMR (Max Marginal Relevance)"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"search_score_threshold"}),(0,s.jsx)(t.td,{children:"Search Score Threshold"}),(0,s.jsxs)(t.td,{children:["Input parameter. The minimum similarity score threshold for vector search results with the ",(0,s.jsx)(t.code,{children:"Similarity with score threshold"})," search type. Default: 0."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"advanced_search_filter"}),(0,s.jsx)(t.td,{children:"Search Metadata Filter"}),(0,s.jsx)(t.td,{children:"Input parameter. An optional dictionary of metadata filters to apply in addition to vector or hybrid search."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"autodetect_collection"}),(0,s.jsx)(t.td,{children:"Autodetect Collection"}),(0,s.jsx)(t.td,{children:"Input parameter. Whether to automatically fetch a list of available collections after providing an application token and API endpoint."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"content_field"}),(0,s.jsx)(t.td,{children:"Content Field"}),(0,s.jsx)(t.td,{children:"Input parameter. For writes, this parameter specifies the name of the field in the documents that contains text strings for which you want to generate embeddings."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"deletion_field"}),(0,s.jsx)(t.td,{children:"Deletion Based On Field"}),(0,s.jsx)(t.td,{children:"Input parameter. When provided, documents in the target collection with metadata field values matching the input metadata field value are deleted before new records are loaded. Use this setting for writes with upserts (overwrites)."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"ignore_invalid_documents"}),(0,s.jsx)(t.td,{children:"Ignore Invalid Documents"}),(0,s.jsxs)(t.td,{children:["Input parameter. Whether to ignore invalid documents during writes. If disabled (",(0,s.jsx)(t.code,{children:"false"}),"), then an error is raised for invalid documents. Default: Enabled (",(0,s.jsx)(t.code,{children:"true"}),")."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"astradb_vectorstore_kwargs"}),(0,s.jsx)(t.td,{children:"AstraDBVectorStore Parameters"}),(0,s.jsxs)(t.td,{children:["Input parameter. An optional dictionary of additional parameters for the ",(0,s.jsx)(t.code,{children:"AstraDBVectorStore"})," instance."]})]})]})]}),"\n",(0,s.jsx)(t.h3,{id:"astra-db-examples",children:"Astra DB examples"}),"\n",(0,s.jsxs)(r,{children:[(0,s.jsx)("summary",{children:"Example: Vector RAG"}),(0,s.jsx)(p.Ay,{})]}),"\n",(0,s.jsxs)(r,{children:[(0,s.jsx)("summary",{children:"Example: Hybrid search"}),(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.strong,{children:"Astra DB"})," component supports the Data API's ",(0,s.jsx)(t.a,{href:"https://docs.datastax.com/en/astra-db-serverless/databases/hybrid-search.html",children:"hybrid search"})," feature.\nHybrid search performs a vector similarity search and a lexical search, compares the results of both searches, and then returns the most relevant results overall."]}),(0,s.jsxs)(t.p,{children:["To use hybrid search through the ",(0,s.jsx)(t.strong,{children:"Astra DB"})," component, do the following:"]}),(0,s.jsxs)(t.ol,{children:["\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["Use the Data API to ",(0,s.jsx)(t.a,{href:"https://docs.datastax.com/en/astra-db-serverless/api-reference/collection-methods/create-collection.html#example-hybrid",children:"create a collection that supports hybrid search"})," if you don't already have one."]}),"\n",(0,s.jsxs)(t.p,{children:["Although you can create a collection through the ",(0,s.jsx)(t.strong,{children:"Astra DB"})," component, you have more control and insight into the collection settings when using the Data API for this operation."]}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["Create a flow based on the ",(0,s.jsx)(t.strong,{children:"Hybrid Search RAG"})," template, which includes an ",(0,s.jsx)(t.strong,{children:"Astra DB"})," component that is pre-configured for hybrid search."]}),"\n",(0,s.jsxs)(t.p,{children:["After loading the template, check for ",(0,s.jsx)(t.strong,{children:"Upgrade available"})," alerts on the components.\nIf any components have an upgrade pending, upgrade and reconnect them before continuing."]}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["In the ",(0,s.jsx)(t.strong,{children:"Language Model"})," components, add your OpenAI API key.\nIf you want to use a different provider or model, see ",(0,s.jsx)(t.a,{href:"/components-models",children:"Language model components"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["Delete the ",(0,s.jsx)(t.strong,{children:"Language Model"})," component that is connected to the ",(0,s.jsx)(t.strong,{children:"Structured Output"})," component's ",(0,s.jsx)(t.strong,{children:"Input Message"})," port, and then connect the ",(0,s.jsx)(t.strong,{children:"Chat Input"})," component to that port."]}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["Configure the ",(0,s.jsx)(t.strong,{children:"Astra DB"})," vector store component:"]}),"\n",(0,s.jsxs)(t.ol,{children:["\n",(0,s.jsx)(t.li,{children:"Enter your Astra DB application token."}),"\n",(0,s.jsxs)(t.li,{children:["In the ",(0,s.jsx)(t.strong,{children:"Database"})," field, select your database."]}),"\n",(0,s.jsxs)(t.li,{children:["In the ",(0,s.jsx)(t.strong,{children:"Collection"})," field, select your collection with hybrid search enabled."]}),"\n"]}),"\n",(0,s.jsx)(t.p,{children:"Once you select a collection that supports hybrid search, the other parameters automatically update to allow hybrid search options."}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["Connect the first ",(0,s.jsx)(t.strong,{children:"Parser"})," component's ",(0,s.jsx)(t.strong,{children:"Parsed Text"})," output to the ",(0,s.jsx)(t.strong,{children:"Astra DB"})," component's ",(0,s.jsx)(t.strong,{children:"Lexical Terms"})," input.\nThis input only appears after connecting a collection that support hybrid search with reranking."]}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["Update the ",(0,s.jsx)(t.strong,{children:"Structured Output"})," template:"]}),"\n",(0,s.jsxs)(t.ol,{children:["\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["Click the ",(0,s.jsx)(t.strong,{children:"Structured Output"})," component to expose the ",(0,s.jsx)(t.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),", and then click ",(0,s.jsx)(o.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,s.jsx)(t.strong,{children:"Controls"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["Find the ",(0,s.jsx)(t.strong,{children:"Format Instructions"})," row, click ",(0,s.jsx)(o.A,{name:"Expand","aria-hidden":"true"})," ",(0,s.jsx)(t.strong,{children:"Expand"}),", and then replace the prompt with the following text:"]}),"\n",(0,s.jsx)(g.Code,{codeConfig:f,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"You are a database query planner that takes a user's requests, and then converts to a search against the subject matter in question.",props:{}}]},{tokens:[{content:"You should convert the query into:",props:{}}]},{tokens:[{content:"1. A list of keywords to use against a Lucene text analyzer index, no more than 4. Strictly unigrams.",props:{}}]},{tokens:[{content:"2. A question to use as the basis for a QA embedding engine.",props:{}}]},{tokens:[{content:"Avoid common keywords associated with the user's subject matter.",props:{}}]}],lang:"text"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["Click ",(0,s.jsx)(t.strong,{children:"Finish Editing"}),", and then click ",(0,s.jsx)(t.strong,{children:"Close"})," to save your changes to the component."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["Open the ",(0,s.jsx)(t.strong,{children:"Playground"}),", and then enter a natural language question that you would ask about your database."]}),"\n",(0,s.jsxs)(t.p,{children:["In this example, your input is sent to both the ",(0,s.jsx)(t.strong,{children:"Astra DB"})," and ",(0,s.jsx)(t.strong,{children:"Structured Output"})," components:"]}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["The input sent directly to the ",(0,s.jsx)(t.strong,{children:"Astra DB"})," component's ",(0,s.jsx)(t.strong,{children:"Search Query"})," port is used as a string for similarity search.\nAn embedding is generated from the query string using the collection's Astra DB vectorize integration."]}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["The input sent to the ",(0,s.jsx)(t.strong,{children:"Structured Output"})," component is processed by the ",(0,s.jsx)(t.strong,{children:"Structured Output"}),", ",(0,s.jsx)(t.strong,{children:"Language Model"}),", and ",(0,s.jsx)(t.strong,{children:"Parser"})," components to extract space-separated ",(0,s.jsx)(t.code,{children:"keywords"})," used for the lexical search portion of the hybrid search."]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(t.p,{children:["The complete hybrid search query is executed against your database using the Data API's ",(0,s.jsx)(t.code,{children:"find_and_rerank"})," command.\nThe API's response is output as a ",(0,s.jsx)(t.code,{children:"DataFrame"})," that is transformed into a text string ",(0,s.jsx)(t.code,{children:"Message"})," by another ",(0,s.jsx)(t.strong,{children:"Parser"})," component.\nFinally, the ",(0,s.jsx)(t.strong,{children:"Chat Output"})," component prints the ",(0,s.jsx)(t.code,{children:"Message"})," response to the ",(0,s.jsx)(t.strong,{children:"Playground"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["Optional: Exit the ",(0,s.jsx)(t.strong,{children:"Playground"}),", and then click ",(0,s.jsx)(o.A,{name:"TextSearch","aria-hidden":"true"})," ",(0,s.jsx)(t.strong,{children:"Inspect Output"})," on each individual component to understand how lexical keywords were constructed and view the raw response from the Data API.\nThis is helpful for debugging flows where a certain component isn't receiving input as expected from another component."]}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)(t.strong,{children:"Structured Output component"}),": The output is the ",(0,s.jsx)(t.code,{children:"Data"})," object produced by applying the output schema to the LLM's response to the input message and format instructions.\nThe following example is based on the aforementioned instructions for keyword extraction:"]}),"\n",(0,s.jsx)(g.Code,{codeConfig:f,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"1. Keywords: features, data, attributes, characteristics",props:{}}]},{tokens:[{content:"2. Question: What characteristics can be identified in my data?",props:{}}]}],lang:"text"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)(t.strong,{children:"Parser component"}),": The output is the string of keywords extracted from the structured output ",(0,s.jsx)(t.code,{children:"Data"}),", and then used as lexical terms for the hybrid search."]}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)(t.strong,{children:"Astra DB component"}),": The output is the ",(0,s.jsx)(t.code,{children:"DataFrame"})," containing the results of the hybrid search as returned by the Data API."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]})]}),"\n",(0,s.jsx)(t.h3,{id:"astra-db-output",children:"Astra DB output"}),"\n",(0,s.jsx)(l.Ay,{}),"\n",(0,s.jsxs)(r,{children:[(0,s.jsx)("summary",{children:"Vector Store Connection port"}),(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.strong,{children:"Astra DB"})," component has an additional ",(0,s.jsx)(t.strong,{children:"Vector Store Connection"})," output.\nThis output can only connect to a ",(0,s.jsx)(t.code,{children:"VectorStore"})," input port, and it was intended for use with dedicated Graph RAG components."]}),(0,s.jsxs)(t.p,{children:["The only non-legacy component that supports this input is the ",(0,s.jsxs)(t.a,{href:"#graph-rag",children:[(0,s.jsx)(t.strong,{children:"Graph RAG"})," component"]}),", which can be a Graph RAG extension to the ",(0,s.jsx)(t.strong,{children:"Astra DB"})," component.\nInstead, use the ",(0,s.jsx)(t.strong,{children:"Astra DB Graph"})," component that includes both the vector store connection and Graph RAG functionality."]})]}),"\n",(0,s.jsx)(t.h2,{id:"astra-db-cql",children:"Astra DB CQL"}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.strong,{children:"Astra DB CQL"})," component allows agents to query data from CQL tables in Astra DB."]}),"\n",(0,s.jsxs)(t.p,{children:["The output is a list of ",(0,s.jsx)(t.a,{href:"/data-types#data",children:(0,s.jsx)(t.code,{children:"Data"})})," objects containing the query results from the Astra DB CQL table. Each Data object contains the document fields specified by the projection fields. Limited by the ",(0,s.jsx)(t.code,{children:"number_of_results"})," parameter."]}),"\n",(0,s.jsx)(t.h3,{id:"astra-db-cql-parameters",children:"Astra DB CQL parameters"}),"\n",(0,s.jsx)(d.Ay,{}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Name"}),(0,s.jsx)(t.th,{children:"Type"}),(0,s.jsx)(t.th,{children:"Description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Tool Name"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. The name used to reference the tool in the agent's prompt."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Tool Description"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. A brief description of the tool to guide the model in using it."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Keyspace"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. The name of the keyspace."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Table Name"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. The name of the Astra DB CQL table to query."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Token"}),(0,s.jsx)(t.td,{children:"SecretString"}),(0,s.jsx)(t.td,{children:"Input parameter. The authentication token for Astra DB."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"API Endpoint"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. The Astra DB API endpoint."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Projection Fields"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:'Input parameter. The attributes to return, separated by commas. Default: "*".'})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Partition Keys"}),(0,s.jsx)(t.td,{children:"Dict"}),(0,s.jsx)(t.td,{children:"Input parameter. Required parameters that the model must fill to query the tool."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Clustering Keys"}),(0,s.jsx)(t.td,{children:"Dict"}),(0,s.jsxs)(t.td,{children:["Input parameter. Optional parameters the model can fill to refine the query. Required parameters should be marked with an exclamation mark, for example, ",(0,s.jsx)(t.code,{children:"!customer_id"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Static Filters"}),(0,s.jsx)(t.td,{children:"Dict"}),(0,s.jsx)(t.td,{children:"Input parameter. Attribute-value pairs used to filter query results."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Limit"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. The number of records to return."})]})]})]}),"\n",(0,s.jsx)(t.h2,{id:"astra-db-tool",children:"Astra DB Tool"}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.strong,{children:"Astra DB Tool"})," component enables searching data in Astra DB collections, including hybrid search, vector search, and regular filter-based search.\nSpecialized searches require that the collection is pre-configured with the required parameters."]}),"\n",(0,s.jsxs)(t.p,{children:["Outputs a list of ",(0,s.jsx)(t.a,{href:"/data-types#data",children:(0,s.jsx)(t.code,{children:"Data"})})," objects containing the query results from Astra DB. Each ",(0,s.jsx)(t.code,{children:"Data"})," object contains the document fields specified by the projection attributes. Limited by the ",(0,s.jsx)(t.code,{children:"number_of_results"})," parameter and the upper limit of the Astra DB Data API, depending on the type of search."]}),"\n",(0,s.jsxs)(t.p,{children:["You can use the component to execute queries directly as isolated steps in a flow, or you can connect it as a ",(0,s.jsx)(t.a,{href:"/agents-tools",children:"tool for an agent"})," to allow the agent to query data from Astra DB collections as needed to respond to user queries.\nFor more information, see ",(0,s.jsx)(t.a,{href:"/agents",children:"Use Langflow agents"}),"."]}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.img,{alt:"Astra DB Tool component connected as a tool to an Agent component",src:n(68335).A+"",width:"4000",height:"2742"})}),"\n",(0,s.jsx)(t.h3,{id:"astra-db-tool-parameters",children:"Astra DB Tool parameters"}),"\n",(0,s.jsxs)(t.p,{children:["The following parameters are for the ",(0,s.jsx)(t.strong,{children:"Astra DB Tool"})," component overall."]}),"\n",(0,s.jsxs)(t.p,{children:["The values for ",(0,s.jsx)(t.strong,{children:"Collection Name"}),", ",(0,s.jsx)(t.strong,{children:"Astra DB Application Token"}),", and ",(0,s.jsx)(t.strong,{children:"Astra DB API Endpoint"})," are found in your Astra DB deployment. For more information, see the ",(0,s.jsx)(t.a,{href:"https://docs.datastax.com/en/astra-db-serverless/databases/create-database.html",children:"Astra DB Serverless documentation"}),"."]}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Name"}),(0,s.jsx)(t.th,{children:"Type"}),(0,s.jsx)(t.th,{children:"Description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Tool Name"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. The name used to reference the tool in the agent's prompt."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Tool Description"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. A brief description of the tool. This helps the model decide when to use it."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Keyspace Name"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsxs)(t.td,{children:["Input parameter. The name of the keyspace in Astra DB. Default: ",(0,s.jsx)(t.code,{children:"default_keyspace"})]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Collection Name"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. The name of the Astra DB collection to query."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Token"}),(0,s.jsx)(t.td,{children:"SecretString"}),(0,s.jsx)(t.td,{children:"Input parameter. The authentication token for accessing Astra DB."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"API Endpoint"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. The Astra DB API endpoint."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Projection Fields"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsxs)(t.td,{children:["Input parameter. Comma-separated list of attributes to return from matching documents. The default is the default projection, ",(0,s.jsx)(t.code,{children:"*"}),", which returns all attributes except reserved fields like ",(0,s.jsx)(t.code,{children:"$vector"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Tool Parameters"}),(0,s.jsx)(t.td,{children:"Dict"}),(0,s.jsxs)(t.td,{children:["Input parameter. ",(0,s.jsxs)(t.a,{href:"https://docs.datastax.com/en/astra-db-serverless/api-reference/document-methods/find-many.html#parameters",children:["Astra DB Data API ",(0,s.jsx)(t.code,{children:"find"})," filters"]})," that become tools for an agent. These Filters ",(0,s.jsx)(t.em,{children:"may"})," be used in a search, if the agent selects them. See ",(0,s.jsx)(t.a,{href:"#define-tool-specific-parameters",children:"Define tool-specific parameters"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Static Filters"}),(0,s.jsx)(t.td,{children:"Dict"}),(0,s.jsxs)(t.td,{children:["Input parameter. Attribute-value pairs used to filter query results. Equivalent to ",(0,s.jsxs)(t.a,{href:"https://docs.datastax.com/en/astra-db-serverless/api-reference/document-methods/find-many.html#parameters",children:["Astra DB Data API ",(0,s.jsx)(t.code,{children:"find"})," filters"]}),". ",(0,s.jsx)(t.strong,{children:"Static Filters"})," are included with ",(0,s.jsx)(t.em,{children:"every"})," query. Use ",(0,s.jsx)(t.strong,{children:"Static Filters"})," without semantic search to perform a regular filter search."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Number of Results"}),(0,s.jsx)(t.td,{children:"Int"}),(0,s.jsx)(t.td,{children:"Input parameter. The maximum number of documents to return."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Semantic Search"}),(0,s.jsx)(t.td,{children:"Boolean"}),(0,s.jsxs)(t.td,{children:["Input parameter. Whether to run a similarity search by generating a vector embedding from the chat input and following the ",(0,s.jsx)(t.strong,{children:"Semantic Search Instruction"}),". Default: ",(0,s.jsx)(t.code,{children:"false"}),". If ",(0,s.jsx)(t.code,{children:"true"}),", you must attach an ",(0,s.jsx)(t.a,{href:"/components-embedding-models",children:"embedding model component"})," or have vectorize pre-enabled on your collection."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Use Astra DB Vectorize"}),(0,s.jsx)(t.td,{children:"Boolean"}),(0,s.jsxs)(t.td,{children:["Input parameter. Whether to use the Astra DB vectorize feature for embedding generation when running a semantic search. Default: ",(0,s.jsx)(t.code,{children:"false"}),". If ",(0,s.jsx)(t.code,{children:"true"}),", you must have vectorize pre-enabled on your collection."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Embedding Model"}),(0,s.jsx)(t.td,{children:"Embedding"}),(0,s.jsxs)(t.td,{children:["Input parameter. A port to attach an embedding model component to generate a vector from input text for semantic search. This can be used when ",(0,s.jsx)(t.strong,{children:"Semantic Search"})," is ",(0,s.jsx)(t.code,{children:"true"}),", with or without vectorize. Be sure to use a model that aligns with the dimensions of the embeddings already present in the collection."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Semantic Search Instruction"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsxs)(t.td,{children:["Input parameter. The query to use for similarity search. Default: ",(0,s.jsx)(t.code,{children:'"Find documents similar to the query."'}),". This instruction is used to guide the model in performing semantic search."]})]})]})]}),"\n",(0,s.jsx)(t.h3,{id:"define-tool-specific-parameters",children:"Define tool-specific parameters"}),"\n",(0,s.jsxs)(t.admonition,{type:"tip",children:[(0,s.jsxs)(t.p,{children:[(0,s.jsx)(t.strong,{children:"Tool Parameters"})," are small functions that you create within the ",(0,s.jsx)(t.strong,{children:"Astra DB Tool"})," component.\nThey give the LLM pre-defined ways to interact with the data in your collection."]}),(0,s.jsx)(t.p,{children:"Without these filters, the LLM has no concept of the data in your collection or which attributes are important."}),(0,s.jsx)(t.p,{children:"At runtime, the LLM can decide which filters are relevant to the current query."}),(0,s.jsxs)(t.p,{children:["Filters in ",(0,s.jsx)(t.strong,{children:"Tool Parameters"})," aren't always applied.\nIf you want to enforce filters for ",(0,s.jsx)(t.em,{children:"every"})," query, use the ",(0,s.jsx)(t.strong,{children:"Static Filters"})," parameter.\nYou can use both ",(0,s.jsx)(t.strong,{children:"Tool Parameters"})," and ",(0,s.jsx)(t.strong,{children:"Static Filters"})," to set some required filters and some optional filters."]})]}),"\n",(0,s.jsxs)(t.p,{children:["In the ",(0,s.jsx)(t.strong,{children:"Astra DB Tool"})," component's ",(0,s.jsx)(t.strong,{children:"Tool Parameters"})," field, you can create filters to query documents in your collection."]}),"\n",(0,s.jsxs)(t.p,{children:["When used in ",(0,s.jsx)(t.strong,{children:"Tool Mode"})," with an agent, these filters tell the agent which document attributes are most important, which are required in searches, and which operators to use on certain attributes.\nThe filters become available as parameters that the LLM can use when calling the tool, with a better understanding of each parameter provided by the ",(0,s.jsx)(t.strong,{children:"Description"})," field."]}),"\n",(0,s.jsxs)(t.p,{children:["In the ",(0,s.jsx)(t.strong,{children:"Tool Parameters"})," pane, click ",(0,s.jsx)(o.A,{name:"Plus","aria-hidden":"true"})," ",(0,s.jsx)(t.strong,{children:"Add a new row"}),", and then edit each cell in the row.\nFor example, the following filter allows an LLM to filter by unique ",(0,s.jsx)(t.code,{children:"customer_id"})," values:"]}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsxs)(t.li,{children:["Name: ",(0,s.jsx)(t.code,{children:"customer_id"})]}),"\n",(0,s.jsx)(t.li,{children:"Attribute Name: Leave empty if the attribute matches the field name in the database."}),"\n",(0,s.jsxs)(t.li,{children:["Description: ",(0,s.jsx)(t.code,{children:'"The unique identifier of the customer to filter by"'}),"."]}),"\n",(0,s.jsxs)(t.li,{children:["Is Metadata: Select ",(0,s.jsx)(t.strong,{children:"False"})," unless the value is stored in the metadata field."]}),"\n",(0,s.jsxs)(t.li,{children:["Is Mandatory: Set to ",(0,s.jsx)(t.strong,{children:"True"})," to make the filter required."]}),"\n",(0,s.jsxs)(t.li,{children:["Is Timestamp: For this example, select ",(0,s.jsx)(t.strong,{children:"False"})," because the value is an ID, not a timestamp."]}),"\n",(0,s.jsxs)(t.li,{children:["Operator: ",(0,s.jsx)(t.code,{children:"$eq"})," to look for an exact match."]}),"\n"]}),"\n",(0,s.jsxs)(t.p,{children:["The following fields are available for each row in the ",(0,s.jsx)(t.strong,{children:"Tool Parameters"})," pane:"]}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Parameter"}),(0,s.jsx)(t.th,{children:"Description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Name"}),(0,s.jsx)(t.td,{children:"The name of the parameter that is exposed to the LLM. It can be the same as the underlying field name or a more descriptive label. The LLM uses this name, along with the description, to infer what value to provide during execution."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Attribute Name"}),(0,s.jsxs)(t.td,{children:["When the parameter name shown to the LLM differs from the actual field or property in the database, use this setting to map the user-facing name to the correct attribute. For example, to apply a range filter to the timestamp field, define two separate parameters, such as ",(0,s.jsx)(t.code,{children:"start_date"})," and ",(0,s.jsx)(t.code,{children:"end_date"}),", that both reference the same timestamp attribute."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Description"}),(0,s.jsxs)(t.td,{children:["Provides instructions to the LLM on how the parameter should be used. Clear and specific guidance helps the LLM provide valid input. For example, if a field such as ",(0,s.jsx)(t.code,{children:"specialty"})," is stored in lowercase, the description should indicate that the input must be lowercase."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Is Metadata"}),(0,s.jsxs)(t.td,{children:["When loading data using LangChain or Langflow, additional attributes may be stored under a metadata object. If the target attribute is stored this way, enable this option. It adjusts the query by generating a filter in the format: ",(0,s.jsx)(t.code,{children:'{"metadata.": ""}'})]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Is Timestamp"}),(0,s.jsx)(t.td,{children:"For date or time-based filters, enable this option to automatically convert values to the timestamp format that the Astrapy client expects. This ensures compatibility with the underlying API without requiring manual formatting."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Operator"}),(0,s.jsxs)(t.td,{children:["Defines the filtering logic applied to the attribute. You can use any valid ",(0,s.jsx)(t.a,{href:"https://docs.datastax.com/en/astra-db-serverless/api-reference/filter-operator-collections.html",children:"Data API filter operator"}),". For example, to filter a time range on the timestamp attribute, use two parameters: one with the ",(0,s.jsx)(t.code,{children:"$gt"}),' operator for "greater than", and another with the ',(0,s.jsx)(t.code,{children:"$lt"}),' operator for "less than".']})]})]})]}),"\n",(0,s.jsx)(t.h2,{id:"astra-db-graph",children:"Astra DB Graph"}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.strong,{children:"Astra DB Graph"})," component uses ",(0,s.jsx)(t.code,{children:"AstraDBGraphVectorStore"}),", an instance of ",(0,s.jsx)(t.a,{href:"https://python.langchain.com/api_reference/community/graph_vectorstores.html",children:"LangChain graph vector store"}),", for graph traversal and graph-based document retrieval in an Astra DB collection. It also supports writing to the vector store.\nFor more information, see ",(0,s.jsx)(t.a,{href:"https://docs.datastax.com/en/astra-db-serverless/tutorials/graph-rag.html",children:"Build a Graph RAG system with LangChain and GraphRetriever"}),"."]}),"\n",(0,s.jsx)(l.Ay,{}),"\n",(0,s.jsx)(t.h3,{id:"astra-db-graph-parameters",children:"Astra DB Graph parameters"}),"\n",(0,s.jsx)(t.p,{children:"You can inspect a vector store component's parameters to learn more about the inputs it accepts, the features it supports, and how to configure it."}),"\n",(0,s.jsx)(d.Ay,{}),"\n",(0,s.jsx)(c.Ay,{}),"\n",(0,s.jsxs)(t.p,{children:["For information about accepted values and functionality, see the ",(0,s.jsx)(t.a,{href:"https://docs.datastax.com/en/astra-db-serverless/index.html",children:"Astra DB Serverless documentation"})," or inspect ",(0,s.jsx)(t.a,{href:"/concepts-components#component-code",children:"component code"}),"."]}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Name"}),(0,s.jsx)(t.th,{children:"Display Name"}),(0,s.jsx)(t.th,{children:"Info"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"token"}),(0,s.jsx)(t.td,{children:"Astra DB Application Token"}),(0,s.jsx)(t.td,{children:"Input parameter. An Astra application token with permission to access your vector database. Once the connection is verified, additional fields are populated with your existing databases and collections. If you want to create a database through this component, the application token must have Organization Administrator permissions."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"api_endpoint"}),(0,s.jsx)(t.td,{children:"API Endpoint"}),(0,s.jsx)(t.td,{children:"Input parameter. Your database's API endpoint."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"keyspace"}),(0,s.jsx)(t.td,{children:"Keyspace"}),(0,s.jsxs)(t.td,{children:["Input parameter. The keyspace in your database that contains the collection specified in ",(0,s.jsx)(t.code,{children:"collection_name"}),". Default: ",(0,s.jsx)(t.code,{children:"default_keyspace"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"collection_name"}),(0,s.jsx)(t.td,{children:"Collection"}),(0,s.jsx)(t.td,{children:"Input parameter. The name of the collection that you want to use with this flow. For write operations, if a matching collection doesn't exist, a new one is created."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"metadata_incoming_links_key"}),(0,s.jsx)(t.td,{children:"Metadata Incoming Links Key"}),(0,s.jsx)(t.td,{children:"Input parameter. The metadata key for the incoming links in the vector store."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"ingest_data"}),(0,s.jsx)(t.td,{children:"Ingest Data"}),(0,s.jsx)(t.td,{children:"Input parameter. Records to load into the vector store. Only relevant for writes."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"search_input"}),(0,s.jsx)(t.td,{children:"Search Query"}),(0,s.jsx)(t.td,{children:"Input parameter. Query string for similarity search. Only relevant for reads."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"cache_vector_store"}),(0,s.jsx)(t.td,{children:"Cache Vector Store"}),(0,s.jsxs)(t.td,{children:["Input parameter. Whether to cache the vector store in Langflow memory for faster reads. Default: Enabled (",(0,s.jsx)(t.code,{children:"true"}),")."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"embedding_model"}),(0,s.jsx)(t.td,{children:"Embedding Model"}),(0,s.jsxs)(t.td,{children:["Input parameter. Attach an ",(0,s.jsx)(t.a,{href:"/components-embedding-models",children:"embedding model component"})," to generate embeddings. If the collection has a ",(0,s.jsx)(t.a,{href:"https://docs.datastax.com/en/astra-db-serverless/databases/embedding-generation.html",children:"vectorize integration"}),", don't attach an embedding model component."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"metric"}),(0,s.jsx)(t.td,{children:"Metric"}),(0,s.jsxs)(t.td,{children:["Input parameter. The metrics to use for similarity search calculations, either ",(0,s.jsx)(t.code,{children:"cosine"})," (default), ",(0,s.jsx)(t.code,{children:"dot_product"}),", or ",(0,s.jsx)(t.code,{children:"euclidean"}),". This is a collection setting."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"batch_size"}),(0,s.jsx)(t.td,{children:"Batch Size"}),(0,s.jsx)(t.td,{children:"Input parameter. Optional number of records to process in a single batch."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bulk_insert_batch_concurrency"}),(0,s.jsx)(t.td,{children:"Bulk Insert Batch Concurrency"}),(0,s.jsx)(t.td,{children:"Input parameter. Optional concurrency level for bulk write operations."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bulk_insert_overwrite_concurrency"}),(0,s.jsx)(t.td,{children:"Bulk Insert Overwrite Concurrency"}),(0,s.jsx)(t.td,{children:"Input parameter. Optional concurrency level for bulk write operations that allow upserts (overwriting existing records)."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bulk_delete_concurrency"}),(0,s.jsx)(t.td,{children:"Bulk Delete Concurrency"}),(0,s.jsx)(t.td,{children:"Input parameter. Optional concurrency level for bulk delete operations."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"setup_mode"}),(0,s.jsx)(t.td,{children:"Setup Mode"}),(0,s.jsxs)(t.td,{children:["Input parameter. Configuration mode for setting up the vector store, either ",(0,s.jsx)(t.code,{children:"Sync"})," (default) or ",(0,s.jsx)(t.code,{children:"Off"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"pre_delete_collection"}),(0,s.jsx)(t.td,{children:"Pre Delete Collection"}),(0,s.jsxs)(t.td,{children:["Input parameter. Whether to delete the collection before creating a new one. Default: Disabled (",(0,s.jsx)(t.code,{children:"false"}),")."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"metadata_indexing_include"}),(0,s.jsx)(t.td,{children:"Metadata Indexing Include"}),(0,s.jsxs)(t.td,{children:["Input parameter. A list of metadata fields to index if you want to enable ",(0,s.jsx)(t.a,{href:"https://docs.datastax.com/en/astra-db-serverless/api-reference/collection-indexes.html",children:"selective indexing"})," ",(0,s.jsx)(t.em,{children:"only"})," when creating a collection. Doesn't apply to existing collections. Only one ",(0,s.jsx)(t.code,{children:"*_indexing_*"})," parameter can be set per collection. If all ",(0,s.jsx)(t.code,{children:"*_indexing_*"})," parameters are unset, then all fields are indexed (default indexing)."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"metadata_indexing_exclude"}),(0,s.jsx)(t.td,{children:"Metadata Indexing Exclude"}),(0,s.jsxs)(t.td,{children:["Input parameter. A list of metadata fields to exclude from indexing if you want to enable selective indexing ",(0,s.jsx)(t.em,{children:"only"})," when creating a collection. Doesn't apply to existing collections. Only one ",(0,s.jsx)(t.code,{children:"*_indexing_*"})," parameter can be set per collection. If all ",(0,s.jsx)(t.code,{children:"*_indexing_*"})," parameters are unset, then all fields are indexed (default indexing)."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"collection_indexing_policy"}),(0,s.jsx)(t.td,{children:"Collection Indexing Policy"}),(0,s.jsxs)(t.td,{children:["Input parameter. A dictionary to define the indexing policy if you want to enable selective indexing ",(0,s.jsx)(t.em,{children:"only"})," when creating a collection. Doesn't apply to existing collections. Only one ",(0,s.jsx)(t.code,{children:"*_indexing_*"})," parameter can be set per collection. If all ",(0,s.jsx)(t.code,{children:"*_indexing_*"})," parameters are unset, then all fields are indexed (default indexing). The ",(0,s.jsx)(t.code,{children:"collection_indexing_policy"})," dictionary is used when you need to set indexing on subfields or a complex indexing definition that isn't compatible as a list."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"number_of_results"}),(0,s.jsx)(t.td,{children:"Number of Results"}),(0,s.jsx)(t.td,{children:"Input parameter. Number of search results to return. Default: 4. Only relevant to reads."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"search_type"}),(0,s.jsx)(t.td,{children:"Search Type"}),(0,s.jsxs)(t.td,{children:["Input parameter. Search type to use, either ",(0,s.jsx)(t.code,{children:"Similarity"}),", ",(0,s.jsx)(t.code,{children:"Similarity with score threshold"}),", or ",(0,s.jsx)(t.code,{children:"MMR (Max Marginal Relevance)"}),", ",(0,s.jsx)(t.code,{children:"Graph Traversal"}),", or ",(0,s.jsx)(t.code,{children:"MMR (Max Marginal Relevance) Graph Traversal"})," (default). Only relevant to reads."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"search_score_threshold"}),(0,s.jsx)(t.td,{children:"Search Score Threshold"}),(0,s.jsxs)(t.td,{children:["Input parameter. Minimum similarity score threshold for search results if the ",(0,s.jsx)(t.code,{children:"search_type"})," is ",(0,s.jsx)(t.code,{children:"Similarity with score threshold"}),". Default: 0."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"search_filter"}),(0,s.jsx)(t.td,{children:"Search Metadata Filter"}),(0,s.jsx)(t.td,{children:"Input parameter. Optional dictionary of metadata filters to apply in addition to vector search."})]})]})]}),"\n",(0,s.jsx)(t.h2,{id:"graph-rag",children:"Graph RAG"}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.strong,{children:"Graph RAG"})," component uses an instance of ",(0,s.jsx)(t.a,{href:"https://datastax.github.io/graph-rag/reference/langchain_graph_retriever/",children:(0,s.jsx)(t.code,{children:"GraphRetriever"})})," for Graph RAG traversal enabling graph-based document retrieval in an Astra DB vector store.\nFor more information, see the ",(0,s.jsx)(t.a,{href:"https://datastax.github.io/graph-rag/",children:"DataStax Graph RAG documentation"}),"."]}),"\n",(0,s.jsx)(t.admonition,{type:"info",children:(0,s.jsxs)(t.p,{children:["This component can be a Graph RAG extension for the ",(0,s.jsxs)(t.a,{href:"#astra-db",children:[(0,s.jsx)(t.strong,{children:"Astra DB"})," vector store component"]}),".\nHowever, the ",(0,s.jsxs)(t.a,{href:"#astra-db-graph",children:[(0,s.jsx)(t.strong,{children:"Astra DB Graph"})," component"]})," includes both the vector store connection and Graph RAG functionality."]})}),"\n",(0,s.jsx)(t.h3,{id:"graph-rag-parameters",children:"Graph RAG parameters"}),"\n",(0,s.jsx)(t.p,{children:"You can inspect a vector store component's parameters to learn more about the inputs it accepts, the features it supports, and how to configure it."}),"\n",(0,s.jsx)(d.Ay,{}),"\n",(0,s.jsx)(c.Ay,{}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Name"}),(0,s.jsx)(t.th,{children:"Display Name"}),(0,s.jsx)(t.th,{children:"Info"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"embedding_model"}),(0,s.jsx)(t.td,{children:"Embedding Model"}),(0,s.jsxs)(t.td,{children:["Input parameter. Specify the embedding model to use. Not required if the connected vector store has a ",(0,s.jsx)(t.a,{href:"https://docs.datastax.com/en/astra-db-serverless/databases/embedding-generation.html",children:"vectorize integration"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"vector_store"}),(0,s.jsx)(t.td,{children:"Vector Store Connection"}),(0,s.jsxs)(t.td,{children:["Input parameter. An instance of ",(0,s.jsx)(t.code,{children:"AstraDbVectorStore"})," inherited from the ",(0,s.jsxs)(t.a,{href:"#astra-db",children:[(0,s.jsx)(t.strong,{children:"Astra DB"})," component"]}),"'s ",(0,s.jsx)(t.strong,{children:"Vector Store Connection"})," output."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"edge_definition"}),(0,s.jsx)(t.td,{children:"Edge Definition"}),(0,s.jsxs)(t.td,{children:["Input parameter. ",(0,s.jsx)(t.a,{href:"https://datastax.github.io/graph-rag/reference/graph_retriever/edges/",children:"Edge definition"})," for the graph traversal."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"strategy"}),(0,s.jsx)(t.td,{children:"Traversal Strategies"}),(0,s.jsx)(t.td,{children:"Input parameter. The strategy to use for graph traversal. Strategy options are dynamically loaded from available strategies."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"search_query"}),(0,s.jsx)(t.td,{children:"Search Query"}),(0,s.jsx)(t.td,{children:"Input parameter. The query to search for in the vector store."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"graphrag_strategy_kwargs"}),(0,s.jsx)(t.td,{children:"Strategy Parameters"}),(0,s.jsxs)(t.td,{children:["Input parameter. Optional dictionary of additional parameters for the ",(0,s.jsx)(t.a,{href:"https://datastax.github.io/graph-rag/reference/graph_retriever/strategies/",children:"retrieval strategy"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"search_results"}),(0,s.jsxs)(t.td,{children:[(0,s.jsx)(t.strong,{children:"Search Results"})," or ",(0,s.jsx)(t.strong,{children:"DataFrame"})]}),(0,s.jsxs)(t.td,{children:["Output parameter. The results of the graph-based document retrieval as a list of ",(0,s.jsx)(t.a,{href:"/data-types#data",children:(0,s.jsx)(t.code,{children:"Data"})})," objects or as a tabular ",(0,s.jsx)(t.a,{href:"/data-types#dataframe",children:(0,s.jsx)(t.code,{children:"DataFrame"})}),". You can set the desired output type near the component's output port."]})]})]})]}),"\n",(0,s.jsx)(t.h2,{id:"hyper-converged-database-hcd",children:"Hyper-Converged Database (HCD)"}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.strong,{children:"Hyper-Converged Database (HCD)"})," component uses your cluster's Data API server to read and write to your HCD vector store.\nBecause the underlying functions call the Data API, which originated from Astra DB, the component uses an instance of ",(0,s.jsx)(t.code,{children:"AstraDBVectorStore"}),"."]}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.img,{alt:"A flow using the HCD component to load vector data.",src:n(42638).A+"",width:"2294",height:"1684"})}),"\n",(0,s.jsxs)(r,{children:[(0,s.jsx)("summary",{children:"About vector store instances"}),(0,s.jsx)(h.Ay,{})]}),"\n",(0,s.jsx)(l.Ay,{}),"\n",(0,s.jsxs)(t.p,{children:["For more information about HCD, see ",(0,s.jsx)(t.a,{href:"https://docs.datastax.com/en/hyper-converged-database/1.2/get-started/get-started-hcd.html",children:"Get started with HCD 1.2"})," and ",(0,s.jsx)(t.a,{href:"https://docs.datastax.com/en/hyper-converged-database/1.2/api-reference/dataapiclient.html",children:"Get started with the Data API in HCD 1.2"}),"."]}),"\n",(0,s.jsx)(t.h3,{id:"hcd-parameters",children:"HCD parameters"}),"\n",(0,s.jsx)(t.p,{children:"You can inspect a vector store component's parameters to learn more about the inputs it accepts, the features it supports, and how to configure it."}),"\n",(0,s.jsx)(d.Ay,{}),"\n",(0,s.jsx)(c.Ay,{}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Name"}),(0,s.jsx)(t.th,{children:"Display Name"}),(0,s.jsx)(t.th,{children:"Info"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"collection_name"}),(0,s.jsx)(t.td,{children:"Collection Name"}),(0,s.jsx)(t.td,{children:"Input parameter. The name of a vector store collection in HCD. For write operations, if the collection doesn't exist, then a new one is created. Required."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"username"}),(0,s.jsx)(t.td,{children:"HCD Username"}),(0,s.jsxs)(t.td,{children:["Input parameter. Username for authenticating to your HCD deployment. Default: ",(0,s.jsx)(t.code,{children:"hcd-superuser"}),". Required."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"password"}),(0,s.jsx)(t.td,{children:"HCD Password"}),(0,s.jsx)(t.td,{children:"Input parameter. Password for authenticating to your HCD deployment. Required."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"api_endpoint"}),(0,s.jsx)(t.td,{children:"HCD API Endpoint"}),(0,s.jsxs)(t.td,{children:["Input parameter. Your deployment's HCD Data API endpoint, formatted as ",(0,s.jsx)(t.code,{children:"http[s]://CLUSTER_HOST:GATEWAY_PORT"})," where ",(0,s.jsx)(t.code,{children:"CLUSTER_HOST"})," is the IP address of any node in your cluster and ",(0,s.jsx)(t.code,{children:"GATEWAY_PORT"})," is the port number for your API gateway service. For example, ",(0,s.jsx)(t.code,{children:"http://192.0.2.250:8181"}),". Required."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"ingest_data"}),(0,s.jsx)(t.td,{children:"Ingest Data"}),(0,s.jsx)(t.td,{children:"Input parameter. Records to load into the vector store. Only relevant for writes."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"search_input"}),(0,s.jsx)(t.td,{children:"Search Input"}),(0,s.jsx)(t.td,{children:"Input parameter. Query string for similarity search. Only relevant for reads."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"namespace"}),(0,s.jsx)(t.td,{children:"Namespace"}),(0,s.jsxs)(t.td,{children:["Input parameter. The namespace in HCD that contains or will contain the collection specified in ",(0,s.jsx)(t.code,{children:"collection_name"}),". Default: ",(0,s.jsx)(t.code,{children:"default_namespace"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"ca_certificate"}),(0,s.jsx)(t.td,{children:"CA Certificate"}),(0,s.jsx)(t.td,{children:"Input parameter. Optional CA certificate for TLS connections to HCD."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"metric"}),(0,s.jsx)(t.td,{children:"Metric"}),(0,s.jsxs)(t.td,{children:["Input parameter. The metrics to use for similarity search calculations, either ",(0,s.jsx)(t.code,{children:"cosine"}),", ",(0,s.jsx)(t.code,{children:"dot_product"}),", or ",(0,s.jsx)(t.code,{children:"euclidean"}),". This is a collection setting. If calling an existing collection, leave unset to use the collection's metric. If a write operation creates a new collection, specify the desired similarity metric setting."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"batch_size"}),(0,s.jsx)(t.td,{children:"Batch Size"}),(0,s.jsx)(t.td,{children:"Input parameter. Optional number of records to process in a single batch."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bulk_insert_batch_concurrency"}),(0,s.jsx)(t.td,{children:"Bulk Insert Batch Concurrency"}),(0,s.jsx)(t.td,{children:"Input parameter. Optional concurrency level for bulk write operations."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bulk_insert_overwrite_concurrency"}),(0,s.jsx)(t.td,{children:"Bulk Insert Overwrite Concurrency"}),(0,s.jsx)(t.td,{children:"Input parameter. Optional concurrency level for bulk write operations that allow upserts (overwriting existing records)."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bulk_delete_concurrency"}),(0,s.jsx)(t.td,{children:"Bulk Delete Concurrency"}),(0,s.jsx)(t.td,{children:"Input parameter. Optional concurrency level for bulk delete operations."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"setup_mode"}),(0,s.jsx)(t.td,{children:"Setup Mode"}),(0,s.jsxs)(t.td,{children:["Input parameter. Configuration mode for setting up the vector store, either ",(0,s.jsx)(t.code,{children:"Sync"})," (default), ",(0,s.jsx)(t.code,{children:"Async"}),", or ",(0,s.jsx)(t.code,{children:"Off"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"pre_delete_collection"}),(0,s.jsx)(t.td,{children:"Pre Delete Collection"}),(0,s.jsx)(t.td,{children:"Input parameter. Whether to delete the collection before creating a new one."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"metadata_indexing_include"}),(0,s.jsx)(t.td,{children:"Metadata Indexing Include"}),(0,s.jsxs)(t.td,{children:["Input parameter. A list of metadata fields to index if you want to enable ",(0,s.jsx)(t.a,{href:"https://docs.datastax.com/en/hyper-converged-database/1.2/api-reference/collection-indexes.html",children:"selective indexing"})," ",(0,s.jsx)(t.em,{children:"only"})," when creating a collection. Doesn't apply to existing collections. Only one ",(0,s.jsx)(t.code,{children:"*_indexing_*"})," parameter can be set per collection. If all ",(0,s.jsx)(t.code,{children:"*_indexing_*"})," parameters are unset, then all fields are indexed (default indexing)."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"metadata_indexing_exclude"}),(0,s.jsx)(t.td,{children:"Metadata Indexing Exclude"}),(0,s.jsxs)(t.td,{children:["Input parameter. A list of metadata fields to exclude from indexing if you want to enable selective indexing ",(0,s.jsx)(t.em,{children:"only"})," when creating a collection. Doesn't apply to existing collections. Only one ",(0,s.jsx)(t.code,{children:"*_indexing_*"})," parameter can be set per collection. If all ",(0,s.jsx)(t.code,{children:"*_indexing_*"})," parameters are unset, then all fields are indexed (default indexing)."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"collection_indexing_policy"}),(0,s.jsx)(t.td,{children:"Collection Indexing Policy"}),(0,s.jsxs)(t.td,{children:["Input parameter. A dictionary to define the indexing policy if you want to enable selective indexing ",(0,s.jsx)(t.em,{children:"only"})," when creating a collection. Doesn't apply to existing collections. Only one ",(0,s.jsx)(t.code,{children:"*_indexing_*"})," parameter can be set per collection. If all ",(0,s.jsx)(t.code,{children:"*_indexing_*"})," parameters are unset, then all fields are indexed (default indexing). The ",(0,s.jsx)(t.code,{children:"collection_indexing_policy"})," dictionary is used when you need to set indexing on subfields or a complex indexing definition that isn't compatible as a list."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"embedding"}),(0,s.jsx)(t.td,{children:"Embedding or Astra Vectorize"}),(0,s.jsxs)(t.td,{children:["Input parameter. The embedding model to use by attaching an ",(0,s.jsx)(t.strong,{children:"Embedding Model"})," component. This component doesn't support additional vectorize authentication headers, so it isn't possible to use a vectorize integration with this component, even if you have enabled one on an existing HCD collection."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"number_of_results"}),(0,s.jsx)(t.td,{children:"Number of Results"}),(0,s.jsx)(t.td,{children:"Input parameter. Number of search results to return. Default: 4. Only relevant to reads."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"search_type"}),(0,s.jsx)(t.td,{children:"Search Type"}),(0,s.jsxs)(t.td,{children:["Input parameter. Search type to use, either ",(0,s.jsx)(t.code,{children:"Similarity"})," (default), ",(0,s.jsx)(t.code,{children:"Similarity with score threshold"}),", or ",(0,s.jsx)(t.code,{children:"MMR (Max Marginal Relevance)"}),". Only relevant to reads."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"search_score_threshold"}),(0,s.jsx)(t.td,{children:"Search Score Threshold"}),(0,s.jsxs)(t.td,{children:["Input parameter. Minimum similarity score threshold for search results if the ",(0,s.jsx)(t.code,{children:"search_type"})," is ",(0,s.jsx)(t.code,{children:"Similarity with score threshold"}),". Default: 0."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"search_filter"}),(0,s.jsx)(t.td,{children:"Search Metadata Filter"}),(0,s.jsx)(t.td,{children:"Input parameter. Optional dictionary of metadata filters to apply in addition to vector search."})]})]})]}),"\n",(0,s.jsx)(t.h2,{id:"other-datastax-components",children:"Other DataStax components"}),"\n",(0,s.jsxs)(t.p,{children:["The following components are also included in the ",(0,s.jsx)(t.strong,{children:"DataStax"})," bundle."]}),"\n",(0,s.jsx)(t.h3,{id:"astra-db-chat-memory",children:"Astra DB Chat Memory"}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.strong,{children:"Astra DB Chat Memory"})," component retrieves and stores chat messages using an Astra DB database."]}),"\n",(0,s.jsxs)(t.p,{children:["Chat memories are passed between memory storage components as the ",(0,s.jsx)(t.a,{href:"/data-types#memory",children:(0,s.jsx)(t.code,{children:"Memory"})})," data type.\nSpecifically, the component creates an instance of ",(0,s.jsx)(t.code,{children:"AstraDBChatMessageHistory"}),", which is a LangChain chat message history class that uses Astra DB for storage."]}),"\n",(0,s.jsxs)(t.admonition,{type:"warning",children:[(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.strong,{children:"Astra DB Chat Memory"})," component isn't recommended for most memory storage because memories tend to be long JSON objects or strings, often exceeding the maximum size of a document or object supported by Astra DB."]}),(0,s.jsxs)(t.p,{children:["However, Langflow's ",(0,s.jsx)(t.strong,{children:"Agent"})," component includes built-in chat memory that is enabled by default.\nYour agentic flows don't need an external database to store chat memory.\nFor more information, see ",(0,s.jsx)(t.a,{href:"/memory",children:"Memory management options"}),"."]})]}),"\n",(0,s.jsxs)(t.p,{children:["For more information about using external chat memory in flows, see the ",(0,s.jsxs)(t.a,{href:"/components-helpers#message-history",children:[(0,s.jsx)(t.strong,{children:"Message History"})," component"]}),"."]}),"\n",(0,s.jsx)(t.h4,{id:"astra-db-chat-memory-parameters",children:"Astra DB Chat Memory parameters"}),"\n",(0,s.jsx)(d.Ay,{}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Name"}),(0,s.jsx)(t.th,{children:"Type"}),(0,s.jsx)(t.th,{children:"Description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"collection_name"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. The name of the Astra DB collection for storing messages. Required."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"token"}),(0,s.jsx)(t.td,{children:"SecretString"}),(0,s.jsx)(t.td,{children:"Input parameter. The authentication token for Astra DB access. Required."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"api_endpoint"}),(0,s.jsx)(t.td,{children:"SecretString"}),(0,s.jsx)(t.td,{children:"Input parameter. The API endpoint URL for the Astra DB service. Required."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"namespace"}),(0,s.jsx)(t.td,{children:"String"}),(0,s.jsx)(t.td,{children:"Input parameter. The optional namespace within Astra DB for the collection."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"session_id"}),(0,s.jsx)(t.td,{children:"MessageText"}),(0,s.jsx)(t.td,{children:"Input parameter. The unique identifier for the chat session. Uses the current session ID if not provided."})]})]})]}),"\n",(0,s.jsx)(t.h3,{id:"assistants-api",children:"Assistants API"}),"\n",(0,s.jsx)(t.p,{children:"The following DataStax components are used to create and manage Assistants API functions in a flow:"}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsx)(t.li,{children:(0,s.jsx)(t.strong,{children:"Astra Assistant Agent"})}),"\n",(0,s.jsx)(t.li,{children:(0,s.jsx)(t.strong,{children:"Create Assistant"})}),"\n",(0,s.jsx)(t.li,{children:(0,s.jsx)(t.strong,{children:"Create Assistant Thread"})}),"\n",(0,s.jsx)(t.li,{children:(0,s.jsx)(t.strong,{children:"Get Assistant Name"})}),"\n",(0,s.jsx)(t.li,{children:(0,s.jsx)(t.strong,{children:"List Assistants"})}),"\n",(0,s.jsx)(t.li,{children:(0,s.jsx)(t.strong,{children:"Run Assistant"})}),"\n"]}),"\n",(0,s.jsx)(t.h2,{id:"environment-variables",children:"Environment variables"}),"\n",(0,s.jsx)(t.p,{children:"The following DataStax components are used to load and retrieve environment variables in a flow:"}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsx)(t.li,{children:(0,s.jsx)(t.strong,{children:"Dotenv"})}),"\n",(0,s.jsx)(t.li,{children:(0,s.jsx)(t.strong,{children:"Get Environment Variable"})}),"\n"]}),"\n",(0,s.jsx)(t.h2,{id:"legacy-datastax-components",children:"Legacy DataStax components"}),"\n","\n",(0,s.jsx)(x.Ay,{}),"\n",(0,s.jsx)(t.p,{children:"The following DataStax components are in legacy status:"}),"\n",(0,s.jsxs)(r,{children:[(0,s.jsx)("summary",{children:"Astra Vectorize"}),(0,s.jsxs)(t.p,{children:["This component was deprecated in Langflow version 1.1.2.\nReplace it with the ",(0,s.jsxs)(t.a,{href:"#astra-db",children:[(0,s.jsx)(t.strong,{children:"Astra DB"})," component"]}),"."]}),(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.strong,{children:"Astra DB Vectorize"})," component was used to generate embeddings with Astra DB's vectorize feature in conjunction with an ",(0,s.jsx)(t.strong,{children:"Astra DB"})," component."]}),(0,s.jsxs)(t.p,{children:["The vectorize functionality is now built into the ",(0,s.jsx)(t.strong,{children:"Astra DB"})," component.\nYou no longer need a separate component for vectorize embedding generation."]})]}),"\n",(0,s.jsx)(t.h2,{id:"see-also",children:"See also"}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsx)(t.li,{children:(0,s.jsxs)(t.a,{href:"/bundles-cassandra",children:[(0,s.jsx)(t.strong,{children:"Cassandra"})," bundle"]})}),"\n",(0,s.jsx)(t.li,{children:(0,s.jsx)(t.a,{href:"/chat-with-rag",children:"Create a vector RAG chatbot"})}),"\n"]})]})}function v(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(b,{...e})}):b(e)}function w(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}},7685:(e,t,n)=>{n.d(t,{A:()=>r});const r=n.p+"assets/images/vector-store-document-ingestion-6157311fb4d16e7f944d55254f0cc0e2.png"},17886:(e,t,n)=>{n.d(t,{A:()=>a});n(96540);var r=n(64058),s=n(74848);function a({name:e,...t}){const n=r[e];return n?(0,s.jsx)(n,{...t}):null}},27027:(e,t,n)=>{n.d(t,{Ay:()=>d,RM:()=>i});var r=n(74848),s=n(28453),a=n(17886);const i=[];function o(e){const t={a:"a",admonition:"admonition",code:"code",em:"em",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,s.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.admonition,{type:"tip",children:(0,r.jsxs)(t.p,{children:["For a tutorial that uses vector data in a flow, see ",(0,r.jsx)(t.a,{href:"/chat-with-rag",children:"Create a vector RAG chatbot"}),"."]})}),"\n",(0,r.jsx)(t.p,{children:"The following example demonstrates how to use vector store components in flows alongside related components like embedding model and language model components.\nThese steps walk through important configuration details, functionality, and best practices for using these components effectively.\nThis is only one example; it isn't a prescriptive guide to all possible use cases or configurations."}),"\n",(0,r.jsxs)(t.ol,{children:["\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Create a flow with the ",(0,r.jsx)(t.strong,{children:"Vector Store RAG"})," template."]}),"\n",(0,r.jsxs)(t.p,{children:["This template has two subflows.\nThe ",(0,r.jsx)(t.strong,{children:"Load Data"})," subflow loads embeddings and content into a vector database, and the ",(0,r.jsx)(t.strong,{children:"Retriever"})," subflow runs a vector search to retrieve relevant context based on a user's query."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Configure the database connection for both ",(0,r.jsxs)(t.a,{href:"/bundles-datastax#astra-db",children:[(0,r.jsx)(t.strong,{children:"Astra DB"})," components"]}),", or replace them with another pair of vector store components of your choice.\nMake sure the components connect to the same vector store, and that the component in the ",(0,r.jsx)(t.strong,{children:"Retriever"})," subflow is able to run a similarity search."]}),"\n",(0,r.jsxs)(t.p,{children:["The parameters you set in each vector store component depend on the component's role in your flow.\nIn this example, the ",(0,r.jsx)(t.strong,{children:"Load Data"})," subflow ",(0,r.jsx)(t.em,{children:"writes"})," to the vector store, whereas the ",(0,r.jsx)(t.strong,{children:"Retriever"})," subflow ",(0,r.jsx)(t.em,{children:"reads"})," from the vector store.\nTherefore, search-related parameters are only relevant to the ",(0,r.jsx)(t.strong,{children:"Vector Search"})," component in the ",(0,r.jsx)(t.strong,{children:"Retriever"})," subflow."]}),"\n",(0,r.jsx)(t.p,{children:"For information about specific parameters, see the documentation for your chosen vector store component."}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsx)(t.p,{children:"To configure the embedding model, do one of the following:"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.strong,{children:"Use an OpenAI model"}),": In both ",(0,r.jsx)(t.strong,{children:"OpenAI Embeddings"})," components, enter your OpenAI API key.\nYou can use the default model or select a different OpenAI embedding model."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.strong,{children:"Use another provider"}),": Replace the ",(0,r.jsx)(t.strong,{children:"OpenAI Embeddings"})," components with another pair of ",(0,r.jsx)(t.a,{href:"/components-embedding-models",children:"embedding model components"})," of your choice, and then configure the parameters and credentials accordingly."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.strong,{children:"Use Astra DB vectorize"}),": If you are using an Astra DB vector store that has a vectorize integration, you can remove both ",(0,r.jsx)(t.strong,{children:"OpenAI Embeddings"})," components.\nIf you do this, the vectorize integration automatically generates embeddings from the ",(0,r.jsx)(t.strong,{children:"Ingest Data"})," (in the ",(0,r.jsx)(t.strong,{children:"Load Data"})," subflow) and ",(0,r.jsx)(t.strong,{children:"Search Query"})," (in the ",(0,r.jsx)(t.strong,{children:"Retriever"})," subflow)."]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(t.admonition,{type:"tip",children:(0,r.jsx)(t.p,{children:"If your vector store already contains embeddings, make sure your embedding model components use the same model as your previous embeddings.\nMixing embedding models in the same vector store can produce inaccurate search results."})}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Recommended: In the ",(0,r.jsxs)(t.a,{href:"/components-processing#split-text",children:[(0,r.jsx)(t.strong,{children:"Split Text"})," component"]}),", optimize the chunking settings for your embedding model.\nFor example, if your embedding model has a token limit of 512, then the ",(0,r.jsx)(t.strong,{children:"Chunk Size"})," parameter must not exceed that limit."]}),"\n",(0,r.jsxs)(t.p,{children:["Additionally, because the ",(0,r.jsx)(t.strong,{children:"Retriever"})," subflow passes the chat input directly to the vector store component for vector search, make sure that your chat input string doesn't exceed your embedding model's limits.\nFor this example, you can enter a query that is within the limits; however, in a production environment, you might need to implement additional checks or preprocessing steps to ensure compliance.\nFor example, use additional components to prepare the chat input before running the vector search, or enforce chat input limits in your application code."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["In the ",(0,r.jsx)(t.strong,{children:"Language Model"})," component, enter your OpenAI API key, or select a different provider and model to use for the chat portion of the flow."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Run the ",(0,r.jsx)(t.strong,{children:"Load Data"})," subflow to populate your vector store.\nIn the ",(0,r.jsx)(t.strong,{children:"File"})," component, select one or more files, and then click ",(0,r.jsx)(a.A,{name:"Play","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Run component"})," on the vector store component in the ",(0,r.jsx)(t.strong,{children:"Load Data"})," subflow."]}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Load Data"})," subflow loads files from your local machine, chunks them, generates embeddings for the chunks, and then stores the chunks and their embeddings in the vector database."]}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.img,{alt:"Embedding data into a vector store",src:n(7685).A+"",width:"4000",height:"2512"})}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Load Data"})," subflow is separate from the ",(0,r.jsx)(t.strong,{children:"Retriever"})," subflow because you probably won't run it every time you use the chat.\nYou can run the ",(0,r.jsx)(t.strong,{children:"Load Data"})," subflow as needed to preload or update the data in your vector store.\nThen, your chat interactions only use the components that are necessary for chat."]}),"\n",(0,r.jsxs)(t.p,{children:["If your vector store already contains data that you want to use for vector search, then you don't need to run the ",(0,r.jsx)(t.strong,{children:"Load Data"})," subflow."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:["Open the ",(0,r.jsx)(t.strong,{children:"Playground"})," and start chatting to run the ",(0,r.jsx)(t.strong,{children:"Retriever"})," subflow."]}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.strong,{children:"Retriever"})," subflow generates an embedding from chat input, runs a vector search to retrieve similar content from your vector store, parses the search results into supplemental context for the LLM, and then uses the LLM to generate a natural language response to your query.\nThe LLM uses the vector search results along with its internal training data and tools, such as basic web search and datetime information, to produce the response."]}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.img,{alt:"Retrieval from a vector store",src:n(67719).A+"",width:"4000",height:"1324"})}),"\n",(0,r.jsxs)(t.p,{children:["To avoid passing the entire block of raw search results to the LLM, the ",(0,r.jsx)(t.strong,{children:"Parser"})," component extracts ",(0,r.jsx)(t.code,{children:"text"})," strings from the search results ",(0,r.jsx)(t.code,{children:"Data"})," object, and then passes them to the ",(0,r.jsx)(t.strong,{children:"Prompt Template"})," component in ",(0,r.jsx)(t.code,{children:"Message"})," format.\nFrom there, the strings and other template content are compiled into natural language instructions for the LLM."]}),"\n",(0,r.jsxs)(t.p,{children:["You can use other components for this transformation, such as the ",(0,r.jsx)(t.strong,{children:"Data Operations"})," component, depending on how you want to use the search results."]}),"\n",(0,r.jsxs)(t.p,{children:["To view the raw search results, click ",(0,r.jsx)(a.A,{name:"TextSearch","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Inspect output"})," on the vector store component after running the ",(0,r.jsx)(t.strong,{children:"Retriever"})," subflow."]}),"\n"]}),"\n"]})]})}function d(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(o,{...e})}):o(e)}},31929:(e,t,n)=>{n.d(t,{Ay:()=>d,RM:()=>i});var r=n(74848),s=n(28453),a=n(17886);const i=[];function o(e){const t={a:"a",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,r.jsxs)(t.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,r.jsx)(a.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Controls"})," in the ",(0,r.jsx)(t.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function d(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(o,{...e})}):o(e)}},36813:(e,t,n)=>{n.d(t,{Ay:()=>d,RM:()=>i});var r=n(74848),s=n(28453),a=n(17886);const i=[];function o(e){const t={a:"a",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(t.p,{children:["Legacy components are longer supported and can be removed in a future release.\nYou can continue to use them in existing flows, but it is recommended that you replace them with supported components as soon as possible.\nSuggested replacements are included in the ",(0,r.jsx)(t.strong,{children:"Legacy"})," banner on components in your flows.\nThey are also given in release notes and Langflow documentation whenever possible."]}),"\n",(0,r.jsxs)(t.p,{children:["If you aren't sure how to replace a legacy component, ",(0,r.jsx)(a.A,{name:"Search","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Search"})," for components by provider, service, or component name.\nThe component may have been deprecated in favor of a completely new component, a similar component, or a new version of the same component in a different category."]}),"\n",(0,r.jsxs)(t.p,{children:["If there is no obvious replacement, consider whether another component can be adapted to your use case.\nFor example, many ",(0,r.jsx)(a.A,{name:"Component","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Core components"})," provide generic functionality that can support multiple providers and use cases, such as the ",(0,r.jsxs)(t.a,{href:"/components-data#api-request",children:[(0,r.jsx)(t.strong,{children:"API Request"})," component"]}),"."]}),"\n",(0,r.jsxs)(t.p,{children:["If neither of these options are viable, you could use the legacy component's code to create your own custom component, or ",(0,r.jsx)(t.a,{href:"/contributing-github-issues",children:"start a discussion"})," about the legacy component."]}),"\n",(0,r.jsxs)(t.p,{children:["To discourage use of legacy components in new flows, these components are hidden by default.\nIn the visual editor, you can click ",(0,r.jsx)(a.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Component settings"})," to toggle the ",(0,r.jsx)(t.strong,{children:"Legacy"})," filter."]})]})}function d(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(o,{...e})}):o(e)}},42638:(e,t,n)=>{n.d(t,{A:()=>r});const r=n.p+"assets/images/component-hcd-example-flow-b82057600ce5e9e4a0f7ea0a61dcbf7f.png"},50005:(e,t,n)=>{n.d(t,{Ay:()=>o,RM:()=>a});var r=n(74848),s=n(28453);const a=[];function i(e){const t={a:"a",code:"code",p:"p",...(0,s.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(t.p,{children:["Because Langflow is based on LangChain, vector store components use an instance of ",(0,r.jsx)(t.a,{href:"https://python.langchain.com/docs/integrations/vectorstores/",children:"LangChain vector store"})," to drive the underlying read and write functions.\nThese instances are provider-specific and configured according to the component's parameters, such as the connection string, index name, and schema."]}),"\n",(0,r.jsxs)(t.p,{children:["In component code, this is often instantiated as ",(0,r.jsx)(t.code,{children:"vector_store"}),", but some vector store components use a different name, such as the provider name."]}),"\n",(0,r.jsx)(t.p,{children:"Some LangChain classes don't expose all possible options as component parameters.\nDepending on the provider, these options might use default values or allow modification through environment variables, if they are supported in Langflow.\nFor information about specific options, see the LangChain API reference and vector store provider's documentation."})]})}function o(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(i,{...e})}):i(e)}},67719:(e,t,n)=>{n.d(t,{A:()=>r});const r=n.p+"assets/images/vector-store-retrieval-af7257d77ff0259ab1a0980641d464ce.png"},68335:(e,t,n)=>{n.d(t,{A:()=>r});const r=n.p+"assets/images/component-astra-db-json-tool-117aff566c0df01a555264bb128b3693.png"},80223:(e,t,n)=>{n.d(t,{Ay:()=>o,RM:()=>a});var r=n(74848),s=n(28453);const a=[];function i(e){const t={p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,r.jsxs)(t.p,{children:["Some parameters are conditional, and they are only available after you set other parameters or select specific options for other parameters.\nConditional parameters may not be visible on the ",(0,r.jsx)(t.strong,{children:"Controls"})," pane until you set the required dependencies."]})}function o(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(i,{...e})}):i(e)}},90465:(e,t,n)=>{n.d(t,{Ay:()=>o,RM:()=>a});var r=n(74848),s=n(28453);const a=[];function i(e){const t={a:"a",code:"code",p:"p",...(0,s.R)(),...e.components};return(0,r.jsxs)(t.p,{children:["If you use a vector store component to query your vector database, it produces search results that you can pass to downstream components in your flow as a list of ",(0,r.jsx)(t.a,{href:"/data-types#data",children:(0,r.jsx)(t.code,{children:"Data"})})," objects or a tabular ",(0,r.jsx)(t.a,{href:"/data-types#dataframe",children:(0,r.jsx)(t.code,{children:"DataFrame"})}),".\nIf both types are supported, you can set the format near the vector store component's output port in the visual editor."]})}function o(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(i,{...e})}):i(e)}}}]); \ No newline at end of file diff --git a/assets/js/f01590dc.26e8c028.js b/assets/js/f01590dc.04e9354d.js similarity index 57% rename from assets/js/f01590dc.26e8c028.js rename to assets/js/f01590dc.04e9354d.js index 4993aea91d..b67c93edc5 100644 --- a/assets/js/f01590dc.26e8c028.js +++ b/assets/js/f01590dc.04e9354d.js @@ -1 +1 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[4223],{17886:(e,t,n)=>{n.d(t,{A:()=>s});n(96540);var r=n(64058),i=n(74848);function s({name:e,...t}){const n=r[e];return n?(0,i.jsx)(n,{...t}):null}},26928:(e,t,n)=>{n.r(t),n.d(t,{CH:()=>x,assets:()=>h,chCodeConfig:()=>p,contentTitle:()=>a,default:()=>g,frontMatter:()=>l,metadata:()=>r,toc:()=>u});const r=JSON.parse('{"id":"Integrations/Nvidia/integrations-nvidia-ingest","title":"Integrate NVIDIA Retriever Extraction with Langflow","description":"The NVIDIA Retriever Extraction component integrates with the NVIDIA nv-ingest microservice for data ingestion, processing, and extraction of text files.","source":"@site/docs/Integrations/Nvidia/integrations-nvidia-ingest.mdx","sourceDirName":"Integrations/Nvidia","slug":"/integrations-nvidia-ingest","permalink":"/integrations-nvidia-ingest","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Integrate NVIDIA Retriever Extraction with Langflow","slug":"/integrations-nvidia-ingest"},"sidebar":"docs","previous":{"title":"NVIDIA components","permalink":"/bundles-nvidia"},"next":{"title":"NVIDIA NIM on WSL2","permalink":"/integrations-nvidia-ingest-wsl2"}}');var i=n(74848),s=n(28453),o=n(24754),c=n(17886),d=n(31929);const l={title:"Integrate NVIDIA Retriever Extraction with Langflow",slug:"/integrations-nvidia-ingest"},a=void 0,h={},x={annotations:o.hk,Code:o.Cy},p={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},u=[{value:"Prerequisites",id:"prerequisites",level:2},{value:"Use the NVIDIA Retriever Extraction component in a flow",id:"use-the-nvidia-retriever-extraction-component-in-a-flow",level:2},...d.RM,{value:"NVIDIA Retriever Extraction component parameters",id:"parameters",level:2},{value:"Inputs",id:"inputs",level:3},{value:"Outputs",id:"outputs",level:3}];function j(e){const t={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,s.R)(),...e.components};return x||m("CH",!1),x.Code||m("CH.Code",!0),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n","\n",(0,i.jsxs)(t.p,{children:["The ",(0,i.jsx)(t.strong,{children:"NVIDIA Retriever Extraction"})," component integrates with the ",(0,i.jsx)(t.a,{href:"https://github.com/NVIDIA/nv-ingest",children:"NVIDIA nv-ingest"})," microservice for data ingestion, processing, and extraction of text files."]}),"\n",(0,i.jsxs)(t.p,{children:["The ",(0,i.jsx)(t.code,{children:"nv-ingest"})," service supports multiple extraction methods for PDF, DOCX, and PPTX file types, and includes pre- and post-processing services like splitting, chunking, and embedding generation. The extractor service's High Resolution mode uses the ",(0,i.jsx)(t.code,{children:"nemoretriever-parse"})," extraction method for better quality extraction from scanned PDF documents. This feature is only available for PDF files."]}),"\n",(0,i.jsxs)(t.p,{children:["The ",(0,i.jsx)(t.strong,{children:"NVIDIA Retriever Extraction"})," component imports the NVIDIA ",(0,i.jsx)(t.code,{children:"Ingestor"})," client, ingests files with requests to the NVIDIA ingest endpoint, and outputs the processed content as a list of ",(0,i.jsx)(t.a,{href:"/data-types#data",children:(0,i.jsx)(t.code,{children:"Data"})})," objects. ",(0,i.jsx)(t.code,{children:"Ingestor"})," accepts additional configuration options for data extraction from other text formats. To configure these options, see the ",(0,i.jsx)(t.a,{href:"#parameters",children:"component parameters"}),"."]}),"\n",(0,i.jsx)(t.admonition,{type:"tip",children:(0,i.jsx)(t.p,{children:"NVIDIA Retriever Extraction is also known as NV-Ingest and NeMo Retriever Extraction."})}),"\n",(0,i.jsx)(t.h2,{id:"prerequisites",children:"Prerequisites"}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:["An NVIDIA Ingest endpoint. For more information on setting up an NVIDIA Ingest endpoint, see the ",(0,i.jsx)(t.a,{href:"https://github.com/NVIDIA/nv-ingest?tab=readme-ov-file#quickstart",children:"NVIDIA Ingest quickstart"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:["The ",(0,i.jsx)(t.strong,{children:"NVIDIA Retriever Extraction"})," component requires the installation of additional dependencies to your Langflow environment. To install the dependencies in a virtual environment, run the following commands."]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:"If you have the Langflow repository cloned and installed from source:"}),"\n"]}),"\n",(0,i.jsx)(x.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"source **",props:{style:{color:"#79C0FF"}}},{content:"YOUR_LANGFLOW_VENV",props:{style:{color:"#A5D6FF"}}},{content:"**",props:{style:{color:"#79C0FF"}}},{content:"/bin/activate",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"uv ",props:{style:{color:"#FFA657"}}},{content:"sync ",props:{style:{color:"#A5D6FF"}}},{content:"--extra ",props:{style:{color:"#79C0FF"}}},{content:"nv-ingest",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"uv ",props:{style:{color:"#FFA657"}}},{content:"run langflow run",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:"If you are installing Langflow from the Python Package Index:"}),"\n"]}),"\n",(0,i.jsx)(x.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"source **",props:{style:{color:"#79C0FF"}}},{content:"YOUR_LANGFLOW_VENV",props:{style:{color:"#A5D6FF"}}},{content:"**",props:{style:{color:"#79C0FF"}}},{content:"/bin/activate",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"uv ",props:{style:{color:"#FFA657"}}},{content:"pip install ",props:{style:{color:"#A5D6FF"}}},{content:"--prerelease=allow ",props:{style:{color:"#79C0FF"}}},{content:"'langflow[nv-ingest]'",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"uv ",props:{style:{color:"#FFA657"}}},{content:"run langflow run",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.h2,{id:"use-the-nvidia-retriever-extraction-component-in-a-flow",children:"Use the NVIDIA Retriever Extraction component in a flow"}),"\n",(0,i.jsxs)(t.p,{children:["The ",(0,i.jsx)(t.strong,{children:"NVIDIA Retriever Extraction"})," component accepts ",(0,i.jsx)(t.code,{children:"Message"})," inputs, and then outputs ",(0,i.jsx)(t.code,{children:"Data"}),". The component calls an NVIDIA Ingest microservice's endpoint to ingest a local file and extract the text."]}),"\n",(0,i.jsxs)(t.p,{children:["To use the ",(0,i.jsx)(t.strong,{children:"NVIDIA Retriever Extraction"})," component in your flow, follow these steps:"]}),"\n",(0,i.jsxs)(t.ol,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:["Add the ",(0,i.jsx)(t.strong,{children:"NVIDIA Retriever Extraction"})," component to your flow."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:["In the ",(0,i.jsx)(t.strong,{children:"Base URL"})," field, enter the URL of the NVIDIA Ingest endpoint.\nYou can also store the URL as a ",(0,i.jsx)(t.a,{href:"/configuration-global-variables",children:"global variable"})," to reuse it in multiple components and flows."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:["Click ",(0,i.jsx)(t.strong,{children:"Select Files"})," to select a file to ingest."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsx)(t.p,{children:"Select which text type to extract from the file: text, charts, tables, images, or infographics."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:["Optional: For PDF files, enable ",(0,i.jsx)(t.strong,{children:"High Resolution Mode"})," for better quality extraction from scanned documents."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsx)(t.p,{children:"Select whether to split the text into chunks."}),"\n",(0,i.jsx)(d.Ay,{}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:["Click ",(0,i.jsx)(c.A,{name:"Play","aria-hidden":"true"})," ",(0,i.jsx)(t.strong,{children:"Run component"})," to ingest the file, and then click ",(0,i.jsx)(t.strong,{children:"Logs"})," or ",(0,i.jsx)(c.A,{name:"TextSearch","aria-hidden":"true"})," ",(0,i.jsx)(t.strong,{children:"Inspect output"})," to confirm the component ingested the file."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:["To store the processed data in a vector database, add a vector store component to your flow, and then connect the ",(0,i.jsx)(t.strong,{children:"NVIDIA Retriever Extraction"})," component's ",(0,i.jsx)(t.code,{children:"Data"})," output to the vector store component's input."]}),"\n",(0,i.jsx)(t.p,{children:"When you run the flow with a vector store component, the processed data is stored in the vector database.\nYou can query your database to retrieve the uploaded data."}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{alt:"NVIDIA Retriever Extraction component flow",src:n(76102).A+"",width:"1722",height:"1548"})}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.h2,{id:"parameters",children:"NVIDIA Retriever Extraction component parameters"}),"\n",(0,i.jsxs)(t.p,{children:["The ",(0,i.jsx)(t.strong,{children:"NVIDIA Retriever Extraction"})," component has the following parameters."]}),"\n",(0,i.jsxs)(t.p,{children:["For more information, see the ",(0,i.jsx)(t.a,{href:"https://nvidia.github.io/nv-ingest/user-guide/",children:"NV-Ingest documentation"}),"."]}),"\n",(0,i.jsx)(t.h3,{id:"inputs",children:"Inputs"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{children:"Name"}),(0,i.jsx)(t.th,{children:"Display Name"}),(0,i.jsx)(t.th,{children:"Info"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"base_url"}),(0,i.jsx)(t.td,{children:"NVIDIA Ingestion URL"}),(0,i.jsx)(t.td,{children:"The URL of the NVIDIA Ingestion API."})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"path"}),(0,i.jsx)(t.td,{children:"Path"}),(0,i.jsx)(t.td,{children:"File path to process."})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"extract_text"}),(0,i.jsx)(t.td,{children:"Extract Text"}),(0,i.jsx)(t.td,{children:"Extract text from documents. Default: true."})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"extract_charts"}),(0,i.jsx)(t.td,{children:"Extract Charts"}),(0,i.jsx)(t.td,{children:"Extract text from charts. Default: false."})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"extract_tables"}),(0,i.jsx)(t.td,{children:"Extract Tables"}),(0,i.jsx)(t.td,{children:"Extract text from tables. Default: true."})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"extract_images"}),(0,i.jsx)(t.td,{children:"Extract Images"}),(0,i.jsx)(t.td,{children:"Extract images from document. Default: true."})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"extract_infographics"}),(0,i.jsx)(t.td,{children:"Extract Infographics"}),(0,i.jsx)(t.td,{children:"Extract infographics from document. Default: false."})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"text_depth"}),(0,i.jsx)(t.td,{children:"Text Depth"}),(0,i.jsxs)(t.td,{children:["The level at which text is extracted. Options: 'document', 'page', 'block', 'line', 'span'. Default: ",(0,i.jsx)(t.code,{children:"page"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"split_text"}),(0,i.jsx)(t.td,{children:"Split Text"}),(0,i.jsx)(t.td,{children:"Split text into smaller chunks. Default: true."})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"chunk_size"}),(0,i.jsx)(t.td,{children:"Chunk Size"}),(0,i.jsxs)(t.td,{children:["The number of tokens per chunk. Default: ",(0,i.jsx)(t.code,{children:"500"}),". Make sure the chunk size is compatible with your embedding model. For more information, see ",(0,i.jsx)(t.a,{href:"/components-processing#chunk-size",children:"Tokenization errors due to chunk size"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"chunk_overlap"}),(0,i.jsx)(t.td,{children:"Chunk Overlap"}),(0,i.jsxs)(t.td,{children:["Number of tokens to overlap from previous chunk. Default: ",(0,i.jsx)(t.code,{children:"150"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"filter_images"}),(0,i.jsx)(t.td,{children:"Filter Images"}),(0,i.jsx)(t.td,{children:"Filter images (see advanced options for filtering criteria). Default: false."})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"min_image_size"}),(0,i.jsx)(t.td,{children:"Minimum Image Size Filter"}),(0,i.jsxs)(t.td,{children:["Minimum image width/length in pixels. Default: ",(0,i.jsx)(t.code,{children:"128"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"min_aspect_ratio"}),(0,i.jsx)(t.td,{children:"Minimum Aspect Ratio Filter"}),(0,i.jsxs)(t.td,{children:["Minimum allowed aspect ratio (width / height). Default: ",(0,i.jsx)(t.code,{children:"0.2"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"max_aspect_ratio"}),(0,i.jsx)(t.td,{children:"Maximum Aspect Ratio Filter"}),(0,i.jsxs)(t.td,{children:["Maximum allowed aspect ratio (width / height). Default: ",(0,i.jsx)(t.code,{children:"5.0"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"dedup_images"}),(0,i.jsx)(t.td,{children:"Deduplicate Images"}),(0,i.jsx)(t.td,{children:"Filter duplicated images. Default: true."})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"caption_images"}),(0,i.jsx)(t.td,{children:"Caption Images"}),(0,i.jsx)(t.td,{children:"Generate captions for images using the NVIDIA captioning model. Default: true."})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"high_resolution"}),(0,i.jsx)(t.td,{children:"High Resolution (PDF only)"}),(0,i.jsx)(t.td,{children:"Process PDF in high-resolution mode for better quality extraction from scanned PDF. Default: false."})]})]})]}),"\n",(0,i.jsx)(t.h3,{id:"outputs",children:"Outputs"}),"\n",(0,i.jsxs)(t.p,{children:["The ",(0,i.jsx)(t.strong,{children:"NVIDIA Retriever Extraction"})," component outputs a list of ",(0,i.jsx)(t.a,{href:"/data-types#data",children:(0,i.jsx)(t.code,{children:"Data"})})," objects where each object contains:"]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"text"}),": The extracted content.","\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:"For text documents: The extracted text content."}),"\n",(0,i.jsx)(t.li,{children:"For tables and charts: The extracted table/chart content."}),"\n",(0,i.jsx)(t.li,{children:"For images: The image caption."}),"\n",(0,i.jsx)(t.li,{children:"For infographics: The extracted infographic content."}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"file_path"}),": The source file name and path."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"document_type"}),": The type of the document, which can be ",(0,i.jsx)(t.code,{children:"text"}),", ",(0,i.jsx)(t.code,{children:"structured"}),", or ",(0,i.jsx)(t.code,{children:"image"}),"."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"description"}),": Additional description of the content."]}),"\n"]}),"\n",(0,i.jsxs)(t.p,{children:["The output varies based on the ",(0,i.jsx)(t.code,{children:"document_type"}),":"]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:["Documents with ",(0,i.jsx)(t.code,{children:'document_type: "text"'})," contain:"]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:"Raw text content extracted from documents, for example, paragraphs from PDFs or DOCX files."}),"\n",(0,i.jsxs)(t.li,{children:["Content stored directly in the ",(0,i.jsx)(t.code,{children:"text"})," field."]}),"\n",(0,i.jsxs)(t.li,{children:["Content extracted using the ",(0,i.jsx)(t.code,{children:"extract_text"})," parameter."]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:["Documents with ",(0,i.jsx)(t.code,{children:'document_type: "structured"'})," contain:"]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:"Text extracted from tables, charts, and infographics and processed to preserve structural information."}),"\n",(0,i.jsxs)(t.li,{children:["Content extracted using the ",(0,i.jsx)(t.code,{children:"extract_tables"}),", ",(0,i.jsx)(t.code,{children:"extract_charts"}),", and ",(0,i.jsx)(t.code,{children:"extract_infographics"})," parameters."]}),"\n",(0,i.jsxs)(t.li,{children:["Content stored in the ",(0,i.jsx)(t.code,{children:"text"})," field after being processed from the ",(0,i.jsx)(t.code,{children:"table_content"})," metadata."]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:["Documents with ",(0,i.jsx)(t.code,{children:'document_type: "image"'})," contain:"]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:"Image content extracted from documents."}),"\n",(0,i.jsxs)(t.li,{children:["Caption text stored in the ",(0,i.jsx)(t.code,{children:"text"})," field when ",(0,i.jsx)(t.code,{children:"caption_images"})," is enabled."]}),"\n",(0,i.jsxs)(t.li,{children:["Content extracted using the ",(0,i.jsx)(t.code,{children:"extract_images"})," parameter."]}),"\n"]}),"\n"]}),"\n"]})]})}function g(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(j,{...e})}):j(e)}function m(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}},31929:(e,t,n)=>{n.d(t,{Ay:()=>d,RM:()=>o});var r=n(74848),i=n(28453),s=n(17886);const o=[];function c(e){const t={a:"a",p:"p",strong:"strong",...(0,i.R)(),...e.components};return(0,r.jsxs)(t.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,r.jsx)(s.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Controls"})," in the ",(0,r.jsx)(t.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function d(e={}){const{wrapper:t}={...(0,i.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(c,{...e})}):c(e)}},76102:(e,t,n)=>{n.d(t,{A:()=>r});const r=n.p+"assets/images/nvidia-component-ingest-astra-c6f0107751252206ab0d500a25ba3f9c.png"}}]); \ No newline at end of file +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[4223],{17886:(e,t,n)=>{n.d(t,{A:()=>s});n(96540);var r=n(64058),i=n(74848);function s({name:e,...t}){const n=r[e];return n?(0,i.jsx)(n,{...t}):null}},26928:(e,t,n)=>{n.r(t),n.d(t,{CH:()=>x,assets:()=>h,chCodeConfig:()=>p,contentTitle:()=>a,default:()=>g,frontMatter:()=>l,metadata:()=>r,toc:()=>u});const r=JSON.parse('{"id":"Integrations/Nvidia/integrations-nvidia-ingest","title":"Integrate NVIDIA Retriever Extraction with Langflow","description":"The NVIDIA Retriever Extraction component integrates with the NVIDIA nv-ingest microservice for data ingestion, processing, and extraction of text files.","source":"@site/docs/Integrations/Nvidia/integrations-nvidia-ingest.mdx","sourceDirName":"Integrations/Nvidia","slug":"/integrations-nvidia-ingest","permalink":"/integrations-nvidia-ingest","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Integrate NVIDIA Retriever Extraction with Langflow","slug":"/integrations-nvidia-ingest"},"sidebar":"docs","previous":{"title":"NVIDIA components","permalink":"/bundles-nvidia"},"next":{"title":"NVIDIA NIM on WSL2","permalink":"/integrations-nvidia-ingest-wsl2"}}');var i=n(74848),s=n(28453),o=n(24754),c=n(17886),d=n(31929);const l={title:"Integrate NVIDIA Retriever Extraction with Langflow",slug:"/integrations-nvidia-ingest"},a=void 0,h={},x={annotations:o.hk,Code:o.Cy},p={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},u=[{value:"Prerequisites",id:"prerequisites",level:2},{value:"Use the NVIDIA Retriever Extraction component in a flow",id:"use-the-nvidia-retriever-extraction-component-in-a-flow",level:2},...d.RM,{value:"NVIDIA Retriever Extraction component parameters",id:"parameters",level:2},{value:"Inputs",id:"inputs",level:3},{value:"Outputs",id:"outputs",level:3}];function j(e){const t={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,s.R)(),...e.components};return x||m("CH",!1),x.Code||m("CH.Code",!0),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n","\n",(0,i.jsxs)(t.p,{children:["The ",(0,i.jsx)(t.strong,{children:"NVIDIA Retriever Extraction"})," component integrates with the ",(0,i.jsx)(t.a,{href:"https://github.com/NVIDIA/nv-ingest",children:"NVIDIA nv-ingest"})," microservice for data ingestion, processing, and extraction of text files."]}),"\n",(0,i.jsxs)(t.p,{children:["The ",(0,i.jsx)(t.code,{children:"nv-ingest"})," service supports multiple extraction methods for PDF, DOCX, and PPTX file types, and includes pre- and post-processing services like splitting, chunking, and embedding generation. The extractor service's High Resolution mode uses the ",(0,i.jsx)(t.code,{children:"nemoretriever-parse"})," extraction method for better quality extraction from scanned PDF documents. This feature is only available for PDF files."]}),"\n",(0,i.jsxs)(t.p,{children:["The ",(0,i.jsx)(t.strong,{children:"NVIDIA Retriever Extraction"})," component imports the NVIDIA ",(0,i.jsx)(t.code,{children:"Ingestor"})," client, ingests files with requests to the NVIDIA ingest endpoint, and outputs the processed content as a list of ",(0,i.jsx)(t.a,{href:"/data-types#data",children:(0,i.jsx)(t.code,{children:"Data"})})," objects. ",(0,i.jsx)(t.code,{children:"Ingestor"})," accepts additional configuration options for data extraction from other text formats. To configure these options, see the ",(0,i.jsx)(t.a,{href:"#parameters",children:"component parameters"}),"."]}),"\n",(0,i.jsx)(t.admonition,{type:"tip",children:(0,i.jsx)(t.p,{children:"NVIDIA Retriever Extraction is also known as NV-Ingest and NeMo Retriever Extraction."})}),"\n",(0,i.jsx)(t.h2,{id:"prerequisites",children:"Prerequisites"}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:["An NVIDIA Ingest endpoint. For more information on setting up an NVIDIA Ingest endpoint, see the ",(0,i.jsx)(t.a,{href:"https://github.com/NVIDIA/nv-ingest?tab=readme-ov-file#quickstart",children:"NVIDIA Ingest quickstart"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:["The ",(0,i.jsx)(t.strong,{children:"NVIDIA Retriever Extraction"})," component requires the installation of additional dependencies to your Langflow environment. To install the dependencies in a virtual environment, run the following commands."]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:"If you have the Langflow repository cloned and installed from source:"}),"\n"]}),"\n",(0,i.jsx)(x.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"source **",props:{style:{color:"#79C0FF"}}},{content:"YOUR_LANGFLOW_VENV",props:{style:{color:"#A5D6FF"}}},{content:"**",props:{style:{color:"#79C0FF"}}},{content:"/bin/activate",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"uv ",props:{style:{color:"#FFA657"}}},{content:"sync ",props:{style:{color:"#A5D6FF"}}},{content:"--extra ",props:{style:{color:"#79C0FF"}}},{content:"nv-ingest",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"uv ",props:{style:{color:"#FFA657"}}},{content:"run langflow run",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:"If you are installing Langflow from the Python Package Index:"}),"\n"]}),"\n",(0,i.jsx)(x.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"source **",props:{style:{color:"#79C0FF"}}},{content:"YOUR_LANGFLOW_VENV",props:{style:{color:"#A5D6FF"}}},{content:"**",props:{style:{color:"#79C0FF"}}},{content:"/bin/activate",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"uv ",props:{style:{color:"#FFA657"}}},{content:"pip install ",props:{style:{color:"#A5D6FF"}}},{content:"--prerelease=allow ",props:{style:{color:"#79C0FF"}}},{content:"'langflow[nv-ingest]'",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"uv ",props:{style:{color:"#FFA657"}}},{content:"run langflow run",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.h2,{id:"use-the-nvidia-retriever-extraction-component-in-a-flow",children:"Use the NVIDIA Retriever Extraction component in a flow"}),"\n",(0,i.jsxs)(t.p,{children:["The ",(0,i.jsx)(t.strong,{children:"NVIDIA Retriever Extraction"})," component accepts ",(0,i.jsx)(t.code,{children:"Message"})," inputs, and then outputs ",(0,i.jsx)(t.code,{children:"Data"}),". The component calls an NVIDIA Ingest microservice's endpoint to ingest a local file and extract the text."]}),"\n",(0,i.jsxs)(t.p,{children:["To use the ",(0,i.jsx)(t.strong,{children:"NVIDIA Retriever Extraction"})," component in your flow, follow these steps:"]}),"\n",(0,i.jsxs)(t.ol,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:["Add the ",(0,i.jsx)(t.strong,{children:"NVIDIA Retriever Extraction"})," component to your flow."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:["In the ",(0,i.jsx)(t.strong,{children:"Base URL"})," field, enter the URL of the NVIDIA Ingest endpoint.\nYou can also store the URL as a ",(0,i.jsx)(t.a,{href:"/configuration-global-variables",children:"global variable"})," to reuse it in multiple components and flows."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:["Click ",(0,i.jsx)(t.strong,{children:"Select Files"})," to select a file to ingest."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsx)(t.p,{children:"Select which text type to extract from the file: text, charts, tables, images, or infographics."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:["Optional: For PDF files, enable ",(0,i.jsx)(t.strong,{children:"High Resolution Mode"})," for better quality extraction from scanned documents."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsx)(t.p,{children:"Select whether to split the text into chunks."}),"\n",(0,i.jsx)(d.Ay,{}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:["Click ",(0,i.jsx)(c.A,{name:"Play","aria-hidden":"true"})," ",(0,i.jsx)(t.strong,{children:"Run component"})," to ingest the file, and then click ",(0,i.jsx)(t.strong,{children:"Logs"})," or ",(0,i.jsx)(c.A,{name:"TextSearch","aria-hidden":"true"})," ",(0,i.jsx)(t.strong,{children:"Inspect output"})," to confirm the component ingested the file."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:["To store the processed data in a vector database, add a vector store component to your flow, and then connect the ",(0,i.jsx)(t.strong,{children:"NVIDIA Retriever Extraction"})," component's ",(0,i.jsx)(t.code,{children:"Data"})," output to the vector store component's input."]}),"\n",(0,i.jsx)(t.p,{children:"When you run the flow with a vector store component, the processed data is stored in the vector database.\nYou can query your database to retrieve the uploaded data."}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{alt:"NVIDIA Retriever Extraction component flow",src:n(76102).A+"",width:"1722",height:"1548"})}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.h2,{id:"parameters",children:"NVIDIA Retriever Extraction component parameters"}),"\n",(0,i.jsxs)(t.p,{children:["The ",(0,i.jsx)(t.strong,{children:"NVIDIA Retriever Extraction"})," component has the following parameters."]}),"\n",(0,i.jsxs)(t.p,{children:["For more information, see the ",(0,i.jsx)(t.a,{href:"https://nvidia.github.io/nv-ingest/user-guide/",children:"NV-Ingest documentation"}),"."]}),"\n",(0,i.jsx)(t.h3,{id:"inputs",children:"Inputs"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{children:"Name"}),(0,i.jsx)(t.th,{children:"Display Name"}),(0,i.jsx)(t.th,{children:"Info"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"base_url"}),(0,i.jsx)(t.td,{children:"NVIDIA Ingestion URL"}),(0,i.jsx)(t.td,{children:"The URL of the NVIDIA Ingestion API."})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"path"}),(0,i.jsx)(t.td,{children:"Path"}),(0,i.jsx)(t.td,{children:"File path to process."})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"extract_text"}),(0,i.jsx)(t.td,{children:"Extract Text"}),(0,i.jsxs)(t.td,{children:["Extract text from documents. Default: ",(0,i.jsx)(t.code,{children:"true"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"extract_charts"}),(0,i.jsx)(t.td,{children:"Extract Charts"}),(0,i.jsxs)(t.td,{children:["Extract text from charts. Default: ",(0,i.jsx)(t.code,{children:"false"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"extract_tables"}),(0,i.jsx)(t.td,{children:"Extract Tables"}),(0,i.jsxs)(t.td,{children:["Extract text from tables. Default: ",(0,i.jsx)(t.code,{children:"true"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"extract_images"}),(0,i.jsx)(t.td,{children:"Extract Images"}),(0,i.jsxs)(t.td,{children:["Extract images from document. Default: ",(0,i.jsx)(t.code,{children:"true"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"extract_infographics"}),(0,i.jsx)(t.td,{children:"Extract Infographics"}),(0,i.jsxs)(t.td,{children:["Extract infographics from document. Default: ",(0,i.jsx)(t.code,{children:"false"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"text_depth"}),(0,i.jsx)(t.td,{children:"Text Depth"}),(0,i.jsxs)(t.td,{children:["The level at which text is extracted. Options: 'document', 'page', 'block', 'line', 'span'. Default: ",(0,i.jsx)(t.code,{children:"page"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"split_text"}),(0,i.jsx)(t.td,{children:"Split Text"}),(0,i.jsxs)(t.td,{children:["Split text into smaller chunks. Default: ",(0,i.jsx)(t.code,{children:"true"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"chunk_size"}),(0,i.jsx)(t.td,{children:"Chunk Size"}),(0,i.jsxs)(t.td,{children:["The number of tokens per chunk. Default: ",(0,i.jsx)(t.code,{children:"500"}),". Make sure the chunk size is compatible with your embedding model. For more information, see ",(0,i.jsx)(t.a,{href:"/components-processing#chunk-size",children:"Tokenization errors due to chunk size"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"chunk_overlap"}),(0,i.jsx)(t.td,{children:"Chunk Overlap"}),(0,i.jsxs)(t.td,{children:["Number of tokens to overlap from previous chunk. Default: ",(0,i.jsx)(t.code,{children:"150"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"filter_images"}),(0,i.jsx)(t.td,{children:"Filter Images"}),(0,i.jsxs)(t.td,{children:["Filter images (see advanced options for filtering criteria). Default: ",(0,i.jsx)(t.code,{children:"false"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"min_image_size"}),(0,i.jsx)(t.td,{children:"Minimum Image Size Filter"}),(0,i.jsxs)(t.td,{children:["Minimum image width/length in pixels. Default: ",(0,i.jsx)(t.code,{children:"128"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"min_aspect_ratio"}),(0,i.jsx)(t.td,{children:"Minimum Aspect Ratio Filter"}),(0,i.jsxs)(t.td,{children:["Minimum allowed aspect ratio (width / height). Default: ",(0,i.jsx)(t.code,{children:"0.2"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"max_aspect_ratio"}),(0,i.jsx)(t.td,{children:"Maximum Aspect Ratio Filter"}),(0,i.jsxs)(t.td,{children:["Maximum allowed aspect ratio (width / height). Default: ",(0,i.jsx)(t.code,{children:"5.0"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"dedup_images"}),(0,i.jsx)(t.td,{children:"Deduplicate Images"}),(0,i.jsxs)(t.td,{children:["Filter duplicated images. Default: ",(0,i.jsx)(t.code,{children:"true"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"caption_images"}),(0,i.jsx)(t.td,{children:"Caption Images"}),(0,i.jsxs)(t.td,{children:["Generate captions for images using the NVIDIA captioning model. Default: ",(0,i.jsx)(t.code,{children:"true"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"high_resolution"}),(0,i.jsx)(t.td,{children:"High Resolution (PDF only)"}),(0,i.jsxs)(t.td,{children:["Process PDF in high-resolution mode for better quality extraction from scanned PDF. Default: ",(0,i.jsx)(t.code,{children:"false"}),"."]})]})]})]}),"\n",(0,i.jsx)(t.h3,{id:"outputs",children:"Outputs"}),"\n",(0,i.jsxs)(t.p,{children:["The ",(0,i.jsx)(t.strong,{children:"NVIDIA Retriever Extraction"})," component outputs a list of ",(0,i.jsx)(t.a,{href:"/data-types#data",children:(0,i.jsx)(t.code,{children:"Data"})})," objects where each object contains:"]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"text"}),": The extracted content.","\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:"For text documents: The extracted text content."}),"\n",(0,i.jsx)(t.li,{children:"For tables and charts: The extracted table/chart content."}),"\n",(0,i.jsx)(t.li,{children:"For images: The image caption."}),"\n",(0,i.jsx)(t.li,{children:"For infographics: The extracted infographic content."}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"file_path"}),": The source file name and path."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"document_type"}),": The type of the document, which can be ",(0,i.jsx)(t.code,{children:"text"}),", ",(0,i.jsx)(t.code,{children:"structured"}),", or ",(0,i.jsx)(t.code,{children:"image"}),"."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"description"}),": Additional description of the content."]}),"\n"]}),"\n",(0,i.jsxs)(t.p,{children:["The output varies based on the ",(0,i.jsx)(t.code,{children:"document_type"}),":"]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:["Documents with ",(0,i.jsx)(t.code,{children:'document_type: "text"'})," contain:"]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:"Raw text content extracted from documents, for example, paragraphs from PDFs or DOCX files."}),"\n",(0,i.jsxs)(t.li,{children:["Content stored directly in the ",(0,i.jsx)(t.code,{children:"text"})," field."]}),"\n",(0,i.jsxs)(t.li,{children:["Content extracted using the ",(0,i.jsx)(t.code,{children:"extract_text"})," parameter."]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:["Documents with ",(0,i.jsx)(t.code,{children:'document_type: "structured"'})," contain:"]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:"Text extracted from tables, charts, and infographics and processed to preserve structural information."}),"\n",(0,i.jsxs)(t.li,{children:["Content extracted using the ",(0,i.jsx)(t.code,{children:"extract_tables"}),", ",(0,i.jsx)(t.code,{children:"extract_charts"}),", and ",(0,i.jsx)(t.code,{children:"extract_infographics"})," parameters."]}),"\n",(0,i.jsxs)(t.li,{children:["Content stored in the ",(0,i.jsx)(t.code,{children:"text"})," field after being processed from the ",(0,i.jsx)(t.code,{children:"table_content"})," metadata."]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:["Documents with ",(0,i.jsx)(t.code,{children:'document_type: "image"'})," contain:"]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:"Image content extracted from documents."}),"\n",(0,i.jsxs)(t.li,{children:["Caption text stored in the ",(0,i.jsx)(t.code,{children:"text"})," field when ",(0,i.jsx)(t.code,{children:"caption_images"})," is enabled."]}),"\n",(0,i.jsxs)(t.li,{children:["Content extracted using the ",(0,i.jsx)(t.code,{children:"extract_images"})," parameter."]}),"\n"]}),"\n"]}),"\n"]})]})}function g(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(j,{...e})}):j(e)}function m(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}},31929:(e,t,n)=>{n.d(t,{Ay:()=>d,RM:()=>o});var r=n(74848),i=n(28453),s=n(17886);const o=[];function c(e){const t={a:"a",p:"p",strong:"strong",...(0,i.R)(),...e.components};return(0,r.jsxs)(t.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,r.jsx)(s.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,r.jsx)(t.strong,{children:"Controls"})," in the ",(0,r.jsx)(t.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function d(e={}){const{wrapper:t}={...(0,i.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(c,{...e})}):c(e)}},76102:(e,t,n)=>{n.d(t,{A:()=>r});const r=n.p+"assets/images/nvidia-component-ingest-astra-c6f0107751252206ab0d500a25ba3f9c.png"}}]); \ No newline at end of file diff --git a/assets/js/f0b67137.c5bb6292.js b/assets/js/f0b67137.4b458f0d.js similarity index 63% rename from assets/js/f0b67137.c5bb6292.js rename to assets/js/f0b67137.4b458f0d.js index c43a802b1c..c469f8f2bb 100644 --- a/assets/js/f0b67137.c5bb6292.js +++ b/assets/js/f0b67137.4b458f0d.js @@ -1 +1 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[3247],{8921:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>l,contentTitle:()=>c,default:()=>u,frontMatter:()=>o,metadata:()=>t,toc:()=>h});const t=JSON.parse('{"id":"Components/bundles-azure","title":"Azure","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/bundles-azure.mdx","sourceDirName":"Components","slug":"/bundles-azure","permalink":"/bundles-azure","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Azure","slug":"/bundles-azure"},"sidebar":"docs","previous":{"title":"AssemblyAI","permalink":"/integrations-assemblyai"},"next":{"title":"Baidu","permalink":"/bundles-baidu"}}');var s=r(74848),d=r(28453),i=r(17886),a=r(31929);const o={title:"Azure",slug:"/bundles-azure"},c=void 0,l={},h=[{value:"Azure OpenAI",id:"azure-openai",level:2},{value:"Azure OpenAI parameters",id:"azure-openai-parameters",level:3},...a.RM,{value:"Azure OpenAI Embeddings",id:"azure-openai-embeddings",level:2},{value:"Azure OpenAI Embeddings parameters",id:"azure-openai-embeddings-parameters",level:3},...a.RM];function p(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,d.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:[(0,s.jsx)(i.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(n.a,{href:"/components-bundle-components",children:(0,s.jsx)(n.strong,{children:"Bundles"})})," contain custom components that support specific third-party integrations with Langflow."]}),"\n",(0,s.jsxs)(n.p,{children:["This page describes the components that are available in the ",(0,s.jsx)(n.strong,{children:"Azure"})," bundle."]}),"\n",(0,s.jsx)(n.h2,{id:"azure-openai",children:"Azure OpenAI"}),"\n",(0,s.jsxs)(n.p,{children:["This component generates text using ",(0,s.jsx)(n.a,{href:"https://learn.microsoft.com/en-us/azure/ai-services/openai/",children:"Azure OpenAI LLMs"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["It can output either a ",(0,s.jsx)(n.strong,{children:"Model Response"})," (",(0,s.jsx)(n.a,{href:"/data-types#message",children:(0,s.jsx)(n.code,{children:"Message"})}),") or a ",(0,s.jsx)(n.strong,{children:"Language Model"})," (",(0,s.jsx)(n.a,{href:"/data-types#languagemodel",children:(0,s.jsx)(n.code,{children:"LanguageModel"})}),").\nSpecifically, the ",(0,s.jsx)(n.strong,{children:"Language Model"})," output is an instance of ",(0,s.jsx)(n.a,{href:"https://python.langchain.com/docs/integrations/chat/azure_chat_openai/",children:(0,s.jsx)(n.code,{children:"AzureChatOpenAI"})})," configured according to the component's parameters."]}),"\n",(0,s.jsxs)(n.p,{children:["Use the ",(0,s.jsx)(n.strong,{children:"Language Model"})," output when you want to use an Azure OpenAI model as the LLM for another LLM-driven component, such as an ",(0,s.jsx)(n.strong,{children:"Agent"})," or ",(0,s.jsx)(n.strong,{children:"Smart Function"})," component."]}),"\n",(0,s.jsxs)(n.p,{children:["For more information, see ",(0,s.jsx)(n.a,{href:"/components-models",children:"Language model components"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"azure-openai-parameters",children:"Azure OpenAI parameters"}),"\n",(0,s.jsx)(a.Ay,{}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Model Name"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. Specifies the name of the Azure OpenAI model to be used for text generation."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Azure Endpoint"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. Your Azure endpoint, including the resource."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Deployment Name"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. Specifies the name of the deployment."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"API Version"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. Specifies the version of the Azure OpenAI API to be used."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"API Key"}),(0,s.jsx)(n.td,{children:"SecretString"}),(0,s.jsx)(n.td,{children:"Input parameter. Your Azure OpenAI API key."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Temperature"}),(0,s.jsx)(n.td,{children:"Float"}),(0,s.jsxs)(n.td,{children:["Input parameter. Specifies the sampling temperature. Defaults to ",(0,s.jsx)(n.code,{children:"0.7"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Max Tokens"}),(0,s.jsx)(n.td,{children:"Integer"}),(0,s.jsxs)(n.td,{children:["Input parameter. Specifies the maximum number of tokens to generate. Defaults to ",(0,s.jsx)(n.code,{children:"1000"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Input Value"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. Specifies the input text for text generation."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Stream"}),(0,s.jsx)(n.td,{children:"Boolean"}),(0,s.jsx)(n.td,{children:"Input parameter. Specifies whether to stream the response from the model. Default to false."})]})]})]}),"\n",(0,s.jsx)(n.h2,{id:"azure-openai-embeddings",children:"Azure OpenAI Embeddings"}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"Azure OpenAI Embeddings"})," component generates embeddings using Azure OpenAI models."]}),"\n",(0,s.jsxs)(n.p,{children:["For more information about using embedding model components in flows, see ",(0,s.jsx)(n.a,{href:"/components-embedding-models",children:"Embedding model components"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"azure-openai-embeddings-parameters",children:"Azure OpenAI Embeddings parameters"}),"\n",(0,s.jsx)(a.Ay,{}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Model"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsxs)(n.td,{children:["Input parameter. The name of the model to use. Default: ",(0,s.jsx)(n.code,{children:"text-embedding-3-small"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Azure Endpoint"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsxs)(n.td,{children:["Input parameter. Your Azure endpoint, including the resource, such as ",(0,s.jsx)(n.code,{children:"https://example-resource.azure.openai.com/"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Deployment Name"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. The name of the deployment."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"API Version"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. The API version to use, with options including various dates."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"API Key"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. The API key required to access the Azure OpenAI service."})]})]})]})]})}function u(e={}){const{wrapper:n}={...(0,d.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(p,{...e})}):p(e)}},17886:(e,n,r)=>{r.d(n,{A:()=>d});r(96540);var t=r(64058),s=r(74848);function d({name:e,...n}){const r=t[e];return r?(0,s.jsx)(r,{...n}):null}},31929:(e,n,r)=>{r.d(n,{Ay:()=>o,RM:()=>i});var t=r(74848),s=r(28453),d=r(17886);const i=[];function a(e){const n={a:"a",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,t.jsxs)(n.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,t.jsx)(d.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,t.jsx)(n.strong,{children:"Controls"})," in the ",(0,t.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function o(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(a,{...e})}):a(e)}}}]); \ No newline at end of file +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[3247],{8921:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>l,contentTitle:()=>c,default:()=>u,frontMatter:()=>o,metadata:()=>t,toc:()=>h});const t=JSON.parse('{"id":"Components/bundles-azure","title":"Azure","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/bundles-azure.mdx","sourceDirName":"Components","slug":"/bundles-azure","permalink":"/bundles-azure","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Azure","slug":"/bundles-azure"},"sidebar":"docs","previous":{"title":"AssemblyAI","permalink":"/integrations-assemblyai"},"next":{"title":"Baidu","permalink":"/bundles-baidu"}}');var s=r(74848),d=r(28453),i=r(17886),a=r(31929);const o={title:"Azure",slug:"/bundles-azure"},c=void 0,l={},h=[{value:"Azure OpenAI",id:"azure-openai",level:2},{value:"Azure OpenAI parameters",id:"azure-openai-parameters",level:3},...a.RM,{value:"Azure OpenAI Embeddings",id:"azure-openai-embeddings",level:2},{value:"Azure OpenAI Embeddings parameters",id:"azure-openai-embeddings-parameters",level:3},...a.RM];function p(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,d.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:[(0,s.jsx)(i.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(n.a,{href:"/components-bundle-components",children:(0,s.jsx)(n.strong,{children:"Bundles"})})," contain custom components that support specific third-party integrations with Langflow."]}),"\n",(0,s.jsxs)(n.p,{children:["This page describes the components that are available in the ",(0,s.jsx)(n.strong,{children:"Azure"})," bundle."]}),"\n",(0,s.jsx)(n.h2,{id:"azure-openai",children:"Azure OpenAI"}),"\n",(0,s.jsxs)(n.p,{children:["This component generates text using ",(0,s.jsx)(n.a,{href:"https://learn.microsoft.com/en-us/azure/ai-services/openai/",children:"Azure OpenAI LLMs"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["It can output either a ",(0,s.jsx)(n.strong,{children:"Model Response"})," (",(0,s.jsx)(n.a,{href:"/data-types#message",children:(0,s.jsx)(n.code,{children:"Message"})}),") or a ",(0,s.jsx)(n.strong,{children:"Language Model"})," (",(0,s.jsx)(n.a,{href:"/data-types#languagemodel",children:(0,s.jsx)(n.code,{children:"LanguageModel"})}),").\nSpecifically, the ",(0,s.jsx)(n.strong,{children:"Language Model"})," output is an instance of ",(0,s.jsx)(n.a,{href:"https://python.langchain.com/docs/integrations/chat/azure_chat_openai/",children:(0,s.jsx)(n.code,{children:"AzureChatOpenAI"})})," configured according to the component's parameters."]}),"\n",(0,s.jsxs)(n.p,{children:["Use the ",(0,s.jsx)(n.strong,{children:"Language Model"})," output when you want to use an Azure OpenAI model as the LLM for another LLM-driven component, such as an ",(0,s.jsx)(n.strong,{children:"Agent"})," or ",(0,s.jsx)(n.strong,{children:"Smart Function"})," component."]}),"\n",(0,s.jsxs)(n.p,{children:["For more information, see ",(0,s.jsx)(n.a,{href:"/components-models",children:"Language model components"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"azure-openai-parameters",children:"Azure OpenAI parameters"}),"\n",(0,s.jsx)(a.Ay,{}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Model Name"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. Specifies the name of the Azure OpenAI model to be used for text generation."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Azure Endpoint"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. Your Azure endpoint, including the resource."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Deployment Name"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. Specifies the name of the deployment."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"API Version"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. Specifies the version of the Azure OpenAI API to be used."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"API Key"}),(0,s.jsx)(n.td,{children:"SecretString"}),(0,s.jsx)(n.td,{children:"Input parameter. Your Azure OpenAI API key."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Temperature"}),(0,s.jsx)(n.td,{children:"Float"}),(0,s.jsxs)(n.td,{children:["Input parameter. Specifies the sampling temperature. Defaults to ",(0,s.jsx)(n.code,{children:"0.7"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Max Tokens"}),(0,s.jsx)(n.td,{children:"Integer"}),(0,s.jsxs)(n.td,{children:["Input parameter. Specifies the maximum number of tokens to generate. Defaults to ",(0,s.jsx)(n.code,{children:"1000"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Input Value"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. Specifies the input text for text generation."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Stream"}),(0,s.jsx)(n.td,{children:"Boolean"}),(0,s.jsxs)(n.td,{children:["Input parameter. Specifies whether to stream the response from the model. Default to ",(0,s.jsx)(n.code,{children:"false"}),"."]})]})]})]}),"\n",(0,s.jsx)(n.h2,{id:"azure-openai-embeddings",children:"Azure OpenAI Embeddings"}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"Azure OpenAI Embeddings"})," component generates embeddings using Azure OpenAI models."]}),"\n",(0,s.jsxs)(n.p,{children:["For more information about using embedding model components in flows, see ",(0,s.jsx)(n.a,{href:"/components-embedding-models",children:"Embedding model components"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"azure-openai-embeddings-parameters",children:"Azure OpenAI Embeddings parameters"}),"\n",(0,s.jsx)(a.Ay,{}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Model"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsxs)(n.td,{children:["Input parameter. The name of the model to use. Default: ",(0,s.jsx)(n.code,{children:"text-embedding-3-small"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Azure Endpoint"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsxs)(n.td,{children:["Input parameter. Your Azure endpoint, including the resource, such as ",(0,s.jsx)(n.code,{children:"https://example-resource.azure.openai.com/"}),"."]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Deployment Name"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. The name of the deployment."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"API Version"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. The API version to use, with options including various dates."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"API Key"}),(0,s.jsx)(n.td,{children:"String"}),(0,s.jsx)(n.td,{children:"Input parameter. The API key required to access the Azure OpenAI service."})]})]})]})]})}function u(e={}){const{wrapper:n}={...(0,d.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(p,{...e})}):p(e)}},17886:(e,n,r)=>{r.d(n,{A:()=>d});r(96540);var t=r(64058),s=r(74848);function d({name:e,...n}){const r=t[e];return r?(0,s.jsx)(r,{...n}):null}},31929:(e,n,r)=>{r.d(n,{Ay:()=>o,RM:()=>i});var t=r(74848),s=r(28453),d=r(17886);const i=[];function a(e){const n={a:"a",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,t.jsxs)(n.p,{children:["Some parameters are hidden by default in the visual editor.\nYou can modify all parameters through the ",(0,t.jsx)(d.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,t.jsx)(n.strong,{children:"Controls"})," in the ",(0,t.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]})}function o(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(a,{...e})}):a(e)}}}]); \ No newline at end of file diff --git a/assets/js/f2da9399.5a04feb7.js b/assets/js/f2da9399.d3bfb9cb.js similarity index 77% rename from assets/js/f2da9399.5a04feb7.js rename to assets/js/f2da9399.d3bfb9cb.js index cd94f8eec6..77735225cf 100644 --- a/assets/js/f2da9399.5a04feb7.js +++ b/assets/js/f2da9399.d3bfb9cb.js @@ -1 +1 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[2348],{17886:(e,t,s)=>{s.d(t,{A:()=>a});s(96540);var r=s(64058),n=s(74848);function a({name:e,...t}){const s=r[e];return s?(0,n.jsx)(s,{...t}):null}},41618:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>d,contentTitle:()=>i,default:()=>x,frontMatter:()=>c,metadata:()=>r,toc:()=>o});const r=JSON.parse('{"id":"Components/bundles-exa","title":"Exa","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/bundles-exa.mdx","sourceDirName":"Components","slug":"/bundles-exa","permalink":"/bundles-exa","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Exa","slug":"/bundles-exa"},"sidebar":"docs","previous":{"title":"Elastic","permalink":"/bundles-elastic"},"next":{"title":"FAISS","permalink":"/bundles-faiss"}}');var n=s(74848),a=s(28453),l=s(17886);const c={title:"Exa",slug:"/bundles-exa"},i=void 0,d={},o=[{value:"Exa Search",id:"exa-search",level:2},{value:"Exa Search parameters",id:"exa-search-parameters",level:3}];function h(e){const t={a:"a",code:"code",h2:"h2",h3:"h3",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,a.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(t.p,{children:[(0,n.jsx)(l.A,{name:"Blocks","aria-hidden":"true"})," ",(0,n.jsx)(t.a,{href:"/components-bundle-components",children:(0,n.jsx)(t.strong,{children:"Bundles"})})," contain custom components that support specific third-party integrations with Langflow."]}),"\n",(0,n.jsxs)(t.p,{children:["This page describes the components that are available in the ",(0,n.jsx)(t.strong,{children:"Exa"})," bundle."]}),"\n",(0,n.jsx)(t.h2,{id:"exa-search",children:"Exa Search"}),"\n",(0,n.jsxs)(t.p,{children:["This component provides an ",(0,n.jsx)(t.a,{href:"https://exa.ai/",children:"Exa Search"})," toolkit for search and content retrieval by a Langflow ",(0,n.jsxs)(t.a,{href:"/agents",children:[(0,n.jsx)(t.strong,{children:"Agent"})," component"]})," or ",(0,n.jsx)(t.a,{href:"/mcp-client",children:"MCP client"}),"."]}),"\n",(0,n.jsxs)(t.p,{children:["The output is exclusively ",(0,n.jsx)(t.a,{href:"/data-types#tool",children:(0,n.jsx)(t.code,{children:"Tools"})}),"."]}),"\n",(0,n.jsx)(t.h3,{id:"exa-search-parameters",children:"Exa Search parameters"}),"\n",(0,n.jsxs)(t.table,{children:[(0,n.jsx)(t.thead,{children:(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.th,{children:"Name"}),(0,n.jsx)(t.th,{children:"Type"}),(0,n.jsx)(t.th,{children:"Description"})]})}),(0,n.jsxs)(t.tbody,{children:[(0,n.jsxs)(t.tr,{children:[(0,n.jsxs)(t.td,{children:["Exa Search API Key (",(0,n.jsx)(t.code,{children:"metaphor_api_key"}),")"]}),(0,n.jsx)(t.td,{children:"SecretString"}),(0,n.jsx)(t.td,{children:"Input parameter. An API key for Exa Search."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsxs)(t.td,{children:["Use Autoprompt (",(0,n.jsx)(t.code,{children:"use_autoprompt"}),")"]}),(0,n.jsx)(t.td,{children:"Boolean"}),(0,n.jsx)(t.td,{children:"Input parameter. Whether to use the autoprompt feature. Default: true."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsxs)(t.td,{children:["Search Number of Results (",(0,n.jsx)(t.code,{children:"search_num_results"}),")"]}),(0,n.jsx)(t.td,{children:"Integer"}),(0,n.jsx)(t.td,{children:"Input parameter. The number of results to return for search. Default: 5."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsxs)(t.td,{children:["Similar Number of Results (",(0,n.jsx)(t.code,{children:"similar_num_results"}),")"]}),(0,n.jsx)(t.td,{children:"Integer"}),(0,n.jsx)(t.td,{children:"Input parameter. The number of similar results to return. Default: 5."})]})]})]})]})}function x(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(h,{...e})}):h(e)}}}]); \ No newline at end of file +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[2348],{17886:(e,t,s)=>{s.d(t,{A:()=>a});s(96540);var r=s(64058),n=s(74848);function a({name:e,...t}){const s=r[e];return s?(0,n.jsx)(s,{...t}):null}},41618:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>d,contentTitle:()=>i,default:()=>x,frontMatter:()=>c,metadata:()=>r,toc:()=>o});const r=JSON.parse('{"id":"Components/bundles-exa","title":"Exa","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/bundles-exa.mdx","sourceDirName":"Components","slug":"/bundles-exa","permalink":"/bundles-exa","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Exa","slug":"/bundles-exa"},"sidebar":"docs","previous":{"title":"Elastic","permalink":"/bundles-elastic"},"next":{"title":"FAISS","permalink":"/bundles-faiss"}}');var n=s(74848),a=s(28453),l=s(17886);const c={title:"Exa",slug:"/bundles-exa"},i=void 0,d={},o=[{value:"Exa Search",id:"exa-search",level:2},{value:"Exa Search parameters",id:"exa-search-parameters",level:3}];function h(e){const t={a:"a",code:"code",h2:"h2",h3:"h3",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,a.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(t.p,{children:[(0,n.jsx)(l.A,{name:"Blocks","aria-hidden":"true"})," ",(0,n.jsx)(t.a,{href:"/components-bundle-components",children:(0,n.jsx)(t.strong,{children:"Bundles"})})," contain custom components that support specific third-party integrations with Langflow."]}),"\n",(0,n.jsxs)(t.p,{children:["This page describes the components that are available in the ",(0,n.jsx)(t.strong,{children:"Exa"})," bundle."]}),"\n",(0,n.jsx)(t.h2,{id:"exa-search",children:"Exa Search"}),"\n",(0,n.jsxs)(t.p,{children:["This component provides an ",(0,n.jsx)(t.a,{href:"https://exa.ai/",children:"Exa Search"})," toolkit for search and content retrieval by a Langflow ",(0,n.jsxs)(t.a,{href:"/agents",children:[(0,n.jsx)(t.strong,{children:"Agent"})," component"]})," or ",(0,n.jsx)(t.a,{href:"/mcp-client",children:"MCP client"}),"."]}),"\n",(0,n.jsxs)(t.p,{children:["The output is exclusively ",(0,n.jsx)(t.a,{href:"/data-types#tool",children:(0,n.jsx)(t.code,{children:"Tools"})}),"."]}),"\n",(0,n.jsx)(t.h3,{id:"exa-search-parameters",children:"Exa Search parameters"}),"\n",(0,n.jsxs)(t.table,{children:[(0,n.jsx)(t.thead,{children:(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.th,{children:"Name"}),(0,n.jsx)(t.th,{children:"Type"}),(0,n.jsx)(t.th,{children:"Description"})]})}),(0,n.jsxs)(t.tbody,{children:[(0,n.jsxs)(t.tr,{children:[(0,n.jsxs)(t.td,{children:["Exa Search API Key (",(0,n.jsx)(t.code,{children:"metaphor_api_key"}),")"]}),(0,n.jsx)(t.td,{children:"SecretString"}),(0,n.jsx)(t.td,{children:"Input parameter. An API key for Exa Search."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsxs)(t.td,{children:["Use Autoprompt (",(0,n.jsx)(t.code,{children:"use_autoprompt"}),")"]}),(0,n.jsx)(t.td,{children:"Boolean"}),(0,n.jsxs)(t.td,{children:["Input parameter. Whether to use the autoprompt feature. Default: ",(0,n.jsx)(t.code,{children:"true"}),"."]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsxs)(t.td,{children:["Search Number of Results (",(0,n.jsx)(t.code,{children:"search_num_results"}),")"]}),(0,n.jsx)(t.td,{children:"Integer"}),(0,n.jsx)(t.td,{children:"Input parameter. The number of results to return for search. Default: 5."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsxs)(t.td,{children:["Similar Number of Results (",(0,n.jsx)(t.code,{children:"similar_num_results"}),")"]}),(0,n.jsx)(t.td,{children:"Integer"}),(0,n.jsx)(t.td,{children:"Input parameter. The number of similar results to return. Default: 5."})]})]})]})]})}function x(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(h,{...e})}):h(e)}}}]); \ No newline at end of file diff --git a/assets/js/f48363a4.aa9aacfc.js b/assets/js/f48363a4.aa9aacfc.js new file mode 100644 index 0000000000..9ced8d998f --- /dev/null +++ b/assets/js/f48363a4.aa9aacfc.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[7800],{17886:(e,o,n)=>{n.d(o,{A:()=>r});n(96540);var t=n(64058),s=n(74848);function r({name:e,...o}){const n=t[e];return n?(0,s.jsx)(n,{...o}):null}},90050:(e,o,n)=>{n.r(o),n.d(o,{CH:()=>d,assets:()=>h,chCodeConfig:()=>p,contentTitle:()=>a,default:()=>x,frontMatter:()=>l,metadata:()=>t,toc:()=>u});const t=JSON.parse('{"id":"Develop/webhook","title":"Trigger flows with webhooks","description":"You can use the Webhook component to start a flow run in response to an external event.","source":"@site/docs/Develop/webhook.mdx","sourceDirName":"Develop","slug":"/webhook","permalink":"/webhook","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Trigger flows with webhooks","slug":"/webhook"},"sidebar":"docs","previous":{"title":"Trigger flows with the Langflow API","permalink":"/concepts-publish"},"next":{"title":"Test flows","permalink":"/concepts-playground"}}');var s=n(74848),r=n(28453),i=n(24754),c=n(17886);const l={title:"Trigger flows with webhooks",slug:"/webhook"},a=void 0,h={},d={annotations:i.hk,Code:i.Cy},p={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},u=[{value:"Configure the Webhook component",id:"configure-the-webhook-component",level:2},{value:"Trigger flows with Composio webhooks",id:"trigger-flows-with-composio-webhooks",level:2},{value:"Require authentication for webhooks",id:"require-authentication-for-webhooks",level:2},{value:"Troubleshoot flows with Webhook components",id:"troubleshoot-flows-with-webhook-components",level:2},{value:"Validate data received by the Webhook component",id:"validate-data-received-by-the-webhook-component",level:3},{value:"Parser component build failure",id:"parser-component-build-failure",level:3},{value:"See also",id:"see-also",level:2}];function g(e){const o={a:"a",code:"code",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return d||j("CH",!1),d.Code||j("CH.Code",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n","\n",(0,s.jsxs)(o.p,{children:["You can use the ",(0,s.jsx)(o.strong,{children:"Webhook"})," component to start a flow run in response to an external event."]}),"\n",(0,s.jsxs)(o.p,{children:["With the ",(0,s.jsx)(o.strong,{children:"Webhook"})," component, a flow can receive data directly from external sources. Then, the flow can parse the data and pass it to other components in the flow to initiate other actions, such as calling APIs, writing to databases, and chatting with LLMs.\nIf the input isn't valid JSON, the ",(0,s.jsx)(o.strong,{children:"Webhook"})," component wraps it in a ",(0,s.jsx)(o.code,{children:"payload"})," object so that it can be accepted as input to trigger the flow."]}),"\n",(0,s.jsxs)(o.p,{children:["The ",(0,s.jsx)(o.strong,{children:"Webhook"})," component provides a versatile entrypoint that can make your flows more event-driven and integrated with your entire stack of applications and services.\nFor example:"]}),"\n",(0,s.jsxs)(o.ul,{children:["\n",(0,s.jsx)(o.li,{children:"Use an LLM to analyze the sentiment and content of customer feedback or survey responses."}),"\n",(0,s.jsx)(o.li,{children:"Receive notifications from a monitoring system, and then trigger automated responses based on alert type and severity."}),"\n",(0,s.jsx)(o.li,{children:"Integrate with e-commerce platforms to process orders and update inventory."}),"\n"]}),"\n",(0,s.jsx)(o.h2,{id:"configure-the-webhook-component",children:"Configure the Webhook component"}),"\n",(0,s.jsxs)(o.p,{children:["To use the ",(0,s.jsx)(o.strong,{children:"Webhook"})," component in a flow, do the following:"]}),"\n",(0,s.jsxs)(o.ol,{children:["\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["In Langflow, open the flow where you want to use the ",(0,s.jsx)(o.strong,{children:"Webhook"})," component."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Add a ",(0,s.jsxs)(o.a,{href:"/components-data#webhook",children:[(0,s.jsx)(o.strong,{children:"Webhook"})," component"]})," and a ",(0,s.jsxs)(o.a,{href:"/components-processing#parser",children:[(0,s.jsx)(o.strong,{children:"Parser"})," component"]})," to your flow."]}),"\n",(0,s.jsxs)(o.p,{children:["These two components are commonly paired together because the ",(0,s.jsx)(o.strong,{children:"Parser"})," component extracts relevant data from the raw payload received by the ",(0,s.jsx)(o.strong,{children:"Webhook"})," component."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Connect the ",(0,s.jsx)(o.strong,{children:"Webhook"})," component's ",(0,s.jsx)(o.strong,{children:"Data"})," output to the ",(0,s.jsx)(o.strong,{children:"Parser"})," component's ",(0,s.jsx)(o.strong,{children:"Data"})," input."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["In the ",(0,s.jsx)(o.strong,{children:"Parser"})," component's ",(0,s.jsx)(o.strong,{children:"Template"})," field, enter a template to parse the raw payload into structured text."]}),"\n",(0,s.jsxs)(o.p,{children:["In the template, use variables for payload keys in the same way you would define variables in a ",(0,s.jsxs)(o.a,{href:"/components-prompts",children:[(0,s.jsx)(o.strong,{children:"Prompt Template"})," component"]}),"."]}),"\n",(0,s.jsxs)(o.p,{children:["For example, assume that you expect your ",(0,s.jsx)(o.strong,{children:"Webhook"})," component to receive the following JSON data:"]}),"\n",(0,s.jsx)(d.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"{",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "id"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'""',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "name"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'""',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "email"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'""',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]}],lang:"json"},annotations:[]}]}),"\n",(0,s.jsxs)(o.p,{children:["Then, you can ",(0,s.jsx)(o.a,{href:"/components-prompts#define-variables-in-prompts",children:"use curly braces"})," to reference the JSON keys anywhere in your parser template:"]}),"\n",(0,s.jsx)(d.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"ID: {id} - Name: {name} - Email: {email}",props:{}}]}],lang:"text"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Connect the ",(0,s.jsx)(o.strong,{children:"Parser"})," component's ",(0,s.jsx)(o.strong,{children:"Parsed Text"})," output to the next logical component in your flow, such as a ",(0,s.jsx)(o.strong,{children:"Chat Input"})," component."]}),"\n",(0,s.jsxs)(o.p,{children:["If you want to test only the ",(0,s.jsx)(o.strong,{children:"Webhook"})," and ",(0,s.jsx)(o.strong,{children:"Parser"})," components, you can connect the ",(0,s.jsx)(o.strong,{children:"Parsed Text"})," output directly to a ",(0,s.jsx)(o.strong,{children:"Chat Output"})," component's ",(0,s.jsx)(o.strong,{children:"Text"})," input. Then, you can see the parsed data in the ",(0,s.jsx)(o.strong,{children:"Playground"})," after you run the flow."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["From the ",(0,s.jsx)(o.strong,{children:"Webhook"})," component's ",(0,s.jsx)(o.strong,{children:"Endpoint"})," field, copy the API endpoint that you will use to send data to the ",(0,s.jsx)(o.strong,{children:"Webhook"})," component and trigger the flow."]}),"\n",(0,s.jsxs)(o.p,{children:["Alternatively, to get a complete ",(0,s.jsx)(o.code,{children:"POST /v1/webhook/$FLOW_ID"})," code snippet, open the flow's ",(0,s.jsxs)(o.a,{href:"/concepts-publish#api-access",children:[(0,s.jsx)(o.strong,{children:"API access"})," pane"]}),", and then click the ",(0,s.jsx)(o.strong,{children:"Webhook curl"})," tab.\nYou can also modify the default curl command in the ",(0,s.jsx)(o.strong,{children:"Webhook"})," component's ",(0,s.jsx)(o.strong,{children:"curl"})," field.\nIf this field isn't visible by default, click the ",(0,s.jsx)(o.strong,{children:"Webhook"})," component, and then click ",(0,s.jsx)(c.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,s.jsx)(o.strong,{children:"Controls"})," in the ",(0,s.jsx)(o.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Send a POST request with ",(0,s.jsx)(o.code,{children:"data"})," to the flow's ",(0,s.jsx)(o.code,{children:"webhook"})," endpoint to trigger the flow."]}),"\n",(0,s.jsxs)(o.p,{children:["The following example sends a payload containing ",(0,s.jsx)(o.code,{children:"id"}),", ",(0,s.jsx)(o.code,{children:"name"}),", and ",(0,s.jsx)(o.code,{children:"email"})," strings:"]}),"\n",(0,s.jsx)(d.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:'POST "http://localhost:7860/api/v1/webhook/FLOW_ID" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"Content-Type: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"x-api-key: LANGFLOW_API_KEY" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -d ",props:{style:{color:"#79C0FF"}}},{content:'\'{"id": "12345", "name": "alex", "email": "alex@email.com"}\'',props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,s.jsx)(o.p,{children:"A successful response indicates that Langflow started the flow.\nThe response doesn't include the output for the entire flow, only an indication that the flow started."}),"\n",(0,s.jsx)(d.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"{",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "message"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"Task started in the background"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "status"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"in progress"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]}],lang:"json"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["To view the flow's most recent parsed payload, click the ",(0,s.jsx)(o.strong,{children:"Parser"})," component, and then click ",(0,s.jsx)(c.A,{name:"TextSearch","aria-hidden":"true"})," ",(0,s.jsx)(o.strong,{children:"Inspect output"}),".\nFor the preceding example, the parsed payload would be a string like ",(0,s.jsx)(o.code,{children:"ID: 12345 - Name: alex - Email: alex@email.com"}),"."]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(o.h2,{id:"trigger-flows-with-composio-webhooks",children:"Trigger flows with Composio webhooks"}),"\n",(0,s.jsxs)(o.p,{children:["Typically, you won't manually trigger the ",(0,s.jsx)(o.strong,{children:"Webhook"})," component.\nTo learn about triggering flows with payloads from external applications, see the video tutorial ",(0,s.jsx)(o.a,{href:"https://www.youtube.com/watch?v=IC1CAtzFRE0",children:"How to Use Webhooks in Langflow"}),"."]}),"\n",(0,s.jsx)(o.h2,{id:"require-authentication-for-webhooks",children:"Require authentication for webhooks"}),"\n",(0,s.jsxs)(o.p,{children:["By default, webhooks run as the flow owner without authentication (",(0,s.jsx)(o.code,{children:"LANGFLOW_WEBHOOK_AUTH_ENABLE=False"}),").\nIf you want to require API key authentication for webhooks, set ",(0,s.jsx)(o.code,{children:"LANGFLOW_WEBHOOK_AUTH_ENABLE=True"}),"."]}),"\n",(0,s.jsx)(o.h2,{id:"troubleshoot-flows-with-webhook-components",children:"Troubleshoot flows with Webhook components"}),"\n",(0,s.jsxs)(o.p,{children:["Use the following information to help address common issues that can occur with the ",(0,s.jsx)(o.strong,{children:"Webhook"})," component."]}),"\n",(0,s.jsx)(o.h3,{id:"validate-data-received-by-the-webhook-component",children:"Validate data received by the Webhook component"}),"\n",(0,s.jsxs)(o.p,{children:["To troubleshoot a flow with a ",(0,s.jsx)(o.strong,{children:"Webhook"})," component and verify that the component is receiving data, you can create a small flow that outputs only the parsed payload:"]}),"\n",(0,s.jsxs)(o.ol,{children:["\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Create a flow with ",(0,s.jsx)(o.strong,{children:"Webhook"}),", ",(0,s.jsx)(o.strong,{children:"Parser"}),", and ",(0,s.jsx)(o.strong,{children:"Chat Output"})," components."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Connect the ",(0,s.jsx)(o.strong,{children:"Webhook"})," component's ",(0,s.jsx)(o.strong,{children:"Data"})," output to the ",(0,s.jsx)(o.strong,{children:"Parser"})," component's ",(0,s.jsx)(o.strong,{children:"Data"})," input."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Connect the ",(0,s.jsx)(o.strong,{children:"Parser"})," component's ",(0,s.jsx)(o.strong,{children:"Parsed Text"})," output to the ",(0,s.jsx)(o.strong,{children:"Chat Output"})," component's ",(0,s.jsx)(o.strong,{children:"Text"})," input."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Edit the ",(0,s.jsx)(o.strong,{children:"Parser"})," component to set ",(0,s.jsx)(o.strong,{children:"Mode"})," to ",(0,s.jsx)(o.strong,{children:"Stringify"}),"."]}),"\n",(0,s.jsxs)(o.p,{children:["This mode passes the data received by the ",(0,s.jsx)(o.strong,{children:"Webhook"})," component as a string that is printed by the ",(0,s.jsx)(o.strong,{children:"Chat Output"})," component."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Click ",(0,s.jsx)(o.strong,{children:"Share"}),", select ",(0,s.jsx)(o.strong,{children:"API access"}),", and then copy the ",(0,s.jsx)(o.strong,{children:"Webhook curl"})," code snippet."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Optional: Edit the ",(0,s.jsx)(o.code,{children:"data"})," in the code snippet if you want to pass a different payload."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsx)(o.p,{children:"Send the POST request to trigger the flow."}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Click ",(0,s.jsx)(o.strong,{children:"Playground"})," to verify that the ",(0,s.jsx)(o.strong,{children:"Chat Output"})," component printed the JSON data from your POST request."]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(o.h3,{id:"parser-component-build-failure",children:"Parser component build failure"}),"\n",(0,s.jsxs)(o.p,{children:["The ",(0,s.jsx)(o.strong,{children:"Parser"})," component can fail to build if it doesn't receive data from the ",(0,s.jsx)(o.strong,{children:"Webhook"})," component or if there is a problem with the incoming data."]}),"\n",(0,s.jsxs)(o.p,{children:["If this occurs, try changing the ",(0,s.jsx)(o.strong,{children:"Parser"})," component's ",(0,s.jsx)(o.strong,{children:"Mode"})," to ",(0,s.jsx)(o.strong,{children:"Stringify"})," so that the component outputs the parsed payload as a single string.\nThen, you can examine the string output and troubleshoot your parsing template, or work with the parsed data in string form."]}),"\n",(0,s.jsx)(o.h2,{id:"see-also",children:"See also"}),"\n",(0,s.jsxs)(o.ul,{children:["\n",(0,s.jsx)(o.li,{children:(0,s.jsx)(o.a,{href:"/api-reference-api-examples",children:"Get started with the Langflow API"})}),"\n",(0,s.jsx)(o.li,{children:(0,s.jsxs)(o.a,{href:"/components-data#webhook",children:[(0,s.jsx)(o.strong,{children:"Webhook"})," component"]})}),"\n",(0,s.jsx)(o.li,{children:(0,s.jsx)(o.a,{href:"/api-flows-run",children:"Flow trigger endpoints"})}),"\n"]})]})}function x(e={}){const{wrapper:o}={...(0,r.R)(),...e.components};return o?(0,s.jsx)(o,{...e,children:(0,s.jsx)(g,{...e})}):g(e)}function j(e,o){throw new Error("Expected "+(o?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}}}]); \ No newline at end of file diff --git a/assets/js/f48363a4.ed085107.js b/assets/js/f48363a4.ed085107.js deleted file mode 100644 index c0c2ef66e7..0000000000 --- a/assets/js/f48363a4.ed085107.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[7800],{17886:(e,o,n)=>{n.d(o,{A:()=>r});n(96540);var t=n(64058),s=n(74848);function r({name:e,...o}){const n=t[e];return n?(0,s.jsx)(n,{...o}):null}},90050:(e,o,n)=>{n.r(o),n.d(o,{CH:()=>d,assets:()=>h,chCodeConfig:()=>p,contentTitle:()=>a,default:()=>x,frontMatter:()=>l,metadata:()=>t,toc:()=>u});const t=JSON.parse('{"id":"Develop/webhook","title":"Trigger flows with webhooks","description":"You can use the Webhook component to start a flow run in response to an external event.","source":"@site/docs/Develop/webhook.mdx","sourceDirName":"Develop","slug":"/webhook","permalink":"/webhook","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Trigger flows with webhooks","slug":"/webhook"},"sidebar":"docs","previous":{"title":"Trigger flows with the Langflow API","permalink":"/concepts-publish"},"next":{"title":"Test flows","permalink":"/concepts-playground"}}');var s=n(74848),r=n(28453),i=n(24754),c=n(17886);const l={title:"Trigger flows with webhooks",slug:"/webhook"},a=void 0,h={},d={annotations:i.hk,Code:i.Cy},p={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},u=[{value:"Configure the Webhook component",id:"configure-the-webhook-component",level:2},{value:"Trigger flows with Composio webhooks",id:"trigger-flows-with-composio-webhooks",level:2},{value:"Require authentication for webhooks",id:"require-authentication-for-webhooks",level:2},{value:"Troubleshoot flows with Webhook components",id:"troubleshoot-flows-with-webhook-components",level:2},{value:"Validate data received by the Webhook component",id:"validate-data-received-by-the-webhook-component",level:3},{value:"Parser component build failure",id:"parser-component-build-failure",level:3},{value:"See also",id:"see-also",level:2}];function g(e){const o={a:"a",code:"code",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return d||j("CH",!1),d.Code||j("CH.Code",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n","\n",(0,s.jsxs)(o.p,{children:["You can use the ",(0,s.jsx)(o.strong,{children:"Webhook"})," component to start a flow run in response to an external event."]}),"\n",(0,s.jsxs)(o.p,{children:["With the ",(0,s.jsx)(o.strong,{children:"Webhook"})," component, a flow can receive data directly from external sources. Then, the flow can parse the data and pass it to other components in the flow to initiate other actions, such as calling APIs, writing to databases, and chatting with LLMs.\nIf the input isn't valid JSON, the ",(0,s.jsx)(o.strong,{children:"Webhook"})," component wraps it in a ",(0,s.jsx)(o.code,{children:"payload"})," object so that it can be accepted as input to trigger the flow."]}),"\n",(0,s.jsxs)(o.p,{children:["The ",(0,s.jsx)(o.strong,{children:"Webhook"})," component provides a versatile entrypoint that can make your flows more event-driven and integrated with your entire stack of applications and services.\nFor example:"]}),"\n",(0,s.jsxs)(o.ul,{children:["\n",(0,s.jsx)(o.li,{children:"Use an LLM to analyze the sentiment and content of customer feedback or survey responses."}),"\n",(0,s.jsx)(o.li,{children:"Receive notifications from a monitoring system, and then trigger automated responses based on alert type and severity."}),"\n",(0,s.jsx)(o.li,{children:"Integrate with e-commerce platforms to process orders and update inventory."}),"\n"]}),"\n",(0,s.jsx)(o.h2,{id:"configure-the-webhook-component",children:"Configure the Webhook component"}),"\n",(0,s.jsxs)(o.p,{children:["To use the ",(0,s.jsx)(o.strong,{children:"Webhook"})," component in a flow, do the following:"]}),"\n",(0,s.jsxs)(o.ol,{children:["\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["In Langflow, open the flow where you want to use the ",(0,s.jsx)(o.strong,{children:"Webhook"})," component."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Add a ",(0,s.jsxs)(o.a,{href:"/components-data#webhook",children:[(0,s.jsx)(o.strong,{children:"Webhook"})," component"]})," and a ",(0,s.jsxs)(o.a,{href:"/components-processing#parser",children:[(0,s.jsx)(o.strong,{children:"Parser"})," component"]})," to your flow."]}),"\n",(0,s.jsxs)(o.p,{children:["These two components are commonly paired together because the ",(0,s.jsx)(o.strong,{children:"Parser"})," component extracts relevant data from the raw payload received by the ",(0,s.jsx)(o.strong,{children:"Webhook"})," component."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Connect the ",(0,s.jsx)(o.strong,{children:"Webhook"})," component's ",(0,s.jsx)(o.strong,{children:"Data"})," output to the ",(0,s.jsx)(o.strong,{children:"Parser"})," component's ",(0,s.jsx)(o.strong,{children:"Data"})," input."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["In the ",(0,s.jsx)(o.strong,{children:"Parser"})," component's ",(0,s.jsx)(o.strong,{children:"Template"})," field, enter a template to parse the raw payload into structured text."]}),"\n",(0,s.jsxs)(o.p,{children:["In the template, use variables for payload keys in the same way you would define variables in a ",(0,s.jsxs)(o.a,{href:"/components-prompts",children:[(0,s.jsx)(o.strong,{children:"Prompt Template"})," component"]}),"."]}),"\n",(0,s.jsxs)(o.p,{children:["For example, assume that you expect your ",(0,s.jsx)(o.strong,{children:"Webhook"})," component to receive the following JSON data:"]}),"\n",(0,s.jsx)(d.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"{",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "id"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'""',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "name"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'""',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "email"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'""',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]}],lang:"json"},annotations:[]}]}),"\n",(0,s.jsx)(o.p,{children:"Then, you can use curly braces to reference the JSON keys anywhere in your parser template:"}),"\n",(0,s.jsx)(d.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"ID: {id} - Name: {name} - Email: {email}",props:{}}]}],lang:"text"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Connect the ",(0,s.jsx)(o.strong,{children:"Parser"})," component's ",(0,s.jsx)(o.strong,{children:"Parsed Text"})," output to the next logical component in your flow, such as a ",(0,s.jsx)(o.strong,{children:"Chat Input"})," component."]}),"\n",(0,s.jsxs)(o.p,{children:["If you want to test only the ",(0,s.jsx)(o.strong,{children:"Webhook"})," and ",(0,s.jsx)(o.strong,{children:"Parser"})," components, you can connect the ",(0,s.jsx)(o.strong,{children:"Parsed Text"})," output directly to a ",(0,s.jsx)(o.strong,{children:"Chat Output"})," component's ",(0,s.jsx)(o.strong,{children:"Text"})," input. Then, you can see the parsed data in the ",(0,s.jsx)(o.strong,{children:"Playground"})," after you run the flow."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["From the ",(0,s.jsx)(o.strong,{children:"Webhook"})," component's ",(0,s.jsx)(o.strong,{children:"Endpoint"})," field, copy the API endpoint that you will use to send data to the ",(0,s.jsx)(o.strong,{children:"Webhook"})," component and trigger the flow."]}),"\n",(0,s.jsxs)(o.p,{children:["Alternatively, to get a complete ",(0,s.jsx)(o.code,{children:"POST /v1/webhook/$FLOW_ID"})," code snippet, open the flow's ",(0,s.jsxs)(o.a,{href:"/concepts-publish#api-access",children:[(0,s.jsx)(o.strong,{children:"API access"})," pane"]}),", and then click the ",(0,s.jsx)(o.strong,{children:"Webhook curl"})," tab.\nYou can also modify the default curl command in the ",(0,s.jsx)(o.strong,{children:"Webhook"})," component's ",(0,s.jsx)(o.strong,{children:"curl"})," field.\nIf this field isn't visible by default, click the ",(0,s.jsx)(o.strong,{children:"Webhook"})," component, and then click ",(0,s.jsx)(c.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,s.jsx)(o.strong,{children:"Controls"})," in the ",(0,s.jsx)(o.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Send a POST request with ",(0,s.jsx)(o.code,{children:"data"})," to the flow's ",(0,s.jsx)(o.code,{children:"webhook"})," endpoint to trigger the flow."]}),"\n",(0,s.jsxs)(o.p,{children:["The following example sends a payload containing ",(0,s.jsx)(o.code,{children:"id"}),", ",(0,s.jsx)(o.code,{children:"name"}),", and ",(0,s.jsx)(o.code,{children:"email"})," strings:"]}),"\n",(0,s.jsx)(d.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"curl ",props:{style:{color:"#FFA657"}}},{content:"-X ",props:{style:{color:"#79C0FF"}}},{content:'POST "http://localhost:7860/api/v1/webhook/FLOW_ID" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"Content-Type: application/json" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -H ",props:{style:{color:"#79C0FF"}}},{content:'"x-api-key: LANGFLOW_API_KEY" ',props:{style:{color:"#A5D6FF"}}},{content:"\\",props:{style:{color:"#79C0FF"}}}]},{tokens:[{content:" -d ",props:{style:{color:"#79C0FF"}}},{content:'\'{"id": "12345", "name": "alex", "email": "alex@email.com"}\'',props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,s.jsx)(o.p,{children:"A successful response indicates that Langflow started the flow.\nThe response doesn't include the output for the entire flow, only an indication that the flow started."}),"\n",(0,s.jsx)(d.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"{",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "message"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"Task started in the background"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "status"',props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:'"in progress"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"}",props:{style:{color:"#C9D1D9"}}}]}],lang:"json"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["To view the flow's most recent parsed payload, click the ",(0,s.jsx)(o.strong,{children:"Parser"})," component, and then click ",(0,s.jsx)(c.A,{name:"TextSearch","aria-hidden":"true"})," ",(0,s.jsx)(o.strong,{children:"Inspect output"}),".\nFor the preceding example, the parsed payload would be a string like ",(0,s.jsx)(o.code,{children:"ID: 12345 - Name: alex - Email: alex@email.com"}),"."]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(o.h2,{id:"trigger-flows-with-composio-webhooks",children:"Trigger flows with Composio webhooks"}),"\n",(0,s.jsxs)(o.p,{children:["Typically, you won't manually trigger the ",(0,s.jsx)(o.strong,{children:"Webhook"})," component.\nTo learn about triggering flows with payloads from external applications, see the video tutorial ",(0,s.jsx)(o.a,{href:"https://www.youtube.com/watch?v=IC1CAtzFRE0",children:"How to Use Webhooks in Langflow"}),"."]}),"\n",(0,s.jsx)(o.h2,{id:"require-authentication-for-webhooks",children:"Require authentication for webhooks"}),"\n",(0,s.jsxs)(o.p,{children:["By default, webhooks run as the flow owner without authentication (",(0,s.jsx)(o.code,{children:"LANGFLOW_WEBHOOK_AUTH_ENABLE=False"}),").\nIf you want to require API key authentication for webhooks, set ",(0,s.jsx)(o.code,{children:"LANGFLOW_WEBHOOK_AUTH_ENABLE=True"}),"."]}),"\n",(0,s.jsx)(o.h2,{id:"troubleshoot-flows-with-webhook-components",children:"Troubleshoot flows with Webhook components"}),"\n",(0,s.jsxs)(o.p,{children:["Use the following information to help address common issues that can occur with the ",(0,s.jsx)(o.strong,{children:"Webhook"})," component."]}),"\n",(0,s.jsx)(o.h3,{id:"validate-data-received-by-the-webhook-component",children:"Validate data received by the Webhook component"}),"\n",(0,s.jsxs)(o.p,{children:["To troubleshoot a flow with a ",(0,s.jsx)(o.strong,{children:"Webhook"})," component and verify that the component is receiving data, you can create a small flow that outputs only the parsed payload:"]}),"\n",(0,s.jsxs)(o.ol,{children:["\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Create a flow with ",(0,s.jsx)(o.strong,{children:"Webhook"}),", ",(0,s.jsx)(o.strong,{children:"Parser"}),", and ",(0,s.jsx)(o.strong,{children:"Chat Output"})," components."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Connect the ",(0,s.jsx)(o.strong,{children:"Webhook"})," component's ",(0,s.jsx)(o.strong,{children:"Data"})," output to the ",(0,s.jsx)(o.strong,{children:"Parser"})," component's ",(0,s.jsx)(o.strong,{children:"Data"})," input."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Connect the ",(0,s.jsx)(o.strong,{children:"Parser"})," component's ",(0,s.jsx)(o.strong,{children:"Parsed Text"})," output to the ",(0,s.jsx)(o.strong,{children:"Chat Output"})," component's ",(0,s.jsx)(o.strong,{children:"Text"})," input."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Edit the ",(0,s.jsx)(o.strong,{children:"Parser"})," component to set ",(0,s.jsx)(o.strong,{children:"Mode"})," to ",(0,s.jsx)(o.strong,{children:"Stringify"}),"."]}),"\n",(0,s.jsxs)(o.p,{children:["This mode passes the data received by the ",(0,s.jsx)(o.strong,{children:"Webhook"})," component as a string that is printed by the ",(0,s.jsx)(o.strong,{children:"Chat Output"})," component."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Click ",(0,s.jsx)(o.strong,{children:"Share"}),", select ",(0,s.jsx)(o.strong,{children:"API access"}),", and then copy the ",(0,s.jsx)(o.strong,{children:"Webhook curl"})," code snippet."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Optional: Edit the ",(0,s.jsx)(o.code,{children:"data"})," in the code snippet if you want to pass a different payload."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsx)(o.p,{children:"Send the POST request to trigger the flow."}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Click ",(0,s.jsx)(o.strong,{children:"Playground"})," to verify that the ",(0,s.jsx)(o.strong,{children:"Chat Output"})," component printed the JSON data from your POST request."]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(o.h3,{id:"parser-component-build-failure",children:"Parser component build failure"}),"\n",(0,s.jsxs)(o.p,{children:["The ",(0,s.jsx)(o.strong,{children:"Parser"})," component can fail to build if it doesn't receive data from the ",(0,s.jsx)(o.strong,{children:"Webhook"})," component or if there is a problem with the incoming data."]}),"\n",(0,s.jsxs)(o.p,{children:["If this occurs, try changing the ",(0,s.jsx)(o.strong,{children:"Parser"})," component's ",(0,s.jsx)(o.strong,{children:"Mode"})," to ",(0,s.jsx)(o.strong,{children:"Stringify"})," so that the component outputs the parsed payload as a single string.\nThen, you can examine the string output and troubleshoot your parsing template, or work with the parsed data in string form."]}),"\n",(0,s.jsx)(o.h2,{id:"see-also",children:"See also"}),"\n",(0,s.jsxs)(o.ul,{children:["\n",(0,s.jsx)(o.li,{children:(0,s.jsx)(o.a,{href:"/api-reference-api-examples",children:"Get started with the Langflow API"})}),"\n",(0,s.jsx)(o.li,{children:(0,s.jsxs)(o.a,{href:"/components-data#webhook",children:[(0,s.jsx)(o.strong,{children:"Webhook"})," component"]})}),"\n",(0,s.jsx)(o.li,{children:(0,s.jsx)(o.a,{href:"/api-flows-run",children:"Flow trigger endpoints"})}),"\n"]})]})}function x(e={}){const{wrapper:o}={...(0,r.R)(),...e.components};return o?(0,s.jsx)(o,{...e,children:(0,s.jsx)(g,{...e})}):g(e)}function j(e,o){throw new Error("Expected "+(o?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}}}]); \ No newline at end of file diff --git a/assets/js/main.90f3e6c7.js b/assets/js/main.35384374.js similarity index 99% rename from assets/js/main.90f3e6c7.js rename to assets/js/main.35384374.js index 5d68fd8cb7..07646ed8ce 100644 --- a/assets/js/main.90f3e6c7.js +++ b/assets/js/main.35384374.js @@ -1,2 +1,2 @@ -/*! For license information please see main.90f3e6c7.js.LICENSE.txt */ -(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[8792],{205:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(96540);const o=n(38193).A.canUseDOM?r.useLayoutEffect:r.useEffect},641:(e,t,n)=>{"use strict";n.r(t)},1093:e=>{"use strict";var t=Object.prototype.toString;e.exports=function(e){var n=t.call(e),r="[object Arguments]"===n;return r||(r="[object Array]"!==n&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===t.call(e.callee)),r}},1189:(e,t,n)=>{"use strict";var r=Array.prototype.slice,o=n(1093),a=Object.keys,i=a?function(e){return a(e)}:n(28875),s=Object.keys;i.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return o(e)?s(r.call(e)):s(e)})}else Object.keys=i;return Object.keys||i},e.exports=i},2694:(e,t,n)=>{"use strict";var r=n(6925);function o(){}function a(){}a.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,a,i){if(i!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:o};return n.PropTypes=n,n}},2833:e=>{e.exports=function(e,t,n,r){var o=n?n.call(r,e,t):void 0;if(void 0!==o)return!!o;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var a=Object.keys(e),i=Object.keys(t);if(a.length!==i.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(t),l=0;l{"use strict";n.d(t,{C:()=>r});const r="default"},3918:(e,t,n)=>{"use strict";var r=n(65606);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function a(e){for(var t=1;te.length)&&(n=e.length),e.substring(n-t.length,n)===t}var w="",x="",k="",S="",_={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function E(e){var t=Object.keys(e),n=Object.create(Object.getPrototypeOf(e));return t.forEach(function(t){n[t]=e[t]}),Object.defineProperty(n,"message",{value:e.message}),n}function j(e){return b(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function O(e,t,n){var o="",a="",i=0,s="",l=!1,c=j(e),u=c.split("\n"),d=j(t).split("\n"),p=0,f="";if("strictEqual"===n&&"object"===g(e)&&"object"===g(t)&&null!==e&&null!==t&&(n="strictEqualObject"),1===u.length&&1===d.length&&u[0]!==d[0]){var m=u[0].length+d[0].length;if(m<=10){if(!("object"===g(e)&&null!==e||"object"===g(t)&&null!==t||0===e&&0===t))return"".concat(_[n],"\n\n")+"".concat(u[0]," !== ").concat(d[0],"\n")}else if("strictEqualObject"!==n){if(m<(r.stderr&&r.stderr.isTTY?r.stderr.columns:80)){for(;u[0][p]===d[0][p];)p++;p>2&&(f="\n ".concat(function(e,t){if(t=Math.floor(t),0==e.length||0==t)return"";var n=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+e.substring(0,n-e.length)}(" ",p),"^"),p=0)}}}for(var h=u[u.length-1],b=d[d.length-1];h===b&&(p++<2?s="\n ".concat(h).concat(s):o=h,u.pop(),d.pop(),0!==u.length&&0!==d.length);)h=u[u.length-1],b=d[d.length-1];var y=Math.max(u.length,d.length);if(0===y){var E=c.split("\n");if(E.length>30)for(E[26]="".concat(w,"...").concat(S);E.length>27;)E.pop();return"".concat(_.notIdentical,"\n\n").concat(E.join("\n"),"\n")}p>3&&(s="\n".concat(w,"...").concat(S).concat(s),l=!0),""!==o&&(s="\n ".concat(o).concat(s),o="");var O=0,A=_[n]+"\n".concat(x,"+ actual").concat(S," ").concat(k,"- expected").concat(S),C=" ".concat(w,"...").concat(S," Lines skipped");for(p=0;p1&&p>2&&(P>4?(a+="\n".concat(w,"...").concat(S),l=!0):P>3&&(a+="\n ".concat(d[p-2]),O++),a+="\n ".concat(d[p-1]),O++),i=p,o+="\n".concat(k,"-").concat(S," ").concat(d[p]),O++;else if(d.length1&&p>2&&(P>4?(a+="\n".concat(w,"...").concat(S),l=!0):P>3&&(a+="\n ".concat(u[p-2]),O++),a+="\n ".concat(u[p-1]),O++),i=p,a+="\n".concat(x,"+").concat(S," ").concat(u[p]),O++;else{var T=d[p],I=u[p],R=I!==T&&(!v(I,",")||I.slice(0,-1)!==T);R&&v(T,",")&&T.slice(0,-1)===I&&(R=!1,I+=","),R?(P>1&&p>2&&(P>4?(a+="\n".concat(w,"...").concat(S),l=!0):P>3&&(a+="\n ".concat(u[p-2]),O++),a+="\n ".concat(u[p-1]),O++),i=p,a+="\n".concat(x,"+").concat(S," ").concat(I),o+="\n".concat(k,"-").concat(S," ").concat(T),O+=2):(a+=o,o="",1!==P&&0!==p||(a+="\n ".concat(I),O++))}if(O>20&&p30)for(f[26]="".concat(w,"...").concat(S);f.length>27;)f.pop();t=1===f.length?p.call(this,"".concat(d," ").concat(f[0])):p.call(this,"".concat(d,"\n\n").concat(f.join("\n"),"\n"))}else{var m=j(i),h="",b=_[o];"notDeepEqual"===o||"notEqual"===o?(m="".concat(_[o],"\n\n").concat(m)).length>1024&&(m="".concat(m.slice(0,1021),"...")):(h="".concat(j(s)),m.length>512&&(m="".concat(m.slice(0,509),"...")),h.length>512&&(h="".concat(h.slice(0,509),"...")),"deepEqual"===o||"equal"===o?m="".concat(b,"\n\n").concat(m,"\n\nshould equal\n\n"):h=" ".concat(o," ").concat(h)),t=p.call(this,"".concat(m).concat(h))}return Error.stackTraceLimit=l,t.generatedMessage=!n,Object.defineProperty(u(t),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),t.code="ERR_ASSERTION",t.actual=i,t.expected=s,t.operator=o,Error.captureStackTrace&&Error.captureStackTrace(u(t),a),t.stack,t.name="AssertionError",c(t)}return i=v,(l=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:t,value:function(e,t){return b(this,a(a({},t),{},{customInspect:!1,depth:0}))}}])&&s(i.prototype,l),d&&s(i,d),Object.defineProperty(i,"prototype",{writable:!1}),v}(d(Error),b.custom);e.exports=A},4146:(e,t,n)=>{"use strict";var r=n(44363),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return r.isMemo(e)?i:s[e.$$typeof]||o}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=i;var c=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,m=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(m){var o=f(n);o&&o!==m&&e(t,o,r)}var i=u(n);d&&(i=i.concat(d(n)));for(var s=l(t),h=l(n),g=0;g{"use strict";n.d(t,{A:()=>r});const r={title:"Langflow Documentation",tagline:"Langflow is a low-code app builder for RAG and multi-agent AI applications.",favicon:"img/favicon.ico",url:"https://docs.langflow.org",baseUrl:"/",onBrokenLinks:"throw",onBrokenMarkdownLinks:"warn",onBrokenAnchors:"warn",organizationName:"langflow-ai",projectName:"langflow",trailingSlash:!1,staticDirectories:["static"],i18n:{defaultLocale:"en",locales:["en"],path:"i18n",localeConfigs:{}},headTags:[{tagName:"link",attributes:{rel:"stylesheet",href:"https://fonts.googleapis.com/css2?family=Sora:wght@550;600&display=swap"}},{tagName:"script",attributes:{},innerHTML:'!function(){window.semaphore=window.semaphore||[],window.ketch=function(){window.semaphore.push(arguments)};var e=document.createElement("script");e.type="text/javascript",e.src="https://global.ketchcdn.com/web/v3/config/datastax/langflow_org_web/boot.js",e.defer=e.async=!0,document.getElementsByTagName("head")[0].appendChild(e)}();'},{tagName:"script",attributes:{defer:"true"},innerHTML:"\n ;(function () {\n const onKetchConsentGtagTrack = (consent) => {\n if (window.gtag &&\n consent.purposes &&\n 'analytics' in consent.purposes &&\n 'targeted_advertising' in consent.purposes\n ) {\n const analyticsString = consent.purposes.analytics === true ? 'granted' : 'denied'\n const targetedAdsString = consent.purposes.targeted_advertising === true ? 'granted' : 'denied'\n const gtagObject = {\n analytics_storage: analyticsString,\n ad_personalization: targetedAdsString,\n ad_storage: targetedAdsString,\n ad_user_data: targetedAdsString,\n }\n window.gtag('consent', 'update', gtagObject)\n }\n }\n if (window.ketch) {\n window.ketch('on', 'consent', onKetchConsentGtagTrack)\n }\n })()\n "}],presets:[["docusaurus-preset-openapi",{api:{path:"openapi.json",routeBasePath:"/api"},docs:{routeBasePath:"/",sidebarPath:"/home/runner/work/langflow/langflow/docs/sidebars.js",sidebarCollapsed:!0,beforeDefaultRemarkPlugins:[[null,{theme:"github-dark",showCopyButton:!0,lineNumbers:!0}]]},sitemap:{lastmod:"datetime",changefreq:null,priority:null,ignorePatterns:["/preferences"]},gtag:{trackingID:"G-SLQFLQ3KPT"},blog:!1,theme:{customCss:["/home/runner/work/langflow/langflow/docs/node_modules/@code-hike/mdx/dist/index.css","/home/runner/work/langflow/langflow/docs/css/custom.css","/home/runner/work/langflow/langflow/docs/css/docu-notion-styles.css","/home/runner/work/langflow/langflow/docs/css/gifplayer.css"]}}]],plugins:[["docusaurus-node-polyfills",{excludeAliases:["console"]}],"docusaurus-plugin-image-zoom",["./src/plugins/segment",{segmentPublicWriteKey:"60AfGDrVxy8nAGJngo3fCYWG4LvhMAlG",allowedInDev:!0}],["./src/plugins/scroll-tracking",{segmentPublicWriteKey:"60AfGDrVxy8nAGJngo3fCYWG4LvhMAlG",allowedInDev:!0,selectors:[{selector:"h1, h2, h3, h4, h5, h6",eventName:"Docs.langflow.org - Heading Viewed",properties:{element_type:"heading"}},{selector:".ch-codeblock",eventName:"Docs.langflow.org - Codeblock Viewed",properties:{element_type:"code",language:"helper:codeLanguage"}}]}],["@docusaurus/plugin-client-redirects",{redirects:[{to:"/",from:["/whats-new-a-new-chapter-langflow","/\ud83d\udc4b Welcome-to-Langflow","/getting-started-welcome-to-langflow","/guides-new-to-llms","/about-langflow"]},{to:"/get-started-installation",from:["/getting-started-installation","/getting-started-common-installation-issues"]},{to:"/get-started-quickstart",from:"/getting-started-quickstart"},{to:"concepts-overview",from:["/workspace-overview","/365085a8-a90a-43f9-a779-f8769ec7eca1","/My-Collection","/workspace","/settings-project-general-settings"]},{to:"/concepts-components",from:["/components","/components-overview"]},{to:"/configuration-global-variables",from:"/settings-global-variables"},{to:"/concepts-playground",from:["/workspace-playground","/workspace-logs","/guides-chat-memory"]},{to:"/data-types",from:["/guides-data-message","/configuration-objects"]},{to:"/concepts-flows",from:["/travel-planning-agent","/starter-projects-travel-planning-agent","/tutorials-travel-planning-agent","/starter-projects-dynamic-agent/","/simple-agent","/math-agent","/starter-projects-simple-agent","/starter-projects-math-agent","/tutorials-math-agent","/sequential-agent","/starter-projects-sequential-agent","/tutorials-sequential-agent","/memory-chatbot","/starter-projects-memory-chatbot","/tutorials-memory-chatbot","/financial-report-parser","/document-qa","/starter-projects-document-qa","/tutorials-document-qa","/blog-writer","/starter-projects-blog-writer","/tutorials-blog-writer","/basic-prompting","/starter-projects-basic-prompting","/vector-store-rag","/starter-projects-vector-store-rag"]},{to:"/components-bundle-components",from:["/components-rag","/components-vector-stores","/components-loaders"]},{to:"/api-keys-and-authentication",from:["/configuration-api-keys","/configuration-authentication","/configuration-security-best-practices","/Configuration/configuration-security-best-practices"]},{to:"/environment-variables",from:["/configuration-auto-saving","/Configuration/configuration-auto-saving","/configuration-backend-only","/Configuration/configuration-backend-only"]},{to:"/concepts-publish",from:["/concepts-api","/workspace-api"]},{to:"/components-custom-components",from:"/components/custom"},{to:"/mcp-server",from:"/integrations-mcp"},{to:"/integrations-nvidia-g-assist",from:"/integrations-nvidia-system-assist"},{to:"/deployment-kubernetes-dev",from:"/deployment-kubernetes"},{to:"/contributing-github-issues",from:"/contributing-github-discussions"},{to:"/agents",from:"/agents-tool-calling-agent-component"},{to:"/concepts-publish",from:"/embedded-chat-widget"},{to:"/bundles-google",from:"/integrations-setup-google-oauth-langflow"},{to:"/bundles-vertexai",from:"/integrations-setup-google-cloud-vertex-ai-langflow"},{to:"/develop-application",from:"/develop-overview"},{to:"/data-types",from:"/concepts-objects"},{to:"/components-helpers",from:"/components-memories"}]}],null],themeConfig:{navbar:{hideOnScroll:!0,logo:{alt:"Langflow",src:"img/lf-docs-light.svg",srcDark:"img/lf-docs-dark.svg"},items:[{position:"right",href:"https://github.com/langflow-ai/langflow",className:"header-github-link",target:"_blank",rel:null,"data-event":"Docs.langflow.org - Social Clicked","data-platform":"github"},{position:"right",href:"https://twitter.com/langflow_ai",className:"header-twitter-link",target:"_blank",rel:null,"data-event":"Docs.langflow.org - Social Clicked","data-platform":"x"},{position:"right",href:"https://discord.gg/EqksyE2EX9",className:"header-discord-link",target:"_blank",rel:null,"data-event":"Docs.langflow.org - Social Clicked","data-platform":"discord"}]},colorMode:{defaultMode:"light",disableSwitch:!1,respectPrefersColorScheme:!0},prism:{theme:{plain:{color:"#393A34",backgroundColor:"#f6f8fa"},styles:[{types:["comment","prolog","doctype","cdata"],style:{color:"#999988",fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}},{types:["string","attr-value"],style:{color:"#e3116c"}},{types:["punctuation","operator"],style:{color:"#393A34"}},{types:["entity","url","symbol","number","boolean","variable","constant","property","regex","inserted"],style:{color:"#36acaa"}},{types:["atrule","keyword","attr-name","selector"],style:{color:"#00a4db"}},{types:["function","deleted","tag"],style:{color:"#d73a49"}},{types:["function-variable"],style:{color:"#6f42c1"}},{types:["tag","selector","keyword"],style:{color:"#00009f"}}]},darkTheme:{plain:{color:"#F8F8F2",backgroundColor:"#282A36"},styles:[{types:["prolog","constant","builtin"],style:{color:"rgb(189, 147, 249)"}},{types:["inserted","function"],style:{color:"rgb(80, 250, 123)"}},{types:["deleted"],style:{color:"rgb(255, 85, 85)"}},{types:["changed"],style:{color:"rgb(255, 184, 108)"}},{types:["punctuation","symbol"],style:{color:"rgb(248, 248, 242)"}},{types:["string","char","tag","selector"],style:{color:"rgb(255, 121, 198)"}},{types:["keyword","variable"],style:{color:"rgb(189, 147, 249)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(98, 114, 164)"}},{types:["attr-name"],style:{color:"rgb(241, 250, 140)"}}]},additionalLanguages:[],magicComments:[{className:"theme-code-block-highlighted-line",line:"highlight-next-line",block:{start:"highlight-start",end:"highlight-end"}}]},zoom:{selector:".markdown :not(a) > img:not(.no-zoom)",background:{light:"rgba(240, 240, 240, 0.9)"},config:{}},docs:{sidebar:{hideable:!1,autoCollapseCategories:!1},versionPersistence:"localStorage"},footer:{links:[{title:null,items:[{html:''}]}],style:"light"},algolia:{appId:"UZK6BDPCVY",apiKey:"adbd7686dceb1cd510d5ce20d04bf74c",indexName:"langflow",contextualSearch:!0,searchParameters:{},searchPagePath:"search"},blog:{sidebar:{groupByYear:!0}},metadata:[],tableOfContents:{minHeadingLevel:2,maxHeadingLevel:3}},baseUrlIssueBanner:!0,future:{v4:{removeLegacyPostBuildHeadAttribute:!1,useCssCascadeLayers:!1},experimental_faster:{swcJsLoader:!1,swcJsMinimizer:!1,swcHtmlMinimizer:!1,lightningCssMinimizer:!1,mdxCrossCompilerCache:!1,rspackBundler:!1,rspackPersistentCache:!1,ssgWorkerThreads:!1},experimental_storage:{type:"localStorage",namespace:!1},experimental_router:"browser"},onDuplicateRoutes:"warn",customFields:{},themes:[],scripts:[],stylesheets:[],clientModules:[],titleDelimiter:"|",noIndex:!1,markdown:{format:"mdx",mermaid:!1,mdx1Compat:{comments:!0,admonitions:!0,headingIds:!0},anchors:{maintainCase:!1}}}},5260:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});n(96540);var r=n(80545),o=n(74848);function a(e){return(0,o.jsx)(r.mg,{...e})}},5338:(e,t,n)=>{"use strict";var r=n(40961);t.createRoot=r.createRoot,t.hydrateRoot=r.hydrateRoot},5556:(e,t,n)=>{e.exports=n(2694)()},5947:function(e,t,n){var r,o;r=function(){var e,t,n={version:"0.2.0"},r=n.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'
      '};function o(e,t,n){return en?n:e}function a(e){return 100*(-1+e)}function i(e,t,n){var o;return(o="translate3d"===r.positionUsing?{transform:"translate3d("+a(e)+"%,0,0)"}:"translate"===r.positionUsing?{transform:"translate("+a(e)+"%,0)"}:{"margin-left":a(e)+"%"}).transition="all "+t+"ms "+n,o}n.configure=function(e){var t,n;for(t in e)void 0!==(n=e[t])&&e.hasOwnProperty(t)&&(r[t]=n);return this},n.status=null,n.set=function(e){var t=n.isStarted();e=o(e,r.minimum,1),n.status=1===e?null:e;var a=n.render(!t),c=a.querySelector(r.barSelector),u=r.speed,d=r.easing;return a.offsetWidth,s(function(t){""===r.positionUsing&&(r.positionUsing=n.getPositioningCSS()),l(c,i(e,u,d)),1===e?(l(a,{transition:"none",opacity:1}),a.offsetWidth,setTimeout(function(){l(a,{transition:"all "+u+"ms linear",opacity:0}),setTimeout(function(){n.remove(),t()},u)},u)):setTimeout(t,u)}),this},n.isStarted=function(){return"number"==typeof n.status},n.start=function(){n.status||n.set(0);var e=function(){setTimeout(function(){n.status&&(n.trickle(),e())},r.trickleSpeed)};return r.trickle&&e(),this},n.done=function(e){return e||n.status?n.inc(.3+.5*Math.random()).set(1):this},n.inc=function(e){var t=n.status;return t?("number"!=typeof e&&(e=(1-t)*o(Math.random()*t,.1,.95)),t=o(t+e,0,.994),n.set(t)):n.start()},n.trickle=function(){return n.inc(Math.random()*r.trickleRate)},e=0,t=0,n.promise=function(r){return r&&"resolved"!==r.state()?(0===t&&n.start(),e++,t++,r.always(function(){0===--t?(e=0,n.done()):n.set((e-t)/e)}),this):this},n.render=function(e){if(n.isRendered())return document.getElementById("nprogress");u(document.documentElement,"nprogress-busy");var t=document.createElement("div");t.id="nprogress",t.innerHTML=r.template;var o,i=t.querySelector(r.barSelector),s=e?"-100":a(n.status||0),c=document.querySelector(r.parent);return l(i,{transition:"all 0 linear",transform:"translate3d("+s+"%,0,0)"}),r.showSpinner||(o=t.querySelector(r.spinnerSelector))&&f(o),c!=document.body&&u(c,"nprogress-custom-parent"),c.appendChild(t),t},n.remove=function(){d(document.documentElement,"nprogress-busy"),d(document.querySelector(r.parent),"nprogress-custom-parent");var e=document.getElementById("nprogress");e&&f(e)},n.isRendered=function(){return!!document.getElementById("nprogress")},n.getPositioningCSS=function(){var e=document.body.style,t="WebkitTransform"in e?"Webkit":"MozTransform"in e?"Moz":"msTransform"in e?"ms":"OTransform"in e?"O":"";return t+"Perspective"in e?"translate3d":t+"Transform"in e?"translate":"margin"};var s=function(){var e=[];function t(){var n=e.shift();n&&n(t)}return function(n){e.push(n),1==e.length&&t()}}(),l=function(){var e=["Webkit","O","Moz","ms"],t={};function n(e){return e.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(e,t){return t.toUpperCase()})}function r(t){var n=document.body.style;if(t in n)return t;for(var r,o=e.length,a=t.charAt(0).toUpperCase()+t.slice(1);o--;)if((r=e[o]+a)in n)return r;return t}function o(e){return e=n(e),t[e]||(t[e]=r(e))}function a(e,t,n){t=o(t),e.style[t]=n}return function(e,t){var n,r,o=arguments;if(2==o.length)for(n in t)void 0!==(r=t[n])&&t.hasOwnProperty(n)&&a(e,n,r);else a(e,o[1],o[2])}}();function c(e,t){return("string"==typeof e?e:p(e)).indexOf(" "+t+" ")>=0}function u(e,t){var n=p(e),r=n+t;c(n,t)||(e.className=r.substring(1))}function d(e,t){var n,r=p(e);c(e,t)&&(n=r.replace(" "+t+" "," "),e.className=n.substring(1,n.length-1))}function p(e){return(" "+(e.className||"")+" ").replace(/\s+/gi," ")}function f(e){e&&e.parentNode&&e.parentNode.removeChild(e)}return n},void 0===(o="function"==typeof r?r.call(t,n,t,e):r)||(e.exports=o)},6125:(e,t,n)=>{"use strict";n.d(t,{o:()=>a,x:()=>i});var r=n(96540),o=n(74848);const a=r.createContext(!1);function i({children:e}){const[t,n]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{n(!0)},[]),(0,o.jsx)(a.Provider,{value:t,children:e})}},6188:e=>{"use strict";e.exports=Math.max},6342:(e,t,n)=>{"use strict";n.d(t,{p:()=>o});var r=n(44586);function o(){return(0,r.A)().siteConfig.themeConfig}},6549:e=>{"use strict";e.exports=Object.getOwnPropertyDescriptor},6925:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},6969:e=>{e.exports&&(e.exports={core:{meta:{path:"components/prism-core.js",option:"mandatory"},core:"Core"},themes:{meta:{path:"themes/{id}.css",link:"index.html?theme={id}",exclusive:!0},prism:{title:"Default",option:"default"},"prism-dark":"Dark","prism-funky":"Funky","prism-okaidia":{title:"Okaidia",owner:"ocodia"},"prism-twilight":{title:"Twilight",owner:"remybach"},"prism-coy":{title:"Coy",owner:"tshedor"},"prism-solarizedlight":{title:"Solarized Light",owner:"hectormatos2011 "},"prism-tomorrow":{title:"Tomorrow Night",owner:"Rosey"}},languages:{meta:{path:"components/prism-{id}",noCSS:!0,examplesPath:"examples/prism-{id}",addCheckAll:!0},markup:{title:"Markup",alias:["html","xml","svg","mathml","ssml","atom","rss"],aliasTitles:{html:"HTML",xml:"XML",svg:"SVG",mathml:"MathML",ssml:"SSML",atom:"Atom",rss:"RSS"},option:"default"},css:{title:"CSS",option:"default",modify:"markup"},clike:{title:"C-like",option:"default"},javascript:{title:"JavaScript",require:"clike",modify:"markup",optional:"regex",alias:"js",option:"default"},abap:{title:"ABAP",owner:"dellagustin"},abnf:{title:"ABNF",owner:"RunDevelopment"},actionscript:{title:"ActionScript",require:"javascript",modify:"markup",owner:"Golmote"},ada:{title:"Ada",owner:"Lucretia"},agda:{title:"Agda",owner:"xy-ren"},al:{title:"AL",owner:"RunDevelopment"},antlr4:{title:"ANTLR4",alias:"g4",owner:"RunDevelopment"},apacheconf:{title:"Apache Configuration",owner:"GuiTeK"},apex:{title:"Apex",require:["clike","sql"],owner:"RunDevelopment"},apl:{title:"APL",owner:"ngn"},applescript:{title:"AppleScript",owner:"Golmote"},aql:{title:"AQL",owner:"RunDevelopment"},arduino:{title:"Arduino",require:"cpp",alias:"ino",owner:"dkern"},arff:{title:"ARFF",owner:"Golmote"},armasm:{title:"ARM Assembly",alias:"arm-asm",owner:"RunDevelopment"},arturo:{title:"Arturo",alias:"art",optional:["bash","css","javascript","markup","markdown","sql"],owner:"drkameleon"},asciidoc:{alias:"adoc",title:"AsciiDoc",owner:"Golmote"},aspnet:{title:"ASP.NET (C#)",require:["markup","csharp"],owner:"nauzilus"},asm6502:{title:"6502 Assembly",owner:"kzurawel"},asmatmel:{title:"Atmel AVR Assembly",owner:"cerkit"},autohotkey:{title:"AutoHotkey",owner:"aviaryan"},autoit:{title:"AutoIt",owner:"Golmote"},avisynth:{title:"AviSynth",alias:"avs",owner:"Zinfidel"},"avro-idl":{title:"Avro IDL",alias:"avdl",owner:"RunDevelopment"},awk:{title:"AWK",alias:"gawk",aliasTitles:{gawk:"GAWK"},owner:"RunDevelopment"},bash:{title:"Bash",alias:["sh","shell"],aliasTitles:{sh:"Shell",shell:"Shell"},owner:"zeitgeist87"},basic:{title:"BASIC",owner:"Golmote"},batch:{title:"Batch",owner:"Golmote"},bbcode:{title:"BBcode",alias:"shortcode",aliasTitles:{shortcode:"Shortcode"},owner:"RunDevelopment"},bbj:{title:"BBj",owner:"hyyan"},bicep:{title:"Bicep",owner:"johnnyreilly"},birb:{title:"Birb",require:"clike",owner:"Calamity210"},bison:{title:"Bison",require:"c",owner:"Golmote"},bnf:{title:"BNF",alias:"rbnf",aliasTitles:{rbnf:"RBNF"},owner:"RunDevelopment"},bqn:{title:"BQN",owner:"yewscion"},brainfuck:{title:"Brainfuck",owner:"Golmote"},brightscript:{title:"BrightScript",owner:"RunDevelopment"},bro:{title:"Bro",owner:"wayward710"},bsl:{title:"BSL (1C:Enterprise)",alias:"oscript",aliasTitles:{oscript:"OneScript"},owner:"Diversus23"},c:{title:"C",require:"clike",owner:"zeitgeist87"},csharp:{title:"C#",require:"clike",alias:["cs","dotnet"],owner:"mvalipour"},cpp:{title:"C++",require:"c",owner:"zeitgeist87"},cfscript:{title:"CFScript",require:"clike",alias:"cfc",owner:"mjclemente"},chaiscript:{title:"ChaiScript",require:["clike","cpp"],owner:"RunDevelopment"},cil:{title:"CIL",owner:"sbrl"},cilkc:{title:"Cilk/C",require:"c",alias:"cilk-c",owner:"OpenCilk"},cilkcpp:{title:"Cilk/C++",require:"cpp",alias:["cilk-cpp","cilk"],owner:"OpenCilk"},clojure:{title:"Clojure",owner:"troglotit"},cmake:{title:"CMake",owner:"mjrogozinski"},cobol:{title:"COBOL",owner:"RunDevelopment"},coffeescript:{title:"CoffeeScript",require:"javascript",alias:"coffee",owner:"R-osey"},concurnas:{title:"Concurnas",alias:"conc",owner:"jasontatton"},csp:{title:"Content-Security-Policy",owner:"ScottHelme"},cooklang:{title:"Cooklang",owner:"ahue"},coq:{title:"Coq",owner:"RunDevelopment"},crystal:{title:"Crystal",require:"ruby",owner:"MakeNowJust"},"css-extras":{title:"CSS Extras",require:"css",modify:"css",owner:"milesj"},csv:{title:"CSV",owner:"RunDevelopment"},cue:{title:"CUE",owner:"RunDevelopment"},cypher:{title:"Cypher",owner:"RunDevelopment"},d:{title:"D",require:"clike",owner:"Golmote"},dart:{title:"Dart",require:"clike",owner:"Golmote"},dataweave:{title:"DataWeave",owner:"machaval"},dax:{title:"DAX",owner:"peterbud"},dhall:{title:"Dhall",owner:"RunDevelopment"},diff:{title:"Diff",owner:"uranusjr"},django:{title:"Django/Jinja2",require:"markup-templating",alias:"jinja2",owner:"romanvm"},"dns-zone-file":{title:"DNS zone file",owner:"RunDevelopment",alias:"dns-zone"},docker:{title:"Docker",alias:"dockerfile",owner:"JustinBeckwith"},dot:{title:"DOT (Graphviz)",alias:"gv",optional:"markup",owner:"RunDevelopment"},ebnf:{title:"EBNF",owner:"RunDevelopment"},editorconfig:{title:"EditorConfig",owner:"osipxd"},eiffel:{title:"Eiffel",owner:"Conaclos"},ejs:{title:"EJS",require:["javascript","markup-templating"],owner:"RunDevelopment",alias:"eta",aliasTitles:{eta:"Eta"}},elixir:{title:"Elixir",owner:"Golmote"},elm:{title:"Elm",owner:"zwilias"},etlua:{title:"Embedded Lua templating",require:["lua","markup-templating"],owner:"RunDevelopment"},erb:{title:"ERB",require:["ruby","markup-templating"],owner:"Golmote"},erlang:{title:"Erlang",owner:"Golmote"},"excel-formula":{title:"Excel Formula",alias:["xlsx","xls"],owner:"RunDevelopment"},fsharp:{title:"F#",require:"clike",owner:"simonreynolds7"},factor:{title:"Factor",owner:"catb0t"},false:{title:"False",owner:"edukisto"},"firestore-security-rules":{title:"Firestore security rules",require:"clike",owner:"RunDevelopment"},flow:{title:"Flow",require:"javascript",owner:"Golmote"},fortran:{title:"Fortran",owner:"Golmote"},ftl:{title:"FreeMarker Template Language",require:"markup-templating",owner:"RunDevelopment"},gml:{title:"GameMaker Language",alias:"gamemakerlanguage",require:"clike",owner:"LiarOnce"},gap:{title:"GAP (CAS)",owner:"RunDevelopment"},gcode:{title:"G-code",owner:"RunDevelopment"},gdscript:{title:"GDScript",owner:"RunDevelopment"},gedcom:{title:"GEDCOM",owner:"Golmote"},gettext:{title:"gettext",alias:"po",owner:"RunDevelopment"},gherkin:{title:"Gherkin",owner:"hason"},git:{title:"Git",owner:"lgiraudel"},glsl:{title:"GLSL",require:"c",owner:"Golmote"},gn:{title:"GN",alias:"gni",owner:"RunDevelopment"},"linker-script":{title:"GNU Linker Script",alias:"ld",owner:"RunDevelopment"},go:{title:"Go",require:"clike",owner:"arnehormann"},"go-module":{title:"Go module",alias:"go-mod",owner:"RunDevelopment"},gradle:{title:"Gradle",require:"clike",owner:"zeabdelkhalek-badido18"},graphql:{title:"GraphQL",optional:"markdown",owner:"Golmote"},groovy:{title:"Groovy",require:"clike",owner:"robfletcher"},haml:{title:"Haml",require:"ruby",optional:["css","css-extras","coffeescript","erb","javascript","less","markdown","scss","textile"],owner:"Golmote"},handlebars:{title:"Handlebars",require:"markup-templating",alias:["hbs","mustache"],aliasTitles:{mustache:"Mustache"},owner:"Golmote"},haskell:{title:"Haskell",alias:"hs",owner:"bholst"},haxe:{title:"Haxe",require:"clike",optional:"regex",owner:"Golmote"},hcl:{title:"HCL",owner:"outsideris"},hlsl:{title:"HLSL",require:"c",owner:"RunDevelopment"},hoon:{title:"Hoon",owner:"matildepark"},http:{title:"HTTP",optional:["csp","css","hpkp","hsts","javascript","json","markup","uri"],owner:"danielgtaylor"},hpkp:{title:"HTTP Public-Key-Pins",owner:"ScottHelme"},hsts:{title:"HTTP Strict-Transport-Security",owner:"ScottHelme"},ichigojam:{title:"IchigoJam",owner:"BlueCocoa"},icon:{title:"Icon",owner:"Golmote"},"icu-message-format":{title:"ICU Message Format",owner:"RunDevelopment"},idris:{title:"Idris",alias:"idr",owner:"KeenS",require:"haskell"},ignore:{title:".ignore",owner:"osipxd",alias:["gitignore","hgignore","npmignore"],aliasTitles:{gitignore:".gitignore",hgignore:".hgignore",npmignore:".npmignore"}},inform7:{title:"Inform 7",owner:"Golmote"},ini:{title:"Ini",owner:"aviaryan"},io:{title:"Io",owner:"AlesTsurko"},j:{title:"J",owner:"Golmote"},java:{title:"Java",require:"clike",owner:"sherblot"},javadoc:{title:"JavaDoc",require:["markup","java","javadoclike"],modify:"java",optional:"scala",owner:"RunDevelopment"},javadoclike:{title:"JavaDoc-like",modify:["java","javascript","php"],owner:"RunDevelopment"},javastacktrace:{title:"Java stack trace",owner:"RunDevelopment"},jexl:{title:"Jexl",owner:"czosel"},jolie:{title:"Jolie",require:"clike",owner:"thesave"},jq:{title:"JQ",owner:"RunDevelopment"},jsdoc:{title:"JSDoc",require:["javascript","javadoclike","typescript"],modify:"javascript",optional:["actionscript","coffeescript"],owner:"RunDevelopment"},"js-extras":{title:"JS Extras",require:"javascript",modify:"javascript",optional:["actionscript","coffeescript","flow","n4js","typescript"],owner:"RunDevelopment"},json:{title:"JSON",alias:"webmanifest",aliasTitles:{webmanifest:"Web App Manifest"},owner:"CupOfTea696"},json5:{title:"JSON5",require:"json",owner:"RunDevelopment"},jsonp:{title:"JSONP",require:"json",owner:"RunDevelopment"},jsstacktrace:{title:"JS stack trace",owner:"sbrl"},"js-templates":{title:"JS Templates",require:"javascript",modify:"javascript",optional:["css","css-extras","graphql","markdown","markup","sql"],owner:"RunDevelopment"},julia:{title:"Julia",owner:"cdagnino"},keepalived:{title:"Keepalived Configure",owner:"dev-itsheng"},keyman:{title:"Keyman",owner:"mcdurdin"},kotlin:{title:"Kotlin",alias:["kt","kts"],aliasTitles:{kts:"Kotlin Script"},require:"clike",owner:"Golmote"},kumir:{title:"KuMir (\u041a\u0443\u041c\u0438\u0440)",alias:"kum",owner:"edukisto"},kusto:{title:"Kusto",owner:"RunDevelopment"},latex:{title:"LaTeX",alias:["tex","context"],aliasTitles:{tex:"TeX",context:"ConTeXt"},owner:"japborst"},latte:{title:"Latte",require:["clike","markup-templating","php"],owner:"nette"},less:{title:"Less",require:"css",optional:"css-extras",owner:"Golmote"},lilypond:{title:"LilyPond",require:"scheme",alias:"ly",owner:"RunDevelopment"},liquid:{title:"Liquid",require:"markup-templating",owner:"cinhtau"},lisp:{title:"Lisp",alias:["emacs","elisp","emacs-lisp"],owner:"JuanCaicedo"},livescript:{title:"LiveScript",owner:"Golmote"},llvm:{title:"LLVM IR",owner:"porglezomp"},log:{title:"Log file",optional:"javastacktrace",owner:"RunDevelopment"},lolcode:{title:"LOLCODE",owner:"Golmote"},lua:{title:"Lua",owner:"Golmote"},magma:{title:"Magma (CAS)",owner:"RunDevelopment"},makefile:{title:"Makefile",owner:"Golmote"},markdown:{title:"Markdown",require:"markup",optional:"yaml",alias:"md",owner:"Golmote"},"markup-templating":{title:"Markup templating",require:"markup",owner:"Golmote"},mata:{title:"Mata",owner:"RunDevelopment"},matlab:{title:"MATLAB",owner:"Golmote"},maxscript:{title:"MAXScript",owner:"RunDevelopment"},mel:{title:"MEL",owner:"Golmote"},mermaid:{title:"Mermaid",owner:"RunDevelopment"},metafont:{title:"METAFONT",owner:"LaeriExNihilo"},mizar:{title:"Mizar",owner:"Golmote"},mongodb:{title:"MongoDB",owner:"airs0urce",require:"javascript"},monkey:{title:"Monkey",owner:"Golmote"},moonscript:{title:"MoonScript",alias:"moon",owner:"RunDevelopment"},n1ql:{title:"N1QL",owner:"TMWilds"},n4js:{title:"N4JS",require:"javascript",optional:"jsdoc",alias:"n4jsd",owner:"bsmith-n4"},"nand2tetris-hdl":{title:"Nand To Tetris HDL",owner:"stephanmax"},naniscript:{title:"Naninovel Script",owner:"Elringus",alias:"nani"},nasm:{title:"NASM",owner:"rbmj"},neon:{title:"NEON",owner:"nette"},nevod:{title:"Nevod",owner:"nezaboodka"},nginx:{title:"nginx",owner:"volado"},nim:{title:"Nim",owner:"Golmote"},nix:{title:"Nix",owner:"Golmote"},nsis:{title:"NSIS",owner:"idleberg"},objectivec:{title:"Objective-C",require:"c",alias:"objc",owner:"uranusjr"},ocaml:{title:"OCaml",owner:"Golmote"},odin:{title:"Odin",owner:"edukisto"},opencl:{title:"OpenCL",require:"c",modify:["c","cpp"],owner:"Milania1"},openqasm:{title:"OpenQasm",alias:"qasm",owner:"RunDevelopment"},oz:{title:"Oz",owner:"Golmote"},parigp:{title:"PARI/GP",owner:"Golmote"},parser:{title:"Parser",require:"markup",owner:"Golmote"},pascal:{title:"Pascal",alias:"objectpascal",aliasTitles:{objectpascal:"Object Pascal"},owner:"Golmote"},pascaligo:{title:"Pascaligo",owner:"DefinitelyNotAGoat"},psl:{title:"PATROL Scripting Language",owner:"bertysentry"},pcaxis:{title:"PC-Axis",alias:"px",owner:"RunDevelopment"},peoplecode:{title:"PeopleCode",alias:"pcode",owner:"RunDevelopment"},perl:{title:"Perl",owner:"Golmote"},php:{title:"PHP",require:"markup-templating",owner:"milesj"},phpdoc:{title:"PHPDoc",require:["php","javadoclike"],modify:"php",owner:"RunDevelopment"},"php-extras":{title:"PHP Extras",require:"php",modify:"php",owner:"milesj"},"plant-uml":{title:"PlantUML",alias:"plantuml",owner:"RunDevelopment"},plsql:{title:"PL/SQL",require:"sql",owner:"Golmote"},powerquery:{title:"PowerQuery",alias:["pq","mscript"],owner:"peterbud"},powershell:{title:"PowerShell",owner:"nauzilus"},processing:{title:"Processing",require:"clike",owner:"Golmote"},prolog:{title:"Prolog",owner:"Golmote"},promql:{title:"PromQL",owner:"arendjr"},properties:{title:".properties",owner:"Golmote"},protobuf:{title:"Protocol Buffers",require:"clike",owner:"just-boris"},pug:{title:"Pug",require:["markup","javascript"],optional:["coffeescript","ejs","handlebars","less","livescript","markdown","scss","stylus","twig"],owner:"Golmote"},puppet:{title:"Puppet",owner:"Golmote"},pure:{title:"Pure",optional:["c","cpp","fortran"],owner:"Golmote"},purebasic:{title:"PureBasic",require:"clike",alias:"pbfasm",owner:"HeX0R101"},purescript:{title:"PureScript",require:"haskell",alias:"purs",owner:"sriharshachilakapati"},python:{title:"Python",alias:"py",owner:"multipetros"},qsharp:{title:"Q#",require:"clike",alias:"qs",owner:"fedonman"},q:{title:"Q (kdb+ database)",owner:"Golmote"},qml:{title:"QML",require:"javascript",owner:"RunDevelopment"},qore:{title:"Qore",require:"clike",owner:"temnroegg"},r:{title:"R",owner:"Golmote"},racket:{title:"Racket",require:"scheme",alias:"rkt",owner:"RunDevelopment"},cshtml:{title:"Razor C#",alias:"razor",require:["markup","csharp"],optional:["css","css-extras","javascript","js-extras"],owner:"RunDevelopment"},jsx:{title:"React JSX",require:["markup","javascript"],optional:["jsdoc","js-extras","js-templates"],owner:"vkbansal"},tsx:{title:"React TSX",require:["jsx","typescript"]},reason:{title:"Reason",require:"clike",owner:"Golmote"},regex:{title:"Regex",owner:"RunDevelopment"},rego:{title:"Rego",owner:"JordanSh"},renpy:{title:"Ren'py",alias:"rpy",owner:"HyuchiaDiego"},rescript:{title:"ReScript",alias:"res",owner:"vmarcosp"},rest:{title:"reST (reStructuredText)",owner:"Golmote"},rip:{title:"Rip",owner:"ravinggenius"},roboconf:{title:"Roboconf",owner:"Golmote"},robotframework:{title:"Robot Framework",alias:"robot",owner:"RunDevelopment"},ruby:{title:"Ruby",require:"clike",alias:"rb",owner:"samflores"},rust:{title:"Rust",owner:"Golmote"},sas:{title:"SAS",optional:["groovy","lua","sql"],owner:"Golmote"},sass:{title:"Sass (Sass)",require:"css",optional:"css-extras",owner:"Golmote"},scss:{title:"Sass (SCSS)",require:"css",optional:"css-extras",owner:"MoOx"},scala:{title:"Scala",require:"java",owner:"jozic"},scheme:{title:"Scheme",owner:"bacchus123"},"shell-session":{title:"Shell session",require:"bash",alias:["sh-session","shellsession"],owner:"RunDevelopment"},smali:{title:"Smali",owner:"RunDevelopment"},smalltalk:{title:"Smalltalk",owner:"Golmote"},smarty:{title:"Smarty",require:"markup-templating",optional:"php",owner:"Golmote"},sml:{title:"SML",alias:"smlnj",aliasTitles:{smlnj:"SML/NJ"},owner:"RunDevelopment"},solidity:{title:"Solidity (Ethereum)",alias:"sol",require:"clike",owner:"glachaud"},"solution-file":{title:"Solution file",alias:"sln",owner:"RunDevelopment"},soy:{title:"Soy (Closure Template)",require:"markup-templating",owner:"Golmote"},sparql:{title:"SPARQL",require:"turtle",owner:"Triply-Dev",alias:"rq"},"splunk-spl":{title:"Splunk SPL",owner:"RunDevelopment"},sqf:{title:"SQF: Status Quo Function (Arma 3)",require:"clike",owner:"RunDevelopment"},sql:{title:"SQL",owner:"multipetros"},squirrel:{title:"Squirrel",require:"clike",owner:"RunDevelopment"},stan:{title:"Stan",owner:"RunDevelopment"},stata:{title:"Stata Ado",require:["mata","java","python"],owner:"RunDevelopment"},iecst:{title:"Structured Text (IEC 61131-3)",owner:"serhioromano"},stylus:{title:"Stylus",owner:"vkbansal"},supercollider:{title:"SuperCollider",alias:"sclang",owner:"RunDevelopment"},swift:{title:"Swift",owner:"chrischares"},systemd:{title:"Systemd configuration file",owner:"RunDevelopment"},"t4-templating":{title:"T4 templating",owner:"RunDevelopment"},"t4-cs":{title:"T4 Text Templates (C#)",require:["t4-templating","csharp"],alias:"t4",owner:"RunDevelopment"},"t4-vb":{title:"T4 Text Templates (VB)",require:["t4-templating","vbnet"],owner:"RunDevelopment"},tap:{title:"TAP",owner:"isaacs",require:"yaml"},tcl:{title:"Tcl",owner:"PeterChaplin"},tt2:{title:"Template Toolkit 2",require:["clike","markup-templating"],owner:"gflohr"},textile:{title:"Textile",require:"markup",optional:"css",owner:"Golmote"},toml:{title:"TOML",owner:"RunDevelopment"},tremor:{title:"Tremor",alias:["trickle","troy"],owner:"darach",aliasTitles:{trickle:"trickle",troy:"troy"}},turtle:{title:"Turtle",alias:"trig",aliasTitles:{trig:"TriG"},owner:"jakubklimek"},twig:{title:"Twig",require:"markup-templating",owner:"brandonkelly"},typescript:{title:"TypeScript",require:"javascript",optional:"js-templates",alias:"ts",owner:"vkbansal"},typoscript:{title:"TypoScript",alias:"tsconfig",aliasTitles:{tsconfig:"TSConfig"},owner:"dkern"},unrealscript:{title:"UnrealScript",alias:["uscript","uc"],owner:"RunDevelopment"},uorazor:{title:"UO Razor Script",owner:"jaseowns"},uri:{title:"URI",alias:"url",aliasTitles:{url:"URL"},owner:"RunDevelopment"},v:{title:"V",require:"clike",owner:"taggon"},vala:{title:"Vala",require:"clike",optional:"regex",owner:"TemplarVolk"},vbnet:{title:"VB.Net",require:"basic",owner:"Bigsby"},velocity:{title:"Velocity",require:"markup",owner:"Golmote"},verilog:{title:"Verilog",owner:"a-rey"},vhdl:{title:"VHDL",owner:"a-rey"},vim:{title:"vim",owner:"westonganger"},"visual-basic":{title:"Visual Basic",alias:["vb","vba"],aliasTitles:{vba:"VBA"},owner:"Golmote"},warpscript:{title:"WarpScript",owner:"RunDevelopment"},wasm:{title:"WebAssembly",owner:"Golmote"},"web-idl":{title:"Web IDL",alias:"webidl",owner:"RunDevelopment"},wgsl:{title:"WGSL",owner:"Dr4gonthree"},wiki:{title:"Wiki markup",require:"markup",owner:"Golmote"},wolfram:{title:"Wolfram language",alias:["mathematica","nb","wl"],aliasTitles:{mathematica:"Mathematica",nb:"Mathematica Notebook"},owner:"msollami"},wren:{title:"Wren",owner:"clsource"},xeora:{title:"Xeora",require:"markup",alias:"xeoracube",aliasTitles:{xeoracube:"XeoraCube"},owner:"freakmaxi"},"xml-doc":{title:"XML doc (.net)",require:"markup",modify:["csharp","fsharp","vbnet"],owner:"RunDevelopment"},xojo:{title:"Xojo (REALbasic)",owner:"Golmote"},xquery:{title:"XQuery",require:"markup",owner:"Golmote"},yaml:{title:"YAML",alias:"yml",owner:"hason"},yang:{title:"YANG",owner:"RunDevelopment"},zig:{title:"Zig",owner:"RunDevelopment"}},plugins:{meta:{path:"plugins/{id}/prism-{id}",link:"plugins/{id}/"},"line-highlight":{title:"Line Highlight",description:"Highlights specific lines and/or line ranges."},"line-numbers":{title:"Line Numbers",description:"Line number at the beginning of code lines.",owner:"kuba-kubula"},"show-invisibles":{title:"Show Invisibles",description:"Show hidden characters such as tabs and line breaks.",optional:["autolinker","data-uri-highlight"]},autolinker:{title:"Autolinker",description:"Converts URLs and emails in code to clickable links. Parses Markdown links in comments."},wpd:{title:"WebPlatform Docs",description:'Makes tokens link to WebPlatform.org documentation. The links open in a new tab.'},"custom-class":{title:"Custom Class",description:"This plugin allows you to prefix Prism's default classes (.comment can become .namespace--comment) or replace them with your defined ones (like .editor__comment). You can even add new classes.",owner:"dvkndn",noCSS:!0},"file-highlight":{title:"File Highlight",description:"Fetch external files and highlight them with Prism. Used on the Prism website itself.",noCSS:!0},"show-language":{title:"Show Language",description:"Display the highlighted language in code blocks (inline code does not show the label).",owner:"nauzilus",noCSS:!0,require:"toolbar"},"jsonp-highlight":{title:"JSONP Highlight",description:"Fetch content with JSONP and highlight some interesting content (e.g. GitHub/Gists or Bitbucket API).",noCSS:!0,owner:"nauzilus"},"highlight-keywords":{title:"Highlight Keywords",description:"Adds special CSS classes for each keyword for fine-grained highlighting.",owner:"vkbansal",noCSS:!0},"remove-initial-line-feed":{title:"Remove initial line feed",description:"Removes the initial line feed in code blocks.",owner:"Golmote",noCSS:!0},"inline-color":{title:"Inline color",description:"Adds a small inline preview for colors in style sheets.",require:"css-extras",owner:"RunDevelopment"},previewers:{title:"Previewers",description:"Previewers for angles, colors, gradients, easing and time.",require:"css-extras",owner:"Golmote"},autoloader:{title:"Autoloader",description:"Automatically loads the needed languages to highlight the code blocks.",owner:"Golmote",noCSS:!0},"keep-markup":{title:"Keep Markup",description:"Prevents custom markup from being dropped out during highlighting.",owner:"Golmote",optional:"normalize-whitespace",noCSS:!0},"command-line":{title:"Command Line",description:"Display a command line with a prompt and, optionally, the output/response from the commands.",owner:"chriswells0"},"unescaped-markup":{title:"Unescaped Markup",description:"Write markup without having to escape anything."},"normalize-whitespace":{title:"Normalize Whitespace",description:"Supports multiple operations to normalize whitespace in code blocks.",owner:"zeitgeist87",optional:"unescaped-markup",noCSS:!0},"data-uri-highlight":{title:"Data-URI Highlight",description:"Highlights data-URI contents.",owner:"Golmote",noCSS:!0},toolbar:{title:"Toolbar",description:"Attach a toolbar for plugins to easily register buttons on the top of a code block.",owner:"mAAdhaTTah"},"copy-to-clipboard":{title:"Copy to Clipboard Button",description:"Add a button that copies the code block to the clipboard when clicked.",owner:"mAAdhaTTah",require:"toolbar",noCSS:!0},"download-button":{title:"Download Button",description:"A button in the toolbar of a code block adding a convenient way to download a code file.",owner:"Golmote",require:"toolbar",noCSS:!0},"match-braces":{title:"Match braces",description:"Highlights matching braces.",owner:"RunDevelopment"},"diff-highlight":{title:"Diff Highlight",description:"Highlights the code inside diff blocks.",owner:"RunDevelopment",require:"diff"},"filter-highlight-all":{title:"Filter highlightAll",description:"Filters the elements the highlightAll and highlightAllUnder methods actually highlight.",owner:"RunDevelopment",noCSS:!0},treeview:{title:"Treeview",description:"A language with special styles to highlight file system tree structures.",owner:"Golmote"}}})},7176:(e,t,n)=>{"use strict";var r,o=n(73126),a=n(75795);try{r=[].__proto__===Array.prototype}catch(c){if(!c||"object"!=typeof c||!("code"in c)||"ERR_PROTO_ACCESS"!==c.code)throw c}var i=!!r&&a&&a(Object.prototype,"__proto__"),s=Object,l=s.getPrototypeOf;e.exports=i&&"function"==typeof i.get?o([i.get]):"function"==typeof l&&function(e){return l(null==e?e:s(e))}},7463:(e,t,n)=>{"use strict";var r=n(96763);function o(e,t){var n=e.length;e.push(t);e:for(;0>>1,o=e[r];if(!(0>>1;rs(l,n))cs(u,l)?(e[r]=u,e[c]=n,r=c):(e[r]=l,e[i]=n,r=i);else{if(!(cs(u,n)))break e;e[r]=u,e[c]=n,r=c}}}return t}function s(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){var l=performance;t.unstable_now=function(){return l.now()}}else{var c=Date,u=c.now();t.unstable_now=function(){return c.now()-u}}var d=[],p=[],f=1,m=null,h=3,g=!1,b=!1,y=!1,v="function"==typeof setTimeout?setTimeout:null,w="function"==typeof clearTimeout?clearTimeout:null,x="undefined"!=typeof setImmediate?setImmediate:null;function k(e){for(var t=a(p);null!==t;){if(null===t.callback)i(p);else{if(!(t.startTime<=e))break;i(p),t.sortIndex=t.expirationTime,o(d,t)}t=a(p)}}function S(e){if(y=!1,k(e),!b)if(null!==a(d))b=!0,D(_);else{var t=a(p);null!==t&&L(S,t.startTime-e)}}function _(e,n){b=!1,y&&(y=!1,w(A),A=-1),g=!0;var r=h;try{for(k(n),m=a(d);null!==m&&(!(m.expirationTime>n)||e&&!T());){var o=m.callback;if("function"==typeof o){m.callback=null,h=m.priorityLevel;var s=o(m.expirationTime<=n);n=t.unstable_now(),"function"==typeof s?m.callback=s:m===a(d)&&i(d),k(n)}else i(d);m=a(d)}if(null!==m)var l=!0;else{var c=a(p);null!==c&&L(S,c.startTime-n),l=!1}return l}finally{m=null,h=r,g=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var E,j=!1,O=null,A=-1,C=5,P=-1;function T(){return!(t.unstable_now()-Pe||125i?(e.sortIndex=r,o(p,e),null===a(d)&&e===a(p)&&(y?(w(A),A=-1):y=!0,L(S,r-i))):(e.sortIndex=s,o(d,e),b||g||(b=!0,D(_))),e},t.unstable_shouldYield=T,t.unstable_wrapCallback=function(e){var t=h;return function(){var n=h;h=t;try{return e.apply(this,arguments)}finally{h=n}}}},8505:(e,t,n)=>{var r=n(64634);e.exports=h,e.exports.parse=a,e.exports.compile=function(e,t){return c(a(e,t),t)},e.exports.tokensToFunction=c,e.exports.tokensToRegExp=m;var o=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function a(e,t){for(var n,r=[],a=0,s=0,l="",c=t&&t.delimiter||"/";null!=(n=o.exec(e));){var u=n[0],p=n[1],f=n.index;if(l+=e.slice(s,f),s=f+u.length,p)l+=p[1];else{var m=e[s],h=n[2],g=n[3],b=n[4],y=n[5],v=n[6],w=n[7];l&&(r.push(l),l="");var x=null!=h&&null!=m&&m!==h,k="+"===v||"*"===v,S="?"===v||"*"===v,_=h||c,E=b||y,j=h||("string"==typeof r[r.length-1]?r[r.length-1]:"");r.push({name:g||a++,prefix:h||"",delimiter:_,optional:S,repeat:k,partial:x,asterisk:!!w,pattern:E?d(E):w?".*":i(_,j)})}}return s-1?"[^"+u(e)+"]+?":u(t)+"|(?:(?!"+u(t)+")[^"+u(e)+"])+?"}function s(e){return encodeURI(e).replace(/[\/?#]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}function l(e){return encodeURI(e).replace(/[?#]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}function c(e,t){for(var n=new Array(e.length),o=0;o{var r=n(96763);const o=n(6969),a=n(98380),i=new Set;function s(e){void 0===e?e=Object.keys(o.languages).filter(e=>"meta"!=e):Array.isArray(e)||(e=[e]);const t=[...i,...Object.keys(Prism.languages)];a(o,e,t).load(e=>{if(!(e in o.languages))return void(s.silent||r.warn("Language does not exist: "+e));const t="./prism-"+e;delete n.c[n(63157).resolve(t)],delete Prism.languages[e],n(63157)(t),i.add(e)})}s.silent=!1,e.exports=s},9394:(e,t,n)=>{"use strict";var r=n(89211);e.exports=function(){return"function"==typeof Object.is?Object.is:r}},9957:(e,t,n)=>{"use strict";var r=Function.prototype.call,o=Object.prototype.hasOwnProperty,a=n(66743);e.exports=a.call(r,o)},10076:e=>{"use strict";e.exports=Function.prototype.call},10119:(e,t,n)=>{"use strict";n.r(t)},10487:(e,t,n)=>{"use strict";var r=n(96897),o=n(30655),a=n(73126),i=n(12205);e.exports=function(e){var t=a(arguments),n=e.length-(arguments.length-1);return r(t,1+(n>0?n:0),!0)},o?o(e.exports,"apply",{value:i}):e.exports.apply=i},11002:e=>{"use strict";e.exports=Function.prototype.apply},11514:(e,t,n)=>{"use strict";var r=n(38403);e.exports=function(){return Object.assign?function(){if(!Object.assign)return!1;for(var e="abcdefghijklmnopqrst",t=e.split(""),n={},r=0;r{"use strict";n.d(t,{A:()=>a});var r=!0,o="Invariant failed";function a(e,t){if(!e){if(r)throw new Error(o);var n="function"==typeof t?t():t,a=n?"".concat(o,": ").concat(n):o;throw new Error(a)}}},11818:(e,t,n)=>{"use strict";n.r(t)},12205:(e,t,n)=>{"use strict";var r=n(66743),o=n(11002),a=n(13144);e.exports=function(){return a(r,o,arguments)}},12838:(e,t,n)=>{"use strict";n.d(t,{A:()=>qt});var r=n(96540),o=n(18215),a=n(67489),i=n(45500),s=n(56347),l=n(21312),c=n(75062),u=n(74848);const d="__docusaurus_skipToContent_fallback";function p(e){e.setAttribute("tabindex","-1"),e.focus(),e.removeAttribute("tabindex")}function f(){const e=(0,r.useRef)(null),{action:t}=(0,s.W6)(),n=(0,r.useCallback)(e=>{e.preventDefault();const t=document.querySelector("main:first-of-type")??document.getElementById(d);t&&p(t)},[]);return(0,c.$)(({location:n})=>{e.current&&!n.hash&&"PUSH"===t&&p(e.current)}),{containerRef:e,onClick:n}}const m=(0,l.T)({id:"theme.common.skipToMainContent",description:"The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation",message:"Skip to main content"});function h(e){const t=e.children??m,{containerRef:n,onClick:r}=f();return(0,u.jsx)("div",{ref:n,role:"region","aria-label":m,children:(0,u.jsx)("a",{...e,href:`#${d}`,onClick:r,children:t})})}var g=n(17559),b=n(14090);const y={skipToContent:"skipToContent_fXgn"};function v(){return(0,u.jsx)(h,{className:y.skipToContent})}var w=n(6342),x=n(65041);function k({width:e=21,height:t=21,color:n="currentColor",strokeWidth:r=1.2,className:o,...a}){return(0,u.jsx)("svg",{viewBox:"0 0 15 15",width:e,height:t,...a,children:(0,u.jsx)("g",{stroke:n,strokeWidth:r,children:(0,u.jsx)("path",{d:"M.75.75l13.5 13.5M14.25.75L.75 14.25"})})})}const S={closeButton:"closeButton_CVFx"};function _(e){return(0,u.jsx)("button",{type:"button","aria-label":(0,l.T)({id:"theme.AnnouncementBar.closeButtonAriaLabel",message:"Close",description:"The ARIA label for close button of announcement bar"}),...e,className:(0,o.A)("clean-btn close",S.closeButton,e.className),children:(0,u.jsx)(k,{width:14,height:14,strokeWidth:3.1})})}const E={content:"content_knG7"};function j(e){const{announcementBar:t}=(0,w.p)(),{content:n}=t;return(0,u.jsx)("div",{...e,className:(0,o.A)(E.content,e.className),dangerouslySetInnerHTML:{__html:n}})}const O={announcementBar:"announcementBar_mb4j",announcementBarPlaceholder:"announcementBarPlaceholder_vyr4",announcementBarClose:"announcementBarClose_gvF7",announcementBarContent:"announcementBarContent_xLdY"};function A(){const{announcementBar:e}=(0,w.p)(),{isActive:t,close:n}=(0,x.M)();if(!t)return null;const{backgroundColor:r,textColor:a,isCloseable:i}=e;return(0,u.jsxs)("div",{className:(0,o.A)(g.G.announcementBar.container,O.announcementBar),style:{backgroundColor:r,color:a},role:"banner",children:[i&&(0,u.jsx)("div",{className:O.announcementBarPlaceholder}),(0,u.jsx)(j,{className:O.announcementBarContent}),i&&(0,u.jsx)(_,{onClick:n,className:O.announcementBarClose})]})}var C=n(22069),P=n(23104);var T=n(89532),I=n(75600);const R=r.createContext(null);function N({children:e}){const t=function(){const e=(0,C.M)(),t=(0,I.YL)(),[n,o]=(0,r.useState)(!1),a=null!==t.component,i=(0,T.ZC)(a);return(0,r.useEffect)(()=>{a&&!i&&o(!0)},[a,i]),(0,r.useEffect)(()=>{a?e.shown||o(!0):o(!1)},[e.shown,a]),(0,r.useMemo)(()=>[n,o],[n])}();return(0,u.jsx)(R.Provider,{value:t,children:e})}function D(e){if(e.component){const t=e.component;return(0,u.jsx)(t,{...e.props})}}function L(){const e=(0,r.useContext)(R);if(!e)throw new T.dV("NavbarSecondaryMenuDisplayProvider");const[t,n]=e,o=(0,r.useCallback)(()=>n(!1),[n]),a=(0,I.YL)();return(0,r.useMemo)(()=>({shown:t,hide:o,content:D(a)}),[o,a,t])}function M(e){return parseInt(r.version.split(".")[0],10)<19?{inert:e?"":void 0}:{inert:e}}function F({children:e,inert:t}){return(0,u.jsx)("div",{className:(0,o.A)(g.G.layout.navbar.mobileSidebar.panel,"navbar-sidebar__item menu"),...M(t),children:e})}function z({header:e,primaryMenu:t,secondaryMenu:n}){const{shown:r}=L();return(0,u.jsxs)("div",{className:(0,o.A)(g.G.layout.navbar.mobileSidebar.container,"navbar-sidebar"),children:[e,(0,u.jsxs)("div",{className:(0,o.A)("navbar-sidebar__items",{"navbar-sidebar__items--show-secondary":r}),children:[(0,u.jsx)(F,{inert:r,children:t}),(0,u.jsx)(F,{inert:!r,children:n})]})]})}var B=n(95293),U=n(92303);function q(e){return(0,u.jsx)("svg",{viewBox:"0 0 24 24",width:24,height:24,...e,children:(0,u.jsx)("path",{fill:"currentColor",d:"M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"})})}function $(e){return(0,u.jsx)("svg",{viewBox:"0 0 24 24",width:24,height:24,...e,children:(0,u.jsx)("path",{fill:"currentColor",d:"M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"})})}function H(e){return(0,u.jsx)("svg",{viewBox:"0 0 24 24",width:24,height:24,...e,children:(0,u.jsx)("path",{fill:"currentColor",d:"m12 21c4.971 0 9-4.029 9-9s-4.029-9-9-9-9 4.029-9 9 4.029 9 9 9zm4.95-13.95c1.313 1.313 2.05 3.093 2.05 4.95s-0.738 3.637-2.05 4.95c-1.313 1.313-3.093 2.05-4.95 2.05v-14c1.857 0 3.637 0.737 4.95 2.05z"})})}const G="toggle_vylO",V="toggleButton_gllP",W="toggleIcon_g3eP",K="systemToggleIcon_QzmC",Q="lightToggleIcon_pyhR",Y="darkToggleIcon_wfgR",J="toggleButtonDisabled_aARS";function Z(e){switch(e){case null:return(0,l.T)({message:"system mode",id:"theme.colorToggle.ariaLabel.mode.system",description:"The name for the system color mode"});case"light":return(0,l.T)({message:"light mode",id:"theme.colorToggle.ariaLabel.mode.light",description:"The name for the light color mode"});case"dark":return(0,l.T)({message:"dark mode",id:"theme.colorToggle.ariaLabel.mode.dark",description:"The name for the dark color mode"});default:throw new Error(`unexpected color mode ${e}`)}}function X(e){return(0,l.T)({message:"Switch between dark and light mode (currently {mode})",id:"theme.colorToggle.ariaLabel",description:"The ARIA label for the color mode toggle"},{mode:Z(e)})}function ee(){return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(q,{"aria-hidden":!0,className:(0,o.A)(W,Q)}),(0,u.jsx)($,{"aria-hidden":!0,className:(0,o.A)(W,Y)}),(0,u.jsx)(H,{"aria-hidden":!0,className:(0,o.A)(W,K)})]})}function te({className:e,buttonClassName:t,respectPrefersColorScheme:n,value:r,onChange:a}){const i=(0,U.A)();return(0,u.jsx)("div",{className:(0,o.A)(G,e),children:(0,u.jsx)("button",{className:(0,o.A)("clean-btn",V,!i&&J,t),type:"button",onClick:()=>a(function(e,t){if(!t)return"dark"===e?"light":"dark";switch(e){case null:return"light";case"light":return"dark";case"dark":return null;default:throw new Error(`unexpected color mode ${e}`)}}(r,n)),disabled:!i,title:Z(r),"aria-label":X(r),children:(0,u.jsx)(ee,{})})})}const ne=r.memo(te),re={darkNavbarColorModeToggle:"darkNavbarColorModeToggle_X3D1"};function oe({className:e}){const t=(0,w.p)().navbar.style,{disableSwitch:n,respectPrefersColorScheme:r}=(0,w.p)().colorMode,{colorModeChoice:o,setColorMode:a}=(0,B.G)();return n?null:(0,u.jsx)(ne,{className:e,buttonClassName:"dark"===t?re.darkNavbarColorModeToggle:void 0,respectPrefersColorScheme:r,value:o,onChange:a})}var ae=n(23465);function ie(){return(0,u.jsx)(ae.A,{className:"navbar__brand",imageClassName:"navbar__logo",titleClassName:"navbar__title text--truncate"})}function se(){const e=(0,C.M)();return(0,u.jsx)("button",{type:"button","aria-label":(0,l.T)({id:"theme.docs.sidebar.closeSidebarButtonAriaLabel",message:"Close navigation bar",description:"The ARIA label for close button of mobile sidebar"}),className:"clean-btn navbar-sidebar__close",onClick:()=>e.toggle(),children:(0,u.jsx)(k,{color:"var(--ifm-color-emphasis-600)"})})}function le(){return(0,u.jsxs)("div",{className:"navbar-sidebar__brand",children:[(0,u.jsx)(ie,{}),(0,u.jsx)(oe,{className:"margin-right--md"}),(0,u.jsx)(se,{})]})}var ce=n(28774),ue=n(86025),de=n(16654),pe=n(91252),fe=n(43186);function me({activeBasePath:e,activeBaseRegex:t,to:n,href:r,label:o,html:a,isDropdownLink:i,prependBaseUrlToHref:s,...l}){const c=(0,ue.Ay)(n),d=(0,ue.Ay)(e),p=(0,ue.Ay)(r,{forcePrependBaseUrl:!0}),f=o&&r&&!(0,de.A)(r),m=a?{dangerouslySetInnerHTML:{__html:a}}:{children:(0,u.jsxs)(u.Fragment,{children:[o,f&&(0,u.jsx)(fe.A,{...i&&{width:12,height:12}})]})};return r?(0,u.jsx)(ce.A,{href:s?p:r,...l,...m}):(0,u.jsx)(ce.A,{to:c,isNavLink:!0,...(e||t)&&{isActive:(e,n)=>t?(0,pe.G)(t,n.pathname):n.pathname.startsWith(d)},...l,...m})}function he({className:e,isDropdownItem:t,...n}){return(0,u.jsx)("li",{className:"menu__list-item",children:(0,u.jsx)(me,{className:(0,o.A)("menu__link",e),...n})})}function ge({className:e,isDropdownItem:t=!1,...n}){const r=(0,u.jsx)(me,{className:(0,o.A)(t?"dropdown__link":"navbar__item navbar__link",e),isDropdownLink:t,...n});return t?(0,u.jsx)("li",{children:r}):r}function be({mobile:e=!1,position:t,...n}){const r=e?he:ge;return(0,u.jsx)(r,{...n,activeClassName:n.activeClassName??(e?"menu__link--active":"navbar__link--active")})}var ye=n(41422),ve=n(99169),we=n(44586);const xe="dropdownNavbarItemMobile_J0Sd";function ke(e,t){return e.some(e=>function(e,t){return!!(0,ve.ys)(e.to,t)||!!(0,pe.G)(e.activeBaseRegex,t)||!(!e.activeBasePath||!t.startsWith(e.activeBasePath))}(e,t))}function Se({collapsed:e,onClick:t}){return(0,u.jsx)("button",{"aria-label":e?(0,l.T)({id:"theme.navbar.mobileDropdown.collapseButton.expandAriaLabel",message:"Expand the dropdown",description:"The ARIA label of the button to expand the mobile dropdown navbar item"}):(0,l.T)({id:"theme.navbar.mobileDropdown.collapseButton.collapseAriaLabel",message:"Collapse the dropdown",description:"The ARIA label of the button to collapse the mobile dropdown navbar item"}),"aria-expanded":!e,type:"button",className:"clean-btn menu__caret",onClick:t})}function _e({items:e,className:t,position:n,onClick:a,...i}){const l=function(){const{siteConfig:{baseUrl:e}}=(0,we.A)(),{pathname:t}=(0,s.zy)();return t.replace(e,"/")}(),c=(0,ve.ys)(i.to,l),d=ke(e,l),{collapsed:p,toggleCollapsed:f}=function({active:e}){const{collapsed:t,toggleCollapsed:n,setCollapsed:o}=(0,ye.u)({initialState:()=>!e});return(0,r.useEffect)(()=>{e&&o(!1)},[e,o]),{collapsed:t,toggleCollapsed:n}}({active:c||d}),m=i.to?void 0:"#";return(0,u.jsxs)("li",{className:(0,o.A)("menu__list-item",{"menu__list-item--collapsed":p}),children:[(0,u.jsxs)("div",{className:(0,o.A)("menu__list-item-collapsible",{"menu__list-item-collapsible--active":c}),children:[(0,u.jsx)(me,{role:"button",className:(0,o.A)(xe,"menu__link menu__link--sublist",t),href:m,...i,onClick:e=>{"#"===m&&e.preventDefault(),f()},children:i.children??i.label}),(0,u.jsx)(Se,{collapsed:p,onClick:e=>{e.preventDefault(),f()}})]}),(0,u.jsx)(ye.N,{lazy:!0,as:"ul",className:"menu__list",collapsed:p,children:e.map((e,t)=>(0,r.createElement)(Xe,{mobile:!0,isDropdownItem:!0,onClick:a,activeClassName:"menu__link--active",...e,key:t}))})]})}function Ee({items:e,position:t,className:n,onClick:a,...i}){const s=(0,r.useRef)(null),[l,c]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{const e=e=>{s.current&&!s.current.contains(e.target)&&c(!1)};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),document.addEventListener("focusin",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e),document.removeEventListener("focusin",e)}},[s]),(0,u.jsxs)("div",{ref:s,className:(0,o.A)("navbar__item","dropdown","dropdown--hoverable",{"dropdown--right":"right"===t,"dropdown--show":l}),children:[(0,u.jsx)(me,{"aria-haspopup":"true","aria-expanded":l,role:"button",href:i.to?void 0:"#",className:(0,o.A)("navbar__link",n),...i,onClick:i.to?void 0:e=>e.preventDefault(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),c(!l))},children:i.children??i.label}),(0,u.jsx)("ul",{className:"dropdown__menu",children:e.map((e,t)=>(0,r.createElement)(Xe,{isDropdownItem:!0,activeClassName:"dropdown__link--active",...e,key:t}))})]})}function je({mobile:e=!1,...t}){const n=e?_e:Ee;return(0,u.jsx)(n,{...t})}var Oe=n(32131);function Ae({width:e=20,height:t=20,...n}){return(0,u.jsx)("svg",{viewBox:"0 0 24 24",width:e,height:t,"aria-hidden":!0,...n,children:(0,u.jsx)("path",{fill:"currentColor",d:"M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"})})}const Ce="iconLanguage_nlXk";var Pe=n(40961),Te=n(55600),Ie=n(5260),Re=n(24255),Ne=n(51062),De=n(2967),Le=n(82565);function Me(){return[`language:${(0,we.A)().i18n.currentLocale}`,function(){const e=(0,Le.v)();return[De.C,...e]}().map(e=>`docusaurus_tag:${e}`)]}const Fe={button:{buttonText:(0,l.T)({id:"theme.SearchBar.label",message:"Search",description:"The ARIA label and placeholder for search button"}),buttonAriaLabel:(0,l.T)({id:"theme.SearchBar.label",message:"Search",description:"The ARIA label and placeholder for search button"})},modal:{searchBox:{resetButtonTitle:(0,l.T)({id:"theme.SearchModal.searchBox.resetButtonTitle",message:"Clear the query",description:"The label and ARIA label for search box reset button"}),resetButtonAriaLabel:(0,l.T)({id:"theme.SearchModal.searchBox.resetButtonTitle",message:"Clear the query",description:"The label and ARIA label for search box reset button"}),cancelButtonText:(0,l.T)({id:"theme.SearchModal.searchBox.cancelButtonText",message:"Cancel",description:"The label and ARIA label for search box cancel button"}),cancelButtonAriaLabel:(0,l.T)({id:"theme.SearchModal.searchBox.cancelButtonText",message:"Cancel",description:"The label and ARIA label for search box cancel button"})},startScreen:{recentSearchesTitle:(0,l.T)({id:"theme.SearchModal.startScreen.recentSearchesTitle",message:"Recent",description:"The title for recent searches"}),noRecentSearchesText:(0,l.T)({id:"theme.SearchModal.startScreen.noRecentSearchesText",message:"No recent searches",description:"The text when no recent searches"}),saveRecentSearchButtonTitle:(0,l.T)({id:"theme.SearchModal.startScreen.saveRecentSearchButtonTitle",message:"Save this search",description:"The label for save recent search button"}),removeRecentSearchButtonTitle:(0,l.T)({id:"theme.SearchModal.startScreen.removeRecentSearchButtonTitle",message:"Remove this search from history",description:"The label for remove recent search button"}),favoriteSearchesTitle:(0,l.T)({id:"theme.SearchModal.startScreen.favoriteSearchesTitle",message:"Favorite",description:"The title for favorite searches"}),removeFavoriteSearchButtonTitle:(0,l.T)({id:"theme.SearchModal.startScreen.removeFavoriteSearchButtonTitle",message:"Remove this search from favorites",description:"The label for remove favorite search button"})},errorScreen:{titleText:(0,l.T)({id:"theme.SearchModal.errorScreen.titleText",message:"Unable to fetch results",description:"The title for error screen of search modal"}),helpText:(0,l.T)({id:"theme.SearchModal.errorScreen.helpText",message:"You might want to check your network connection.",description:"The help text for error screen of search modal"})},footer:{selectText:(0,l.T)({id:"theme.SearchModal.footer.selectText",message:"to select",description:"The explanatory text of the action for the enter key"}),selectKeyAriaLabel:(0,l.T)({id:"theme.SearchModal.footer.selectKeyAriaLabel",message:"Enter key",description:"The ARIA label for the Enter key button that makes the selection"}),navigateText:(0,l.T)({id:"theme.SearchModal.footer.navigateText",message:"to navigate",description:"The explanatory text of the action for the Arrow up and Arrow down key"}),navigateUpKeyAriaLabel:(0,l.T)({id:"theme.SearchModal.footer.navigateUpKeyAriaLabel",message:"Arrow up",description:"The ARIA label for the Arrow up key button that makes the navigation"}),navigateDownKeyAriaLabel:(0,l.T)({id:"theme.SearchModal.footer.navigateDownKeyAriaLabel",message:"Arrow down",description:"The ARIA label for the Arrow down key button that makes the navigation"}),closeText:(0,l.T)({id:"theme.SearchModal.footer.closeText",message:"to close",description:"The explanatory text of the action for Escape key"}),closeKeyAriaLabel:(0,l.T)({id:"theme.SearchModal.footer.closeKeyAriaLabel",message:"Escape key",description:"The ARIA label for the Escape key button that close the modal"}),searchByText:(0,l.T)({id:"theme.SearchModal.footer.searchByText",message:"Search by",description:"The text explain that the search is making by Algolia"})},noResultsScreen:{noResultsText:(0,l.T)({id:"theme.SearchModal.noResultsScreen.noResultsText",message:"No results for",description:"The text explains that there are no results for the following search"}),suggestedQueryText:(0,l.T)({id:"theme.SearchModal.noResultsScreen.suggestedQueryText",message:"Try searching for",description:"The text for the suggested query when no results are found for the following search"}),reportMissingResultsText:(0,l.T)({id:"theme.SearchModal.noResultsScreen.reportMissingResultsText",message:"Believe this query should return results?",description:"The text for the question where the user thinks there are missing results"}),reportMissingResultsLinkText:(0,l.T)({id:"theme.SearchModal.noResultsScreen.reportMissingResultsLinkText",message:"Let us know.",description:"The text for the link to report missing results"})}},placeholder:(0,l.T)({id:"theme.SearchModal.placeholder",message:"Search docs",description:"The placeholder of the input of the DocSearch pop-up modal"})};let ze=null;function Be(){return ze?Promise.resolve():Promise.all([n.e(8158).then(n.bind(n,48158)),Promise.all([n.e(1869),n.e(8913)]).then(n.bind(n,58913)),Promise.all([n.e(1869),n.e(416)]).then(n.bind(n,90416))]).then(([{DocSearchModal:e}])=>{ze=e})}function Ue({hit:e,children:t}){return(0,u.jsx)(ce.A,{to:e.url,children:t})}function qe({state:e,onClose:t}){const n=(0,Re.w)();return(0,u.jsx)(ce.A,{to:n(e.query),onClick:t,children:(0,u.jsx)(l.A,{id:"theme.SearchBar.seeAll",values:{count:e.context.nbHits},children:"See all {count} results"})})}function $e({externalUrlRegex:e,...t}){const n=function({externalUrlRegex:e}){const t=(0,s.W6)(),[n]=(0,r.useState)(()=>({navigate(n){(0,pe.G)(e,n.itemUrl)?window.location.href=n.itemUrl:t.push(n.itemUrl)}}));return n}({externalUrlRegex:e}),o=function({contextualSearch:e,...t}){const n=Me(),r=t.searchParameters?.facetFilters??[],o=e?function(e,t){const n=e=>"string"==typeof e?[e]:e;return[...n(e),...n(t)]}(n,r):r;return{...t.searchParameters,facetFilters:o}}({...t}),a=function(e){const t=(0,Ne.C)(),[n]=(0,r.useState)(()=>n=>e.transformItems?e.transformItems(n):n.map(e=>({...e,url:t(e.url)})));return n}(t),i=function(){const{siteMetadata:{docusaurusVersion:e}}=(0,we.A)();return(0,r.useCallback)(t=>(t.addAlgoliaAgent("docusaurus",e),t),[e])}(),l=(0,r.useRef)(null),c=(0,r.useRef)(null),[d,p]=(0,r.useState)(!1),[f,m]=(0,r.useState)(void 0),h=(0,r.useCallback)(()=>{if(!l.current){const e=document.createElement("div");l.current=e,document.body.insertBefore(e,document.body.firstChild)}},[]),g=(0,r.useCallback)(()=>{h(),Be().then(()=>p(!0))},[h]),b=(0,r.useCallback)(()=>{p(!1),c.current?.focus(),m(void 0)},[]),y=(0,r.useCallback)(e=>{"f"===e.key&&(e.metaKey||e.ctrlKey)||(e.preventDefault(),m(e.key),g())},[g]),v=function({closeModal:e}){return(0,r.useMemo)(()=>({state:t})=>(0,u.jsx)(qe,{state:t,onClose:e}),[e])}({closeModal:b});return(0,Te.E8)({isOpen:d,onOpen:g,onClose:b,onInput:y,searchButtonRef:c}),(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(Ie.A,{children:(0,u.jsx)("link",{rel:"preconnect",href:`https://${t.appId}-dsn.algolia.net`,crossOrigin:"anonymous"})}),(0,u.jsx)(Te.Bc,{onTouchStart:Be,onFocus:Be,onMouseOver:Be,onClick:g,ref:c,translations:t.translations?.button??Fe.button}),d&&ze&&l.current&&(0,Pe.createPortal)((0,u.jsx)(ze,{onClose:b,initialScrollY:window.scrollY,initialQuery:f,navigator:n,transformItems:a,hitComponent:Ue,transformSearchClient:i,...t.searchPagePath&&{resultsFooterComponent:v},placeholder:Fe.placeholder,...t,translations:t.translations?.modal??Fe.modal,searchParameters:o}),l.current)]})}function He(){const{siteConfig:e}=(0,we.A)();return(0,u.jsx)($e,{...e.themeConfig.algolia})}const Ge={navbarSearchContainer:"navbarSearchContainer_Bca1"};function Ve({children:e,className:t}){return(0,u.jsx)("div",{className:(0,o.A)(t,Ge.navbarSearchContainer),children:e})}var We=n(44070),Ke=n(26972);var Qe=n(53886);function Ye({docsPluginId:e,configs:t}){return function(e,t){if(t){const n=new Map(e.map(e=>[e.name,e])),r=(t,r)=>{const o=n.get(t);if(!o)throw new Error(`No docs version exist for name '${t}', please verify your 'docsVersionDropdown' navbar item versions config.\nAvailable version names:\n- ${e.map(e=>`${e.name}`).join("\n- ")}`);return{version:o,label:r?.label??o.label}};return Array.isArray(t)?t.map(e=>r(e,void 0)):Object.entries(t).map(([e,t])=>r(e,t))}return e.map(e=>({version:e,label:e.label}))}((0,We.jh)(e),t)}function Je(e,t){return t.alternateDocVersions[e.name]??function(e){return e.docs.find(t=>t.id===e.mainDocId)}(e)}const Ze={default:be,localeDropdown:function({mobile:e,dropdownItemsBefore:t,dropdownItemsAfter:n,queryString:r="",...o}){const{i18n:{currentLocale:a,locales:i,localeConfigs:c}}=(0,we.A)(),d=(0,Oe.o)(),{search:p,hash:f}=(0,s.zy)(),m=[...t,...i.map(t=>{const n=`${`pathname://${d.createUrl({locale:t,fullyQualified:!1})}`}${p}${f}${r}`;return{label:c[t].label,lang:c[t].htmlLang,to:n,target:"_self",autoAddBaseUrl:!1,className:t===a?e?"menu__link--active":"dropdown__link--active":""}}),...n],h=e?(0,l.T)({message:"Languages",id:"theme.navbar.mobileLanguageDropdown.label",description:"The label for the mobile language switcher dropdown"}):c[a].label;return(0,u.jsx)(je,{...o,mobile:e,label:(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(Ae,{className:Ce}),h]}),items:m})},search:function({mobile:e,className:t}){return e?null:(0,u.jsx)(Ve,{className:t,children:(0,u.jsx)(He,{})})},dropdown:je,html:function({value:e,className:t,mobile:n=!1,isDropdownItem:r=!1}){const a=r?"li":"div";return(0,u.jsx)(a,{className:(0,o.A)({navbar__item:!n&&!r,"menu__list-item":n},t),dangerouslySetInnerHTML:{__html:e}})},doc:function({docId:e,label:t,docsPluginId:n,...r}){const{activeDoc:o}=(0,We.zK)(n),a=(0,Ke.QB)(e,n),i=o?.path===a?.path;return null===a||a.unlisted&&!i?null:(0,u.jsx)(be,{exact:!0,...r,isActive:()=>i||!!o?.sidebar&&o.sidebar===a.sidebar,label:t??a.id,to:a.path})},docSidebar:function({sidebarId:e,label:t,docsPluginId:n,...r}){const{activeDoc:o}=(0,We.zK)(n),a=(0,Ke.fW)(e,n).link;if(!a)throw new Error(`DocSidebarNavbarItem: Sidebar with ID "${e}" doesn't have anything to be linked to.`);return(0,u.jsx)(be,{exact:!0,...r,isActive:()=>o?.sidebar===e,label:t??a.label,to:a.path})},docsVersion:function({label:e,to:t,docsPluginId:n,...r}){const o=(0,Ke.Vd)(n)[0],a=e??o.label,i=t??(e=>e.docs.find(t=>t.id===e.mainDocId))(o).path;return(0,u.jsx)(be,{...r,label:a,to:i})},docsVersionDropdown:function({mobile:e,docsPluginId:t,dropdownActiveClassDisabled:n,dropdownItemsBefore:r,dropdownItemsAfter:o,versions:a,...i}){const{search:c,hash:d}=(0,s.zy)(),p=(0,We.zK)(t),{savePreferredVersionName:f}=(0,Qe.g1)(t),m=Ye({docsPluginId:t,configs:a}),h=function({docsPluginId:e,versionItems:t}){return(0,Ke.Vd)(e).map(e=>t.find(t=>t.version===e)).filter(e=>void 0!==e)[0]??t[0]}({docsPluginId:t,versionItems:m}),g=[...r,...m.map(function({version:e,label:t}){return{label:t,to:`${Je(e,p).path}${c}${d}`,isActive:()=>e===p.activeVersion,onClick:()=>f(e.name)}}),...o],b=e&&g.length>1?(0,l.T)({id:"theme.navbar.mobileVersionsDropdown.label",message:"Versions",description:"The label for the navbar versions dropdown on mobile view"}):h.label,y=e&&g.length>1?void 0:Je(h.version,p).path;return g.length<=1?(0,u.jsx)(be,{...i,mobile:e,label:b,to:y,isActive:n?()=>!1:void 0}):(0,u.jsx)(je,{...i,mobile:e,label:b,to:y,items:g,isActive:n?()=>!1:void 0})}};function Xe({type:e,...t}){const n=function(e,t){return e&&"default"!==e?e:"items"in t?"dropdown":"default"}(e,t),r=Ze[n];if(!r)throw new Error(`No NavbarItem component found for type "${e}".`);return(0,u.jsx)(r,{...t})}function et(){const e=(0,C.M)(),t=(0,w.p)().navbar.items;return(0,u.jsx)("ul",{className:"menu__list",children:t.map((t,n)=>(0,r.createElement)(Xe,{mobile:!0,...t,onClick:()=>e.toggle(),key:n}))})}function tt(e){return(0,u.jsx)("button",{...e,type:"button",className:"clean-btn navbar-sidebar__back",children:(0,u.jsx)(l.A,{id:"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel",description:"The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)",children:"\u2190 Back to main menu"})})}function nt(){const e=0===(0,w.p)().navbar.items.length,t=L();return(0,u.jsxs)(u.Fragment,{children:[!e&&(0,u.jsx)(tt,{onClick:()=>t.hide()}),t.content]})}function rt(){const e=(0,C.M)();return function(e=!0){(0,r.useEffect)(()=>(document.body.style.overflow=e?"hidden":"visible",()=>{document.body.style.overflow="visible"}),[e])}(e.shown),e.shouldRender?(0,u.jsx)(z,{header:(0,u.jsx)(le,{}),primaryMenu:(0,u.jsx)(et,{}),secondaryMenu:(0,u.jsx)(nt,{})}):null}const ot={navbarHideable:"navbarHideable_m1mJ",navbarHidden:"navbarHidden_jGov"};function at(e){return(0,u.jsx)("div",{role:"presentation",...e,className:(0,o.A)("navbar-sidebar__backdrop",e.className)})}function it({children:e}){const{navbar:{hideOnScroll:t,style:n}}=(0,w.p)(),a=(0,C.M)(),{navbarRef:i,isNavbarVisible:s}=function(e){const[t,n]=(0,r.useState)(e),o=(0,r.useRef)(!1),a=(0,r.useRef)(0),i=(0,r.useCallback)(e=>{null!==e&&(a.current=e.getBoundingClientRect().height)},[]);return(0,P.Mq)(({scrollY:t},r)=>{if(!e)return;if(t=i?n(!1):t+l{if(!e)return;const r=t.location.hash;if(r?document.getElementById(r.substring(1)):void 0)return o.current=!0,void n(!1);n(!0)}),{navbarRef:i,isNavbarVisible:t}}(t);return(0,u.jsxs)("nav",{ref:i,"aria-label":(0,l.T)({id:"theme.NavBar.navAriaLabel",message:"Main",description:"The ARIA label for the main navigation"}),className:(0,o.A)(g.G.layout.navbar.container,"navbar","navbar--fixed-top",t&&[ot.navbarHideable,!s&&ot.navbarHidden],{"navbar--dark":"dark"===n,"navbar--primary":"primary"===n,"navbar-sidebar--show":a.shown}),children:[e,(0,u.jsx)(at,{onClick:a.toggle}),(0,u.jsx)(rt,{})]})}var st=n(70440);const lt={errorBoundaryError:"errorBoundaryError_a6uf",errorBoundaryFallback:"errorBoundaryFallback_VBag"};function ct(e){return(0,u.jsx)("button",{type:"button",...e,children:(0,u.jsx)(l.A,{id:"theme.ErrorPageContent.tryAgain",description:"The label of the button to try again rendering when the React error boundary captures an error",children:"Try again"})})}function ut({error:e}){const t=(0,st.rA)(e).map(e=>e.message).join("\n\nCause:\n");return(0,u.jsx)("p",{className:lt.errorBoundaryError,children:t})}class dt extends r.Component{componentDidCatch(e,t){throw this.props.onError(e,t)}render(){return this.props.children}}const pt="right";function ft({width:e=30,height:t=30,className:n,...r}){return(0,u.jsx)("svg",{className:n,width:e,height:t,viewBox:"0 0 30 30","aria-hidden":"true",...r,children:(0,u.jsx)("path",{stroke:"currentColor",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"M4 7h22M4 15h22M4 23h22"})})}function mt(){const{toggle:e,shown:t}=(0,C.M)();return(0,u.jsx)("button",{onClick:e,"aria-label":(0,l.T)({id:"theme.docs.sidebar.toggleSidebarButtonAriaLabel",message:"Toggle navigation bar",description:"The ARIA label for hamburger menu button of mobile navigation"}),"aria-expanded":t,className:"navbar__toggle clean-btn",type:"button",children:(0,u.jsx)(ft,{})})}const ht={colorModeToggle:"colorModeToggle_DEke"};function gt({items:e}){return(0,u.jsx)(u.Fragment,{children:e.map((e,t)=>(0,u.jsx)(dt,{onError:t=>new Error(`A theme navbar item failed to render.\nPlease double-check the following navbar item (themeConfig.navbar.items) of your Docusaurus config:\n${JSON.stringify(e,null,2)}`,{cause:t}),children:(0,u.jsx)(Xe,{...e})},t))})}function bt({left:e,right:t}){return(0,u.jsxs)("div",{className:"navbar__inner",children:[(0,u.jsx)("div",{className:(0,o.A)(g.G.layout.navbar.containerLeft,"navbar__items"),children:e}),(0,u.jsx)("div",{className:(0,o.A)(g.G.layout.navbar.containerRight,"navbar__items navbar__items--right"),children:t})]})}function yt(){const e=(0,C.M)(),t=(0,w.p)().navbar.items,[n,r]=function(e){function t(e){return"left"===(e.position??pt)}return[e.filter(t),e.filter(e=>!t(e))]}(t),o=t.find(e=>"search"===e.type);return(0,u.jsx)(bt,{left:(0,u.jsxs)(u.Fragment,{children:[!e.disabled&&(0,u.jsx)(mt,{}),(0,u.jsx)(ie,{}),(0,u.jsx)(gt,{items:n})]}),right:(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(gt,{items:r}),(0,u.jsx)(oe,{className:ht.colorModeToggle}),!o&&(0,u.jsx)(Ve,{children:(0,u.jsx)(He,{})})]})})}function vt(){return(0,u.jsx)(it,{children:(0,u.jsx)(yt,{})})}function wt({item:e}){const{to:t,href:n,label:r,prependBaseUrlToHref:a,className:i,...s}=e,l=(0,ue.Ay)(t),c=(0,ue.Ay)(n,{forcePrependBaseUrl:!0});return(0,u.jsxs)(ce.A,{className:(0,o.A)("footer__link-item",i),...n?{href:a?c:n}:{to:l},...s,children:[r,n&&!(0,de.A)(n)&&(0,u.jsx)(fe.A,{})]})}function xt({item:e}){return e.html?(0,u.jsx)("li",{className:(0,o.A)("footer__item",e.className),dangerouslySetInnerHTML:{__html:e.html}}):(0,u.jsx)("li",{className:"footer__item",children:(0,u.jsx)(wt,{item:e})},e.href??e.to)}function kt({column:e}){return(0,u.jsxs)("div",{className:(0,o.A)(g.G.layout.footer.column,"col footer__col",e.className),children:[(0,u.jsx)("div",{className:"footer__title",children:e.title}),(0,u.jsx)("ul",{className:"footer__items clean-list",children:e.items.map((e,t)=>(0,u.jsx)(xt,{item:e},t))})]})}function St({columns:e}){return(0,u.jsx)("div",{className:"row footer__links",children:e.map((e,t)=>(0,u.jsx)(kt,{column:e},t))})}function _t(){return(0,u.jsx)("span",{className:"footer__link-separator",children:"\xb7"})}function Et({item:e}){return e.html?(0,u.jsx)("span",{className:(0,o.A)("footer__link-item",e.className),dangerouslySetInnerHTML:{__html:e.html}}):(0,u.jsx)(wt,{item:e})}function jt({links:e}){return(0,u.jsx)("div",{className:"footer__links text--center",children:(0,u.jsx)("div",{className:"footer__links",children:e.map((t,n)=>(0,u.jsxs)(r.Fragment,{children:[(0,u.jsx)(Et,{item:t}),e.length!==n+1&&(0,u.jsx)(_t,{})]},n))})})}function Ot({links:e}){return function(e){return"title"in e[0]}(e)?(0,u.jsx)(St,{columns:e}):(0,u.jsx)(jt,{links:e})}var At=n(21122);const Ct="footerLogoLink_BH7S";function Pt({logo:e}){const{withBaseUrl:t}=(0,ue.hH)(),n={light:t(e.src),dark:t(e.srcDark??e.src)};return(0,u.jsx)(At.A,{className:(0,o.A)("footer__logo",e.className),alt:e.alt,sources:n,width:e.width,height:e.height,style:e.style})}function Tt({logo:e}){return e.href?(0,u.jsx)(ce.A,{href:e.href,className:Ct,target:e.target,children:(0,u.jsx)(Pt,{logo:e})}):(0,u.jsx)(Pt,{logo:e})}function It({copyright:e}){return(0,u.jsx)("div",{className:"footer__copyright",dangerouslySetInnerHTML:{__html:e}})}function Rt({style:e,links:t,logo:n,copyright:r}){return(0,u.jsx)("footer",{className:(0,o.A)(g.G.layout.footer.container,"footer",{"footer--dark":"dark"===e}),children:(0,u.jsxs)("div",{className:"container container-fluid",children:[t,(n||r)&&(0,u.jsxs)("div",{className:"footer__bottom text--center",children:[n&&(0,u.jsx)("div",{className:"margin-bottom--sm",children:n}),r]})]})})}function Nt(){const{footer:e}=(0,w.p)();if(!e)return null;const{copyright:t,links:n,logo:r,style:o}=e;return(0,u.jsx)(Rt,{style:o,links:n&&n.length>0&&(0,u.jsx)(Ot,{links:n}),logo:r&&(0,u.jsx)(Tt,{logo:r}),copyright:t&&(0,u.jsx)(It,{copyright:t})})}const Dt=r.memo(Nt);function Lt(e){const[t,n]=(0,r.useState)(!1),o=r.useRef(null);(0,Te.E8)({isOpen:!1,onOpen:()=>{o.current?.click()}});const a=(0,u.jsxs)("div",{ref:o,onClick:()=>{document.querySelector(".DocSearch-Button")?.click()},onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),style:{position:"fixed",right:"21px",bottom:"21px",zIndex:100,display:"flex",alignItems:"center",gap:"10px",cursor:"pointer"},children:[t&&(0,u.jsx)("div",{style:{backgroundColor:"#f6f6f6",padding:"8px 16px",borderRadius:"20px",color:"#000",fontSize:"14px",boxShadow:"0 2px 4px rgba(0,0,0,0.1)"},children:"Hi, how can I help you?"}),(0,u.jsx)("div",{style:{backgroundColor:"#f6f6f6",borderRadius:"50%",width:"48px",height:"48px",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 2px 4px rgba(0,0,0,0.1)"},children:(0,u.jsx)("img",{src:"/img/langflow-icon-black-transparent.svg",style:{width:"40px"},alt:"Search"})})]});return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(Dt,{...e}),a]})}const Mt=(0,T.fM)([B.a,x.o,P.Tv,Qe.VQ,i.Jx,function({children:e}){return(0,u.jsx)(I.y_,{children:(0,u.jsx)(C.e,{children:(0,u.jsx)(N,{children:e})})})}]);function Ft({children:e}){return(0,u.jsx)(Mt,{children:e})}var zt=n(51107);function Bt({error:e,tryAgain:t}){return(0,u.jsx)("main",{className:"container margin-vert--xl",children:(0,u.jsx)("div",{className:"row",children:(0,u.jsxs)("div",{className:"col col--6 col--offset-3",children:[(0,u.jsx)(zt.A,{as:"h1",className:"hero__title",children:(0,u.jsx)(l.A,{id:"theme.ErrorPageContent.title",description:"The title of the fallback page when the page crashed",children:"This page crashed."})}),(0,u.jsx)("div",{className:"margin-vert--lg",children:(0,u.jsx)(ct,{onClick:t,className:"button button--primary shadow--lw"})}),(0,u.jsx)("hr",{}),(0,u.jsx)("div",{className:"margin-vert--md",children:(0,u.jsx)(ut,{error:e})})]})})})}const Ut={mainWrapper:"mainWrapper_z2l0"};function qt(e){const{children:t,noFooter:n,wrapperClassName:r,title:s,description:l}=e;return(0,b.J)(),(0,u.jsxs)(Ft,{children:[(0,u.jsx)(i.be,{title:s,description:l}),(0,u.jsx)(v,{}),(0,u.jsx)(A,{}),(0,u.jsx)(vt,{}),(0,u.jsx)("div",{id:d,className:(0,o.A)(g.G.layout.main.container,g.G.wrapper.main,Ut.mainWrapper,r),children:(0,u.jsx)(a.A,{fallback:e=>(0,u.jsx)(Bt,{...e}),children:t})}),!n&&(0,u.jsx)(Lt,{})]})}},12983:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addTrailingSlash=o,t.default=function(e,t){const{trailingSlash:n,baseUrl:r}=t;if(e.startsWith("#"))return e;if(void 0===n)return e;const[i]=e.split(/[#?]/),s="/"===i||i===r?i:(l=i,c=n,c?o(l):a(l));var l,c;return e.replace(i,s)},t.addLeadingSlash=function(e){return(0,r.addPrefix)(e,"/")},t.removeTrailingSlash=a;const r=n(42566);function o(e){return e.endsWith("/")?e:`${e}/`}function a(e){return(0,r.removeSuffix)(e,"/")}},13003:e=>{"use strict";e.exports=function(e){return e!=e}},13144:(e,t,n)=>{"use strict";var r=n(66743),o=n(11002),a=n(10076),i=n(47119);e.exports=i||r.call(a,o)},14035:(e,t,n)=>{"use strict";var r,o=n(36556),a=n(49092)(),i=n(9957),s=n(75795);if(a){var l=o("RegExp.prototype.exec"),c={},u=function(){throw c},d={toString:u,valueOf:u};"symbol"==typeof Symbol.toPrimitive&&(d[Symbol.toPrimitive]=u),r=function(e){if(!e||"object"!=typeof e)return!1;var t=s(e,"lastIndex");if(!(t&&i(t,"value")))return!1;try{l(e,d)}catch(n){return n===c}}}else{var p=o("Object.prototype.toString");r=function(e){return!(!e||"object"!=typeof e&&"function"!=typeof e)&&"[object RegExp]"===p(e)}}e.exports=r},14090:(e,t,n)=>{"use strict";n.d(t,{w:()=>o,J:()=>a});var r=n(96540);const o="navigation-with-keyboard";function a(){(0,r.useEffect)(()=>{function e(e){"keydown"===e.type&&"Tab"===e.key&&document.body.classList.add(o),"mousedown"===e.type&&document.body.classList.remove(o)}return document.addEventListener("keydown",e),document.addEventListener("mousedown",e),()=>{document.body.classList.remove(o),document.removeEventListener("keydown",e),document.removeEventListener("mousedown",e)}},[])}},14563:(e,t,n)=>{"use strict";n.d(t,{AL:()=>u,s$:()=>d});var r=n(96540),o=n(44586),a=n(36803),i=n(89532),s=n(74848);const l=({title:e,siteTitle:t,titleDelimiter:n})=>{const r=e?.trim();return r&&r!==t?`${r} ${n} ${t}`:t},c=(0,r.createContext)(null);function u({formatter:e,children:t}){return(0,s.jsx)(c.Provider,{value:e,children:t})}function d(){const e=function(){const e=(0,r.useContext)(c);if(null===e)throw new i.dV("TitleFormatterProvider");return e}(),{siteConfig:t}=(0,o.A)(),{title:n,titleDelimiter:s}=t,{plugin:u}=(0,a.A)();return{format:t=>e({title:t,siteTitle:n,titleDelimiter:s,plugin:u,defaultFormatter:l})}}},14875:(e,t,n)=>{"use strict";n.r(t),n.d(t,{onRouteDidUpdate:()=>d});var r=n(38193),o=n(96763);let a=!1;const i={codeLanguage:e=>{const t=e.querySelector("[data-ch-lang]")||e.closest("[data-ch-lang]");if(t){const e=t.getAttribute("data-ch-lang");if(e&&"text"!==e)return e}const n=e.closest(".theme-code-block")||e.parentElement?.closest('[class*="code"]')||e.parentElement;if(n){const e=n.querySelector('li[role="tab"][aria-selected="true"]');if(e){const t=e.textContent?.trim();if(t&&"text"!==t.toLowerCase())return t.toLowerCase()}}if(n){const e=n.querySelector('li[role="tab"]');if(e){const t=e.textContent?.trim();if(t&&"text"!==t.toLowerCase())return t.toLowerCase()}}return null}},s={selectors:[{selector:"h1, h2, h3, h4, h5, h6",eventName:"Scroll - Heading Viewed",properties:{element_type:"heading"}}]};function l(e,t={}){const n={};return Object.keys(t).forEach(r=>{const a=t[r];if("function"==typeof a)try{const t=a(e);null!=t&&(n[r]=t)}catch(s){o.warn(`Scroll tracking: Error executing function for property "${r}":`,s)}else if("string"==typeof a&&a.startsWith("helper:")){const t=a.replace("helper:","");if(i[t])try{const o=i[t](e);null!=o&&(n[r]=o)}catch(s){o.warn(`Scroll tracking: Error executing helper "${t}" for property "${r}":`,s)}else o.warn(`Scroll tracking: Unknown helper function "${t}"`)}else n[r]=a}),n.page_path=window.location.pathname,n.page_url=window.location.href,n.scroll_depth=function(){const e=window.pageYOffset||document.documentElement.scrollTop,t=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)-window.innerHeight;return t<=0?100:Math.min(100,Math.round(e/t*100))}(),e.tagName&&(n.tag_name=e.tagName.toLowerCase()),e.id&&(n.element_id=e.id),e.className&&(n.element_class=e.className),e.tagName&&e.tagName.match(/^H[1-6]$/)&&(n.heading_level=e.tagName.toLowerCase(),n.heading_text=e.textContent?.trim().substring(0,200),n.text=e.textContent?.trim().substring(0,200)),n}function c(e={}){if(!r.A.canUseDOM||a)return;const t=window.__SCROLL_TRACKING_CONFIG__||{},n=function(e){if(!window.IntersectionObserver)return void o.warn("IntersectionObserver not supported, element tracking disabled");const t=new IntersectionObserver(t=>{t.forEach(t=>{if(t.isIntersecting){const n=e.selectors.find(e=>t.target.matches(e.selector));if(n){const e=window.innerWidth<=768,r=t.target.matches(".ch-codeblock");setTimeout(()=>{const e=l(t.target,n.properties||{});window.analytics&&"function"==typeof window.analytics.track&&window.analytics.track(n.eventName,e)},e&&r?100:0)}}})},{threshold:.1,rootMargin:"0px"}),n=e=>{document.querySelectorAll(e.selector).forEach(e=>{e._scrollTrackingObserved||(t.observe(e),e._scrollTrackingObserved=!0)})};if(e.selectors.forEach(n),setTimeout(()=>{e.selectors.forEach(n)},1e3),window.MutationObserver){const n=new MutationObserver(n=>{n.forEach(n=>{n.addedNodes.forEach(n=>{n.nodeType===Node.ELEMENT_NODE&&e.selectors.forEach(e=>{n.matches&&n.matches(e.selector)&&(n._scrollTrackingObserved||(t.observe(n),n._scrollTrackingObserved=!0)),(n.querySelectorAll?n.querySelectorAll(e.selector):[]).forEach(e=>{e._scrollTrackingObserved||(t.observe(e),e._scrollTrackingObserved=!0)})})})})});n.observe(document.body,{childList:!0,subtree:!0}),t._mutationObserver=n}return t}({...s,...t,...e});a=!0,window._scrollTrackingObserver=n}function u(){window._scrollTrackingObserver&&(window._scrollTrackingObserver._mutationObserver&&window._scrollTrackingObserver._mutationObserver.disconnect(),window._scrollTrackingObserver.disconnect(),window._scrollTrackingObserver=null),document.querySelectorAll("[data-scroll-tracked]").forEach(e=>{delete e._scrollTrackingObserved,e.removeAttribute("data-scroll-tracked")}),a=!1}if(r.A.canUseDOM){const e=()=>{setTimeout(()=>{c()},250)};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",e):"interactive"===document.readyState?setTimeout(e,100):e(),window.addEventListener("popstate",()=>{u(),setTimeout(()=>c(),100)})}function d({location:e,previousLocation:t}){r.A.canUseDOM&&t&&e.pathname!==t.pathname&&(u(),setTimeout(()=>c(),100))}},15066:(e,t,n)=>{"use strict";function r(e){var t,n,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e)){var a=e.length;for(t=0;to});const o=function(){for(var e,t,n=0,o="",a=arguments.length;n{"use strict";var n=Symbol.for("react.element"),r=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),f=Symbol.iterator;var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,g={};function b(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}function y(){}function v(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}b.prototype.isReactComponent={},b.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},b.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},y.prototype=b.prototype;var w=v.prototype=new y;w.constructor=v,h(w,b.prototype),w.isPureReactComponent=!0;var x=Array.isArray,k=Object.prototype.hasOwnProperty,S={current:null},_={key:!0,ref:!0,__self:!0,__source:!0};function E(e,t,r){var o,a={},i=null,s=null;if(null!=t)for(o in void 0!==t.ref&&(s=t.ref),void 0!==t.key&&(i=""+t.key),t)k.call(t,o)&&!_.hasOwnProperty(o)&&(a[o]=t[o]);var l=arguments.length-2;if(1===l)a.children=r;else if(1{"use strict";function r(e){return/^(?:\w*:|\/\/)/.test(e)}function o(e){return void 0!==e&&!r(e)}n.d(t,{A:()=>o,z:()=>r})},17065:(e,t,n)=>{"use strict";n.d(t,{W:()=>r});const r="default"},17559:(e,t,n)=>{"use strict";n.d(t,{G:()=>r});const r={page:{blogListPage:"blog-list-page",blogPostPage:"blog-post-page",blogTagsListPage:"blog-tags-list-page",blogTagPostListPage:"blog-tags-post-list-page",blogAuthorsListPage:"blog-authors-list-page",blogAuthorsPostsPage:"blog-authors-posts-page",docsDocPage:"docs-doc-page",docsTagsListPage:"docs-tags-list-page",docsTagDocListPage:"docs-tags-doc-list-page",mdxPage:"mdx-page"},wrapper:{main:"main-wrapper",blogPages:"blog-wrapper",docsPages:"docs-wrapper",mdxPages:"mdx-wrapper"},common:{editThisPage:"theme-edit-this-page",lastUpdated:"theme-last-updated",backToTopButton:"theme-back-to-top-button",codeBlock:"theme-code-block",admonition:"theme-admonition",unlistedBanner:"theme-unlisted-banner",draftBanner:"theme-draft-banner",admonitionType:e=>`theme-admonition-${e}`},announcementBar:{container:"theme-announcement-bar"},layout:{navbar:{container:"theme-layout-navbar",containerLeft:"theme-layout-navbar-left",containerRight:"theme-layout-navbar-right",mobileSidebar:{container:"theme-layout-navbar-sidebar",panel:"theme-layout-navbar-sidebar-panel"}},main:{container:"theme-layout-main"},footer:{container:"theme-layout-footer",column:"theme-layout-footer-column"}},docs:{docVersionBanner:"theme-doc-version-banner",docVersionBadge:"theme-doc-version-badge",docBreadcrumbs:"theme-doc-breadcrumbs",docMarkdown:"theme-doc-markdown",docTocMobile:"theme-doc-toc-mobile",docTocDesktop:"theme-doc-toc-desktop",docFooter:"theme-doc-footer",docFooterTagsRow:"theme-doc-footer-tags-row",docFooterEditMetaRow:"theme-doc-footer-edit-meta-row",docSidebarContainer:"theme-doc-sidebar-container",docSidebarMenu:"theme-doc-sidebar-menu",docSidebarItemCategory:"theme-doc-sidebar-item-category",docSidebarItemLink:"theme-doc-sidebar-item-link",docSidebarItemCategoryLevel:e=>`theme-doc-sidebar-item-category-level-${e}`,docSidebarItemLinkLevel:e=>`theme-doc-sidebar-item-link-level-${e}`},blog:{blogFooterTagsRow:"theme-blog-footer-tags-row",blogFooterEditMetaRow:"theme-blog-footer-edit-meta-row"},pages:{pageFooterEditMetaRow:"theme-pages-footer-edit-meta-row"}}},18215:(e,t,n)=>{"use strict";function r(e){var t,n,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e)){var a=e.length;for(t=0;to});const o=function(){for(var e,t,n=0,o="",a=arguments.length;n{var r={"./":8722};function o(e){var t=a(e);return n(t)}function a(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}o.keys=function(){return Object.keys(r)},o.resolve=a,e.exports=o,o.id=18692},19700:()=>{!function(e){function t(e,t){return"___"+e.toUpperCase()+t+"___"}Object.defineProperties(e.languages["markup-templating"]={},{buildPlaceholders:{value:function(n,r,o,a){if(n.language===r){var i=n.tokenStack=[];n.code=n.code.replace(o,function(e){if("function"==typeof a&&!a(e))return e;for(var o,s=i.length;-1!==n.code.indexOf(o=t(r,s));)++s;return i[s]=e,o}),n.grammar=e.languages.markup}}},tokenizePlaceholders:{value:function(n,r){if(n.language===r&&n.tokenStack){n.grammar=e.languages[r];var o=0,a=Object.keys(n.tokenStack);!function i(s){for(var l=0;l=a.length);l++){var c=s[l];if("string"==typeof c||c.content&&"string"==typeof c.content){var u=a[o],d=n.tokenStack[u],p="string"==typeof c?c:c.content,f=t(r,u),m=p.indexOf(f);if(m>-1){++o;var h=p.substring(0,m),g=new e.Token(r,e.tokenize(d,n.grammar),"language-"+r,d),b=p.substring(m+f.length),y=[];h&&y.push.apply(y,i([h])),y.push(g),b&&y.push.apply(y,i([b])),"string"==typeof c?s.splice.apply(s,[l,1].concat(y)):c.content=y}}else c.content&&i(c.content)}return s}(n.tokens)}}}})}(Prism)},20311:e=>{"use strict";e.exports=function(e,t,n,r,o,a,i,s){if(!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,o,a,i,s],u=0;(l=new Error(t.replace(/%s/g,function(){return c[u++]}))).name="Invariant Violation"}throw l.framesToPop=1,l}}},21020:(e,t,n)=>{"use strict";var r=n(96540),o=Symbol.for("react.element"),a=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,s=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,a={},c=null,u=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)i.call(t,r)&&!l.hasOwnProperty(r)&&(a[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===a[r]&&(a[r]=t[r]);return{$$typeof:o,type:e,key:c,ref:u,props:a,_owner:s.current}}t.Fragment=a,t.jsx=c,t.jsxs=c},21122:(e,t,n)=>{"use strict";n.d(t,{A:()=>u});var r=n(96540),o=n(15066),a=n(92303),i=n(95293);const s={themedComponent:"themedComponent_mlkZ","themedComponent--light":"themedComponent--light_NVdE","themedComponent--dark":"themedComponent--dark_xIcU"};var l=n(74848);function c({className:e,children:t}){const n=(0,a.A)(),{colorMode:c}=(0,i.G)();return(0,l.jsx)(l.Fragment,{children:(n?"dark"===c?["dark"]:["light"]:["light","dark"]).map(n=>{const a=t({theme:n,className:(0,o.A)(e,s.themedComponent,s[`themedComponent--${n}`])});return(0,l.jsx)(r.Fragment,{children:a},n)})})}function u(e){const{sources:t,className:n,alt:r,...o}=e;return(0,l.jsx)(c,{className:n,children:({theme:e,className:n})=>(0,l.jsx)("img",{src:t[e],alt:r,className:n,...o})})}},21312:(e,t,n)=>{"use strict";n.d(t,{A:()=>u,T:()=>c});var r=n(96540),o=n(74848);function a(e,t){const n=e.split(/(\{\w+\})/).map((e,n)=>{if(n%2==1){const n=t?.[e.slice(1,-1)];if(void 0!==n)return n}return e});return n.some(e=>(0,r.isValidElement)(e))?n.map((e,t)=>(0,r.isValidElement)(e)?r.cloneElement(e,{key:t}):e).filter(e=>""!==e):n.join("")}var i=n(22654),s=n(96763);function l({id:e,message:t}){if(void 0===e&&void 0===t)throw new Error("Docusaurus translation declarations must have at least a translation id or a default translation message");return i[e??t]??t??e}function c({message:e,id:t},n){return a(l({message:e,id:t}),n)}function u({children:e,id:t,values:n}){if(e&&"string"!=typeof e)throw s.warn("Illegal children",e),new Error("The Docusaurus component only accept simple string values");const r=l({message:e,id:t});return(0,o.jsx)(o.Fragment,{children:a(r,n)})}},21798:(e,t,n)=>{"use strict";n.r(t)},22067:(e,t,n)=>{"use strict";var r=n(96540),o=n(5338),a=n(80545),i=n(54625),s=n(4784),l=n(38193);const c=[n(31911),n(10119),n(26134),n(76294),n(641),n(21798),n(68665),n(11818),n(73796),n(29492),n(88135),n(14875)];var u=n(35947),d=n(56347),p=n(22831),f=n(74848);function m({children:e}){return(0,f.jsx)(f.Fragment,{children:e})}var h=n(14563);const g=e=>e.defaultFormatter(e);function b({children:e}){return(0,f.jsx)(h.AL,{formatter:g,children:e})}function y({children:e}){return(0,f.jsx)(b,{children:e})}var v=n(5260),w=n(44586),x=n(86025),k=n(6342),S=n(45500),_=n(32131),E=n(14090),j=n(2967),O=n(70440),A=n(41463);function C(){const{i18n:{currentLocale:e,defaultLocale:t,localeConfigs:n}}=(0,w.A)(),r=(0,_.o)(),o=n[e].htmlLang,a=e=>e.replace("-","_");return(0,f.jsxs)(v.A,{children:[Object.entries(n).map(([e,{htmlLang:t}])=>(0,f.jsx)("link",{rel:"alternate",href:r.createUrl({locale:e,fullyQualified:!0}),hrefLang:t},e)),(0,f.jsx)("link",{rel:"alternate",href:r.createUrl({locale:t,fullyQualified:!0}),hrefLang:"x-default"}),(0,f.jsx)("meta",{property:"og:locale",content:a(o)}),Object.values(n).filter(e=>o!==e.htmlLang).map(e=>(0,f.jsx)("meta",{property:"og:locale:alternate",content:a(e.htmlLang)},`meta-og-${e.htmlLang}`))]})}function P({permalink:e}){const{siteConfig:{url:t}}=(0,w.A)(),n=function(){const{siteConfig:{url:e,baseUrl:t,trailingSlash:n}}=(0,w.A)(),{pathname:r}=(0,d.zy)();return e+(0,O.Ks)((0,x.Ay)(r),{trailingSlash:n,baseUrl:t})}(),r=e?`${t}${e}`:n;return(0,f.jsxs)(v.A,{children:[(0,f.jsx)("meta",{property:"og:url",content:r}),(0,f.jsx)("link",{rel:"canonical",href:r})]})}function T(){const{i18n:{currentLocale:e}}=(0,w.A)(),{metadata:t,image:n}=(0,k.p)();return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(v.A,{children:[(0,f.jsx)("meta",{name:"twitter:card",content:"summary_large_image"}),(0,f.jsx)("body",{className:E.w})]}),n&&(0,f.jsx)(S.be,{image:n}),(0,f.jsx)(P,{}),(0,f.jsx)(C,{}),(0,f.jsx)(A.A,{tag:j.C,locale:e}),(0,f.jsx)(v.A,{children:t.map((e,t)=>(0,f.jsx)("meta",{...e},t))})]})}const I=new Map;var R=n(6125),N=n(26988),D=n(205);function L(e,...t){const n=c.map(n=>{const r=n.default?.[e]??n[e];return r?.(...t)});return()=>n.forEach(e=>e?.())}const M=function({children:e,location:t,previousLocation:n}){return(0,D.A)(()=>{n!==t&&(!function({location:e,previousLocation:t}){if(!t)return;const n=e.pathname===t.pathname,r=e.hash===t.hash,o=e.search===t.search;if(n&&r&&!o)return;const{hash:a}=e;if(a){const e=decodeURIComponent(a.substring(1)),t=document.getElementById(e);t?.scrollIntoView()}else window.scrollTo(0,0)}({location:t,previousLocation:n}),L("onRouteDidUpdate",{previousLocation:n,location:t}))},[n,t]),e};function F(e){const t=Array.from(new Set([e,decodeURI(e)])).map(e=>(0,p.u)(u.A,e)).flat();return Promise.all(t.map(e=>e.route.component.preload?.()))}var z=n(96763);class B extends r.Component{previousLocation;routeUpdateCleanupCb;constructor(e){super(e),this.previousLocation=null,this.routeUpdateCleanupCb=l.A.canUseDOM?L("onRouteUpdate",{previousLocation:null,location:this.props.location}):()=>{},this.state={nextRouteHasLoaded:!0}}shouldComponentUpdate(e,t){if(e.location===this.props.location)return t.nextRouteHasLoaded;const n=e.location;return this.previousLocation=this.props.location,this.setState({nextRouteHasLoaded:!1}),this.routeUpdateCleanupCb=L("onRouteUpdate",{previousLocation:this.previousLocation,location:n}),F(n.pathname).then(()=>{this.routeUpdateCleanupCb(),this.setState({nextRouteHasLoaded:!0})}).catch(e=>{z.warn(e),window.location.reload()}),!1}render(){const{children:e,location:t}=this.props;return(0,f.jsx)(M,{previousLocation:this.previousLocation,location:t,children:(0,f.jsx)(d.qh,{location:t,render:()=>e})})}}const U=B,q="__docusaurus-base-url-issue-banner-suggestion-container";function $(e){return`\ndocument.addEventListener('DOMContentLoaded', function maybeInsertBanner() {\n var shouldInsert = typeof window['docusaurus'] === 'undefined';\n shouldInsert && insertBanner();\n});\n\nfunction insertBanner() {\n var bannerContainer = document.createElement('div');\n bannerContainer.id = '__docusaurus-base-url-issue-banner-container';\n var bannerHtml = ${JSON.stringify(function(e){return`\n
      \n

      Your Docusaurus site did not load properly.

      \n

      A very common reason is a wrong site baseUrl configuration.

      \n

      Current configured baseUrl = ${e} ${"/"===e?" (default value)":""}

      \n

      We suggest trying baseUrl =

      \n
      \n`}(e)).replace(/!0===e.exact))return I.set(e.pathname,e.pathname),e;const t=e.pathname.trim().replace(/(?:\/index)?\.html$/,"")||"/";return I.set(e.pathname,t),{...e,pathname:t}}((0,d.zy)());return(0,f.jsx)(U,{location:e,children:Y})}function Z(){return(0,f.jsx)(W.A,{children:(0,f.jsx)(N.l,{children:(0,f.jsxs)(R.x,{children:[(0,f.jsx)(m,{children:(0,f.jsxs)(y,{children:[(0,f.jsx)(V,{}),(0,f.jsx)(T,{}),(0,f.jsx)(G,{}),(0,f.jsx)(J,{})]})}),(0,f.jsx)(Q,{})]})})})}var X=n(84054);const ee=function(e){try{return document.createElement("link").relList.supports(e)}catch{return!1}}("prefetch")?function(e){return new Promise((t,n)=>{if("undefined"==typeof document)return void n();const r=document.createElement("link");r.setAttribute("rel","prefetch"),r.setAttribute("href",e),r.onload=()=>t(),r.onerror=()=>n();const o=document.getElementsByTagName("head")[0]??document.getElementsByName("script")[0]?.parentNode;o?.appendChild(r)})}:function(e){return new Promise((t,n)=>{const r=new XMLHttpRequest;r.open("GET",e,!0),r.withCredentials=!0,r.onload=()=>{200===r.status?t():n()},r.send(null)})};var te=n(86921);const ne=new Set,re=new Set,oe=()=>navigator.connection?.effectiveType.includes("2g")||navigator.connection?.saveData,ae={prefetch:e=>{if(!(e=>!oe()&&!re.has(e)&&!ne.has(e))(e))return!1;ne.add(e);const t=(0,p.u)(u.A,e).flatMap(e=>{return t=e.route.path,Object.entries(X).filter(([e])=>e.replace(/-[^-]+$/,"")===t).flatMap(([,e])=>Object.values((0,te.A)(e)));var t});return Promise.all(t.map(e=>{const t=n.gca(e);return t&&!t.includes("undefined")?ee(t).catch(()=>{}):Promise.resolve()}))},preload:e=>!!(e=>!oe()&&!re.has(e))(e)&&(re.add(e),F(e))},ie=Object.freeze(ae);var se=n(96763);function le({children:e}){return"hash"===s.A.future.experimental_router?(0,f.jsx)(i.I9,{children:e}):(0,f.jsx)(i.Kd,{children:e})}const ce=Boolean(!0);if(l.A.canUseDOM){window.docusaurus=ie;const e=document.getElementById("__docusaurus"),t=(0,f.jsx)(a.vd,{children:(0,f.jsx)(le,{children:(0,f.jsx)(Z,{})})}),n=(e,t)=>{se.error("Docusaurus React Root onRecoverableError:",e,t)},i=()=>{if(window.docusaurusRoot)window.docusaurusRoot.render(t);else if(ce)window.docusaurusRoot=o.hydrateRoot(e,t,{onRecoverableError:n});else{const r=o.createRoot(e,{onRecoverableError:n});r.render(t),window.docusaurusRoot=r}};F(window.location.pathname).then(()=>{(0,r.startTransition)(i)})}},22069:(e,t,n)=>{"use strict";n.d(t,{M:()=>m,e:()=>f});var r=n(96540),o=n(75600),a=n(24581),i=n(57485),s=n(6342),l=n(89532),c=n(74848);const u=r.createContext(void 0);function d(){const e=function(){const e=(0,o.YL)(),{items:t}=(0,s.p)().navbar;return 0===t.length&&!e.component}(),t=(0,a.l)(),n=!e&&"mobile"===t,[i,l]=(0,r.useState)(!1),c=(0,r.useCallback)(()=>{l(e=>!e)},[]);return(0,r.useEffect)(()=>{"desktop"===t&&l(!1)},[t]),(0,r.useMemo)(()=>({disabled:e,shouldRender:n,toggle:c,shown:i}),[e,n,c,i])}function p({handler:e}){return(0,i.$Z)(e),null}function f({children:e}){const t=d();return(0,c.jsxs)(c.Fragment,{children:[t.shown&&(0,c.jsx)(p,{handler:()=>(t.toggle(),!1)}),(0,c.jsx)(u.Provider,{value:t,children:e})]})}function m(){const e=r.useContext(u);if(void 0===e)throw new l.dV("NavbarMobileSidebarProvider");return e}},22551:(e,t,n)=>{"use strict";var r=n(96763),o=n(96540),a=n(69982);function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n