diff --git a/404.html b/404.html index 7d0608ff18..70877d899a 100644 --- a/404.html +++ b/404.html @@ -23,7 +23,7 @@ - +
diff --git a/about-langflow.html b/about-langflow.html index 8d5b7b5e4d..3d177a91c7 100644 --- a/about-langflow.html +++ b/about-langflow.html @@ -23,7 +23,7 @@ - + diff --git a/agent-tutorial.html b/agent-tutorial.html index 3aaab4673d..84b22c4739 100644 --- a/agent-tutorial.html +++ b/agent-tutorial.html @@ -23,7 +23,7 @@ - + diff --git a/agents-tools.html b/agents-tools.html index 08f3c7daca..4592c3b3e5 100644 --- a/agents-tools.html +++ b/agents-tools.html @@ -23,7 +23,7 @@ - + diff --git a/agents.html b/agents.html index d75fde33a7..06be1f90cc 100644 --- a/agents.html +++ b/agents.html @@ -23,7 +23,7 @@ - + diff --git a/api-build.html b/api-build.html index 7f16552d6e..c433931184 100644 --- a/api-build.html +++ b/api-build.html @@ -23,7 +23,7 @@ - + diff --git a/api-files.html b/api-files.html index b1db36d3e5..9d742626e7 100644 --- a/api-files.html +++ b/api-files.html @@ -23,7 +23,7 @@ - + diff --git a/api-flows-run.html b/api-flows-run.html index 02d035fda9..45b8b96644 100644 --- a/api-flows-run.html +++ b/api-flows-run.html @@ -23,7 +23,7 @@ - + diff --git a/api-flows.html b/api-flows.html index 21365bdf13..040c0d6ce3 100644 --- a/api-flows.html +++ b/api-flows.html @@ -23,7 +23,7 @@ - + diff --git a/api-keys-and-authentication.html b/api-keys-and-authentication.html index 7637de7a22..31a94df823 100644 --- a/api-keys-and-authentication.html +++ b/api-keys-and-authentication.html @@ -23,7 +23,7 @@ - + diff --git a/api-logs.html b/api-logs.html index 7b1f6957db..549a148486 100644 --- a/api-logs.html +++ b/api-logs.html @@ -23,7 +23,7 @@ - + diff --git a/api-monitor.html b/api-monitor.html index 2828008021..da0f89ef03 100644 --- a/api-monitor.html +++ b/api-monitor.html @@ -23,7 +23,7 @@ - + diff --git a/api-projects.html b/api-projects.html index 59a948c18a..0686d77949 100644 --- a/api-projects.html +++ b/api-projects.html @@ -23,7 +23,7 @@ - + diff --git a/api-reference-api-examples.html b/api-reference-api-examples.html index b923215f6c..0459b848ae 100644 --- a/api-reference-api-examples.html +++ b/api-reference-api-examples.html @@ -23,7 +23,7 @@ - + diff --git a/api-users.html b/api-users.html index 506cf648c5..9573509556 100644 --- a/api-users.html +++ b/api-users.html @@ -23,7 +23,7 @@ - + diff --git a/api.html b/api.html index 51d3f2287d..ebedce5193 100644 --- a/api.html +++ b/api.html @@ -23,7 +23,7 @@ - + diff --git a/api/add-server.html b/api/add-server.html index b67e1580b0..3a21ba06a6 100644 --- a/api/add-server.html +++ b/api/add-server.html @@ -23,7 +23,7 @@ - + diff --git a/api/add-user.html b/api/add-user.html index b0186783f5..2664dd4425 100644 --- a/api/add-user.html +++ b/api/add-user.html @@ -23,7 +23,7 @@ - + diff --git a/api/auto-login.html b/api/auto-login.html index b76ffcb406..bcba804dbd 100644 --- a/api/auto-login.html +++ b/api/auto-login.html @@ -23,7 +23,7 @@ - + diff --git a/api/build-flow.html b/api/build-flow.html index 89d4be4756..8af14ce08c 100644 --- a/api/build-flow.html +++ b/api/build-flow.html @@ -23,7 +23,7 @@ - + diff --git a/api/build-public-tmp.html b/api/build-public-tmp.html index 92f33269a4..318839afba 100644 --- a/api/build-public-tmp.html +++ b/api/build-public-tmp.html @@ -23,7 +23,7 @@ - + diff --git a/api/build-vertex-stream.html b/api/build-vertex-stream.html index 0f2e26a54c..5f06b9c3b2 100644 --- a/api/build-vertex-stream.html +++ b/api/build-vertex-stream.html @@ -23,7 +23,7 @@ - + diff --git a/api/build-vertex.html b/api/build-vertex.html index 2fc11607c4..e5e81481ca 100644 --- a/api/build-vertex.html +++ b/api/build-vertex.html @@ -23,7 +23,7 @@ - + diff --git a/api/cancel-build.html b/api/cancel-build.html index 0d7841664d..e08d124d5a 100644 --- a/api/cancel-build.html +++ b/api/cancel-build.html @@ -23,7 +23,7 @@ - + diff --git a/api/check-if-store-has-api-key.html b/api/check-if-store-has-api-key.html index a1528b809d..6d5137c6b7 100644 --- a/api/check-if-store-has-api-key.html +++ b/api/check-if-store-has-api-key.html @@ -23,7 +23,7 @@ - + diff --git a/api/check-if-store-is-enabled.html b/api/check-if-store-is-enabled.html index 1bfb693850..991f5a2ca4 100644 --- a/api/check-if-store-is-enabled.html +++ b/api/check-if-store-is-enabled.html @@ -23,7 +23,7 @@ - + diff --git a/api/check-installed-mcp-servers.html b/api/check-installed-mcp-servers.html index e02646f89b..aeadc132bf 100644 --- a/api/check-installed-mcp-servers.html +++ b/api/check-installed-mcp-servers.html @@ -23,7 +23,7 @@ - + diff --git a/api/create-api-key-route.html b/api/create-api-key-route.html index 63de27fe40..7fa4222819 100644 --- a/api/create-api-key-route.html +++ b/api/create-api-key-route.html @@ -23,7 +23,7 @@ - + diff --git a/api/create-flow.html b/api/create-flow.html index 718a7b5634..a76ebaa563 100644 --- a/api/create-flow.html +++ b/api/create-flow.html @@ -23,7 +23,7 @@ - + diff --git a/api/create-flows.html b/api/create-flows.html index 50bd438b5d..19f0896190 100644 --- a/api/create-flows.html +++ b/api/create-flows.html @@ -23,7 +23,7 @@ - + diff --git a/api/create-folder-redirect.html b/api/create-folder-redirect.html index e80bc8dbe7..714b152d56 100644 --- a/api/create-folder-redirect.html +++ b/api/create-folder-redirect.html @@ -23,7 +23,7 @@ - + diff --git a/api/create-project.html b/api/create-project.html index 617ed44398..bbe476ffeb 100644 --- a/api/create-project.html +++ b/api/create-project.html @@ -23,7 +23,7 @@ - + diff --git a/api/create-upload-file.html b/api/create-upload-file.html index bcc7c37a20..7b554423ce 100644 --- a/api/create-upload-file.html +++ b/api/create-upload-file.html @@ -23,7 +23,7 @@ - + diff --git a/api/create-variable.html b/api/create-variable.html index 98ca34a3a2..56a38c33b8 100644 --- a/api/create-variable.html +++ b/api/create-variable.html @@ -23,7 +23,7 @@ - + diff --git a/api/custom-component-update.html b/api/custom-component-update.html index 34aa0816eb..f135f103d7 100644 --- a/api/custom-component-update.html +++ b/api/custom-component-update.html @@ -23,7 +23,7 @@ - + diff --git a/api/custom-component.html b/api/custom-component.html index e3bf3e16a1..60d7b6483d 100644 --- a/api/custom-component.html +++ b/api/custom-component.html @@ -23,7 +23,7 @@ - + diff --git a/api/delete-all-files-1.html b/api/delete-all-files-1.html index d36ee90701..afa1002947 100644 --- a/api/delete-all-files-1.html +++ b/api/delete-all-files-1.html @@ -23,7 +23,7 @@ - + diff --git a/api/delete-all-files.html b/api/delete-all-files.html index 0750c0c5f4..4dec9363be 100644 --- a/api/delete-all-files.html +++ b/api/delete-all-files.html @@ -23,7 +23,7 @@ - + diff --git a/api/delete-api-key-route.html b/api/delete-api-key-route.html index 7fc75e20c3..a96504f154 100644 --- a/api/delete-api-key-route.html +++ b/api/delete-api-key-route.html @@ -23,7 +23,7 @@ - + diff --git a/api/delete-file-1.html b/api/delete-file-1.html index 1d5962532c..7991959e5f 100644 --- a/api/delete-file-1.html +++ b/api/delete-file-1.html @@ -23,7 +23,7 @@ - + diff --git a/api/delete-file.html b/api/delete-file.html index a290ae20f4..ae720bd673 100644 --- a/api/delete-file.html +++ b/api/delete-file.html @@ -23,7 +23,7 @@ - + diff --git a/api/delete-files-batch.html b/api/delete-files-batch.html index 94e1cb90c3..7a8745ca2e 100644 --- a/api/delete-files-batch.html +++ b/api/delete-files-batch.html @@ -23,7 +23,7 @@ - + diff --git a/api/delete-flow.html b/api/delete-flow.html index 1bdf2f55a7..e5faab4b72 100644 --- a/api/delete-flow.html +++ b/api/delete-flow.html @@ -23,7 +23,7 @@ - + diff --git a/api/delete-folder-redirect.html b/api/delete-folder-redirect.html index 4cc13353cb..eb7cf07ba0 100644 --- a/api/delete-folder-redirect.html +++ b/api/delete-folder-redirect.html @@ -23,7 +23,7 @@ - + diff --git a/api/delete-messages-session.html b/api/delete-messages-session.html index 62bf793660..e179f7796d 100644 --- a/api/delete-messages-session.html +++ b/api/delete-messages-session.html @@ -23,7 +23,7 @@ - + diff --git a/api/delete-messages.html b/api/delete-messages.html index 1f7e1d37ce..b1090d9f42 100644 --- a/api/delete-messages.html +++ b/api/delete-messages.html @@ -23,7 +23,7 @@ - + diff --git a/api/delete-multiple-flows.html b/api/delete-multiple-flows.html index a5e4cb7e9a..737edf9815 100644 --- a/api/delete-multiple-flows.html +++ b/api/delete-multiple-flows.html @@ -23,7 +23,7 @@ - + diff --git a/api/delete-project.html b/api/delete-project.html index 6d79d600d2..2a13027c7b 100644 --- a/api/delete-project.html +++ b/api/delete-project.html @@ -23,7 +23,7 @@ - + diff --git a/api/delete-server.html b/api/delete-server.html index 7eb1e38517..6e8034a832 100644 --- a/api/delete-server.html +++ b/api/delete-server.html @@ -23,7 +23,7 @@ - + diff --git a/api/delete-user.html b/api/delete-user.html index 95fcb3f0ad..e12a775ff8 100644 --- a/api/delete-user.html +++ b/api/delete-user.html @@ -23,7 +23,7 @@ - + diff --git a/api/delete-variable.html b/api/delete-variable.html index 50a391048e..6a548b1676 100644 --- a/api/delete-variable.html +++ b/api/delete-variable.html @@ -23,7 +23,7 @@ - + diff --git a/api/delete-vertex-builds.html b/api/delete-vertex-builds.html index ad46617201..6ba59adb16 100644 --- a/api/delete-vertex-builds.html +++ b/api/delete-vertex-builds.html @@ -23,7 +23,7 @@ - + diff --git a/api/download-component.html b/api/download-component.html index 2ad5638e44..f3c5dd685b 100644 --- a/api/download-component.html +++ b/api/download-component.html @@ -23,7 +23,7 @@ - + diff --git a/api/download-file-1.html b/api/download-file-1.html index 11d7750c28..f52b52558d 100644 --- a/api/download-file-1.html +++ b/api/download-file-1.html @@ -23,7 +23,7 @@ - + diff --git a/api/download-file-2.html b/api/download-file-2.html index de1bfb8d83..357bcf7845 100644 --- a/api/download-file-2.html +++ b/api/download-file-2.html @@ -23,7 +23,7 @@ - + diff --git a/api/download-file-redirect.html b/api/download-file-redirect.html index c8f0a72d97..d5e4a1c4f7 100644 --- a/api/download-file-redirect.html +++ b/api/download-file-redirect.html @@ -23,7 +23,7 @@ - + diff --git a/api/download-file.html b/api/download-file.html index 4b81e26cfb..6e4bcd26aa 100644 --- a/api/download-file.html +++ b/api/download-file.html @@ -23,7 +23,7 @@ - + diff --git a/api/download-files-batch.html b/api/download-files-batch.html index c60b91f98e..5e460f698c 100644 --- a/api/download-files-batch.html +++ b/api/download-files-batch.html @@ -23,7 +23,7 @@ - + diff --git a/api/download-image.html b/api/download-image.html index 4edd634847..985c8bf104 100644 --- a/api/download-image.html +++ b/api/download-image.html @@ -23,7 +23,7 @@ - + diff --git a/api/download-multiple-file.html b/api/download-multiple-file.html index a0405234de..a060f128c1 100644 --- a/api/download-multiple-file.html +++ b/api/download-multiple-file.html @@ -23,7 +23,7 @@ - + diff --git a/api/download-profile-picture.html b/api/download-profile-picture.html index 118f0bb6df..98fefd6fe9 100644 --- a/api/download-profile-picture.html +++ b/api/download-profile-picture.html @@ -23,7 +23,7 @@ - + diff --git a/api/edit-file-name.html b/api/edit-file-name.html index 2eae3ca2f4..beaaa26814 100644 --- a/api/edit-file-name.html +++ b/api/edit-file-name.html @@ -23,7 +23,7 @@ - + diff --git a/api/experimental-run-flow.html b/api/experimental-run-flow.html index e28d001bbc..f8429a8cbf 100644 --- a/api/experimental-run-flow.html +++ b/api/experimental-run-flow.html @@ -23,7 +23,7 @@ - + diff --git a/api/get-all.html b/api/get-all.html index 16b29779af..ba1d72293c 100644 --- a/api/get-all.html +++ b/api/get-all.html @@ -23,7 +23,7 @@ - + diff --git a/api/get-api-keys-route.html b/api/get-api-keys-route.html index 60fce371e2..f2777158a7 100644 --- a/api/get-api-keys-route.html +++ b/api/get-api-keys-route.html @@ -23,7 +23,7 @@ - + diff --git a/api/get-build-events.html b/api/get-build-events.html index 2fdfdc05b5..17818d87a0 100644 --- a/api/get-build-events.html +++ b/api/get-build-events.html @@ -23,7 +23,7 @@ - + diff --git a/api/get-components.html b/api/get-components.html index 8e1414e780..ef2bec9d12 100644 --- a/api/get-components.html +++ b/api/get-components.html @@ -23,7 +23,7 @@ - + diff --git a/api/get-config.html b/api/get-config.html index 738218d11d..2f69004141 100644 --- a/api/get-config.html +++ b/api/get-config.html @@ -23,7 +23,7 @@ - + diff --git a/api/get-elevenlabs-voice-ids.html b/api/get-elevenlabs-voice-ids.html index b25f138869..c3118fb43a 100644 --- a/api/get-elevenlabs-voice-ids.html +++ b/api/get-elevenlabs-voice-ids.html @@ -23,7 +23,7 @@ - + diff --git a/api/get-list-of-components-liked-by-user.html b/api/get-list-of-components-liked-by-user.html index 41f176995e..ec2c545faa 100644 --- a/api/get-list-of-components-liked-by-user.html +++ b/api/get-list-of-components-liked-by-user.html @@ -23,7 +23,7 @@ - + diff --git a/api/get-message-sessions.html b/api/get-message-sessions.html index b47ecd9298..cc20bd4c9b 100644 --- a/api/get-message-sessions.html +++ b/api/get-message-sessions.html @@ -23,7 +23,7 @@ - + diff --git a/api/get-messages.html b/api/get-messages.html index 8ee62460d4..0b41554a23 100644 --- a/api/get-messages.html +++ b/api/get-messages.html @@ -23,7 +23,7 @@ - + diff --git a/api/get-server-endpoint.html b/api/get-server-endpoint.html index 3e783c721d..b912f25c81 100644 --- a/api/get-server-endpoint.html +++ b/api/get-server-endpoint.html @@ -23,7 +23,7 @@ - + diff --git a/api/get-servers.html b/api/get-servers.html index 313a59c44d..f980eb526c 100644 --- a/api/get-servers.html +++ b/api/get-servers.html @@ -23,7 +23,7 @@ - + diff --git a/api/get-starter-projects.html b/api/get-starter-projects.html index 2514f210f9..f5ca5c1724 100644 --- a/api/get-starter-projects.html +++ b/api/get-starter-projects.html @@ -23,7 +23,7 @@ - + diff --git a/api/get-tags.html b/api/get-tags.html index 1c73253a77..dc1b4f6e37 100644 --- a/api/get-tags.html +++ b/api/get-tags.html @@ -23,7 +23,7 @@ - + diff --git a/api/get-task-status.html b/api/get-task-status.html index eb85a78d41..06e20ba649 100644 --- a/api/get-task-status.html +++ b/api/get-task-status.html @@ -23,7 +23,7 @@ - + diff --git a/api/get-transactions.html b/api/get-transactions.html index fed9353658..78832c2bb0 100644 --- a/api/get-transactions.html +++ b/api/get-transactions.html @@ -23,7 +23,7 @@ - + diff --git a/api/get-version.html b/api/get-version.html index 0d7ce3e9e9..78474f666d 100644 --- a/api/get-version.html +++ b/api/get-version.html @@ -23,7 +23,7 @@ - + diff --git a/api/get-vertex-builds.html b/api/get-vertex-builds.html index b714fbf2bc..b81b756eb6 100644 --- a/api/get-vertex-builds.html +++ b/api/get-vertex-builds.html @@ -23,7 +23,7 @@ - + diff --git a/api/handle-messages-1.html b/api/handle-messages-1.html index cbf0631e18..d7e4c03129 100644 --- a/api/handle-messages-1.html +++ b/api/handle-messages-1.html @@ -23,7 +23,7 @@ - + diff --git a/api/handle-messages.html b/api/handle-messages.html index 1520469975..98a3194c79 100644 --- a/api/handle-messages.html +++ b/api/handle-messages.html @@ -23,7 +23,7 @@ - + diff --git a/api/handle-project-messages-with-slash.html b/api/handle-project-messages-with-slash.html index 61bb2e0aec..b511eefd9c 100644 --- a/api/handle-project-messages-with-slash.html +++ b/api/handle-project-messages-with-slash.html @@ -23,7 +23,7 @@ - + diff --git a/api/handle-project-messages.html b/api/handle-project-messages.html index 7115db1148..5096bc7038 100644 --- a/api/handle-project-messages.html +++ b/api/handle-project-messages.html @@ -23,7 +23,7 @@ - + diff --git a/api/handle-project-sse.html b/api/handle-project-sse.html index 277ae69358..22507328f6 100644 --- a/api/handle-project-sse.html +++ b/api/handle-project-sse.html @@ -23,7 +23,7 @@ - + diff --git a/api/handle-sse-1.html b/api/handle-sse-1.html index cd949815a9..dca1c4a7c8 100644 --- a/api/handle-sse-1.html +++ b/api/handle-sse-1.html @@ -23,7 +23,7 @@ - + diff --git a/api/handle-sse.html b/api/handle-sse.html index f8f1901889..f2515df8fd 100644 --- a/api/handle-sse.html +++ b/api/handle-sse.html @@ -23,7 +23,7 @@ - + diff --git a/api/health-check.html b/api/health-check.html index ba0844be8c..ef261cd997 100644 --- a/api/health-check.html +++ b/api/health-check.html @@ -23,7 +23,7 @@ - + diff --git a/api/health.html b/api/health.html index cbb00552cb..0e32edf61d 100644 --- a/api/health.html +++ b/api/health.html @@ -23,7 +23,7 @@ - + diff --git a/api/install-mcp-config.html b/api/install-mcp-config.html index 20dd4210d3..5d0b0e6e73 100644 --- a/api/install-mcp-config.html +++ b/api/install-mcp-config.html @@ -23,7 +23,7 @@ - + diff --git a/api/like-component.html b/api/like-component.html index 9839def1e6..5fbcb7be89 100644 --- a/api/like-component.html +++ b/api/like-component.html @@ -23,7 +23,7 @@ - + diff --git a/api/list-files-1.html b/api/list-files-1.html index ab32a10d46..27e3006c5f 100644 --- a/api/list-files-1.html +++ b/api/list-files-1.html @@ -23,7 +23,7 @@ - + diff --git a/api/list-files-2.html b/api/list-files-2.html index b4fd58ea4f..28c3c95e2f 100644 --- a/api/list-files-2.html +++ b/api/list-files-2.html @@ -23,7 +23,7 @@ - + diff --git a/api/list-files.html b/api/list-files.html index d9bde029dd..f75d685223 100644 --- a/api/list-files.html +++ b/api/list-files.html @@ -23,7 +23,7 @@ - + diff --git a/api/list-profile-pictures.html b/api/list-profile-pictures.html index 72b2bc8b7b..25209659f2 100644 --- a/api/list-profile-pictures.html +++ b/api/list-profile-pictures.html @@ -23,7 +23,7 @@ - + diff --git a/api/list-project-tools.html b/api/list-project-tools.html index 6b95693b56..fa03461148 100644 --- a/api/list-project-tools.html +++ b/api/list-project-tools.html @@ -23,7 +23,7 @@ - + diff --git a/api/login-to-get-access-token.html b/api/login-to-get-access-token.html index 53cf266ba1..663961802f 100644 --- a/api/login-to-get-access-token.html +++ b/api/login-to-get-access-token.html @@ -23,7 +23,7 @@ - + diff --git a/api/logout.html b/api/logout.html index 24025d5c19..31aaffbb1e 100644 --- a/api/logout.html +++ b/api/logout.html @@ -23,7 +23,7 @@ - + diff --git a/api/logs.html b/api/logs.html index 5dc015c5da..ee77cb5646 100644 --- a/api/logs.html +++ b/api/logs.html @@ -23,7 +23,7 @@ - + diff --git a/api/patch-user.html b/api/patch-user.html index b31f2f9ac9..55abcf53b5 100644 --- a/api/patch-user.html +++ b/api/patch-user.html @@ -23,7 +23,7 @@ - + diff --git a/api/post-validate-code.html b/api/post-validate-code.html index b9894161bd..dc638f1af8 100644 --- a/api/post-validate-code.html +++ b/api/post-validate-code.html @@ -23,7 +23,7 @@ - + diff --git a/api/post-validate-prompt.html b/api/post-validate-prompt.html index f0c4697593..f67098fb91 100644 --- a/api/post-validate-prompt.html +++ b/api/post-validate-prompt.html @@ -23,7 +23,7 @@ - + diff --git a/api/process-1.html b/api/process-1.html index c2d7392a61..ff93a52b7a 100644 --- a/api/process-1.html +++ b/api/process-1.html @@ -23,7 +23,7 @@ - + diff --git a/api/process.html b/api/process.html index 28b0261dc5..f78f8d0acd 100644 --- a/api/process.html +++ b/api/process.html @@ -23,7 +23,7 @@ - + diff --git a/api/read-all-users.html b/api/read-all-users.html index 2ec244663d..4c6ab6d7df 100644 --- a/api/read-all-users.html +++ b/api/read-all-users.html @@ -23,7 +23,7 @@ - + diff --git a/api/read-basic-examples.html b/api/read-basic-examples.html index 9267175e53..84469fd2ec 100644 --- a/api/read-basic-examples.html +++ b/api/read-basic-examples.html @@ -23,7 +23,7 @@ - + diff --git a/api/read-current-user.html b/api/read-current-user.html index 379016ec38..3f776ec2f1 100644 --- a/api/read-current-user.html +++ b/api/read-current-user.html @@ -23,7 +23,7 @@ - + diff --git a/api/read-flow.html b/api/read-flow.html index e1ec461cb5..392ce61e2b 100644 --- a/api/read-flow.html +++ b/api/read-flow.html @@ -23,7 +23,7 @@ - + diff --git a/api/read-flows.html b/api/read-flows.html index ce98256a35..fa96e1bbe7 100644 --- a/api/read-flows.html +++ b/api/read-flows.html @@ -23,7 +23,7 @@ - + diff --git a/api/read-folder-redirect.html b/api/read-folder-redirect.html index de114891d2..6911a40fdf 100644 --- a/api/read-folder-redirect.html +++ b/api/read-folder-redirect.html @@ -23,7 +23,7 @@ - + diff --git a/api/read-folders-redirect.html b/api/read-folders-redirect.html index 9ce169349f..8096736b0a 100644 --- a/api/read-folders-redirect.html +++ b/api/read-folders-redirect.html @@ -23,7 +23,7 @@ - + diff --git a/api/read-project.html b/api/read-project.html index bbcb593413..3311bb823f 100644 --- a/api/read-project.html +++ b/api/read-project.html @@ -23,7 +23,7 @@ - + diff --git a/api/read-projects.html b/api/read-projects.html index 77e3cd4a8c..e05f6c01c1 100644 --- a/api/read-projects.html +++ b/api/read-projects.html @@ -23,7 +23,7 @@ - + diff --git a/api/read-public-flow.html b/api/read-public-flow.html index b37c41e1af..63bc0027c3 100644 --- a/api/read-public-flow.html +++ b/api/read-public-flow.html @@ -23,7 +23,7 @@ - + diff --git a/api/read-variables.html b/api/read-variables.html index df74062dea..faeb0a02c3 100644 --- a/api/read-variables.html +++ b/api/read-variables.html @@ -23,7 +23,7 @@ - + diff --git a/api/refresh-token.html b/api/refresh-token.html index e698ddf5fa..40b29fcc2b 100644 --- a/api/refresh-token.html +++ b/api/refresh-token.html @@ -23,7 +23,7 @@ - + diff --git a/api/reset-password.html b/api/reset-password.html index a3f014f729..bbd6ecd6fb 100644 --- a/api/reset-password.html +++ b/api/reset-password.html @@ -23,7 +23,7 @@ - + diff --git a/api/retrieve-vertices-order.html b/api/retrieve-vertices-order.html index dbeacdea91..11d4d697d9 100644 --- a/api/retrieve-vertices-order.html +++ b/api/retrieve-vertices-order.html @@ -23,7 +23,7 @@ - + diff --git a/api/save-store-api-key.html b/api/save-store-api-key.html index 01adf7f26e..80b2100f0f 100644 --- a/api/save-store-api-key.html +++ b/api/save-store-api-key.html @@ -23,7 +23,7 @@ - + diff --git a/api/share-component.html b/api/share-component.html index 3838787026..031a426850 100644 --- a/api/share-component.html +++ b/api/share-component.html @@ -23,7 +23,7 @@ - + diff --git a/api/simplified-run-flow.html b/api/simplified-run-flow.html index ef45846fb6..8dd6d125ea 100644 --- a/api/simplified-run-flow.html +++ b/api/simplified-run-flow.html @@ -23,7 +23,7 @@ - + diff --git a/api/stream-logs.html b/api/stream-logs.html index b1d44a7d3a..4bbb49d5ac 100644 --- a/api/stream-logs.html +++ b/api/stream-logs.html @@ -23,7 +23,7 @@ - + diff --git a/api/update-flow.html b/api/update-flow.html index 81fe57441f..60c5cd2445 100644 --- a/api/update-flow.html +++ b/api/update-flow.html @@ -23,7 +23,7 @@ - + diff --git a/api/update-folder-redirect.html b/api/update-folder-redirect.html index 43c42786c1..a043b63a58 100644 --- a/api/update-folder-redirect.html +++ b/api/update-folder-redirect.html @@ -23,7 +23,7 @@ - + diff --git a/api/update-message.html b/api/update-message.html index 10469dbfff..4e5b395df1 100644 --- a/api/update-message.html +++ b/api/update-message.html @@ -23,7 +23,7 @@ - + diff --git a/api/update-project-mcp-settings.html b/api/update-project-mcp-settings.html index 882b09048c..0d58381946 100644 --- a/api/update-project-mcp-settings.html +++ b/api/update-project-mcp-settings.html @@ -23,7 +23,7 @@ - + diff --git a/api/update-project.html b/api/update-project.html index 88ce96bdd8..0dca443d40 100644 --- a/api/update-project.html +++ b/api/update-project.html @@ -23,7 +23,7 @@ - + diff --git a/api/update-server-endpoint.html b/api/update-server-endpoint.html index 6aa06b884c..7ec284f362 100644 --- a/api/update-server-endpoint.html +++ b/api/update-server-endpoint.html @@ -23,7 +23,7 @@ - + diff --git a/api/update-session-id.html b/api/update-session-id.html index c4042ea7a1..de4b162b72 100644 --- a/api/update-session-id.html +++ b/api/update-session-id.html @@ -23,7 +23,7 @@ - + diff --git a/api/update-shared-component.html b/api/update-shared-component.html index d123c0198a..12d912ee83 100644 --- a/api/update-shared-component.html +++ b/api/update-shared-component.html @@ -23,7 +23,7 @@ - + diff --git a/api/update-variable.html b/api/update-variable.html index e5c839a676..1534672f5d 100644 --- a/api/update-variable.html +++ b/api/update-variable.html @@ -23,7 +23,7 @@ - + diff --git a/api/upload-file-1.html b/api/upload-file-1.html index 1e1b2167c1..3d1641532e 100644 --- a/api/upload-file-1.html +++ b/api/upload-file-1.html @@ -23,7 +23,7 @@ - + diff --git a/api/upload-file-2.html b/api/upload-file-2.html index 5b7029bd61..48cb2cfb5b 100644 --- a/api/upload-file-2.html +++ b/api/upload-file-2.html @@ -23,7 +23,7 @@ - + diff --git a/api/upload-file-redirect.html b/api/upload-file-redirect.html index a763f46525..0aa1b6b18f 100644 --- a/api/upload-file-redirect.html +++ b/api/upload-file-redirect.html @@ -23,7 +23,7 @@ - + diff --git a/api/upload-file.html b/api/upload-file.html index 85f7cf4b01..1d0b6ddaab 100644 --- a/api/upload-file.html +++ b/api/upload-file.html @@ -23,7 +23,7 @@ - + diff --git a/api/upload-user-file-1.html b/api/upload-user-file-1.html index 72924c47e3..f36b07d91a 100644 --- a/api/upload-user-file-1.html +++ b/api/upload-user-file-1.html @@ -23,7 +23,7 @@ - + diff --git a/api/upload-user-file.html b/api/upload-user-file.html index 7f94f15c19..f6de10a4de 100644 --- a/api/upload-user-file.html +++ b/api/upload-user-file.html @@ -23,7 +23,7 @@ - + diff --git a/api/webhook-run-flow.html b/api/webhook-run-flow.html index a8ad8d9019..98ff54042a 100644 --- a/api/webhook-run-flow.html +++ b/api/webhook-run-flow.html @@ -23,7 +23,7 @@ - + diff --git a/assets/js/0132780e.f18fc120.js b/assets/js/0132780e.4cf7ec16.js similarity index 99% rename from assets/js/0132780e.f18fc120.js rename to assets/js/0132780e.4cf7ec16.js index 73a34221b2..62e455fe1c 100644 --- a/assets/js/0132780e.f18fc120.js +++ b/assets/js/0132780e.4cf7ec16.js @@ -1 +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}},57373:(e,n,t)=>{t.r(n),t.d(n,{CH:()=>h,assets:()=>a,chCodeConfig:()=>p,contentTitle:()=>d,default:()=>j,frontMatter:()=>l,metadata:()=>o,toc:()=>x});const o=JSON.parse('{"id":"Components/components-logic","title":"Logic","description":"Langflow\'s 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);const l={title:"Logic",slug:"/components-logic"},d=void 0,a={},h={annotations:i.hk,Code:i.Cy},p={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},x=[{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},{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},{value:"Legacy Logic components",id:"legacy-logic-components",level:2}];function u(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 h||g("CH",!1),h.Code||g("CH.Code",!0),o||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)(n.p,{children:["Langflow's ",(0,s.jsx)(n.strong,{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)(h.Code,{codeConfig:p,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.jsxs)(n.p,{children:["Some ",(0,s.jsx)(n.strong,{children:"If-Else"})," component input parameters are hidden by default in the visual editor.\nYou can toggle parameters through the ",(0,s.jsx)(c.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"}),"."]}),"\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:"message"}),(0,s.jsx)(n.td,{children:"Message"}),(0,s.jsx)(n.td,{children:"Input parameter. The message to pass through either route."})]}),(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)(h.Code,{codeConfig:p,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.jsxs)(n.p,{children:["Some ",(0,s.jsx)(n.strong,{children:"Run Flow"})," component input parameters are hidden by default in the visual editor.\nYou can toggle parameters through the ",(0,s.jsx)(c.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"}),"."]}),"\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",(0,s.jsxs)(n.p,{children:["The following ",(0,s.jsx)(n.strong,{children:"Logic"})," components are legacy components.\nYou can still use them in your flows, but they are no longer supported and can be removed in a future release."]}),"\n",(0,s.jsx)(n.p,{children:"Replace these components with suggested alternatives as soon as possible.\nComponents marked deprecated in addition to legacy should be replaced immediately."}),"\n",(0,s.jsxs)(o,{children:[(0,s.jsx)("summary",{children:"Condition/Data Conditional Router"}),(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 (deprecated)"}),(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 (deprecated)"}),(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 j(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(u,{...e})}):u(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.")}},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 +"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}},57373:(e,n,t)=>{t.r(n),t.d(n,{CH:()=>h,assets:()=>a,chCodeConfig:()=>p,contentTitle:()=>d,default:()=>j,frontMatter:()=>l,metadata:()=>o,toc:()=>x});const o=JSON.parse('{"id":"Components/components-logic","title":"Logic","description":"Langflow\'s 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);const l={title:"Logic",slug:"/components-logic"},d=void 0,a={},h={annotations:i.hk,Code:i.Cy},p={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},x=[{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},{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},{value:"Legacy Logic components",id:"legacy-logic-components",level:2}];function u(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 h||g("CH",!1),h.Code||g("CH.Code",!0),o||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)(n.p,{children:["Langflow's ",(0,s.jsx)(n.strong,{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)(h.Code,{codeConfig:p,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.jsxs)(n.p,{children:["Some ",(0,s.jsx)(n.strong,{children:"If-Else"})," component input parameters are hidden by default in the visual editor.\nYou can toggle parameters through the ",(0,s.jsx)(c.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"}),"."]}),"\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)(h.Code,{codeConfig:p,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.jsxs)(n.p,{children:["Some ",(0,s.jsx)(n.strong,{children:"Run Flow"})," component input parameters are hidden by default in the visual editor.\nYou can toggle parameters through the ",(0,s.jsx)(c.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"}),"."]}),"\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",(0,s.jsxs)(n.p,{children:["The following ",(0,s.jsx)(n.strong,{children:"Logic"})," components are legacy components.\nYou can still use them in your flows, but they are no longer supported and can be removed in a future release."]}),"\n",(0,s.jsx)(n.p,{children:"Replace these components with suggested alternatives as soon as possible.\nComponents marked deprecated in addition to legacy should be replaced immediately."}),"\n",(0,s.jsxs)(o,{children:[(0,s.jsx)("summary",{children:"Condition/Data Conditional Router"}),(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 (deprecated)"}),(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 (deprecated)"}),(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 j(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(u,{...e})}):u(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.")}},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.72c911f5.js b/assets/js/017d425f.8f8d01b2.js similarity index 59% rename from assets/js/017d425f.72c911f5.js rename to assets/js/017d425f.8f8d01b2.js index 3c9c5933aa..9b9d4f28c4 100644 --- a/assets/js/017d425f.72c911f5.js +++ b/assets/js/017d425f.8f8d01b2.js @@ -1 +1 @@ -"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:"Language Model"})," and ",(0,r.jsx)(t.strong,{children:"Agent"})," components include 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.jsxs)(t.a,{href:"/components-processing",children:[(0,r.jsx)(t.strong,{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 +"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.jsxs)(t.a,{href:"/components-processing",children:[(0,r.jsx)(t.strong,{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/2ab0d4f5.932761f6.js b/assets/js/2ab0d4f5.7d26814a.js similarity index 50% rename from assets/js/2ab0d4f5.932761f6.js rename to assets/js/2ab0d4f5.7d26814a.js index 764ba36bef..a637c614b3 100644 --- a/assets/js/2ab0d4f5.932761f6.js +++ b/assets/js/2ab0d4f5.7d26814a.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":"The Astra DB Chat Memory component retrieves and stores chat messages using an Astra DB database.
Chat memories are passed between memory storage components as the Memory data type.
Specifically, the component creates an instance of AstraDBChatMessageHistory, which is a LangChain chat message history class that uses Astra DB for storage.
The 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.
However, Langflow's Agent and Language Model components include built-in chat memory that is enabled by default. -Your flows don't need an external database to store chat memory. +
The 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.
However, Langflow's Agent component includes built-in chat memory that is enabled by default. +Your agentic flows don't need an external database to store chat memory. For more information, see Memory management options.
For more information about using external chat memory in flows, see the Message History component.
The Message History component provides combined chat history and message storage functionality. It can store and retrieve chat messages from either Langflow storage or a dedicated chat memory database like Mem0 or Redis.
-It replaces the legacy Chat History and Message Store components.
-The Language Model and Agent components have built-in chat memory that is enabled by default and uses Langflow storage.
This built-in chat memory functionality is sufficient for most use cases.
Use the Message History component only if you need to access chat memories outside the chat context, such as sentiment analysis flow that retrieves and analyzes recently stored memories, or you want to store memories in a specific database, separate from Langflow storage.
For more information, see Store chat memory.
The Agent component has built-in chat memory that is enabled by default and uses Langflow storage. +This built-in chat memory functionality is sufficient for most use cases.
Use the Message History component for the following use cases:
For more information, see Store chat memory.
The Message History component has two modes, depending on where you want to use it in your flow:
Connect the Prompt Template component's output to a Language Model component's System Message input.
-This example uses a Language Model component as the central chat driver, but you can also use an Agent component.
+This example uses the Language Model core component as the central chat driver, but you can also use another language model component or the Agent component.
Add a Chat Input component, and then connect it to the Language Model component's Input input.
+Add a Chat Input component, and then connect it to the Language Model component's Input field.
Connect the Language Model component's output to a Chat Output component.
@@ -108,8 +112,8 @@ The template can include any text and variables that you want to supply to the LConnect the Chat Output component's output to the Message History component's Message input.
Each response from the LLM is output from the Language Model component to the Chat Output component, and then stored in chat memory by the final Message History component.
To store and retrieve chat memory from a dedicated, external chat memory database, use the Message History component and a provider-specific chat memory component.
Available provider-specific chat memory components include Cassandra Chat Memory component, Mem0 Chat Memory component, and Redis Chat Memory component. -For all provider-specific chat memory components, see Bundles.
The following steps explain how to create a flow that stores and retrieves chat memory from Redis chat memory:
To store and retrieve chat memory from a dedicated, external chat memory database, use the Message History component and a provider-specific chat memory component.
The following steps explain how to create a flow that stores and retrieves chat memory with a Redis Chat Memory component. +Other options include the Mem0 Chat Memory component and Cassandra Chat Memory component.
Create or edit a flow where you want to use chat memory.
Some If-Else component input parameters are hidden by default in the visual editor. You can toggle parameters through the Controls in the component's header menu.
-| Name | Type | Description |
|---|---|---|
| input_text | String | Input parameter. The primary text input for the operation. |
| match_text | String | Input parameter. The text to compare against. |
| operator | Dropdown | Input parameter. The operator used to compare texts. Options include equals, not equals, contains, starts with, ends with, and regex. The default is equals. |
| case_sensitive | Boolean | Input parameter. When true, the comparison is case sensitive. The default is false. This setting doesn't apply to regex comparisons. |
| message | Message | Input parameter. The message to pass through either route. |
| max_iterations | Integer | Input parameter. The maximum number of iterations allowed for the conditional router. The default is 10. |
| default_route | Dropdown | Input parameter. The route to take when max iterations are reached. Options include true_result or false_result. The default is false_result. |
| true_result | Message | Output parameter. The output produced when the condition is true. |
| false_result | Message | Output parameter. The output produced when the condition is false. |
| Name | Type | Description |
|---|---|---|
| input_text | String | Input parameter. The primary text input for the operation. |
| match_text | String | Input parameter. The text to compare against. |
| operator | Dropdown | Input parameter. The operator used to compare texts. Options include equals, not equals, contains, starts with, ends with, and regex. The default is equals. |
| case_sensitive | Boolean | Input parameter. When true, the comparison is case sensitive. The default is false. This setting doesn't apply to regex comparisons. |
| max_iterations | Integer | Input parameter. The maximum number of iterations allowed for the conditional router. The default is 10. |
| default_route | Dropdown | Input parameter. The route to take when max iterations are reached. Options include true_result or false_result. The default is false_result. |
| true_result | Message | Output parameter. The output produced when the condition is true. |
| false_result | Message | Output parameter. The output produced when the condition is false. |
The Loop component iterates over a list of input by passing individual items to other components attached at the Item output port until there are no items left to process. Then, the Loop component passes the aggregated result of all looping to the component connected to the Done port.
diff --git a/components-memories.html b/components-memories.html index 01f35d9156..5e1452954c 100644 --- a/components-memories.html +++ b/components-memories.html @@ -23,7 +23,7 @@ - + diff --git a/components-models.html b/components-models.html index 028725085a..cc2bc3d748 100644 --- a/components-models.html +++ b/components-models.html @@ -23,7 +23,7 @@ - + diff --git a/components-processing.html b/components-processing.html index 14b8c28aa0..e30e3a8a2d 100644 --- a/components-processing.html +++ b/components-processing.html @@ -23,7 +23,7 @@ - + diff --git a/components-prompts.html b/components-prompts.html index a6382e96bf..aaeb517dba 100644 --- a/components-prompts.html +++ b/components-prompts.html @@ -23,7 +23,7 @@ - + @@ -63,7 +63,7 @@ For example:Variables in a Prompt Template component dynamically add fields to the Prompt Template component so that your flow can receive definitions for those values from other components, Langflow global variables, or fixed input.
For example, with the Message History component, you can use a {memory} variable to pass chat history to the prompt.
-However, the Language Model and Agent components include built-in chat memory that is enabled by default.
+However, the Agent component includes built-in chat memory that is enabled by default.
For more information, see Memory management options.
The following steps demonstrate how to add variables to a Prompt Template component:
For other options, see the LANGFLOW_CACHE_TYPE environment variable.
Chat-based flows with a Language Model or Agent component have built-in chat memory that is enabled by default. -This memory allows them to retrieve and reference messages from previous conversations associated with the same session ID.
-Built-in chat memory stores memories in the Langflow messages table.
Chat memory is a cache for the LLM or agent to preserve past conversations to retain and reference that context in future interactions. -For 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.
Chat memory is distinct from vector store memory because it is built specifically for storing and retrieving chat messages from databases.
Components that support chat memory (such as the Agent, Language Model, Message History, or third-party Chat Memory components) provide access to their respective databases as memory. +
Chat-based flows with a Chat Input or Chat Output component produce chat history that is stored in the Langflow messages table.
+At minimum, this serves as a chat log, but it isn't functionally the same as chat memory that provides historical context to an LLM.
To store and retrieve chat memories in flows, you can use a Message History component or the Agent component's built-in chat memory.
+Chat memory is a cache for an LLM or agent to preserve past conversations to retain and reference that context in future interactions. +For 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.
Chat memory is distinct from vector store memory because it is built specifically for storing and retrieving chat messages from databases.
Components that support chat memory (such as the Agent and Message History components) provide access to their respective databases as memory. Retrieval 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. Unlike 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.
Chat memories are grouped by session ID (session_id).
Chat history and memories are grouped by session ID (session_id).
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.
For better segregation of chat memory, especially in flows used by multiple users, consider using custom session IDs. For 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.
@@ -113,18 +113,19 @@ For example, if you use user IDs as session IDs, then each user's chat histWhere and how chat memory is stored depends on the components used in your flow:
Language Model and Agent components: All messages are stored in Langflow storage. -The Agent component provides some memory configuration options, such as Number of Chat History Messages.
-The Language Model and Agent component's built-in chat memory are sufficient for most use cases.
-If you prefer to use dedicated, external chat memory storage, or you need to retrieve memories outside the context of a chat, you can add Message History and Chat Memory components to your flow.
+Agent component: This component has built-in chat memory that is enabled by default. +This memory allows the agent to retrieve and reference messages from previous conversations associated with the same session ID. +All messages are stored in Langflow storage, and the component provides minimal memory configuration options, such as the number of messages to retrieve.
+The Agent component's built-in chat memory is sufficient for most use cases.
+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 Message History component (with or without a third-party chat memory component).
Message History component: By default, this component stores and retrieves memories from Langflow storage, unless you attach a Chat Memory component. It provides a few more options for sorting and filtering memories, although most of these options are built-in to the Agent component as configurable or fixed parameters.
-You can use the Message History component with or without a Language Model or Agent component. +
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 Agent component as configurable or fixed parameters.
+You can use the Message History component with or without a language model or agent. For example, if you need to retrieve data from memories outside of chat, you can use the Message History component to fetch that data directly from your chat memory database without feeding it into a chat.
Third-party Chat Memory components: Use one of these components only if you need to specifically store or retrieve chat memories from a dedicated chat memory database. +
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. Typically, this is necessary only if you have specific storage needs that aren't met by Langflow storage. For 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.