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":""}],"variable":[{"disabled":false,"description":{"content":"(Required) ","type":"text/plain"},"type":"any","value":"","key":"flow_id_or_name"}]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"{\\n \\"input_value\\": \\"\\",\\n \\"input_type\\": \\"\\",\\n \\"output_type\\": \\"\\",\\n \\"output_component\\": \\"\\",\\n \\"tweaks\\": {\\n \\"Lorem_5_\\": \\"\\"\\n },\\n \\"session_id\\": \\"\\"\\n}","options":{"raw":{"language":"json"}}},"auth":{"type":"apikey","apikey":[{"type":"any","value":"x-api-key","key":"key"},{"type":"any","value":"{{apiKey}}","key":"value"},{"type":"any","value":"query","key":"in"}]}}},"source":"@site/openapi.json","sourceDirName":".","permalink":"/api/simplified-run-flow","previous":{"title":"Get All","permalink":"/api/get-all"},"next":{"title":"Webhook Run Flow","permalink":"/api/webhook-run-flow"}}');var s=t(74848),r=t(28453);const a={},o="Simplified Run Flow",l=[];function d(e){const n={h1:"h1",header:"header",li:"li",p:"p",ul:"ul",...(0,r.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.header,{children:(0,s.jsx)(n.h1,{id:"simplified-run-flow",children:"Simplified Run Flow"})}),"\n",(0,s.jsx)(n.p,{children:"Executes a specified flow by ID with support for streaming and telemetry."}),"\n",(0,s.jsx)(n.p,{children:"This endpoint executes a flow identified by ID or name, with options for streaming the response\nand tracking execution metrics. It handles both streaming and non-streaming execution modes."}),"\n",(0,s.jsx)(n.p,{children:"Args:\nbackground_tasks (BackgroundTasks): FastAPI background task manager\nflow (FlowRead | None): The flow to execute, loaded via dependency\ninput_request (SimplifiedAPIRequest | None): Input parameters for the flow\nstream (bool): Whether to stream the response\napi_key_user (UserRead): Authenticated user from API key\nrequest (Request): The incoming HTTP request"}),"\n",(0,s.jsx)(n.p,{children:"Returns:\nUnion[StreamingResponse, RunResponse]: Either a streaming response for real-time results\nor a RunResponse with the complete execution results"}),"\n",(0,s.jsx)(n.p,{children:"Raises:\nHTTPException: For flow not found (404) or invalid input (400)\nAPIException: For internal execution errors (500)"}),"\n",(0,s.jsx)(n.p,{children:"Notes:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Supports both streaming and non-streaming execution modes"}),"\n",(0,s.jsx)(n.li,{children:"Tracks execution time and success/failure via telemetry"}),"\n",(0,s.jsx)(n.li,{children:"Handles graceful client disconnection in streaming mode"}),"\n",(0,s.jsx)(n.li,{children:"Provides detailed error handling with appropriate HTTP status codes"}),"\n",(0,s.jsxs)(n.li,{children:["In streaming mode, uses EventManager to handle events:","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:'"add_message": New messages during execution'}),"\n",(0,s.jsx)(n.li,{children:'"token": Individual tokens during streaming'}),"\n",(0,s.jsx)(n.li,{children:'"end": Final execution result'}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)("table",{style:{display:"table",width:"100%"},children:[(0,s.jsx)("thead",{children:(0,s.jsx)("tr",{children:(0,s.jsx)("th",{style:{textAlign:"left"},children:"Path Parameters"})})}),(0,s.jsx)("tbody",{children:(0,s.jsx)("tr",{children:(0,s.jsxs)("td",{children:[(0,s.jsx)("code",{children:"flow_id_or_name"}),(0,s.jsx)("span",{style:{opacity:"0.6"},children:" Flow Id Or Name"}),(0,s.jsx)("span",{style:{opacity:"0.6"},children:" \u2014 "}),(0,s.jsx)("strong",{style:{fontSize:"var(--ifm-code-font-size)",color:"var(--openapi-required)"},children:" REQUIRED"})]})})})]}),"\n",(0,s.jsxs)("table",{style:{display:"table",width:"100%"},children:[(0,s.jsx)("thead",{children:(0,s.jsx)("tr",{children:(0,s.jsx)("th",{style:{textAlign:"left"},children:"Query Parameters"})})}),(0,s.jsxs)("tbody",{children:[(0,s.jsx)("tr",{children:(0,s.jsxs)("td",{children:[(0,s.jsx)("code",{children:"stream"}),(0,s.jsx)("span",{style:{opacity:"0.6"},children:" Stream"})]})}),(0,s.jsx)("tr",{children:(0,s.jsxs)("td",{children:[(0,s.jsx)("code",{children:"user_id"}),(0,s.jsx)("span",{style:{opacity:"0.6"},children:" User Id"})]})})]})]}),"\n",(0,s.jsxs)("table",{style:{display:"table",width:"100%"},children:[(0,s.jsx)("thead",{children:(0,s.jsx)("tr",{children:(0,s.jsxs)("th",{style:{textAlign:"left"},children:[(0,s.jsx)("span",{children:"Request Body "}),(0,s.jsx)("div",{})]})})}),(0,s.jsx)("tbody",{children:(0,s.jsx)("tr",{children:(0,s.jsx)("td",{children:(0,s.jsx)("span",{style:{opacity:"0.6"},children:" undefined"})})})})]}),"\n",(0,s.jsxs)("table",{style:{display:"table",width:"100%"},children:[(0,s.jsx)("thead",{children:(0,s.jsx)("tr",{children:(0,s.jsx)("th",{style:{textAlign:"left"},children:"Responses"})})}),(0,s.jsxs)("tbody",{children:[(0,s.jsx)("tr",{children:(0,s.jsxs)("td",{children:[(0,s.jsxs)("div",{style:{display:"flex"},children:[(0,s.jsx)("div",{style:{marginRight:"var(--ifm-table-cell-padding)"},children:(0,s.jsx)("code",{children:"200"})}),(0,s.jsx)("div",{children:(0,s.jsx)(n.p,{children:"Successful Response"})})]}),(0,s.jsx)("div",{children:(0,s.jsxs)("table",{style:{display:"table",width:"100%",marginTop:"var(--ifm-table-cell-padding)",marginBottom:"0px"},children:[(0,s.jsx)("thead",{children:(0,s.jsx)("tr",{children:(0,s.jsxs)("th",{style:{textAlign:"left"},children:[(0,s.jsx)("span",{children:"Schema "}),(0,s.jsx)("span",{style:{opacity:"0.6"},children:" \u2014 "}),(0,s.jsx)("strong",{style:{fontSize:"var(--ifm-code-font-size)",color:"var(--openapi-optional)"},children:" OPTIONAL"}),(0,s.jsx)("div",{})]})})}),(0,s.jsx)("tbody",{children:(0,s.jsx)("tr",{children:(0,s.jsx)("td",{children:(0,s.jsx)("span",{style:{opacity:"0.6"},children:" undefined"})})})})]})})]})}),(0,s.jsx)("tr",{children:(0,s.jsxs)("td",{children:[(0,s.jsxs)("div",{style:{display:"flex"},children:[(0,s.jsx)("div",{style:{marginRight:"var(--ifm-table-cell-padding)"},children:(0,s.jsx)("code",{children:"422"})}),(0,s.jsx)("div",{children:(0,s.jsx)(n.p,{children:"Validation Error"})})]}),(0,s.jsx)("div",{children:(0,s.jsxs)("table",{style:{display:"table",width:"100%",marginTop:"var(--ifm-table-cell-padding)",marginBottom:"0px"},children:[(0,s.jsx)("thead",{children:(0,s.jsx)("tr",{children:(0,s.jsxs)("th",{style:{textAlign:"left"},children:[(0,s.jsx)("span",{children:"Schema "}),(0,s.jsx)("span",{style:{opacity:"0.6"},children:" \u2014 "}),(0,s.jsx)("strong",{style:{fontSize:"var(--ifm-code-font-size)",color:"var(--openapi-optional)"},children:" OPTIONAL"}),(0,s.jsx)("div",{})]})})}),(0,s.jsx)("tbody",{children:(0,s.jsx)("tr",{children:(0,s.jsxs)("td",{children:[(0,s.jsx)("code",{children:"detail"}),(0,s.jsx)("span",{style:{opacity:"0.6"},children:" object[]"}),(0,s.jsx)("span",{style:{opacity:"0.6"},children:" \u2014 "}),(0,s.jsx)("strong",{style:{fontSize:"var(--ifm-code-font-size)",color:"var(--openapi-optional)"},children:" OPTIONAL"}),(0,s.jsx)("table",{style:{display:"table",width:"100%",marginTop:"var(--ifm-table-cell-padding)",marginBottom:"0px"},children:(0,s.jsxs)("tbody",{children:[(0,s.jsx)("tr",{children:(0,s.jsxs)("td",{children:[(0,s.jsx)("code",{children:"loc"}),(0,s.jsx)("span",{style:{opacity:"0.6"},children:" undefined[]"})]})}),(0,s.jsx)("tr",{children:(0,s.jsxs)("td",{children:[(0,s.jsx)("code",{children:"msg"}),(0,s.jsx)("span",{style:{opacity:"0.6"},children:" Message"})]})}),(0,s.jsx)("tr",{children:(0,s.jsxs)("td",{children:[(0,s.jsx)("code",{children:"type"}),(0,s.jsx)("span",{style:{opacity:"0.6"},children:" Error Type"})]})})]})})]})})})]})})]})})]})]})]})}function c(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}}}]); \ No newline at end of file +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[1845],{28453:(e,n,t)=>{t.d(n,{R:()=>a,x:()=>o});var i=t(96540);const s={},r=i.createContext(s);function a(e){const n=i.useContext(r);return i.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:a(e.components),i.createElement(r.Provider,{value:n},e.children)}},83640:(e,n,t)=>{t.r(n),t.d(n,{contentTitle:()=>o,default:()=>c,frontMatter:()=>a,metadata:()=>i,toc:()=>l});const i=JSON.parse('{"type":"api","id":"simplified-run-flow","title":"Simplified Run Flow","description":"","slug":"/simplified-run-flow","frontMatter":{},"api":{"tags":["Base"],"description":"Executes a specified flow by ID with support for streaming and telemetry.\\n\\nThis endpoint executes a flow identified by ID or name, with options for streaming the response\\nand tracking execution metrics. It handles both streaming and non-streaming execution modes.\\n\\nArgs:\\n background_tasks (BackgroundTasks): FastAPI background task manager\\n flow (FlowRead | None): The flow to execute, loaded via dependency\\n input_request (SimplifiedAPIRequest | None): Input parameters for the flow\\n stream (bool): Whether to stream the response\\n api_key_user (UserRead): Authenticated user from API key\\n request (Request): The incoming HTTP request\\n\\nReturns:\\n Union[StreamingResponse, RunResponse]: Either a streaming response for real-time results\\n or a RunResponse with the complete execution results\\n\\nRaises:\\n HTTPException: For flow not found (404) or invalid input (400)\\n APIException: For internal execution errors (500)\\n\\nNotes:\\n - Supports both streaming and non-streaming execution modes\\n - Tracks execution time and success/failure via telemetry\\n - Handles graceful client disconnection in streaming mode\\n - Provides detailed error handling with appropriate HTTP status codes\\n - In streaming mode, uses EventManager to handle events:\\n - \\"add_message\\": New messages during execution\\n - \\"token\\": Individual tokens during streaming\\n - \\"end\\": Final execution result","operationId":"simplified_run_flow_api_v1_run__flow_id_or_name__post","security":[{"API key query":[]},{"API key header":[]}],"parameters":[{"name":"flow_id_or_name","in":"path","required":true,"schema":{"type":"string","title":"Flow Id Or Name"}},{"name":"stream","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Stream"}},{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"string","format":"uuid"},{"type":"null"}],"title":"User Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"properties":{"input_value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Input Value","description":"The input value"},"input_type":{"anyOf":[{"type":"string","enum":["chat","text","any"]},{"type":"null"}],"title":"Input Type","description":"The input type","default":"chat"},"output_type":{"anyOf":[{"type":"string","enum":["chat","text","any","debug"]},{"type":"null"}],"title":"Output Type","description":"The output type","default":"chat"},"output_component":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Output Component","description":"If there are multiple output components, you can specify the component to get the output from.","default":""},"tweaks":{"anyOf":[{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"object"}]},"type":"object","title":"Tweaks","description":"A dictionary of tweaks to adjust the flow\'s execution. Allows customizing flow behavior dynamically. All tweaks are overridden by the input values.","examples":[{"Component Name":{"parameter_name":"value"},"component_id":{"parameter_name":"value"},"parameter_name":"value"}]},{"type":"null"}],"description":"The tweaks"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id","description":"The session id"}},"type":"object","title":"SimplifiedAPIRequest"},{"type":"null"}],"title":"Input Request"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"properties":{"detail":{"items":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"}}}}},"method":"post","path":"/api/v1/run/{flow_id_or_name}","securitySchemes":{"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"api/v1/login"}}},"API key query":{"type":"apiKey","in":"query","name":"x-api-key"},"API key header":{"type":"apiKey","in":"header","name":"x-api-key"}},"info":{"title":"Langflow","version":"1.5.1"},"postman":{"name":"Simplified Run Flow","description":{"content":"Executes a specified flow by ID with support for streaming and telemetry.\\n\\nThis endpoint executes a flow identified by ID or name, with options for streaming the response\\nand tracking execution metrics. It handles both streaming and non-streaming execution modes.\\n\\nArgs:\\n background_tasks (BackgroundTasks): FastAPI background task manager\\n flow (FlowRead | None): The flow to execute, loaded via dependency\\n input_request (SimplifiedAPIRequest | None): Input parameters for the flow\\n stream (bool): Whether to stream the response\\n api_key_user (UserRead): Authenticated user from API key\\n request (Request): The incoming HTTP request\\n\\nReturns:\\n Union[StreamingResponse, RunResponse]: Either a streaming response for real-time results\\n or a RunResponse with the complete execution results\\n\\nRaises:\\n HTTPException: For flow not found (404) or invalid input (400)\\n APIException: For internal execution errors (500)\\n\\nNotes:\\n - Supports both streaming and non-streaming execution modes\\n - Tracks execution time and success/failure via telemetry\\n - Handles graceful client disconnection in streaming mode\\n - Provides detailed error handling with appropriate HTTP status codes\\n - In streaming mode, uses EventManager to handle events:\\n - \\"add_message\\": New messages during execution\\n - \\"token\\": Individual tokens during streaming\\n - \\"end\\": Final execution result","type":"text/plain"},"url":{"path":["api","v1","run",":flow_id_or_name"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"key":"stream","value":"false"},{"disabled":false,"key":"user_id","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) ","type":"text/plain"},"type":"any","value":"","key":"flow_id_or_name"}]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"{\\n \\"input_value\\": \\"\\",\\n \\"input_type\\": \\"\\",\\n \\"output_type\\": \\"\\",\\n \\"output_component\\": \\"\\",\\n \\"tweaks\\": {\\n \\"consequat_ee\\": \\"\\",\\n \\"labore1\\": \\"\\"\\n },\\n \\"session_id\\": \\"\\"\\n}","options":{"raw":{"language":"json"}}},"auth":{"type":"apikey","apikey":[{"type":"any","value":"x-api-key","key":"key"},{"type":"any","value":"{{apiKey}}","key":"value"},{"type":"any","value":"query","key":"in"}]}}},"source":"@site/openapi.json","sourceDirName":".","permalink":"/api/simplified-run-flow","previous":{"title":"Get All","permalink":"/api/get-all"},"next":{"title":"Webhook Run Flow","permalink":"/api/webhook-run-flow"}}');var s=t(74848),r=t(28453);const a={},o="Simplified Run Flow",l=[];function d(e){const n={h1:"h1",header:"header",li:"li",p:"p",ul:"ul",...(0,r.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.header,{children:(0,s.jsx)(n.h1,{id:"simplified-run-flow",children:"Simplified Run Flow"})}),"\n",(0,s.jsx)(n.p,{children:"Executes a specified flow by ID with support for streaming and telemetry."}),"\n",(0,s.jsx)(n.p,{children:"This endpoint executes a flow identified by ID or name, with options for streaming the response\nand tracking execution metrics. It handles both streaming and non-streaming execution modes."}),"\n",(0,s.jsx)(n.p,{children:"Args:\nbackground_tasks (BackgroundTasks): FastAPI background task manager\nflow (FlowRead | None): The flow to execute, loaded via dependency\ninput_request (SimplifiedAPIRequest | None): Input parameters for the flow\nstream (bool): Whether to stream the response\napi_key_user (UserRead): Authenticated user from API key\nrequest (Request): The incoming HTTP request"}),"\n",(0,s.jsx)(n.p,{children:"Returns:\nUnion[StreamingResponse, RunResponse]: Either a streaming response for real-time results\nor a RunResponse with the complete execution results"}),"\n",(0,s.jsx)(n.p,{children:"Raises:\nHTTPException: For flow not found (404) or invalid input (400)\nAPIException: For internal execution errors (500)"}),"\n",(0,s.jsx)(n.p,{children:"Notes:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Supports both streaming and non-streaming execution modes"}),"\n",(0,s.jsx)(n.li,{children:"Tracks execution time and success/failure via telemetry"}),"\n",(0,s.jsx)(n.li,{children:"Handles graceful client disconnection in streaming mode"}),"\n",(0,s.jsx)(n.li,{children:"Provides detailed error handling with appropriate HTTP status codes"}),"\n",(0,s.jsxs)(n.li,{children:["In streaming mode, uses EventManager to handle events:","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:'"add_message": New messages during execution'}),"\n",(0,s.jsx)(n.li,{children:'"token": Individual tokens during streaming'}),"\n",(0,s.jsx)(n.li,{children:'"end": Final execution result'}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)("table",{style:{display:"table",width:"100%"},children:[(0,s.jsx)("thead",{children:(0,s.jsx)("tr",{children:(0,s.jsx)("th",{style:{textAlign:"left"},children:"Path Parameters"})})}),(0,s.jsx)("tbody",{children:(0,s.jsx)("tr",{children:(0,s.jsxs)("td",{children:[(0,s.jsx)("code",{children:"flow_id_or_name"}),(0,s.jsx)("span",{style:{opacity:"0.6"},children:" Flow Id Or Name"}),(0,s.jsx)("span",{style:{opacity:"0.6"},children:" \u2014 "}),(0,s.jsx)("strong",{style:{fontSize:"var(--ifm-code-font-size)",color:"var(--openapi-required)"},children:" REQUIRED"})]})})})]}),"\n",(0,s.jsxs)("table",{style:{display:"table",width:"100%"},children:[(0,s.jsx)("thead",{children:(0,s.jsx)("tr",{children:(0,s.jsx)("th",{style:{textAlign:"left"},children:"Query Parameters"})})}),(0,s.jsxs)("tbody",{children:[(0,s.jsx)("tr",{children:(0,s.jsxs)("td",{children:[(0,s.jsx)("code",{children:"stream"}),(0,s.jsx)("span",{style:{opacity:"0.6"},children:" Stream"})]})}),(0,s.jsx)("tr",{children:(0,s.jsxs)("td",{children:[(0,s.jsx)("code",{children:"user_id"}),(0,s.jsx)("span",{style:{opacity:"0.6"},children:" User Id"})]})})]})]}),"\n",(0,s.jsxs)("table",{style:{display:"table",width:"100%"},children:[(0,s.jsx)("thead",{children:(0,s.jsx)("tr",{children:(0,s.jsxs)("th",{style:{textAlign:"left"},children:[(0,s.jsx)("span",{children:"Request Body "}),(0,s.jsx)("div",{})]})})}),(0,s.jsx)("tbody",{children:(0,s.jsx)("tr",{children:(0,s.jsx)("td",{children:(0,s.jsx)("span",{style:{opacity:"0.6"},children:" undefined"})})})})]}),"\n",(0,s.jsxs)("table",{style:{display:"table",width:"100%"},children:[(0,s.jsx)("thead",{children:(0,s.jsx)("tr",{children:(0,s.jsx)("th",{style:{textAlign:"left"},children:"Responses"})})}),(0,s.jsxs)("tbody",{children:[(0,s.jsx)("tr",{children:(0,s.jsxs)("td",{children:[(0,s.jsxs)("div",{style:{display:"flex"},children:[(0,s.jsx)("div",{style:{marginRight:"var(--ifm-table-cell-padding)"},children:(0,s.jsx)("code",{children:"200"})}),(0,s.jsx)("div",{children:(0,s.jsx)(n.p,{children:"Successful Response"})})]}),(0,s.jsx)("div",{children:(0,s.jsxs)("table",{style:{display:"table",width:"100%",marginTop:"var(--ifm-table-cell-padding)",marginBottom:"0px"},children:[(0,s.jsx)("thead",{children:(0,s.jsx)("tr",{children:(0,s.jsxs)("th",{style:{textAlign:"left"},children:[(0,s.jsx)("span",{children:"Schema "}),(0,s.jsx)("span",{style:{opacity:"0.6"},children:" \u2014 "}),(0,s.jsx)("strong",{style:{fontSize:"var(--ifm-code-font-size)",color:"var(--openapi-optional)"},children:" OPTIONAL"}),(0,s.jsx)("div",{})]})})}),(0,s.jsx)("tbody",{children:(0,s.jsx)("tr",{children:(0,s.jsx)("td",{children:(0,s.jsx)("span",{style:{opacity:"0.6"},children:" undefined"})})})})]})})]})}),(0,s.jsx)("tr",{children:(0,s.jsxs)("td",{children:[(0,s.jsxs)("div",{style:{display:"flex"},children:[(0,s.jsx)("div",{style:{marginRight:"var(--ifm-table-cell-padding)"},children:(0,s.jsx)("code",{children:"422"})}),(0,s.jsx)("div",{children:(0,s.jsx)(n.p,{children:"Validation Error"})})]}),(0,s.jsx)("div",{children:(0,s.jsxs)("table",{style:{display:"table",width:"100%",marginTop:"var(--ifm-table-cell-padding)",marginBottom:"0px"},children:[(0,s.jsx)("thead",{children:(0,s.jsx)("tr",{children:(0,s.jsxs)("th",{style:{textAlign:"left"},children:[(0,s.jsx)("span",{children:"Schema "}),(0,s.jsx)("span",{style:{opacity:"0.6"},children:" \u2014 "}),(0,s.jsx)("strong",{style:{fontSize:"var(--ifm-code-font-size)",color:"var(--openapi-optional)"},children:" OPTIONAL"}),(0,s.jsx)("div",{})]})})}),(0,s.jsx)("tbody",{children:(0,s.jsx)("tr",{children:(0,s.jsxs)("td",{children:[(0,s.jsx)("code",{children:"detail"}),(0,s.jsx)("span",{style:{opacity:"0.6"},children:" object[]"}),(0,s.jsx)("span",{style:{opacity:"0.6"},children:" \u2014 "}),(0,s.jsx)("strong",{style:{fontSize:"var(--ifm-code-font-size)",color:"var(--openapi-optional)"},children:" OPTIONAL"}),(0,s.jsx)("table",{style:{display:"table",width:"100%",marginTop:"var(--ifm-table-cell-padding)",marginBottom:"0px"},children:(0,s.jsxs)("tbody",{children:[(0,s.jsx)("tr",{children:(0,s.jsxs)("td",{children:[(0,s.jsx)("code",{children:"loc"}),(0,s.jsx)("span",{style:{opacity:"0.6"},children:" undefined[]"})]})}),(0,s.jsx)("tr",{children:(0,s.jsxs)("td",{children:[(0,s.jsx)("code",{children:"msg"}),(0,s.jsx)("span",{style:{opacity:"0.6"},children:" Message"})]})}),(0,s.jsx)("tr",{children:(0,s.jsxs)("td",{children:[(0,s.jsx)("code",{children:"type"}),(0,s.jsx)("span",{style:{opacity:"0.6"},children:" Error Type"})]})})]})})]})})})]})})]})})]})]})]})}function c(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}}}]); \ No newline at end of file diff --git a/assets/js/47e58a89.48978cd6.js b/assets/js/47e58a89.48978cd6.js new file mode 100644 index 0000000000..f8270705f8 --- /dev/null +++ b/assets/js/47e58a89.48978cd6.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[1006],{28453:(e,o,n)=>{n.d(o,{R:()=>a,x:()=>i});var t=n(96540);const s={},r=t.createContext(s);function a(e){const o=t.useContext(r);return t.useMemo(function(){return"function"==typeof e?e(o):{...o,...e}},[o,e])}function i(e){let o;return o=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:a(e.components),t.createElement(r.Provider,{value:o},e.children)}},33354:(e,o,n)=>{n.r(o),n.d(o,{CH:()=>d,assets:()=>l,chCodeConfig:()=>h,contentTitle:()=>c,default:()=>g,frontMatter:()=>i,metadata:()=>t,toc:()=>m});const t=JSON.parse('{"id":"Develop/memory","title":"Memory management options","description":"Langflow provides flexible memory management options for storage and retrieval of data relevant to your flows and your Langflow server.","source":"@site/docs/Develop/memory.mdx","sourceDirName":"Develop","slug":"/memory","permalink":"/memory","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Memory management options","slug":"/memory"},"sidebar":"docs","previous":{"title":"Manage files","permalink":"/concepts-file-management"},"next":{"title":"Use Session IDs","permalink":"/session-id"}}');var s=n(74848),r=n(28453),a=n(24754);const i={title:"Memory management options",slug:"/memory"},c=void 0,l={},d={annotations:a.hk,Code:a.Cy},h={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},m=[{value:"Storage options and paths",id:"storage-options-and-paths",level:2},{value:"Local Langflow database tables",id:"local-langflow-database-tables",level:2},{value:"Configure external memory",id:"configure-external-memory",level:2},{value:"Configure the external database connection",id:"configure-the-external-database-connection",level:3},{value:"Configure cache memory",id:"configure-cache-memory",level:2},{value:"Store chat memory",id:"store-chat-memory",level:2},{value:"Session ID and chat memory",id:"session-id-and-chat-memory",level:3},{value:"Chat memory options",id:"chat-memory-options",level:3},{value:"See also",id:"see-also",level:2}];function u(e){const o={a:"a",code:"code",em:"em",h2:"h2",h3:"h3",li:"li",p:"p",strong:"strong",ul:"ul",...(0,r.R)(),...e.components},{Details:n}=o;return d||f("CH",!1),d.Code||f("CH.Code",!0),n||f("Details",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n",(0,s.jsx)(o.p,{children:"Langflow provides flexible memory management options for storage and retrieval of data relevant to your flows and your Langflow server.\nThis includes essential Langflow database tables, file management, and caching, as well as chat memory."}),"\n",(0,s.jsx)(o.h2,{id:"storage-options-and-paths",children:"Storage options and paths"}),"\n",(0,s.jsx)(o.p,{children:"Langflow supports both local memory and external memory options."}),"\n",(0,s.jsxs)(o.p,{children:["Langflow's default storage option is a ",(0,s.jsx)(o.a,{href:"https://www.sqlite.org/",children:"SQLite"})," database stored in your system's cache directory.\nThe default storage path depends on your operation system and installation method:"]}),"\n",(0,s.jsxs)(o.ul,{children:["\n",(0,s.jsxs)(o.li,{children:[(0,s.jsx)(o.strong,{children:"macOS Desktop"}),": ",(0,s.jsx)(o.code,{children:"/Users//.langflow/data/database.db"})]}),"\n",(0,s.jsxs)(o.li,{children:[(0,s.jsx)(o.strong,{children:"Windows Desktop"}),": ",(0,s.jsx)(o.code,{children:"C:\\Users\\\\AppData\\Roaming\\com.Langflow\\data\\langflow.db"})]}),"\n",(0,s.jsxs)(o.li,{children:[(0,s.jsxs)(o.strong,{children:["OSS macOS/Windows/Linux/WSL (",(0,s.jsx)(o.code,{children:"uv pip install"}),")"]}),": ",(0,s.jsx)(o.code,{children:"/lib/python3.12/site-packages/langflow/langflow.db"})," (Python version may vary)"]}),"\n",(0,s.jsxs)(o.li,{children:[(0,s.jsxs)(o.strong,{children:["OSS macOS/Windows/Linux/WSL (",(0,s.jsx)(o.code,{children:"git clone"}),")"]}),": ",(0,s.jsx)(o.code,{children:"/src/backend/base/langflow/langflow.db"})]}),"\n"]}),"\n",(0,s.jsxs)(o.p,{children:["Alternatively, you can use an external PostgreSQL database for all of your Langflow storage.\nYou can also selectively use external storage for chat memory, separate from other Langflow storage.\nFor more information, see ",(0,s.jsx)(o.a,{href:"#configure-external-memory",children:"Configure external memory"})," and ",(0,s.jsx)(o.a,{href:"#store-chat-memory",children:"Store chat memory"}),"."]}),"\n",(0,s.jsx)(o.h2,{id:"local-langflow-database-tables",children:"Local Langflow database tables"}),"\n",(0,s.jsxs)(o.p,{children:["The following tables are stored in ",(0,s.jsx)(o.code,{children:"langflow.db"}),":"]}),"\n",(0,s.jsxs)(o.p,{children:["\u2022 ",(0,s.jsx)(o.strong,{children:"User"}),": Stores user account information including credentials, permissions, profiles, and user management settings. For more information, see ",(0,s.jsx)(o.a,{href:"/api-keys-and-authentication",children:"API keys and authentication"}),"."]}),"\n",(0,s.jsxs)(o.p,{children:["\u2022 ",(0,s.jsx)(o.strong,{children:"Flow"}),": Contains flow definitions, including nodes, edges, and components, stored as JSON or database records. For more information, see ",(0,s.jsx)(o.a,{href:"/concepts-flows",children:"Build flows"}),"."]}),"\n",(0,s.jsxs)(o.p,{children:["\u2022 ",(0,s.jsx)(o.strong,{children:"Message"}),": Stores chat messages and interactions that occur between components. For more information, see ",(0,s.jsx)(o.a,{href:"/data-types#message",children:"Message objects"})," and ",(0,s.jsx)(o.a,{href:"#store-chat-memory",children:"Store chat memory"}),"."]}),"\n",(0,s.jsxs)(o.p,{children:["\u2022 ",(0,s.jsx)(o.strong,{children:"Transaction"}),": Records execution history and results of flow runs. This information is used for ",(0,s.jsx)(o.a,{href:"/logging",children:"logging"}),"."]}),"\n",(0,s.jsxs)(o.p,{children:["\u2022 ",(0,s.jsx)(o.strong,{children:"ApiKey"}),": Manages Langflow API authentication keys. Component API keys are stored in the ",(0,s.jsx)(o.strong,{children:"Variables"})," table. For more information, see ",(0,s.jsx)(o.a,{href:"/api-keys-and-authentication",children:"API keys and authentication"}),"."]}),"\n",(0,s.jsxs)(o.p,{children:["\u2022 ",(0,s.jsx)(o.strong,{children:"Project"}),": Provides a structure for flow storage, including single-user projects and shared projects accessed by multiple users. For more information, see ",(0,s.jsx)(o.a,{href:"/concepts-flows#projects",children:"Manage flows in projects"}),"."]}),"\n",(0,s.jsxs)(o.p,{children:["\u2022 ",(0,s.jsx)(o.strong,{children:"Variables"}),": Stores global encrypted values and credentials. For more information, see ",(0,s.jsx)(o.a,{href:"/configuration-global-variables",children:"Global variables"}),"."]}),"\n",(0,s.jsxs)(o.p,{children:["\u2022 ",(0,s.jsx)(o.strong,{children:"VertexBuild"}),": Tracks the build status of individual nodes within flows. For more information, see ",(0,s.jsx)(o.a,{href:"/concepts-playground",children:"Test flows in the Playground"}),"."]}),"\n",(0,s.jsxs)(o.p,{children:["For more information, see the database models in the ",(0,s.jsx)(o.a,{href:"https://github.com/langflow-ai/langflow/tree/main/src/backend/base/langflow/services/database/models",children:"source code"}),"."]}),"\n",(0,s.jsx)(o.h2,{id:"configure-external-memory",children:"Configure external memory"}),"\n",(0,s.jsxs)(o.p,{children:["To replace the default Langflow SQLite database with another database, modify the ",(0,s.jsx)(o.code,{children:"LANGFLOW_DATABASE_URL"})," environment variable, and then start Langflow with your ",(0,s.jsx)(o.code,{children:".env"})," file:"]}),"\n",(0,s.jsx)(d.Code,{codeConfig:h,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"LANGFLOW_DATABASE_URL=postgresql://user:password@localhost:5432/langflow",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,s.jsxs)(o.p,{children:["For an example, see ",(0,s.jsx)(o.a,{href:"/configuration-custom-database",children:"Configure an external PostgreSQL database"}),"."]}),"\n",(0,s.jsx)(o.h3,{id:"configure-the-external-database-connection",children:"Configure the external database connection"}),"\n",(0,s.jsx)(o.p,{children:"The following settings allow you to fine-tune your database connection pool and timeout settings:"}),"\n",(0,s.jsx)(d.Code,{codeConfig:h,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:'LANGFLOW_DB_CONNECTION_SETTINGS=\'{"pool_size": 20, "max_overflow": 30, "pool_timeout": 30, "pool_pre_ping": true, "pool_recycle": 1800, "echo": false}\'',props:{}}]},{tokens:[{content:"LANGFLOW_DB_CONNECT_TIMEOUT=20",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,s.jsxs)(o.ul,{children:["\n",(0,s.jsxs)(o.li,{children:[(0,s.jsx)(o.code,{children:"pool_size"}),": Maximum number of database connections to keep in the pool (default: 20)"]}),"\n",(0,s.jsxs)(o.li,{children:[(0,s.jsx)(o.code,{children:"max_overflow"}),": Maximum number of connections that can be created beyond the pool_size (default: 30)"]}),"\n",(0,s.jsxs)(o.li,{children:[(0,s.jsx)(o.code,{children:"pool_timeout"}),": Number of seconds to wait before timing out on getting a connection from the pool (default: 30)"]}),"\n",(0,s.jsxs)(o.li,{children:[(0,s.jsx)(o.code,{children:"pool_pre_ping"}),": If true, the pool tests connections for liveness upon each checkout (default: true)"]}),"\n",(0,s.jsxs)(o.li,{children:[(0,s.jsx)(o.code,{children:"pool_recycle"}),": Number of seconds after which a connection is automatically recycled (default: 1800, or 30 minutes)"]}),"\n",(0,s.jsxs)(o.li,{children:[(0,s.jsx)(o.code,{children:"echo"}),": If true, SQL queries are logged for debugging purposes (default: false)"]}),"\n",(0,s.jsxs)(o.li,{children:[(0,s.jsx)(o.code,{children:"LANGFLOW_DB_CONNECT_TIMEOUT"}),": Maximum number of seconds to wait when establishing a new database connection (default: 20)"]}),"\n"]}),"\n",(0,s.jsx)(o.h2,{id:"configure-cache-memory",children:"Configure cache memory"}),"\n",(0,s.jsx)(o.p,{children:"The default Langflow caching behavior is an asynchronous, in-memory cache."}),"\n",(0,s.jsx)(d.Code,{codeConfig:h,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"LANGFLOW_LANGCHAIN_CACHE=InMemoryCache",props:{}}]},{tokens:[{content:"LANGFLOW_CACHE_TYPE=Async",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,s.jsx)(o.p,{children:"Alternative caching options can be configured, but options other than the default asynchronous, in-memory cache aren't supported.\nThe default behavior is suitable for most use cases."}),"\n",(0,s.jsxs)(o.p,{children:["For other options, see the ",(0,s.jsx)(o.code,{children:"LANGFLOW_CACHE_TYPE"})," ",(0,s.jsx)(o.a,{href:"/environment-variables",children:"environment variable"}),"."]}),"\n",(0,s.jsx)(o.h2,{id:"store-chat-memory",children:"Store chat memory"}),"\n",(0,s.jsxs)(o.p,{children:["Chat-based flows with a ",(0,s.jsx)(o.strong,{children:"Chat Input"})," or ",(0,s.jsx)(o.strong,{children:"Chat Output"})," component produce chat history that is stored in the Langflow ",(0,s.jsx)(o.code,{children:"messages"})," table.\nAt minimum, this serves as a chat log, but it isn't functionally the same as chat memory that provides historical context to an LLM."]}),"\n",(0,s.jsxs)(o.p,{children:["To store and retrieve chat memories in flows, you can use a ",(0,s.jsx)(o.strong,{children:"Message History"})," component or the ",(0,s.jsx)(o.strong,{children:"Agent"})," component's built-in chat memory."]}),"\n",(0,s.jsxs)(n,{children:[(0,s.jsx)("summary",{children:"How does chat memory work?"}),(0,s.jsx)(o.p,{children:"Chat memory is a cache for an LLM or agent to preserve past conversations to retain and reference that context in future interactions.\nFor example, if a user has already told the LLM their name, the LLM can retrieve that information from chat memory rather than asking the user to repeat themselves in future conversations or messages."}),(0,s.jsx)(o.p,{children:"Chat memory is distinct from vector store memory because it is built specifically for storing and retrieving chat messages from databases."}),(0,s.jsxs)(o.p,{children:["Components that support chat memory (such as the ",(0,s.jsx)(o.strong,{children:"Agent"})," and ",(0,s.jsx)(o.strong,{children:"Message History"})," components) provide access to their respective databases ",(0,s.jsx)(o.em,{children:"as memory"}),".\nRetrieval as memory is an important distinction for LLMs and agents because this storage and retrieval mechanism is specifically designed to recall context from past conversations.\nUnlike vector stores, which are designed for semantic search and retrieval of text chunks, chat memory is designed to store and retrieve chat messages in a way that is optimized for conversation history."]})]}),"\n",(0,s.jsx)(o.h3,{id:"session-id-and-chat-memory",children:"Session ID and chat memory"}),"\n",(0,s.jsxs)(o.p,{children:["Chat history and memories are grouped by ",(0,s.jsxs)(o.a,{href:"/session-id",children:["session ID (",(0,s.jsx)(o.code,{children:"session_id"}),")"]}),"."]}),"\n",(0,s.jsx)(o.p,{children:"The default session ID is the flow ID, which means that all chat messages for a flow are stored under the same session ID as one large chat session."}),"\n",(0,s.jsx)(o.p,{children:"For better segregation of chat memory, especially in flows used by multiple users, consider using custom session IDs.\nFor example, if you use user IDs as session IDs, then each user's chat history is stored separately, isolating the context of their chats from other users' chats."}),"\n",(0,s.jsx)(o.h3,{id:"chat-memory-options",children:"Chat memory options"}),"\n",(0,s.jsx)(o.p,{children:"Where and how chat memory is stored depends on the components used in your flow:"}),"\n",(0,s.jsxs)(o.ul,{children:["\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:[(0,s.jsx)(o.strong,{children:"Agent component"}),": This component has built-in chat memory that is enabled by default.\nThis memory allows the agent to retrieve and reference messages from previous conversations associated with the same session ID.\nAll messages are stored in ",(0,s.jsx)(o.a,{href:"#storage-options-and-paths",children:"Langflow storage"}),", and the component provides minimal memory configuration options, such as the number of messages to retrieve."]}),"\n",(0,s.jsxs)(o.p,{children:["The ",(0,s.jsx)(o.strong,{children:"Agent"})," component's built-in chat memory is sufficient for most use cases."]}),"\n",(0,s.jsxs)(o.p,{children:["If you want to use external chat memory storage, retrieve memories outside the context of a chat, or use chat memory with a language model component (not an agent), you must use the ",(0,s.jsx)(o.strong,{children:"Message History"})," component (with or without a third-party chat memory component)."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:[(0,s.jsx)(o.strong,{children:"Message History component"}),": By default, this component stores and retrieves memories from Langflow storage, unless you attach a third-party chat memory component. It provides a few more options for sorting and filtering memories, although most of these options are also built-in to the ",(0,s.jsx)(o.strong,{children:"Agent"})," component as configurable or fixed parameters."]}),"\n",(0,s.jsxs)(o.p,{children:["You can use the ",(0,s.jsx)(o.strong,{children:"Message History"})," component with or without a language model or agent.\nFor example, if you need to retrieve data from memories outside of chat, you can use the ",(0,s.jsx)(o.strong,{children:"Message History"})," component to fetch that data directly from your chat memory database without feeding it into a chat."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:[(0,s.jsx)(o.strong,{children:"Third-party chat memory components"}),": Use one of these components only if you need to store or retrieve chat memories from a dedicated external chat memory database.\nTypically, this is necessary only if you have specific storage needs that aren't met by Langflow storage.\nFor example, if you want to manage chat memory data by directly working with the database, or if you want to use a different database than the default Langflow storage."]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(o.p,{children:["For more information and examples, see ",(0,s.jsxs)(o.a,{href:"/components-helpers#message-history",children:[(0,s.jsx)(o.strong,{children:"Message History"})," component"]})," and ",(0,s.jsx)(o.a,{href:"/agents#agent-memory",children:"Agent memory"}),"."]}),"\n",(0,s.jsx)(o.h2,{id:"see-also",children:"See also"}),"\n",(0,s.jsxs)(o.ul,{children:["\n",(0,s.jsx)(o.li,{children:(0,s.jsx)(o.a,{href:"/concepts-file-management",children:"Langflow file management"})}),"\n",(0,s.jsx)(o.li,{children:(0,s.jsx)(o.a,{href:"/logging",children:"Langflow logs"})}),"\n"]})]})}function g(e={}){const{wrapper:o}={...(0,r.R)(),...e.components};return o?(0,s.jsx)(o,{...e,children:(0,s.jsx)(u,{...e})}):u(e)}function f(e,o){throw new Error("Expected "+(o?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}}}]); \ No newline at end of file diff --git a/assets/js/47e58a89.60c6ebd1.js b/assets/js/47e58a89.60c6ebd1.js deleted file mode 100644 index fa7b61330e..0000000000 --- a/assets/js/47e58a89.60c6ebd1.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[1006],{28453:(e,n,o)=>{o.d(n,{R:()=>a,x:()=>i});var s=o(96540);const t={},r=s.createContext(t);function a(e){const n=s.useContext(r);return s.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function i(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:a(e.components),s.createElement(r.Provider,{value:n},e.children)}},33354:(e,n,o)=>{o.r(n),o.d(n,{CH:()=>d,assets:()=>l,chCodeConfig:()=>h,contentTitle:()=>c,default:()=>u,frontMatter:()=>i,metadata:()=>s,toc:()=>m});const s=JSON.parse('{"id":"Develop/memory","title":"Memory management options","description":"Langflow provides flexible memory management options for storage and retrieval of data relevant to your flows and your Langflow server.","source":"@site/docs/Develop/memory.mdx","sourceDirName":"Develop","slug":"/memory","permalink":"/memory","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Memory management options","slug":"/memory"},"sidebar":"docs","previous":{"title":"Manage files","permalink":"/concepts-file-management"},"next":{"title":"Use Session IDs","permalink":"/session-id"}}');var t=o(74848),r=o(28453),a=o(24754);const i={title:"Memory management options",slug:"/memory"},c=void 0,l={},d={annotations:a.hk,Code:a.Cy},h={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},m=[{value:"Storage options and paths",id:"storage-options-and-paths",level:2},{value:"Local Langflow database tables",id:"local-langflow-database-tables",level:2},{value:"Configure external memory",id:"configure-external-memory",level:2},{value:"Configure the external database connection",id:"configure-the-external-database-connection",level:3},{value:"Configure cache memory",id:"configure-cache-memory",level:2},{value:"Store chat memory",id:"store-chat-memory",level:2},{value:"Session ID and chat memory",id:"session-id-and-chat-memory",level:3},{value:"Chat memory options",id:"chat-memory-options",level:3},{value:"See also",id:"see-also",level:2}];function g(e){const n={a:"a",code:"code",em:"em",h2:"h2",h3:"h3",li:"li",p:"p",strong:"strong",ul:"ul",...(0,r.R)(),...e.components},{Details:o}=n;return d||f("CH",!1),d.Code||f("CH.Code",!0),o||f("Details",!0),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n",(0,t.jsx)(n.p,{children:"Langflow provides flexible memory management options for storage and retrieval of data relevant to your flows and your Langflow server.\nThis includes essential Langflow database tables, file management, and caching, as well as chat memory."}),"\n",(0,t.jsx)(n.h2,{id:"storage-options-and-paths",children:"Storage options and paths"}),"\n",(0,t.jsx)(n.p,{children:"Langflow supports both local memory and external memory options."}),"\n",(0,t.jsxs)(n.p,{children:["Langflow's default storage option is a ",(0,t.jsx)(n.a,{href:"https://www.sqlite.org/",children:"SQLite"})," database stored in your system's cache directory.\nThe default storage path depends on your operation system and installation method:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"macOS Desktop"}),": ",(0,t.jsx)(n.code,{children:"/Users//.langflow/data/database.db"})]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"Windows Desktop"}),": ",(0,t.jsx)(n.code,{children:"C:\\Users\\\\AppData\\Roaming\\com.Langflow\\data\\langflow.db"})]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsxs)(n.strong,{children:["OSS macOS/Windows/Linux/WSL (",(0,t.jsx)(n.code,{children:"uv pip install"}),")"]}),": ",(0,t.jsx)(n.code,{children:"/lib/python3.12/site-packages/langflow/langflow.db"})," (Python version may vary)"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsxs)(n.strong,{children:["OSS macOS/Windows/Linux/WSL (",(0,t.jsx)(n.code,{children:"git clone"}),")"]}),": ",(0,t.jsx)(n.code,{children:"/src/backend/base/langflow/langflow.db"})]}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["Alternatively, you can use an external PostgreSQL database for all of your Langflow storage.\nYou can also selectively use external storage for chat memory, separate from other Langflow storage.\nFor more information, see ",(0,t.jsx)(n.a,{href:"#configure-external-memory",children:"Configure external memory"})," and ",(0,t.jsx)(n.a,{href:"#store-chat-memory",children:"Store chat memory"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"local-langflow-database-tables",children:"Local Langflow database tables"}),"\n",(0,t.jsxs)(n.p,{children:["The following tables are stored in ",(0,t.jsx)(n.code,{children:"langflow.db"}),":"]}),"\n",(0,t.jsxs)(n.p,{children:["\u2022 ",(0,t.jsx)(n.strong,{children:"User"}),": Stores user account information including credentials, permissions, profiles, and user management settings. For more information, see ",(0,t.jsx)(n.a,{href:"/api-keys-and-authentication",children:"API keys and authentication"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["\u2022 ",(0,t.jsx)(n.strong,{children:"Flow"}),": Contains flow definitions, including nodes, edges, and components, stored as JSON or database records. For more information, see ",(0,t.jsx)(n.a,{href:"/concepts-flows",children:"Build flows"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["\u2022 ",(0,t.jsx)(n.strong,{children:"Message"}),": Stores chat messages and interactions that occur between components. For more information, see ",(0,t.jsx)(n.a,{href:"/data-types#message",children:"Message objects"})," and ",(0,t.jsx)(n.a,{href:"#store-chat-memory",children:"Store chat memory"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["\u2022 ",(0,t.jsx)(n.strong,{children:"Transaction"}),": Records execution history and results of flow runs. This information is used for ",(0,t.jsx)(n.a,{href:"/logging",children:"logging"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["\u2022 ",(0,t.jsx)(n.strong,{children:"ApiKey"}),": Manages Langflow API authentication keys. Component API keys are stored in the ",(0,t.jsx)(n.strong,{children:"Variables"})," table. For more information, see ",(0,t.jsx)(n.a,{href:"/api-keys-and-authentication",children:"API keys and authentication"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["\u2022 ",(0,t.jsx)(n.strong,{children:"Project"}),": Provides a structure for flow storage, including single-user projects and shared projects accessed by multiple users. For more information, see ",(0,t.jsx)(n.a,{href:"/concepts-flows#projects",children:"Manage flows in projects"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["\u2022 ",(0,t.jsx)(n.strong,{children:"Variables"}),": Stores global encrypted values and credentials. For more information, see ",(0,t.jsx)(n.a,{href:"/configuration-global-variables",children:"Global variables"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["\u2022 ",(0,t.jsx)(n.strong,{children:"VertexBuild"}),": Tracks the build status of individual nodes within flows. For more information, see ",(0,t.jsx)(n.a,{href:"/concepts-playground",children:"Test flows in the Playground"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["For more information, see the database models in the ",(0,t.jsx)(n.a,{href:"https://github.com/langflow-ai/langflow/tree/main/src/backend/base/langflow/services/database/models",children:"source code"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"configure-external-memory",children:"Configure external memory"}),"\n",(0,t.jsxs)(n.p,{children:["To replace the default Langflow SQLite database with another database, modify the ",(0,t.jsx)(n.code,{children:"LANGFLOW_DATABASE_URL"})," environment variable, and then start Langflow with your ",(0,t.jsx)(n.code,{children:".env"})," file:"]}),"\n",(0,t.jsx)(d.Code,{codeConfig:h,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"LANGFLOW_DATABASE_URL=postgresql://user:password@localhost:5432/langflow",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,t.jsxs)(n.p,{children:["For an example, see ",(0,t.jsx)(n.a,{href:"/configuration-custom-database",children:"Configure an external PostgreSQL database"}),"."]}),"\n",(0,t.jsx)(n.h3,{id:"configure-the-external-database-connection",children:"Configure the external database connection"}),"\n",(0,t.jsx)(n.p,{children:"The following settings allow you to fine-tune your database connection pool and timeout settings:"}),"\n",(0,t.jsx)(d.Code,{codeConfig:h,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:'LANGFLOW_DB_CONNECTION_SETTINGS=\'{"pool_size": 20, "max_overflow": 30, "pool_timeout": 30, "pool_pre_ping": true, "pool_recycle": 1800, "echo": false}\'',props:{}}]},{tokens:[{content:"LANGFLOW_DB_CONNECT_TIMEOUT=20",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"pool_size"}),": Maximum number of database connections to keep in the pool (default: 20)"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"max_overflow"}),": Maximum number of connections that can be created beyond the pool_size (default: 30)"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"pool_timeout"}),": Number of seconds to wait before timing out on getting a connection from the pool (default: 30)"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"pool_pre_ping"}),": If true, the pool tests connections for liveness upon each checkout (default: true)"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"pool_recycle"}),": Number of seconds after which a connection is automatically recycled (default: 1800, or 30 minutes)"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"echo"}),": If true, SQL queries are logged for debugging purposes (default: false)"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"LANGFLOW_DB_CONNECT_TIMEOUT"}),": Maximum number of seconds to wait when establishing a new database connection (default: 20)"]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"configure-cache-memory",children:"Configure cache memory"}),"\n",(0,t.jsx)(n.p,{children:"The default Langflow caching behavior is an asynchronous, in-memory cache."}),"\n",(0,t.jsx)(d.Code,{codeConfig:h,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"LANGFLOW_LANGCHAIN_CACHE=InMemoryCache",props:{}}]},{tokens:[{content:"LANGFLOW_CACHE_TYPE=Async",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,t.jsx)(n.p,{children:"Alternative caching options can be configured, but options other than the default asynchronous, in-memory cache aren't supported.\nThe default behavior is suitable for most use cases."}),"\n",(0,t.jsxs)(n.p,{children:["For other options, see the ",(0,t.jsx)(n.code,{children:"LANGFLOW_CACHE_TYPE"})," ",(0,t.jsx)(n.a,{href:"/environment-variables",children:"environment variable"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"store-chat-memory",children:"Store chat memory"}),"\n",(0,t.jsxs)(n.p,{children:["Chat-based flows with a ",(0,t.jsx)(n.strong,{children:"Language Model"})," or ",(0,t.jsx)(n.strong,{children:"Agent"})," component have built-in chat memory that is enabled by default.\nThis memory allows them to retrieve and reference messages from previous conversations associated with the same session ID."]}),"\n",(0,t.jsxs)(n.p,{children:["Built-in chat memory stores memories in the Langflow ",(0,t.jsx)(n.code,{children:"messages"})," table."]}),"\n",(0,t.jsxs)(o,{children:[(0,t.jsx)("summary",{children:"How does chat memory work?"}),(0,t.jsx)(n.p,{children:"Chat memory is a cache for the LLM or agent to preserve past conversations to retain and reference that context in future interactions.\nFor example, if a user has already told the LLM their name, the LLM can retrieve that information from chat memory rather than asking the user to repeat themselves in future conversations or messages."}),(0,t.jsx)(n.p,{children:"Chat memory is distinct from vector store memory because it is built specifically for storing and retrieving chat messages from databases."}),(0,t.jsxs)(n.p,{children:["Components that support chat memory (such as the ",(0,t.jsx)(n.strong,{children:"Agent"}),", ",(0,t.jsx)(n.strong,{children:"Language Model"}),", ",(0,t.jsx)(n.strong,{children:"Message History"}),", or third-party ",(0,t.jsx)(n.strong,{children:"Chat Memory"})," components) provide access to their respective databases ",(0,t.jsx)(n.em,{children:"as memory"}),".\nRetrieval as memory is an important distinction for LLMs and agents because this storage and retrieval mechanism is specifically designed to recall context from past conversations.\nUnlike vector stores, which are designed for semantic search and retrieval of text chunks, chat memory is designed to store and retrieve chat messages in a way that is optimized for conversation history."]})]}),"\n",(0,t.jsx)(n.h3,{id:"session-id-and-chat-memory",children:"Session ID and chat memory"}),"\n",(0,t.jsxs)(n.p,{children:["Chat memories are grouped by ",(0,t.jsxs)(n.a,{href:"/session-id",children:["session ID (",(0,t.jsx)(n.code,{children:"session_id"}),")"]}),"."]}),"\n",(0,t.jsx)(n.p,{children:"The default session ID is the flow ID, which means that all chat messages for a flow are stored under the same session ID as one large chat session."}),"\n",(0,t.jsx)(n.p,{children:"For better segregation of chat memory, especially in flows used by multiple users, consider using custom session IDs.\nFor example, if you use user IDs as session IDs, then each user's chat history is stored separately, isolating the context of their chats from other users' chats."}),"\n",(0,t.jsx)(n.h3,{id:"chat-memory-options",children:"Chat memory options"}),"\n",(0,t.jsx)(n.p,{children:"Where and how chat memory is stored depends on the components used in your flow:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"Language Model and Agent components"}),": All messages are stored in ",(0,t.jsx)(n.a,{href:"#storage-options-and-paths",children:"Langflow storage"}),".\nThe ",(0,t.jsx)(n.strong,{children:"Agent"})," component provides some memory configuration options, such as ",(0,t.jsx)(n.strong,{children:"Number of Chat History Messages"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.strong,{children:"Language Model"})," and ",(0,t.jsx)(n.strong,{children:"Agent"})," component's built-in chat memory are sufficient for most use cases."]}),"\n",(0,t.jsxs)(n.p,{children:["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 ",(0,t.jsx)(n.strong,{children:"Message History"})," and ",(0,t.jsx)(n.strong,{children:"Chat Memory"})," components to your flow."]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"Message History component"}),": By default, this component stores and retrieves memories from Langflow storage, unless you attach a ",(0,t.jsx)(n.strong,{children:"Chat Memory"})," component. It provides a few more options for sorting and filtering memories, although most of these options are built-in to the ",(0,t.jsx)(n.strong,{children:"Agent"})," component as configurable or fixed parameters."]}),"\n",(0,t.jsxs)(n.p,{children:["You can use the ",(0,t.jsx)(n.strong,{children:"Message History"})," component with or without a ",(0,t.jsx)(n.strong,{children:"Language Model"})," or ",(0,t.jsx)(n.strong,{children:"Agent"})," component.\nFor example, if you need to retrieve data from memories outside of chat, you can use the ",(0,t.jsx)(n.strong,{children:"Message History"})," component to fetch that data directly from your chat memory database without feeding it into a chat."]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"Third-party Chat Memory components"}),": Use one of these components only if you need to specifically store or retrieve chat memories from a dedicated chat memory database.\nTypically, this is necessary only if you have specific storage needs that aren't met by Langflow storage.\nFor example, if you want to manage chat memory data by directly working with the database, or if you want to use a different database than the default Langflow storage."]}),"\n"]}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["For more information and examples, see ",(0,t.jsxs)(n.a,{href:"/components-helpers#message-history",children:[(0,t.jsx)(n.strong,{children:"Message History"})," component"]})," and ",(0,t.jsx)(n.a,{href:"/agents#agent-memory",children:"Agent memory"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"see-also",children:"See also"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"/concepts-file-management",children:"Langflow file management"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"/logging",children:"Langflow logs"})}),"\n"]})]})}function u(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(g,{...e})}):g(e)}function f(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}}}]); \ No newline at end of file diff --git a/assets/js/5015646b.3dbc4b4b.js b/assets/js/5015646b.3dbc4b4b.js deleted file mode 100644 index 62ff9c11ea..0000000000 --- a/assets/js/5015646b.3dbc4b4b.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[824],{11470:(e,n,t)=>{t.d(n,{A:()=>w});var s=t(96540),r=t(18215),o=t(23104),a=t(56347),i=t(205),c=t(57485),l=t(31682),d=t(70679);function h(e){return s.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,s.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function p(e){const{values:n,children:t}=e;return(0,s.useMemo)(()=>{const e=n??function(e){return h(e).map(({props:{value:e,label:n,attributes:t,default:s}})=>({value:e,label:n,attributes:t,default:s}))}(t);return function(e){const n=(0,l.XI)(e,(e,n)=>e.value===n.value);if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map(e=>e.value).join(", ")}" found in . Every value needs to be unique.`)}(e),e},[n,t])}function m({value:e,tabValues:n}){return n.some(n=>n.value===e)}function u({queryString:e=!1,groupId:n}){const t=(0,a.W6)(),r=function({queryString:e=!1,groupId:n}){if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:e,groupId:n});return[(0,c.aZ)(r),(0,s.useCallback)(e=>{if(!r)return;const n=new URLSearchParams(t.location.search);n.set(r,e),t.replace({...t.location,search:n.toString()})},[r,t])]}function x(e){const{defaultValue:n,queryString:t=!1,groupId:r}=e,o=p(e),[a,c]=(0,s.useState)(()=>function({defaultValue:e,tabValues:n}){if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(e){if(!m({value:e,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${n.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}const t=n.find(e=>e.default)??n[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:n,tabValues:o})),[l,h]=u({queryString:t,groupId:r}),[x,j]=function({groupId:e}){const n=function(e){return e?`docusaurus.tab.${e}`:null}(e),[t,r]=(0,d.Dv)(n);return[t,(0,s.useCallback)(e=>{n&&r.set(e)},[n,r])]}({groupId:r}),g=(()=>{const e=l??x;return m({value:e,tabValues:o})?e:null})();(0,i.A)(()=>{g&&c(g)},[g]);return{selectedValue:a,selectValue:(0,s.useCallback)(e=>{if(!m({value:e,tabValues:o}))throw new Error(`Can't select invalid tab value=${e}`);c(e),h(e),j(e)},[h,j,o]),tabValues:o}}var j=t(92303);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=t(74848);function y({className:e,block:n,selectedValue:t,selectValue:s,tabValues:a}){const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,o.a_)(),l=e=>{const n=e.currentTarget,r=i.indexOf(n),o=a[r].value;o!==t&&(c(n),s(o))},d=e=>{let n=null;switch(e.key){case"Enter":l(e);break;case"ArrowRight":{const t=i.indexOf(e.currentTarget)+1;n=i[t]??i[0];break}case"ArrowLeft":{const t=i.indexOf(e.currentTarget)-1;n=i[t]??i[i.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.A)("tabs",{"tabs--block":n},e),children:a.map(({value:e,label:n,attributes:s})=>(0,f.jsx)("li",{role:"tab",tabIndex:t===e?0:-1,"aria-selected":t===e,ref:e=>{i.push(e)},onKeyDown:d,onClick:l,...s,className:(0,r.A)("tabs__item",g.tabItem,s?.className,{"tabs__item--active":t===e}),children:n??e},e))})}function b({lazy:e,children:n,selectedValue:t}){const o=(Array.isArray(n)?n:[n]).filter(Boolean);if(e){const e=o.find(e=>e.props.value===t);return e?(0,s.cloneElement)(e,{className:(0,r.A)("margin-top--md",e.props.className)}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:o.map((e,n)=>(0,s.cloneElement)(e,{key:n,hidden:e.props.value!==t}))})}function v(e){const n=x(e);return(0,f.jsxs)("div",{className:(0,r.A)("tabs-container",g.tabList),children:[(0,f.jsx)(y,{...n,...e}),(0,f.jsx)(b,{...n,...e})]})}function w(e){const n=(0,j.A)();return(0,f.jsx)(v,{...e,children:h(e.children)},String(n))}},17886:(e,n,t)=>{t.d(n,{A:()=>o});t(96540);var s=t(64058),r=t(74848);function o({name:e,...n}){const t=s[e];return t?(0,r.jsx)(t,{...n}):null}},19365:(e,n,t)=>{t.d(n,{A:()=>a});t(96540);var s=t(18215);const r={tabItem:"tabItem_Ymn6"};var o=t(74848);function a({children:e,hidden:n,className:t}){return(0,o.jsx)("div",{role:"tabpanel",className:(0,s.A)(r.tabItem,t),hidden:n,children:e})}},28838:(e,n,t)=>{t.r(n),t.d(n,{CH:()=>m,assets:()=>p,chCodeConfig:()=>u,contentTitle:()=>h,default:()=>g,frontMatter:()=>d,metadata:()=>s,toc:()=>x});const s=JSON.parse('{"id":"Components/components-helpers","title":"Helpers","description":"Helper components provide utility functions to help manage data and perform simple tasks in your flow.","source":"@site/docs/Components/components-helpers.mdx","sourceDirName":"Components","slug":"/components-helpers","permalink":"/components-helpers","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Helpers","slug":"/components-helpers"},"sidebar":"docs","previous":{"title":"Logic","permalink":"/components-logic"},"next":{"title":"Tools","permalink":"/components-tools"}}');var r=t(74848),o=t(28453),a=t(24754),i=t(17886),c=t(11470),l=t(19365);const d={title:"Helpers",slug:"/components-helpers"},h=void 0,p={},m={annotations:a.hk,Code:a.Cy},u={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},x=[{value:"Calculator",id:"calculator",level:2},{value:"Calculator parameters",id:"calculator-parameters",level:3},{value:"Current Date",id:"current-date",level:2},{value:"Current Date parameters",id:"current-date-parameters",level:3},{value:"Message History",id:"message-history",level:2},{value:"Use the Message History component in a flow",id:"use-the-message-history-component-in-a-flow",level:3},{value:"Message History parameters",id:"message-history-parameters",level:3},{value:"Legacy Helper components",id:"legacy-helper-components",level:2}];function j(e){const n={a:"a",admonition:"admonition",code:"code",em:"em",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,o.R)(),...e.components},{Details:s}=n;return m||f("CH",!1),m.Code||f("CH.Code",!0),s||f("Details",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n","\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Helper"})," components provide utility functions to help manage data and perform simple tasks in your flow."]}),"\n",(0,r.jsx)(n.h2,{id:"calculator",children:"Calculator"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"Calculator"})," component performs basic arithmetic operations on mathematical expressions.\nIt supports addition, subtraction, multiplication, division, and exponentiation operations."]}),"\n",(0,r.jsxs)(n.p,{children:["For an example of using this component in a flow, see the ",(0,r.jsxs)(n.a,{href:"/components-processing#python-interpreter",children:[(0,r.jsx)(n.strong,{children:"Python Interpreter"})," component"]}),"."]}),"\n",(0,r.jsx)(n.h3,{id:"calculator-parameters",children:"Calculator parameters"}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"expression"}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsxs)(n.td,{children:["Input parameter. The arithmetic expression to evaluate, such as ",(0,r.jsx)(n.code,{children:"4*4*(33/22)+12-20"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"result"}),(0,r.jsx)(n.td,{children:"Data"}),(0,r.jsxs)(n.td,{children:["Output parameter. The calculation result as a ",(0,r.jsxs)(n.a,{href:"/data-types",children:[(0,r.jsx)(n.code,{children:"Data"})," object"]})," containing the evaluated expression."]})]})]})]}),"\n",(0,r.jsx)(n.h2,{id:"current-date",children:"Current Date"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"Current Date"})," component returns the current date and time in a selected timezone. This component provides a flexible way to obtain timezone-specific date and time information within a Langflow pipeline."]}),"\n",(0,r.jsx)(n.h3,{id:"current-date-parameters",children:"Current Date parameters"}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"timezone"}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsx)(n.td,{children:"Input parameter. The timezone for the current date and time."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"current_date"}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsx)(n.td,{children:"Output parameter. The resulting current date and time in the selected timezone."})]})]})]}),"\n",(0,r.jsx)(n.h2,{id:"message-history",children:"Message History"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"Message History"})," component provides combined chat history and message storage functionality.\nIt can store and retrieve chat messages from either ",(0,r.jsx)(n.a,{href:"/memory",children:"Langflow storage"})," ",(0,r.jsx)(n.em,{children:"or"})," a dedicated chat memory database like Mem0 or Redis."]}),"\n",(0,r.jsxs)(n.p,{children:["It replaces the legacy ",(0,r.jsx)(n.strong,{children:"Chat History"})," and ",(0,r.jsx)(n.strong,{children:"Message Store"})," components."]}),"\n",(0,r.jsxs)(n.admonition,{type:"important",children:[(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"Language Model"})," and ",(0,r.jsx)(n.strong,{children:"Agent"})," components have built-in chat memory that is enabled by default and uses Langflow storage."]}),(0,r.jsx)(n.p,{children:"This built-in chat memory functionality is sufficient for most use cases."}),(0,r.jsxs)(n.p,{children:["Use the ",(0,r.jsx)(n.strong,{children:"Message History"})," component 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."]}),(0,r.jsxs)(n.p,{children:["For more information, see ",(0,r.jsx)(n.a,{href:"/memory#store-chat-memory",children:"Store chat memory"}),"."]})]}),"\n",(0,r.jsx)(n.h3,{id:"use-the-message-history-component-in-a-flow",children:"Use the Message History component in a flow"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"Message History"})," component has two modes, depending on where you want to use it in your flow:"]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Retrieve mode"}),": The component retrieves chat messages from your Langflow database or external memory."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Store mode"}),": The component stores chat messages in your Langflow database or external memory."]}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["This means that you need multiple ",(0,r.jsx)(n.strong,{children:"Message History"})," components in your flow if you want to both store and retrieve chat messages."]}),"\n",(0,r.jsxs)(c.A,{children:[(0,r.jsxs)(l.A,{value:"langflow",label:"Use Langflow storage",default:!0,children:[(0,r.jsxs)(n.p,{children:["The following steps explain how to create a chat-based flow that uses ",(0,r.jsx)(n.strong,{children:"Message History"})," components to store and retrieve chat memory from your Langflow installation's database:"]}),(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Create or edit a flow where you want to use chat memory."}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["At the beginning of the flow, add a ",(0,r.jsx)(n.strong,{children:"Message History"})," component, and then set it to ",(0,r.jsx)(n.strong,{children:"Retrieve"})," mode."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Optional: In the ",(0,r.jsx)(n.strong,{children:"Message History"})," ",(0,r.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),", click ",(0,r.jsx)(i.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Controls"})," to enable parameters for memory sorting, filtering, and limits."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Add a ",(0,r.jsxs)(n.a,{href:"/components-prompts",children:[(0,r.jsx)(n.strong,{children:"Prompt Template"})," component"]}),", add a ",(0,r.jsx)(n.code,{children:"{memory}"})," variable to the ",(0,r.jsx)(n.strong,{children:"Template"})," field, and then connect the ",(0,r.jsx)(n.strong,{children:"Message History"})," output to the ",(0,r.jsx)(n.strong,{children:"memory"})," input."]}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"Prompt Template"})," component supplies instructions and context to LLMs, separate from chat messages passed through a ",(0,r.jsx)(n.strong,{children:"Chat Input"})," component.\nThe template can include any text and variables that you want to supply to the LLM, for example:"]}),"\n",(0,r.jsx)(m.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"You are a helpful assistant that answers questions.",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"Use markdown to format your answer, properly embedding images and urls.",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"History:",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"{memory}",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,r.jsxs)(n.p,{children:["Variables (",(0,r.jsx)(n.code,{children:"{variable}"}),") in the template dynamically add fields to the ",(0,r.jsx)(n.strong,{children:"Prompt Template"})," component so that your flow can receive definitions for those values from elsewhere, such as other components, Langflow global variables, or runtime input."]}),"\n",(0,r.jsxs)(n.p,{children:["In this example, the ",(0,r.jsx)(n.code,{children:"{memory}"})," variable is populated by the retrieved chat memories, which are then passed to a ",(0,r.jsx)(n.strong,{children:"Language Model"})," or ",(0,r.jsx)(n.strong,{children:"Agent"})," component to provide additional context to the LLM."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Connect the ",(0,r.jsx)(n.strong,{children:"Prompt Template"})," component's output to a ",(0,r.jsx)(n.strong,{children:"Language Model"})," component's ",(0,r.jsx)(n.strong,{children:"System Message"})," input."]}),"\n",(0,r.jsxs)(n.p,{children:["This example uses a ",(0,r.jsx)(n.strong,{children:"Language Model"})," component as the central chat driver, but you can also use an ",(0,r.jsx)(n.strong,{children:"Agent"})," component."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Add a ",(0,r.jsx)(n.strong,{children:"Chat Input"})," component, and then connect it to the ",(0,r.jsx)(n.strong,{children:"Language Model"})," component's ",(0,r.jsx)(n.strong,{children:"Input"})," input."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Connect the ",(0,r.jsx)(n.strong,{children:"Language Model"})," component's output to a ",(0,r.jsx)(n.strong,{children:"Chat Output"})," component."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["At the end of the flow, add another ",(0,r.jsx)(n.strong,{children:"Message History"})," component, and then set it to ",(0,r.jsx)(n.strong,{children:"Store"})," mode."]}),"\n",(0,r.jsxs)(n.p,{children:["Configure any additional parameters in the second ",(0,r.jsx)(n.strong,{children:"Message History"})," component as needed, taking into consideration that this particular component will store chat messages rather than retrieve them."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Connect the ",(0,r.jsx)(n.strong,{children:"Chat Output"})," component's output to the ",(0,r.jsx)(n.strong,{children:"Message History"})," component's ",(0,r.jsx)(n.strong,{children:"Message"})," input."]}),"\n",(0,r.jsxs)(n.p,{children:["Each response from the LLM is output from the ",(0,r.jsx)(n.strong,{children:"Language Model"})," component to the ",(0,r.jsx)(n.strong,{children:"Chat Output"})," component, and then stored in chat memory by the final ",(0,r.jsx)(n.strong,{children:"Message History"})," component."]}),"\n"]}),"\n"]})]}),(0,r.jsxs)(l.A,{value:"external",label:"Use external chat memory",children:[(0,r.jsxs)(n.p,{children:["To store and retrieve chat memory from a dedicated, external chat memory database, use the ",(0,r.jsx)(n.strong,{children:"Message History"})," component ",(0,r.jsx)(n.em,{children:"and"})," a provider-specific chat memory component."]}),(0,r.jsxs)(n.p,{children:["Available provider-specific chat memory components include ",(0,r.jsxs)(n.a,{href:"/bundles-datastax#cassandra-chat-memory",children:[(0,r.jsx)(n.strong,{children:"Cassandra Chat Memory"})," component"]}),", ",(0,r.jsxs)(n.a,{href:"/bundles-mem0",children:[(0,r.jsx)(n.strong,{children:"Mem0 Chat Memory"})," component"]}),", and ",(0,r.jsxs)(n.a,{href:"/bundles-redis",children:[(0,r.jsx)(n.strong,{children:"Redis Chat Memory"})," component"]}),".\nFor all provider-specific chat memory components, see ",(0,r.jsx)(n.a,{href:"/components-bundle-components",children:"Bundles"}),"."]}),(0,r.jsx)(n.p,{children:"The following steps explain how to create a flow that stores and retrieves chat memory from Redis chat memory:"}),(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Create or edit a flow where you want to use chat memory."}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["At the beginning of the flow, add ",(0,r.jsx)(n.strong,{children:"Message History"})," and ",(0,r.jsx)(n.strong,{children:"Redis Chat Memory"})," components:"]}),"\n",(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Configure the ",(0,r.jsx)(n.strong,{children:"Redis Chat Memory"})," component to connect to your Redis database. For more information, see the ",(0,r.jsx)(n.a,{href:"https://redis.io/docs/latest/",children:"Redis documentation"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Set the ",(0,r.jsx)(n.strong,{children:"Message History"})," component to ",(0,r.jsx)(n.strong,{children:"Retrieve"})," mode."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["In the ",(0,r.jsx)(n.strong,{children:"Message History"})," ",(0,r.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),", click ",(0,r.jsx)(i.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Controls"}),", enable ",(0,r.jsx)(n.strong,{children:"External Memory"}),", and then click ",(0,r.jsx)(n.strong,{children:"Close"}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["In ",(0,r.jsx)(n.strong,{children:"Controls"}),", you can also enable parameters for memory sorting, filtering, and limits."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Connect the ",(0,r.jsx)(n.strong,{children:"Redis Chat Memory"})," component's output to the ",(0,r.jsx)(n.strong,{children:"Message History"})," component's ",(0,r.jsx)(n.strong,{children:"External Memory"})," input."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Add a ",(0,r.jsxs)(n.a,{href:"/components-prompts",children:[(0,r.jsx)(n.strong,{children:"Prompt Template"})," component"]}),", add a ",(0,r.jsx)(n.code,{children:"{memory}"})," variable to the ",(0,r.jsx)(n.strong,{children:"Template"})," field, and then connect the ",(0,r.jsx)(n.strong,{children:"Message History"})," output to the ",(0,r.jsx)(n.strong,{children:"memory"})," input."]}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"Prompt Template"})," component supplies instructions and context to LLMs, separate from chat messages passed through a ",(0,r.jsx)(n.strong,{children:"Chat Input"})," component.\nThe template can include any text and variables that you want to supply to the LLM, for example:"]}),"\n",(0,r.jsx)(m.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"You are a helpful assistant that answers questions.",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"Use markdown to format your answer, properly embedding images and urls.",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"History:",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"{memory}",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,r.jsxs)(n.p,{children:["Variables (",(0,r.jsx)(n.code,{children:"{variable}"}),") in the template dynamically add fields to the ",(0,r.jsx)(n.strong,{children:"Prompt Template"})," component so that your flow can receive definitions for those values from elsewhere, such as other components, Langflow global variables, or runtime input."]}),"\n",(0,r.jsxs)(n.p,{children:["In this example, the ",(0,r.jsx)(n.code,{children:"{memory}"})," variable is populated by the retrieved chat memories, which are then passed to a ",(0,r.jsx)(n.strong,{children:"Language Model"})," or ",(0,r.jsx)(n.strong,{children:"Agent"})," component to provide additional context to the LLM."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Connect the ",(0,r.jsx)(n.strong,{children:"Prompt Template"})," component's output to a ",(0,r.jsx)(n.strong,{children:"Language Model"})," component's ",(0,r.jsx)(n.strong,{children:"System Message"})," input."]}),"\n",(0,r.jsxs)(n.p,{children:["This example uses a ",(0,r.jsx)(n.strong,{children:"Language Model"})," component as the central chat driver, but you can also use an ",(0,r.jsx)(n.strong,{children:"Agent"})," component."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Add a ",(0,r.jsx)(n.strong,{children:"Chat Input"})," component, and then connect it to the ",(0,r.jsx)(n.strong,{children:"Language Model"})," component's ",(0,r.jsx)(n.strong,{children:"Input"})," input."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Connect the ",(0,r.jsx)(n.strong,{children:"Language Model"})," component's output to a ",(0,r.jsx)(n.strong,{children:"Chat Output"})," component."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["At the end of the flow, add another pair of ",(0,r.jsx)(n.strong,{children:"Message History"})," and ",(0,r.jsx)(n.strong,{children:"Redis Chat Memory"})," components:"]}),"\n",(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Configure the ",(0,r.jsx)(n.strong,{children:"Redis Chat Memory"})," component to connect to your Redis database."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Set the ",(0,r.jsx)(n.strong,{children:"Message History"})," component to ",(0,r.jsx)(n.strong,{children:"Store"})," mode."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["In the ",(0,r.jsx)(n.strong,{children:"Message History"})," ",(0,r.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),", click ",(0,r.jsx)(i.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Controls"}),", enable ",(0,r.jsx)(n.strong,{children:"External Memory"}),", and then click ",(0,r.jsx)(n.strong,{children:"Close"}),"."]}),"\n",(0,r.jsx)(n.p,{children:"Configure any additional parameters in this component as needed, taking into consideration that this particular component will store chat messages rather than retrieve them."}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Connect the ",(0,r.jsx)(n.strong,{children:"Redis Chat Memory"})," component to the ",(0,r.jsx)(n.strong,{children:"Message History"})," component's ",(0,r.jsx)(n.strong,{children:"External Memory"})," input."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Connect the ",(0,r.jsx)(n.strong,{children:"Chat Output"})," component's output to the ",(0,r.jsx)(n.strong,{children:"Message History"})," component's ",(0,r.jsx)(n.strong,{children:"Message"})," input."]}),"\n",(0,r.jsxs)(n.p,{children:["Each response from the LLM is output from the ",(0,r.jsx)(n.strong,{children:"Language Model"})," component to the ",(0,r.jsx)(n.strong,{children:"Chat Output"})," component, and then stored in chat memory by passing it to the final ",(0,r.jsx)(n.strong,{children:"Message History"})," and ",(0,r.jsx)(n.strong,{children:"Redis Chat Memory"})," components."]}),"\n"]}),"\n"]}),(0,r.jsx)(n.p,{children:(0,r.jsx)(n.img,{alt:"A flow with Message History and Redis Chat Memory components",src:t(96841).A+"",width:"4000",height:"1768"})})]})]}),"\n",(0,r.jsx)(n.h3,{id:"message-history-parameters",children:"Message History parameters"}),"\n",(0,r.jsxs)(n.p,{children:["Many ",(0,r.jsx)(n.strong,{children:"Message History"})," component input parameters are hidden by default in the visual editor.\nYou can toggle parameters through the ",(0,r.jsx)(i.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Controls"})," in the ",(0,r.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"memory"}),(0,r.jsx)(n.td,{children:"Memory"}),(0,r.jsx)(n.td,{children:"Input parameter. Retrieve messages from an external memory. If empty, the Langflow tables are used."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"sender"}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsx)(n.td,{children:"Input parameter. Filter by sender type."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"sender_name"}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsx)(n.td,{children:"Input parameter. Filter by sender name."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"n_messages"}),(0,r.jsx)(n.td,{children:"Integer"}),(0,r.jsx)(n.td,{children:"Input parameter. The number of messages to retrieve."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"session_id"}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsxs)(n.td,{children:["Input parameter. The ",(0,r.jsx)(n.a,{href:"/session-id",children:"session ID"})," of the chat memories to store or retrieve. If omitted or empty, the current session ID for the flow run is used. Use custom session IDs if you need to segregate chat memory for different users or applications that run the same flow."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"order"}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsx)(n.td,{children:"Input parameter. The order of the messages."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"template"}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsxs)(n.td,{children:["Input parameter. The template to use for formatting the data. It can contain the keys ",(0,r.jsx)(n.code,{children:"{text}"}),", ",(0,r.jsx)(n.code,{children:"{sender}"})," or any other key in the message data."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"messages"}),(0,r.jsx)(n.td,{children:"Message"}),(0,r.jsxs)(n.td,{children:["Output parameter. The retrieved memories as ",(0,r.jsx)(n.code,{children:"Message"})," objects, including ",(0,r.jsx)(n.code,{children:"messages_text"})," containing retrieved chat message text. This is the typical output format used to pass memories ",(0,r.jsx)(n.em,{children:"as chat messages"})," to another component."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"dataframe"}),(0,r.jsx)(n.td,{children:"DataFrame"}),(0,r.jsxs)(n.td,{children:["Output parameter. A ",(0,r.jsx)(n.code,{children:"DataFrame"})," containing the message data. Useful for cases where you need to retrieve memories in a tabular format rather than as chat messages."]})]})]})]}),"\n",(0,r.jsx)(n.h2,{id:"legacy-helper-components",children:"Legacy Helper components"}),"\n",(0,r.jsx)(n.p,{children:"The following components are legacy components.\nYou can use these components in your flows, but they are no longer maintained and may be removed in a future release.\nIt is recommended that you replace legacy components with the recommended alternatives as soon as possible."}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Chat History"}),": Replaced by the ",(0,r.jsxs)(n.a,{href:"#message-history",children:[(0,r.jsx)(n.strong,{children:"Message History"})," component"]})]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Message Store"}),": Replaced by the ",(0,r.jsxs)(n.a,{href:"#message-history",children:[(0,r.jsx)(n.strong,{children:"Message History"})," component"]})]}),"\n"]}),"\n",(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"Create List"}),(0,r.jsx)(n.p,{children:"This component dynamically creates a record with a specified number of fields."}),(0,r.jsx)(n.p,{children:"It accepts the following parameters:"}),(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"n_fields"}),(0,r.jsx)(n.td,{children:"Integer"}),(0,r.jsx)(n.td,{children:"Input parameter. The number of fields to be added to the record."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"text_key"}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsx)(n.td,{children:"Input parameter. The key used as text."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"list"}),(0,r.jsx)(n.td,{children:"List"}),(0,r.jsx)(n.td,{children:"Output parameter. The dynamically created list with the specified number of fields."})]})]})]})]}),"\n",(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"ID Generator"}),(0,r.jsx)(n.p,{children:"This component generates a unique ID."}),(0,r.jsx)(n.p,{children:"It accepts the following parameters:"}),(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"unique_id"}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsx)(n.td,{children:"Input parameter. The generated unique ID."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"id"}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsx)(n.td,{children:"Output parameter. The generated unique ID."})]})]})]})]}),"\n",(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"Output Parser"}),(0,r.jsxs)(n.p,{children:["Replace the legacy ",(0,r.jsx)(n.strong,{children:"Output Parser"})," component with the ",(0,r.jsxs)(n.a,{href:"/components-processing#structured-output",children:[(0,r.jsx)(n.strong,{children:"Structured Output"})," component"]})," and ",(0,r.jsxs)(n.a,{href:"/components-processing#parser",children:[(0,r.jsx)(n.strong,{children:"Parser"})," component"]}),".\nThe components you need depend on the data types and complexity of the parsing task."]}),(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"Output Parser"})," component transforms the output of a language model into comma-separated values (CSV) format, such as ",(0,r.jsx)(n.code,{children:'["item1", "item2", "item3"]'}),", using LangChain's ",(0,r.jsx)(n.code,{children:"CommaSeparatedListOutputParser"}),".\nThe ",(0,r.jsx)(n.strong,{children:"Structured Output"})," component is a good alternative for this component because it also formats LLM responses with support for custom schemas and more complex parsing."]}),(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Parsing"})," components only provide formatting instructions and parsing functionality.\n",(0,r.jsx)(n.em,{children:"They don't include prompts."}),"\nYou must connect parsers to ",(0,r.jsx)(n.strong,{children:"Prompt Template"})," components to create prompts that LLMs can use."]}),(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Open a flow that has a ",(0,r.jsx)(n.strong,{children:"Chat Input"}),", ",(0,r.jsx)(n.strong,{children:"Language Model"}),", and ",(0,r.jsx)(n.strong,{children:"Chat Output"})," components."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Add ",(0,r.jsx)(n.strong,{children:"Output Parser"})," and ",(0,r.jsx)(n.strong,{children:"Prompt Template"})," components to your flow."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Define your LLM's prompt in the ",(0,r.jsx)(n.strong,{children:"Prompt Template"})," component's ",(0,r.jsx)(n.strong,{children:"Template"}),", including all instructions and pre-loaded context.\nMake sure to include a ",(0,r.jsx)(n.code,{children:"{format_instructions}"})," variable where you will inject the formatting instructions from the ",(0,r.jsx)(n.strong,{children:"Output Parser"})," component.\nFor example:"]}),"\n",(0,r.jsx)(m.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"You are a helpful assistant that provides lists of information.",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"{format_instructions}",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,r.jsxs)(n.p,{children:["Variables in the template dynamically add fields to the ",(0,r.jsx)(n.strong,{children:"Prompt Template"})," component so that your flow can receive definitions for those values from other components, Langflow global variables, or fixed input."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Connect the ",(0,r.jsx)(n.strong,{children:"Output Parser"})," component's output to the ",(0,r.jsx)(n.strong,{children:"Prompt Template"})," component's ",(0,r.jsx)(n.strong,{children:"format instructions"})," input."]}),"\n"]}),"\n"]}),(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"Output Parser"})," component accepts the following parameters:"]}),(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"parser_type"}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsx)(n.td,{children:'Input parameter. Sets the parser type as "CSV".'})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"format_instructions"}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsx)(n.td,{children:"Output parameter. Pass to a prompt template to include formatting instructions for LLM responses."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"output_parser"}),(0,r.jsx)(n.td,{children:"Parser"}),(0,r.jsx)(n.td,{children:"Output parameter. The constructed output parser that can be used to parse LLM responses."})]})]})]})]})]})}function g(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(j,{...e})}):j(e)}function f(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}},96841:(e,n,t)=>{t.d(n,{A:()=>s});const s=t.p+"assets/images/component-message-history-external-memory-7e32402d0b6e819f5539adfbfbd3620f.png"}}]); \ No newline at end of file diff --git a/assets/js/5015646b.61eb2fc0.js b/assets/js/5015646b.61eb2fc0.js new file mode 100644 index 0000000000..47eaf22cbe --- /dev/null +++ b/assets/js/5015646b.61eb2fc0.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[824],{11470:(e,n,t)=>{t.d(n,{A:()=>w});var s=t(96540),r=t(18215),o=t(23104),a=t(56347),i=t(205),c=t(57485),l=t(31682),d=t(70679);function h(e){return s.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,s.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function p(e){const{values:n,children:t}=e;return(0,s.useMemo)(()=>{const e=n??function(e){return h(e).map(({props:{value:e,label:n,attributes:t,default:s}})=>({value:e,label:n,attributes:t,default:s}))}(t);return function(e){const n=(0,l.XI)(e,(e,n)=>e.value===n.value);if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map(e=>e.value).join(", ")}" found in . Every value needs to be unique.`)}(e),e},[n,t])}function m({value:e,tabValues:n}){return n.some(n=>n.value===e)}function u({queryString:e=!1,groupId:n}){const t=(0,a.W6)(),r=function({queryString:e=!1,groupId:n}){if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:e,groupId:n});return[(0,c.aZ)(r),(0,s.useCallback)(e=>{if(!r)return;const n=new URLSearchParams(t.location.search);n.set(r,e),t.replace({...t.location,search:n.toString()})},[r,t])]}function x(e){const{defaultValue:n,queryString:t=!1,groupId:r}=e,o=p(e),[a,c]=(0,s.useState)(()=>function({defaultValue:e,tabValues:n}){if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(e){if(!m({value:e,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${n.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}const t=n.find(e=>e.default)??n[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:n,tabValues:o})),[l,h]=u({queryString:t,groupId:r}),[x,j]=function({groupId:e}){const n=function(e){return e?`docusaurus.tab.${e}`:null}(e),[t,r]=(0,d.Dv)(n);return[t,(0,s.useCallback)(e=>{n&&r.set(e)},[n,r])]}({groupId:r}),g=(()=>{const e=l??x;return m({value:e,tabValues:o})?e:null})();(0,i.A)(()=>{g&&c(g)},[g]);return{selectedValue:a,selectValue:(0,s.useCallback)(e=>{if(!m({value:e,tabValues:o}))throw new Error(`Can't select invalid tab value=${e}`);c(e),h(e),j(e)},[h,j,o]),tabValues:o}}var j=t(92303);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=t(74848);function y({className:e,block:n,selectedValue:t,selectValue:s,tabValues:a}){const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,o.a_)(),l=e=>{const n=e.currentTarget,r=i.indexOf(n),o=a[r].value;o!==t&&(c(n),s(o))},d=e=>{let n=null;switch(e.key){case"Enter":l(e);break;case"ArrowRight":{const t=i.indexOf(e.currentTarget)+1;n=i[t]??i[0];break}case"ArrowLeft":{const t=i.indexOf(e.currentTarget)-1;n=i[t]??i[i.length-1];break}}n?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.A)("tabs",{"tabs--block":n},e),children:a.map(({value:e,label:n,attributes:s})=>(0,f.jsx)("li",{role:"tab",tabIndex:t===e?0:-1,"aria-selected":t===e,ref:e=>{i.push(e)},onKeyDown:d,onClick:l,...s,className:(0,r.A)("tabs__item",g.tabItem,s?.className,{"tabs__item--active":t===e}),children:n??e},e))})}function b({lazy:e,children:n,selectedValue:t}){const o=(Array.isArray(n)?n:[n]).filter(Boolean);if(e){const e=o.find(e=>e.props.value===t);return e?(0,s.cloneElement)(e,{className:(0,r.A)("margin-top--md",e.props.className)}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:o.map((e,n)=>(0,s.cloneElement)(e,{key:n,hidden:e.props.value!==t}))})}function v(e){const n=x(e);return(0,f.jsxs)("div",{className:(0,r.A)("tabs-container",g.tabList),children:[(0,f.jsx)(y,{...n,...e}),(0,f.jsx)(b,{...n,...e})]})}function w(e){const n=(0,j.A)();return(0,f.jsx)(v,{...e,children:h(e.children)},String(n))}},17886:(e,n,t)=>{t.d(n,{A:()=>o});t(96540);var s=t(64058),r=t(74848);function o({name:e,...n}){const t=s[e];return t?(0,r.jsx)(t,{...n}):null}},19365:(e,n,t)=>{t.d(n,{A:()=>a});t(96540);var s=t(18215);const r={tabItem:"tabItem_Ymn6"};var o=t(74848);function a({children:e,hidden:n,className:t}){return(0,o.jsx)("div",{role:"tabpanel",className:(0,s.A)(r.tabItem,t),hidden:n,children:e})}},28838:(e,n,t)=>{t.r(n),t.d(n,{CH:()=>m,assets:()=>p,chCodeConfig:()=>u,contentTitle:()=>h,default:()=>g,frontMatter:()=>d,metadata:()=>s,toc:()=>x});const s=JSON.parse('{"id":"Components/components-helpers","title":"Helpers","description":"Helper components provide utility functions to help manage data and perform simple tasks in your flow.","source":"@site/docs/Components/components-helpers.mdx","sourceDirName":"Components","slug":"/components-helpers","permalink":"/components-helpers","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Helpers","slug":"/components-helpers"},"sidebar":"docs","previous":{"title":"Logic","permalink":"/components-logic"},"next":{"title":"Tools","permalink":"/components-tools"}}');var r=t(74848),o=t(28453),a=t(24754),i=t(17886),c=t(11470),l=t(19365);const d={title:"Helpers",slug:"/components-helpers"},h=void 0,p={},m={annotations:a.hk,Code:a.Cy},u={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},x=[{value:"Calculator",id:"calculator",level:2},{value:"Calculator parameters",id:"calculator-parameters",level:3},{value:"Current Date",id:"current-date",level:2},{value:"Current Date parameters",id:"current-date-parameters",level:3},{value:"Message History",id:"message-history",level:2},{value:"Use the Message History component in a flow",id:"use-the-message-history-component-in-a-flow",level:3},{value:"Message History parameters",id:"message-history-parameters",level:3},{value:"Legacy Helper components",id:"legacy-helper-components",level:2}];function j(e){const n={a:"a",admonition:"admonition",code:"code",em:"em",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,o.R)(),...e.components},{Details:s}=n;return m||f("CH",!1),m.Code||f("CH.Code",!0),s||f("Details",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n","\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Helper"})," components provide utility functions to help manage data and perform simple tasks in your flow."]}),"\n",(0,r.jsx)(n.h2,{id:"calculator",children:"Calculator"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"Calculator"})," component performs basic arithmetic operations on mathematical expressions.\nIt supports addition, subtraction, multiplication, division, and exponentiation operations."]}),"\n",(0,r.jsxs)(n.p,{children:["For an example of using this component in a flow, see the ",(0,r.jsxs)(n.a,{href:"/components-processing#python-interpreter",children:[(0,r.jsx)(n.strong,{children:"Python Interpreter"})," component"]}),"."]}),"\n",(0,r.jsx)(n.h3,{id:"calculator-parameters",children:"Calculator parameters"}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"expression"}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsxs)(n.td,{children:["Input parameter. The arithmetic expression to evaluate, such as ",(0,r.jsx)(n.code,{children:"4*4*(33/22)+12-20"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"result"}),(0,r.jsx)(n.td,{children:"Data"}),(0,r.jsxs)(n.td,{children:["Output parameter. The calculation result as a ",(0,r.jsxs)(n.a,{href:"/data-types",children:[(0,r.jsx)(n.code,{children:"Data"})," object"]})," containing the evaluated expression."]})]})]})]}),"\n",(0,r.jsx)(n.h2,{id:"current-date",children:"Current Date"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"Current Date"})," component returns the current date and time in a selected timezone. This component provides a flexible way to obtain timezone-specific date and time information within a Langflow pipeline."]}),"\n",(0,r.jsx)(n.h3,{id:"current-date-parameters",children:"Current Date parameters"}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"timezone"}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsx)(n.td,{children:"Input parameter. The timezone for the current date and time."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"current_date"}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsx)(n.td,{children:"Output parameter. The resulting current date and time in the selected timezone."})]})]})]}),"\n",(0,r.jsx)(n.h2,{id:"message-history",children:"Message History"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"Message History"})," component provides combined chat history and message storage functionality.\nIt can store and retrieve chat messages from either ",(0,r.jsx)(n.a,{href:"/memory",children:"Langflow storage"})," ",(0,r.jsx)(n.em,{children:"or"})," a dedicated chat memory database like Mem0 or Redis."]}),"\n",(0,r.jsxs)(n.admonition,{type:"important",children:[(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"Agent"})," component has built-in chat memory that is enabled by default and uses Langflow storage.\nThis built-in chat memory functionality is sufficient for most use cases."]}),(0,r.jsxs)(n.p,{children:["Use the ",(0,r.jsx)(n.strong,{children:"Message History"})," component for the following use cases:"]}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"You need to store and retrieve chat memory for a language model component (not an agent)."}),"\n",(0,r.jsx)(n.li,{children:"You need to retrieve chat memories outside the chat context, such as a sentiment analysis flow that retrieves and analyzes recently stored memories."}),"\n",(0,r.jsx)(n.li,{children:"You want to store memories in a specific database that is separate from Langflow storage."}),"\n"]}),(0,r.jsxs)(n.p,{children:["For more information, see ",(0,r.jsx)(n.a,{href:"/memory#store-chat-memory",children:"Store chat memory"}),"."]})]}),"\n",(0,r.jsx)(n.h3,{id:"use-the-message-history-component-in-a-flow",children:"Use the Message History component in a flow"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"Message History"})," component has two modes, depending on where you want to use it in your flow:"]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Retrieve mode"}),": The component retrieves chat messages from your Langflow database or external memory."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Store mode"}),": The component stores chat messages in your Langflow database or external memory."]}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["This means that you need multiple ",(0,r.jsx)(n.strong,{children:"Message History"})," components in your flow if you want to both store and retrieve chat messages."]}),"\n",(0,r.jsxs)(c.A,{children:[(0,r.jsxs)(l.A,{value:"langflow",label:"Use Langflow storage",default:!0,children:[(0,r.jsxs)(n.p,{children:["The following steps explain how to create a chat-based flow that uses ",(0,r.jsx)(n.strong,{children:"Message History"})," components to store and retrieve chat memory from your Langflow installation's database:"]}),(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Create or edit a flow where you want to use chat memory."}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["At the beginning of the flow, add a ",(0,r.jsx)(n.strong,{children:"Message History"})," component, and then set it to ",(0,r.jsx)(n.strong,{children:"Retrieve"})," mode."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Optional: In the ",(0,r.jsx)(n.strong,{children:"Message History"})," ",(0,r.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),", click ",(0,r.jsx)(i.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Controls"})," to enable parameters for memory sorting, filtering, and limits."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Add a ",(0,r.jsxs)(n.a,{href:"/components-prompts",children:[(0,r.jsx)(n.strong,{children:"Prompt Template"})," component"]}),", add a ",(0,r.jsx)(n.code,{children:"{memory}"})," variable to the ",(0,r.jsx)(n.strong,{children:"Template"})," field, and then connect the ",(0,r.jsx)(n.strong,{children:"Message History"})," output to the ",(0,r.jsx)(n.strong,{children:"memory"})," input."]}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"Prompt Template"})," component supplies instructions and context to LLMs, separate from chat messages passed through a ",(0,r.jsx)(n.strong,{children:"Chat Input"})," component.\nThe template can include any text and variables that you want to supply to the LLM, for example:"]}),"\n",(0,r.jsx)(m.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"You are a helpful assistant that answers questions.",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"Use markdown to format your answer, properly embedding images and urls.",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"History:",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"{memory}",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,r.jsxs)(n.p,{children:["Variables (",(0,r.jsx)(n.code,{children:"{variable}"}),") in the template dynamically add fields to the ",(0,r.jsx)(n.strong,{children:"Prompt Template"})," component so that your flow can receive definitions for those values from elsewhere, such as other components, Langflow global variables, or runtime input."]}),"\n",(0,r.jsxs)(n.p,{children:["In this example, the ",(0,r.jsx)(n.code,{children:"{memory}"})," variable is populated by the retrieved chat memories, which are then passed to a ",(0,r.jsx)(n.strong,{children:"Language Model"})," or ",(0,r.jsx)(n.strong,{children:"Agent"})," component to provide additional context to the LLM."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Connect the ",(0,r.jsx)(n.strong,{children:"Prompt Template"})," component's output to a ",(0,r.jsx)(n.strong,{children:"Language Model"})," component's ",(0,r.jsx)(n.strong,{children:"System Message"})," input."]}),"\n",(0,r.jsxs)(n.p,{children:["This example uses the ",(0,r.jsx)(n.strong,{children:"Language Model"})," core component as the central chat driver, but you can also use another language model component or the ",(0,r.jsx)(n.strong,{children:"Agent"})," component."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Add a ",(0,r.jsx)(n.strong,{children:"Chat Input"})," component, and then connect it to the ",(0,r.jsx)(n.strong,{children:"Language Model"})," component's ",(0,r.jsx)(n.strong,{children:"Input"})," field."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Connect the ",(0,r.jsx)(n.strong,{children:"Language Model"})," component's output to a ",(0,r.jsx)(n.strong,{children:"Chat Output"})," component."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["At the end of the flow, add another ",(0,r.jsx)(n.strong,{children:"Message History"})," component, and then set it to ",(0,r.jsx)(n.strong,{children:"Store"})," mode."]}),"\n",(0,r.jsxs)(n.p,{children:["Configure any additional parameters in the second ",(0,r.jsx)(n.strong,{children:"Message History"})," component as needed, taking into consideration that this particular component will store chat messages rather than retrieve them."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Connect the ",(0,r.jsx)(n.strong,{children:"Chat Output"})," component's output to the ",(0,r.jsx)(n.strong,{children:"Message History"})," component's ",(0,r.jsx)(n.strong,{children:"Message"})," input."]}),"\n",(0,r.jsxs)(n.p,{children:["Each response from the LLM is output from the ",(0,r.jsx)(n.strong,{children:"Language Model"})," component to the ",(0,r.jsx)(n.strong,{children:"Chat Output"})," component, and then stored in chat memory by the final ",(0,r.jsx)(n.strong,{children:"Message History"})," component."]}),"\n"]}),"\n"]})]}),(0,r.jsxs)(l.A,{value:"external",label:"Use external chat memory",children:[(0,r.jsxs)(n.p,{children:["To store and retrieve chat memory from a dedicated, external chat memory database, use the ",(0,r.jsx)(n.strong,{children:"Message History"})," component ",(0,r.jsx)(n.em,{children:"and"})," a provider-specific chat memory component."]}),(0,r.jsxs)(n.p,{children:["The following steps explain how to create a flow that stores and retrieves chat memory with a ",(0,r.jsxs)(n.a,{href:"/bundles-redis",children:[(0,r.jsx)(n.strong,{children:"Redis Chat Memory"})," component"]}),".\nOther options include the ",(0,r.jsxs)(n.a,{href:"/bundles-mem0",children:[(0,r.jsx)(n.strong,{children:"Mem0 Chat Memory"})," component"]})," and ",(0,r.jsxs)(n.a,{href:"/bundles-datastax#cassandra-chat-memory",children:[(0,r.jsx)(n.strong,{children:"Cassandra Chat Memory"})," component"]}),"."]}),(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Create or edit a flow where you want to use chat memory."}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["At the beginning of the flow, add ",(0,r.jsx)(n.strong,{children:"Message History"})," and ",(0,r.jsx)(n.strong,{children:"Redis Chat Memory"})," components:"]}),"\n",(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Configure the ",(0,r.jsx)(n.strong,{children:"Redis Chat Memory"})," component to connect to your Redis database. For more information, see the ",(0,r.jsx)(n.a,{href:"https://redis.io/docs/latest/",children:"Redis documentation"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Set the ",(0,r.jsx)(n.strong,{children:"Message History"})," component to ",(0,r.jsx)(n.strong,{children:"Retrieve"})," mode."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["In the ",(0,r.jsx)(n.strong,{children:"Message History"})," ",(0,r.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),", click ",(0,r.jsx)(i.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Controls"}),", enable ",(0,r.jsx)(n.strong,{children:"External Memory"}),", and then click ",(0,r.jsx)(n.strong,{children:"Close"}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["In ",(0,r.jsx)(n.strong,{children:"Controls"}),", you can also enable parameters for memory sorting, filtering, and limits."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Connect the ",(0,r.jsx)(n.strong,{children:"Redis Chat Memory"})," component's output to the ",(0,r.jsx)(n.strong,{children:"Message History"})," component's ",(0,r.jsx)(n.strong,{children:"External Memory"})," input."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Add a ",(0,r.jsxs)(n.a,{href:"/components-prompts",children:[(0,r.jsx)(n.strong,{children:"Prompt Template"})," component"]}),", add a ",(0,r.jsx)(n.code,{children:"{memory}"})," variable to the ",(0,r.jsx)(n.strong,{children:"Template"})," field, and then connect the ",(0,r.jsx)(n.strong,{children:"Message History"})," output to the ",(0,r.jsx)(n.strong,{children:"memory"})," input."]}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"Prompt Template"})," component supplies instructions and context to LLMs, separate from chat messages passed through a ",(0,r.jsx)(n.strong,{children:"Chat Input"})," component.\nThe template can include any text and variables that you want to supply to the LLM, for example:"]}),"\n",(0,r.jsx)(m.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"You are a helpful assistant that answers questions.",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"Use markdown to format your answer, properly embedding images and urls.",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"History:",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"{memory}",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,r.jsxs)(n.p,{children:["Variables (",(0,r.jsx)(n.code,{children:"{variable}"}),") in the template dynamically add fields to the ",(0,r.jsx)(n.strong,{children:"Prompt Template"})," component so that your flow can receive definitions for those values from elsewhere, such as other components, Langflow global variables, or runtime input."]}),"\n",(0,r.jsxs)(n.p,{children:["In this example, the ",(0,r.jsx)(n.code,{children:"{memory}"})," variable is populated by the retrieved chat memories, which are then passed to a ",(0,r.jsx)(n.strong,{children:"Language Model"})," or ",(0,r.jsx)(n.strong,{children:"Agent"})," component to provide additional context to the LLM."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Connect the ",(0,r.jsx)(n.strong,{children:"Prompt Template"})," component's output to a ",(0,r.jsx)(n.strong,{children:"Language Model"})," component's ",(0,r.jsx)(n.strong,{children:"System Message"})," input."]}),"\n",(0,r.jsxs)(n.p,{children:["This example uses a ",(0,r.jsx)(n.strong,{children:"Language Model"})," component as the central chat driver, but you can also use an ",(0,r.jsx)(n.strong,{children:"Agent"})," component."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Add a ",(0,r.jsx)(n.strong,{children:"Chat Input"})," component, and then connect it to the ",(0,r.jsx)(n.strong,{children:"Language Model"})," component's ",(0,r.jsx)(n.strong,{children:"Input"})," input."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Connect the ",(0,r.jsx)(n.strong,{children:"Language Model"})," component's output to a ",(0,r.jsx)(n.strong,{children:"Chat Output"})," component."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["At the end of the flow, add another pair of ",(0,r.jsx)(n.strong,{children:"Message History"})," and ",(0,r.jsx)(n.strong,{children:"Redis Chat Memory"})," components:"]}),"\n",(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Configure the ",(0,r.jsx)(n.strong,{children:"Redis Chat Memory"})," component to connect to your Redis database."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Set the ",(0,r.jsx)(n.strong,{children:"Message History"})," component to ",(0,r.jsx)(n.strong,{children:"Store"})," mode."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["In the ",(0,r.jsx)(n.strong,{children:"Message History"})," ",(0,r.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),", click ",(0,r.jsx)(i.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Controls"}),", enable ",(0,r.jsx)(n.strong,{children:"External Memory"}),", and then click ",(0,r.jsx)(n.strong,{children:"Close"}),"."]}),"\n",(0,r.jsx)(n.p,{children:"Configure any additional parameters in this component as needed, taking into consideration that this particular component will store chat messages rather than retrieve them."}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Connect the ",(0,r.jsx)(n.strong,{children:"Redis Chat Memory"})," component to the ",(0,r.jsx)(n.strong,{children:"Message History"})," component's ",(0,r.jsx)(n.strong,{children:"External Memory"})," input."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Connect the ",(0,r.jsx)(n.strong,{children:"Chat Output"})," component's output to the ",(0,r.jsx)(n.strong,{children:"Message History"})," component's ",(0,r.jsx)(n.strong,{children:"Message"})," input."]}),"\n",(0,r.jsxs)(n.p,{children:["Each response from the LLM is output from the ",(0,r.jsx)(n.strong,{children:"Language Model"})," component to the ",(0,r.jsx)(n.strong,{children:"Chat Output"})," component, and then stored in chat memory by passing it to the final ",(0,r.jsx)(n.strong,{children:"Message History"})," and ",(0,r.jsx)(n.strong,{children:"Redis Chat Memory"})," components."]}),"\n"]}),"\n"]}),(0,r.jsx)(n.p,{children:(0,r.jsx)(n.img,{alt:"A flow with Message History and Redis Chat Memory components",src:t(96841).A+"",width:"4000",height:"1768"})})]})]}),"\n",(0,r.jsx)(n.h3,{id:"message-history-parameters",children:"Message History parameters"}),"\n",(0,r.jsxs)(n.p,{children:["Many ",(0,r.jsx)(n.strong,{children:"Message History"})," component input parameters are hidden by default in the visual editor.\nYou can toggle parameters through the ",(0,r.jsx)(i.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Controls"})," in the ",(0,r.jsx)(n.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"memory"}),(0,r.jsx)(n.td,{children:"Memory"}),(0,r.jsx)(n.td,{children:"Input parameter. Retrieve messages from an external memory. If empty, the Langflow tables are used."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"sender"}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsx)(n.td,{children:"Input parameter. Filter by sender type."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"sender_name"}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsx)(n.td,{children:"Input parameter. Filter by sender name."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"n_messages"}),(0,r.jsx)(n.td,{children:"Integer"}),(0,r.jsx)(n.td,{children:"Input parameter. The number of messages to retrieve."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"session_id"}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsxs)(n.td,{children:["Input parameter. The ",(0,r.jsx)(n.a,{href:"/session-id",children:"session ID"})," of the chat memories to store or retrieve. If omitted or empty, the current session ID for the flow run is used. Use custom session IDs if you need to segregate chat memory for different users or applications that run the same flow."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"order"}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsx)(n.td,{children:"Input parameter. The order of the messages."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"template"}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsxs)(n.td,{children:["Input parameter. The template to use for formatting the data. It can contain the keys ",(0,r.jsx)(n.code,{children:"{text}"}),", ",(0,r.jsx)(n.code,{children:"{sender}"})," or any other key in the message data."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"messages"}),(0,r.jsx)(n.td,{children:"Message"}),(0,r.jsxs)(n.td,{children:["Output parameter. The retrieved memories as ",(0,r.jsx)(n.code,{children:"Message"})," objects, including ",(0,r.jsx)(n.code,{children:"messages_text"})," containing retrieved chat message text. This is the typical output format used to pass memories ",(0,r.jsx)(n.em,{children:"as chat messages"})," to another component."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"dataframe"}),(0,r.jsx)(n.td,{children:"DataFrame"}),(0,r.jsxs)(n.td,{children:["Output parameter. A ",(0,r.jsx)(n.code,{children:"DataFrame"})," containing the message data. Useful for cases where you need to retrieve memories in a tabular format rather than as chat messages."]})]})]})]}),"\n",(0,r.jsx)(n.h2,{id:"legacy-helper-components",children:"Legacy Helper components"}),"\n",(0,r.jsx)(n.p,{children:"The following components are legacy components.\nYou can use these components in your flows, but they are no longer maintained and may be removed in a future release.\nIt is recommended that you replace legacy components with the recommended alternatives as soon as possible."}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Chat History"}),": Replaced by the ",(0,r.jsxs)(n.a,{href:"#message-history",children:[(0,r.jsx)(n.strong,{children:"Message History"})," component"]})]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Message Store"}),": Replaced by the ",(0,r.jsxs)(n.a,{href:"#message-history",children:[(0,r.jsx)(n.strong,{children:"Message History"})," component"]})]}),"\n"]}),"\n",(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"Create List"}),(0,r.jsx)(n.p,{children:"This component dynamically creates a record with a specified number of fields."}),(0,r.jsx)(n.p,{children:"It accepts the following parameters:"}),(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"n_fields"}),(0,r.jsx)(n.td,{children:"Integer"}),(0,r.jsx)(n.td,{children:"Input parameter. The number of fields to be added to the record."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"text_key"}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsx)(n.td,{children:"Input parameter. The key used as text."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"list"}),(0,r.jsx)(n.td,{children:"List"}),(0,r.jsx)(n.td,{children:"Output parameter. The dynamically created list with the specified number of fields."})]})]})]})]}),"\n",(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"ID Generator"}),(0,r.jsx)(n.p,{children:"This component generates a unique ID."}),(0,r.jsx)(n.p,{children:"It accepts the following parameters:"}),(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"unique_id"}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsx)(n.td,{children:"Input parameter. The generated unique ID."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"id"}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsx)(n.td,{children:"Output parameter. The generated unique ID."})]})]})]})]}),"\n",(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"Output Parser"}),(0,r.jsxs)(n.p,{children:["Replace the legacy ",(0,r.jsx)(n.strong,{children:"Output Parser"})," component with the ",(0,r.jsxs)(n.a,{href:"/components-processing#structured-output",children:[(0,r.jsx)(n.strong,{children:"Structured Output"})," component"]})," and ",(0,r.jsxs)(n.a,{href:"/components-processing#parser",children:[(0,r.jsx)(n.strong,{children:"Parser"})," component"]}),".\nThe components you need depend on the data types and complexity of the parsing task."]}),(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"Output Parser"})," component transforms the output of a language model into comma-separated values (CSV) format, such as ",(0,r.jsx)(n.code,{children:'["item1", "item2", "item3"]'}),", using LangChain's ",(0,r.jsx)(n.code,{children:"CommaSeparatedListOutputParser"}),".\nThe ",(0,r.jsx)(n.strong,{children:"Structured Output"})," component is a good alternative for this component because it also formats LLM responses with support for custom schemas and more complex parsing."]}),(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Parsing"})," components only provide formatting instructions and parsing functionality.\n",(0,r.jsx)(n.em,{children:"They don't include prompts."}),"\nYou must connect parsers to ",(0,r.jsx)(n.strong,{children:"Prompt Template"})," components to create prompts that LLMs can use."]}),(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Open a flow that has a ",(0,r.jsx)(n.strong,{children:"Chat Input"}),", ",(0,r.jsx)(n.strong,{children:"Language Model"}),", and ",(0,r.jsx)(n.strong,{children:"Chat Output"})," components."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Add ",(0,r.jsx)(n.strong,{children:"Output Parser"})," and ",(0,r.jsx)(n.strong,{children:"Prompt Template"})," components to your flow."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Define your LLM's prompt in the ",(0,r.jsx)(n.strong,{children:"Prompt Template"})," component's ",(0,r.jsx)(n.strong,{children:"Template"}),", including all instructions and pre-loaded context.\nMake sure to include a ",(0,r.jsx)(n.code,{children:"{format_instructions}"})," variable where you will inject the formatting instructions from the ",(0,r.jsx)(n.strong,{children:"Output Parser"})," component.\nFor example:"]}),"\n",(0,r.jsx)(m.Code,{codeConfig:u,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"You are a helpful assistant that provides lists of information.",props:{}}]},{tokens:[{content:"",props:{}}]},{tokens:[{content:"{format_instructions}",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,r.jsxs)(n.p,{children:["Variables in the template dynamically add fields to the ",(0,r.jsx)(n.strong,{children:"Prompt Template"})," component so that your flow can receive definitions for those values from other components, Langflow global variables, or fixed input."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Connect the ",(0,r.jsx)(n.strong,{children:"Output Parser"})," component's output to the ",(0,r.jsx)(n.strong,{children:"Prompt Template"})," component's ",(0,r.jsx)(n.strong,{children:"format instructions"})," input."]}),"\n"]}),"\n"]}),(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"Output Parser"})," component accepts the following parameters:"]}),(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"parser_type"}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsx)(n.td,{children:'Input parameter. Sets the parser type as "CSV".'})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"format_instructions"}),(0,r.jsx)(n.td,{children:"String"}),(0,r.jsx)(n.td,{children:"Output parameter. Pass to a prompt template to include formatting instructions for LLM responses."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"output_parser"}),(0,r.jsx)(n.td,{children:"Parser"}),(0,r.jsx)(n.td,{children:"Output parameter. The constructed output parser that can be used to parse LLM responses."})]})]})]})]})]})}function g(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(j,{...e})}):j(e)}function f(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}},96841:(e,n,t)=>{t.d(n,{A:()=>s});const s=t.p+"assets/images/component-message-history-external-memory-7e32402d0b6e819f5539adfbfbd3620f.png"}}]); \ No newline at end of file diff --git a/assets/js/e6c6a4d2.daf51668.js b/assets/js/e6c6a4d2.83ee7202.js similarity index 55% rename from assets/js/e6c6a4d2.daf51668.js rename to assets/js/e6c6a4d2.83ee7202.js index b238674600..156e76795c 100644 --- a/assets/js/e6c6a4d2.daf51668.js +++ b/assets/js/e6c6a4d2.83ee7202.js @@ -1 +1 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[8504],{28453:(e,t,n)=>{n.d(t,{R:()=>a,x:()=>l});var s=n(96540);const i={},o=s.createContext(i);function a(e){const t=s.useContext(o);return s.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:a(e.components),s.createElement(o.Provider,{value:t},e.children)}},94910:(e,t,n)=>{n.r(t),n.d(t,{contentTitle:()=>l,default:()=>d,frontMatter:()=>a,metadata:()=>s,toc:()=>r});const s=JSON.parse('{"type":"api","id":"experimental-run-flow","title":"Experimental Run Flow","description":"","slug":"/experimental-run-flow","frontMatter":{},"api":{"tags":["Base"],"description":"Executes a specified flow by ID with optional input values, output selection, tweaks, and streaming capability.\\n\\nThis endpoint supports running flows with caching to enhance performance and efficiency.\\n\\n### Parameters:\\n- `flow_id` (str): The unique identifier of the flow to be executed.\\n- `inputs` (List[InputValueRequest], optional): A list of inputs specifying the input values and components\\n for the flow. Each input can target specific components and provide custom values.\\n- `outputs` (List[str], optional): A list of output names to retrieve from the executed flow.\\n If not provided, all outputs are returned.\\n- `tweaks` (Optional[Tweaks], optional): A dictionary of tweaks to customize the flow execution.\\n The tweaks can be used to modify the flow\'s parameters and components.\\n Tweaks can be overridden by the input values.\\n- `stream` (bool, optional): Specifies whether the results should be streamed. Defaults to False.\\n- `session_id` (Union[None, str], optional): An optional session ID to utilize existing session data for the flow\\n execution.\\n- `api_key_user` (User): The user associated with the current API key. Automatically resolved from the API key.\\n\\n### Returns:\\nA `RunResponse` object containing the selected outputs (or all if not specified) of the executed flow\\nand the session ID.\\nThe structure of the response accommodates multiple inputs, providing a nested list of outputs for each input.\\n\\n### Raises:\\nHTTPException: Indicates issues with finding the specified flow, invalid input formats, or internal errors during\\nflow execution.\\n\\n### Example usage:\\n```json\\nPOST /run/flow_id\\nx-api-key: YOUR_API_KEY\\nPayload:\\n{\\n \\"inputs\\": [\\n {\\"components\\": [\\"component1\\"], \\"input_value\\": \\"value1\\"},\\n {\\"components\\": [\\"component3\\"], \\"input_value\\": \\"value2\\"}\\n ],\\n \\"outputs\\": [\\"Component Name\\", \\"component_id\\"],\\n \\"tweaks\\": {\\"parameter_name\\": \\"value\\", \\"Component Name\\": {\\"parameter_name\\": \\"value\\"}, \\"component_id\\": {\\"parameter_name\\": \\"value\\"}}\\n \\"stream\\": false\\n}\\n```\\n\\nThis endpoint facilitates complex flow executions with customized inputs, outputs, and configurations,\\ncatering to diverse application requirements.","operationId":"experimental_run_flow_api_v1_run_advanced__flow_id__post","security":[{"API key query":[]},{"API key header":[]}],"parameters":[{"name":"flow_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Flow Id"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"inputs":{"anyOf":[{"items":{"properties":{"components":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Components","default":[]},"input_value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Input Value"},"session":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session"},"type":{"anyOf":[{"type":"string","enum":["chat","text","any"]},{"type":"null"}],"title":"Type","description":"Defines on which components the input value should be applied. \'any\' applies to all input components.","default":"any"}},"additionalProperties":false,"type":"object","title":"InputValueRequest","examples":[{"components":["components_id","Component Name"],"input_value":"input_value","session":"session_id"},{"components":["Component Name"],"input_value":"input_value"},{"input_value":"input_value"},{"components":["Component Name"],"input_value":"input_value","session":"session_id"},{"input_value":"input_value","session":"session_id"},{"input_value":"input_value","type":"chat"},{"input_value":"{\\"key\\": \\"value\\"}","type":"json"}]},"type":"array"},{"type":"null"}],"title":"Inputs"},"outputs":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Outputs"},"tweaks":{"anyOf":[{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"object"}]},"type":"object","title":"Tweaks","description":"A dictionary of tweaks to adjust the flow\'s execution. Allows customizing flow behavior dynamically. All tweaks are overridden by the input values.","examples":[{"Component Name":{"parameter_name":"value"},"component_id":{"parameter_name":"value"},"parameter_name":"value"}]},{"type":"null"}]},"stream":{"type":"boolean","title":"Stream","default":false},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}},"type":"object","title":"Body_experimental_run_flow_api_v1_run_advanced__flow_id__post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"properties":{"outputs":{"anyOf":[{"items":{"properties":{"inputs":{"type":"object","title":"Inputs"},"outputs":{"items":{"anyOf":[{"properties":{"results":{"anyOf":[{},{"type":"null"}],"title":"Results"},"artifacts":{"anyOf":[{},{"type":"null"}],"title":"Artifacts"},"outputs":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Outputs"},"logs":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Logs"},"messages":{"anyOf":[{"items":{"properties":{"message":{"anyOf":[{"type":"string"},{"items":{"anyOf":[{"type":"string"},{"type":"object"}]},"type":"array"}],"title":"Message"},"sender":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender","default":"Machine"},"sender_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender Name","default":"AI"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"},"stream_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stream Url"},"component_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Component Id"},"files":{"items":{"properties":{"path":{"type":"string","title":"Path"},"name":{"type":"string","title":"Name"},"type":{"type":"string","title":"Type"}},"type":"object","required":["path","name","type"],"title":"File","description":"File schema."},"type":"array","title":"Files","default":[]},"type":{"type":"string","title":"Type"}},"type":"object","required":["message","type"],"title":"ChatOutputResponse","description":"Chat output response schema."},"type":"array"},{"type":"null"}],"title":"Messages"},"timedelta":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Timedelta"},"duration":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Duration"},"component_display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Component Display Name"},"component_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Component Id"},"used_frozen_result":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Used Frozen Result","default":false}},"type":"object","title":"ResultData"},{"type":"null"}]},"type":"array","title":"Outputs"}},"type":"object","title":"RunOutputs"},"type":"array"},{"type":"null"}],"title":"Outputs","default":[]},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}},"type":"object","title":"RunResponse","description":"Run response schema."}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"properties":{"detail":{"items":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"}}}}},"method":"post","path":"/api/v1/run/advanced/{flow_id}","securitySchemes":{"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"api/v1/login"}}},"API key query":{"type":"apiKey","in":"query","name":"x-api-key"},"API key header":{"type":"apiKey","in":"header","name":"x-api-key"}},"jsonRequestBodyExample":{"stream":false},"info":{"title":"Langflow","version":"1.5.1"},"postman":{"name":"Experimental Run Flow","description":{"content":"Executes a specified flow by ID with optional input values, output selection, tweaks, and streaming capability.\\n\\nThis endpoint supports running flows with caching to enhance performance and efficiency.\\n\\n### Parameters:\\n- `flow_id` (str): The unique identifier of the flow to be executed.\\n- `inputs` (List[InputValueRequest], optional): A list of inputs specifying the input values and components\\n for the flow. Each input can target specific components and provide custom values.\\n- `outputs` (List[str], optional): A list of output names to retrieve from the executed flow.\\n If not provided, all outputs are returned.\\n- `tweaks` (Optional[Tweaks], optional): A dictionary of tweaks to customize the flow execution.\\n The tweaks can be used to modify the flow\'s parameters and components.\\n Tweaks can be overridden by the input values.\\n- `stream` (bool, optional): Specifies whether the results should be streamed. Defaults to False.\\n- `session_id` (Union[None, str], optional): An optional session ID to utilize existing session data for the flow\\n execution.\\n- `api_key_user` (User): The user associated with the current API key. Automatically resolved from the API key.\\n\\n### Returns:\\nA `RunResponse` object containing the selected outputs (or all if not specified) of the executed flow\\nand the session ID.\\nThe structure of the response accommodates multiple inputs, providing a nested list of outputs for each input.\\n\\n### Raises:\\nHTTPException: Indicates issues with finding the specified flow, invalid input formats, or internal errors during\\nflow execution.\\n\\n### Example usage:\\n```json\\nPOST /run/flow_id\\nx-api-key: YOUR_API_KEY\\nPayload:\\n{\\n \\"inputs\\": [\\n {\\"components\\": [\\"component1\\"], \\"input_value\\": \\"value1\\"},\\n {\\"components\\": [\\"component3\\"], \\"input_value\\": \\"value2\\"}\\n ],\\n \\"outputs\\": [\\"Component Name\\", \\"component_id\\"],\\n \\"tweaks\\": {\\"parameter_name\\": \\"value\\", \\"Component Name\\": {\\"parameter_name\\": \\"value\\"}, \\"component_id\\": {\\"parameter_name\\": \\"value\\"}}\\n \\"stream\\": false\\n}\\n```\\n\\nThis endpoint facilitates complex flow executions with customized inputs, outputs, and configurations,\\ncatering to diverse application requirements.","type":"text/plain"},"url":{"path":["api","v1","run","advanced",":flow_id"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) ","type":"text/plain"},"type":"any","value":"","key":"flow_id"}]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"{\\n \\"inputs\\": [\\n {\\n \\"components\\": [\\n \\"\\",\\n \\"\\"\\n ],\\n \\"input_value\\": \\"\\",\\n \\"session\\": \\"\\",\\n \\"type\\": \\"\\"\\n },\\n {\\n \\"components\\": [\\n \\"\\",\\n \\"\\"\\n ],\\n \\"input_value\\": \\"\\",\\n \\"session\\": \\"\\",\\n \\"type\\": \\"\\"\\n }\\n ],\\n \\"outputs\\": [\\n \\"\\",\\n \\"\\"\\n ],\\n \\"tweaks\\": {\\n \\"eu_b\\": \\"\\",\\n \\"ut8a\\": \\"\\",\\n \\"consequat_b\\": \\"\\",\\n \\"Duis_9a2\\": \\"\\"\\n },\\n \\"stream\\": false,\\n \\"session_id\\": \\"\\"\\n}","options":{"raw":{"language":"json"}}},"auth":{"type":"apikey","apikey":[{"type":"any","value":"x-api-key","key":"key"},{"type":"any","value":"{{apiKey}}","key":"value"},{"type":"any","value":"query","key":"in"}]}}},"source":"@site/openapi.json","sourceDirName":".","permalink":"/api/experimental-run-flow","previous":{"title":"Webhook Run Flow","permalink":"/api/webhook-run-flow"},"next":{"title":"Process","permalink":"/api/process"}}');var i=n(74848),o=n(28453);const a={},l="Experimental Run Flow",r=[{value:"Parameters:",id:"parameters",level:3},{value:"Returns:",id:"returns",level:3},{value:"Raises:",id:"raises",level:3},{value:"Example usage:",id:"example-usage",level:3}];function p(e){const t={code:"code",h1:"h1",h3:"h3",header:"header",li:"li",p:"p",pre:"pre",ul:"ul",...(0,o.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.header,{children:(0,i.jsx)(t.h1,{id:"experimental-run-flow",children:"Experimental Run Flow"})}),"\n",(0,i.jsx)(t.p,{children:"Executes a specified flow by ID with optional input values, output selection, tweaks, and streaming capability."}),"\n",(0,i.jsx)(t.p,{children:"This endpoint supports running flows with caching to enhance performance and efficiency."}),"\n",(0,i.jsx)(t.h3,{id:"parameters",children:"Parameters:"}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"flow_id"})," (str): The unique identifier of the flow to be executed."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"inputs"})," (List[InputValueRequest], optional): A list of inputs specifying the input values and components\nfor the flow. Each input can target specific components and provide custom values."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"outputs"})," (List[str], optional): A list of output names to retrieve from the executed flow.\nIf not provided, all outputs are returned."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"tweaks"})," (Optional[Tweaks], optional): A dictionary of tweaks to customize the flow execution.\nThe tweaks can be used to modify the flow's parameters and components.\nTweaks can be overridden by the input values."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"stream"})," (bool, optional): Specifies whether the results should be streamed. Defaults to False."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"session_id"})," (Union[None, str], optional): An optional session ID to utilize existing session data for the flow\nexecution."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"api_key_user"})," (User): The user associated with the current API key. Automatically resolved from the API key."]}),"\n"]}),"\n",(0,i.jsx)(t.h3,{id:"returns",children:"Returns:"}),"\n",(0,i.jsxs)(t.p,{children:["A ",(0,i.jsx)(t.code,{children:"RunResponse"})," object containing the selected outputs (or all if not specified) of the executed flow\nand the session ID.\nThe structure of the response accommodates multiple inputs, providing a nested list of outputs for each input."]}),"\n",(0,i.jsx)(t.h3,{id:"raises",children:"Raises:"}),"\n",(0,i.jsx)(t.p,{children:"HTTPException: Indicates issues with finding the specified flow, invalid input formats, or internal errors during\nflow execution."}),"\n",(0,i.jsx)(t.h3,{id:"example-usage",children:"Example usage:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-json",children:'POST /run/flow_id\nx-api-key: YOUR_API_KEY\nPayload:\n{\n "inputs": [\n {"components": ["component1"], "input_value": "value1"},\n {"components": ["component3"], "input_value": "value2"}\n ],\n "outputs": ["Component Name", "component_id"],\n "tweaks": {"parameter_name": "value", "Component Name": {"parameter_name": "value"}, "component_id": {"parameter_name": "value"}}\n "stream": false\n}\n'})}),"\n",(0,i.jsx)(t.p,{children:"This endpoint facilitates complex flow executions with customized inputs, outputs, and configurations,\ncatering to diverse application requirements."}),"\n",(0,i.jsxs)("table",{style:{display:"table",width:"100%"},children:[(0,i.jsx)("thead",{children:(0,i.jsx)("tr",{children:(0,i.jsx)("th",{style:{textAlign:"left"},children:"Path Parameters"})})}),(0,i.jsx)("tbody",{children:(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsx)("code",{children:"flow_id"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" uuid"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" \u2014 "}),(0,i.jsx)("strong",{style:{fontSize:"var(--ifm-code-font-size)",color:"var(--openapi-required)"},children:" REQUIRED"})]})})})]}),"\n",(0,i.jsxs)("table",{style:{display:"table",width:"100%"},children:[(0,i.jsx)("thead",{children:(0,i.jsx)("tr",{children:(0,i.jsxs)("th",{style:{textAlign:"left"},children:[(0,i.jsx)("span",{children:"Request Body "}),(0,i.jsx)("div",{})]})})}),(0,i.jsxs)("tbody",{children:[(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsx)("code",{children:"inputs"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" Inputs"})]})}),(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsx)("code",{children:"outputs"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" Outputs"})]})}),(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsx)("code",{children:"tweaks"}),(0,i.jsx)("span",{style:{opacity:"0.6"}})]})}),(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsx)("code",{children:"stream"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" Stream"})]})}),(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsx)("code",{children:"session_id"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" Session Id"})]})})]})]}),"\n",(0,i.jsxs)("table",{style:{display:"table",width:"100%"},children:[(0,i.jsx)("thead",{children:(0,i.jsx)("tr",{children:(0,i.jsx)("th",{style:{textAlign:"left"},children:"Responses"})})}),(0,i.jsxs)("tbody",{children:[(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsxs)("div",{style:{display:"flex"},children:[(0,i.jsx)("div",{style:{marginRight:"var(--ifm-table-cell-padding)"},children:(0,i.jsx)("code",{children:"200"})}),(0,i.jsx)("div",{children:(0,i.jsx)(t.p,{children:"Successful Response"})})]}),(0,i.jsx)("div",{children:(0,i.jsxs)("table",{style:{display:"table",width:"100%",marginTop:"var(--ifm-table-cell-padding)",marginBottom:"0px"},children:[(0,i.jsx)("thead",{children:(0,i.jsx)("tr",{children:(0,i.jsxs)("th",{style:{textAlign:"left"},children:[(0,i.jsx)("span",{children:"Schema "}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" \u2014 "}),(0,i.jsx)("strong",{style:{fontSize:"var(--ifm-code-font-size)",color:"var(--openapi-optional)"},children:" OPTIONAL"}),(0,i.jsx)("div",{})]})})}),(0,i.jsxs)("tbody",{children:[(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsx)("code",{children:"outputs"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" Outputs"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" \u2014 "}),(0,i.jsx)("strong",{style:{fontSize:"var(--ifm-code-font-size)",color:"var(--openapi-optional)"},children:" OPTIONAL"})]})}),(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsx)("code",{children:"session_id"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" Session Id"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" \u2014 "}),(0,i.jsx)("strong",{style:{fontSize:"var(--ifm-code-font-size)",color:"var(--openapi-optional)"},children:" OPTIONAL"})]})})]})]})})]})}),(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsxs)("div",{style:{display:"flex"},children:[(0,i.jsx)("div",{style:{marginRight:"var(--ifm-table-cell-padding)"},children:(0,i.jsx)("code",{children:"422"})}),(0,i.jsx)("div",{children:(0,i.jsx)(t.p,{children:"Validation Error"})})]}),(0,i.jsx)("div",{children:(0,i.jsxs)("table",{style:{display:"table",width:"100%",marginTop:"var(--ifm-table-cell-padding)",marginBottom:"0px"},children:[(0,i.jsx)("thead",{children:(0,i.jsx)("tr",{children:(0,i.jsxs)("th",{style:{textAlign:"left"},children:[(0,i.jsx)("span",{children:"Schema "}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" \u2014 "}),(0,i.jsx)("strong",{style:{fontSize:"var(--ifm-code-font-size)",color:"var(--openapi-optional)"},children:" OPTIONAL"}),(0,i.jsx)("div",{})]})})}),(0,i.jsx)("tbody",{children:(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsx)("code",{children:"detail"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" object[]"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" \u2014 "}),(0,i.jsx)("strong",{style:{fontSize:"var(--ifm-code-font-size)",color:"var(--openapi-optional)"},children:" OPTIONAL"}),(0,i.jsx)("table",{style:{display:"table",width:"100%",marginTop:"var(--ifm-table-cell-padding)",marginBottom:"0px"},children:(0,i.jsxs)("tbody",{children:[(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsx)("code",{children:"loc"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" undefined[]"})]})}),(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsx)("code",{children:"msg"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" Message"})]})}),(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsx)("code",{children:"type"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" Error Type"})]})})]})})]})})})]})})]})})]})]})]})}function d(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(p,{...e})}):p(e)}}}]); \ No newline at end of file +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[8504],{28453:(e,t,n)=>{n.d(t,{R:()=>a,x:()=>l});var s=n(96540);const i={},o=s.createContext(i);function a(e){const t=s.useContext(o);return s.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:a(e.components),s.createElement(o.Provider,{value:t},e.children)}},94910:(e,t,n)=>{n.r(t),n.d(t,{contentTitle:()=>l,default:()=>d,frontMatter:()=>a,metadata:()=>s,toc:()=>r});const s=JSON.parse('{"type":"api","id":"experimental-run-flow","title":"Experimental Run Flow","description":"","slug":"/experimental-run-flow","frontMatter":{},"api":{"tags":["Base"],"description":"Executes a specified flow by ID with optional input values, output selection, tweaks, and streaming capability.\\n\\nThis endpoint supports running flows with caching to enhance performance and efficiency.\\n\\n### Parameters:\\n- `flow_id` (str): The unique identifier of the flow to be executed.\\n- `inputs` (List[InputValueRequest], optional): A list of inputs specifying the input values and components\\n for the flow. Each input can target specific components and provide custom values.\\n- `outputs` (List[str], optional): A list of output names to retrieve from the executed flow.\\n If not provided, all outputs are returned.\\n- `tweaks` (Optional[Tweaks], optional): A dictionary of tweaks to customize the flow execution.\\n The tweaks can be used to modify the flow\'s parameters and components.\\n Tweaks can be overridden by the input values.\\n- `stream` (bool, optional): Specifies whether the results should be streamed. Defaults to False.\\n- `session_id` (Union[None, str], optional): An optional session ID to utilize existing session data for the flow\\n execution.\\n- `api_key_user` (User): The user associated with the current API key. Automatically resolved from the API key.\\n\\n### Returns:\\nA `RunResponse` object containing the selected outputs (or all if not specified) of the executed flow\\nand the session ID.\\nThe structure of the response accommodates multiple inputs, providing a nested list of outputs for each input.\\n\\n### Raises:\\nHTTPException: Indicates issues with finding the specified flow, invalid input formats, or internal errors during\\nflow execution.\\n\\n### Example usage:\\n```json\\nPOST /run/flow_id\\nx-api-key: YOUR_API_KEY\\nPayload:\\n{\\n \\"inputs\\": [\\n {\\"components\\": [\\"component1\\"], \\"input_value\\": \\"value1\\"},\\n {\\"components\\": [\\"component3\\"], \\"input_value\\": \\"value2\\"}\\n ],\\n \\"outputs\\": [\\"Component Name\\", \\"component_id\\"],\\n \\"tweaks\\": {\\"parameter_name\\": \\"value\\", \\"Component Name\\": {\\"parameter_name\\": \\"value\\"}, \\"component_id\\": {\\"parameter_name\\": \\"value\\"}}\\n \\"stream\\": false\\n}\\n```\\n\\nThis endpoint facilitates complex flow executions with customized inputs, outputs, and configurations,\\ncatering to diverse application requirements.","operationId":"experimental_run_flow_api_v1_run_advanced__flow_id__post","security":[{"API key query":[]},{"API key header":[]}],"parameters":[{"name":"flow_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Flow Id"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"inputs":{"anyOf":[{"items":{"properties":{"components":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Components","default":[]},"input_value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Input Value"},"session":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session"},"type":{"anyOf":[{"type":"string","enum":["chat","text","any"]},{"type":"null"}],"title":"Type","description":"Defines on which components the input value should be applied. \'any\' applies to all input components.","default":"any"}},"additionalProperties":false,"type":"object","title":"InputValueRequest","examples":[{"components":["components_id","Component Name"],"input_value":"input_value","session":"session_id"},{"components":["Component Name"],"input_value":"input_value"},{"input_value":"input_value"},{"components":["Component Name"],"input_value":"input_value","session":"session_id"},{"input_value":"input_value","session":"session_id"},{"input_value":"input_value","type":"chat"},{"input_value":"{\\"key\\": \\"value\\"}","type":"json"}]},"type":"array"},{"type":"null"}],"title":"Inputs"},"outputs":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Outputs"},"tweaks":{"anyOf":[{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"object"}]},"type":"object","title":"Tweaks","description":"A dictionary of tweaks to adjust the flow\'s execution. Allows customizing flow behavior dynamically. All tweaks are overridden by the input values.","examples":[{"Component Name":{"parameter_name":"value"},"component_id":{"parameter_name":"value"},"parameter_name":"value"}]},{"type":"null"}]},"stream":{"type":"boolean","title":"Stream","default":false},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}},"type":"object","title":"Body_experimental_run_flow_api_v1_run_advanced__flow_id__post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"properties":{"outputs":{"anyOf":[{"items":{"properties":{"inputs":{"type":"object","title":"Inputs"},"outputs":{"items":{"anyOf":[{"properties":{"results":{"anyOf":[{},{"type":"null"}],"title":"Results"},"artifacts":{"anyOf":[{},{"type":"null"}],"title":"Artifacts"},"outputs":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Outputs"},"logs":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Logs"},"messages":{"anyOf":[{"items":{"properties":{"message":{"anyOf":[{"type":"string"},{"items":{"anyOf":[{"type":"string"},{"type":"object"}]},"type":"array"}],"title":"Message"},"sender":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender","default":"Machine"},"sender_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender Name","default":"AI"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"},"stream_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stream Url"},"component_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Component Id"},"files":{"items":{"properties":{"path":{"type":"string","title":"Path"},"name":{"type":"string","title":"Name"},"type":{"type":"string","title":"Type"}},"type":"object","required":["path","name","type"],"title":"File","description":"File schema."},"type":"array","title":"Files","default":[]},"type":{"type":"string","title":"Type"}},"type":"object","required":["message","type"],"title":"ChatOutputResponse","description":"Chat output response schema."},"type":"array"},{"type":"null"}],"title":"Messages"},"timedelta":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Timedelta"},"duration":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Duration"},"component_display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Component Display Name"},"component_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Component Id"},"used_frozen_result":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Used Frozen Result","default":false}},"type":"object","title":"ResultData"},{"type":"null"}]},"type":"array","title":"Outputs"}},"type":"object","title":"RunOutputs"},"type":"array"},{"type":"null"}],"title":"Outputs","default":[]},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}},"type":"object","title":"RunResponse","description":"Run response schema."}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"properties":{"detail":{"items":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"}}}}},"method":"post","path":"/api/v1/run/advanced/{flow_id}","securitySchemes":{"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"api/v1/login"}}},"API key query":{"type":"apiKey","in":"query","name":"x-api-key"},"API key header":{"type":"apiKey","in":"header","name":"x-api-key"}},"jsonRequestBodyExample":{"stream":false},"info":{"title":"Langflow","version":"1.5.1"},"postman":{"name":"Experimental Run Flow","description":{"content":"Executes a specified flow by ID with optional input values, output selection, tweaks, and streaming capability.\\n\\nThis endpoint supports running flows with caching to enhance performance and efficiency.\\n\\n### Parameters:\\n- `flow_id` (str): The unique identifier of the flow to be executed.\\n- `inputs` (List[InputValueRequest], optional): A list of inputs specifying the input values and components\\n for the flow. Each input can target specific components and provide custom values.\\n- `outputs` (List[str], optional): A list of output names to retrieve from the executed flow.\\n If not provided, all outputs are returned.\\n- `tweaks` (Optional[Tweaks], optional): A dictionary of tweaks to customize the flow execution.\\n The tweaks can be used to modify the flow\'s parameters and components.\\n Tweaks can be overridden by the input values.\\n- `stream` (bool, optional): Specifies whether the results should be streamed. Defaults to False.\\n- `session_id` (Union[None, str], optional): An optional session ID to utilize existing session data for the flow\\n execution.\\n- `api_key_user` (User): The user associated with the current API key. Automatically resolved from the API key.\\n\\n### Returns:\\nA `RunResponse` object containing the selected outputs (or all if not specified) of the executed flow\\nand the session ID.\\nThe structure of the response accommodates multiple inputs, providing a nested list of outputs for each input.\\n\\n### Raises:\\nHTTPException: Indicates issues with finding the specified flow, invalid input formats, or internal errors during\\nflow execution.\\n\\n### Example usage:\\n```json\\nPOST /run/flow_id\\nx-api-key: YOUR_API_KEY\\nPayload:\\n{\\n \\"inputs\\": [\\n {\\"components\\": [\\"component1\\"], \\"input_value\\": \\"value1\\"},\\n {\\"components\\": [\\"component3\\"], \\"input_value\\": \\"value2\\"}\\n ],\\n \\"outputs\\": [\\"Component Name\\", \\"component_id\\"],\\n \\"tweaks\\": {\\"parameter_name\\": \\"value\\", \\"Component Name\\": {\\"parameter_name\\": \\"value\\"}, \\"component_id\\": {\\"parameter_name\\": \\"value\\"}}\\n \\"stream\\": false\\n}\\n```\\n\\nThis endpoint facilitates complex flow executions with customized inputs, outputs, and configurations,\\ncatering to diverse application requirements.","type":"text/plain"},"url":{"path":["api","v1","run","advanced",":flow_id"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) ","type":"text/plain"},"type":"any","value":"","key":"flow_id"}]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"{\\n \\"inputs\\": [\\n {\\n \\"components\\": [\\n \\"\\",\\n \\"\\"\\n ],\\n \\"input_value\\": \\"\\",\\n \\"session\\": \\"\\",\\n \\"type\\": \\"\\"\\n },\\n {\\n \\"components\\": [\\n \\"\\",\\n \\"\\"\\n ],\\n \\"input_value\\": \\"\\",\\n \\"session\\": \\"\\",\\n \\"type\\": \\"\\"\\n }\\n ],\\n \\"outputs\\": [\\n \\"\\",\\n \\"\\"\\n ],\\n \\"tweaks\\": {\\n \\"nostrudf\\": \\"\\"\\n },\\n \\"stream\\": false,\\n \\"session_id\\": \\"\\"\\n}","options":{"raw":{"language":"json"}}},"auth":{"type":"apikey","apikey":[{"type":"any","value":"x-api-key","key":"key"},{"type":"any","value":"{{apiKey}}","key":"value"},{"type":"any","value":"query","key":"in"}]}}},"source":"@site/openapi.json","sourceDirName":".","permalink":"/api/experimental-run-flow","previous":{"title":"Webhook Run Flow","permalink":"/api/webhook-run-flow"},"next":{"title":"Process","permalink":"/api/process"}}');var i=n(74848),o=n(28453);const a={},l="Experimental Run Flow",r=[{value:"Parameters:",id:"parameters",level:3},{value:"Returns:",id:"returns",level:3},{value:"Raises:",id:"raises",level:3},{value:"Example usage:",id:"example-usage",level:3}];function p(e){const t={code:"code",h1:"h1",h3:"h3",header:"header",li:"li",p:"p",pre:"pre",ul:"ul",...(0,o.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.header,{children:(0,i.jsx)(t.h1,{id:"experimental-run-flow",children:"Experimental Run Flow"})}),"\n",(0,i.jsx)(t.p,{children:"Executes a specified flow by ID with optional input values, output selection, tweaks, and streaming capability."}),"\n",(0,i.jsx)(t.p,{children:"This endpoint supports running flows with caching to enhance performance and efficiency."}),"\n",(0,i.jsx)(t.h3,{id:"parameters",children:"Parameters:"}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"flow_id"})," (str): The unique identifier of the flow to be executed."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"inputs"})," (List[InputValueRequest], optional): A list of inputs specifying the input values and components\nfor the flow. Each input can target specific components and provide custom values."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"outputs"})," (List[str], optional): A list of output names to retrieve from the executed flow.\nIf not provided, all outputs are returned."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"tweaks"})," (Optional[Tweaks], optional): A dictionary of tweaks to customize the flow execution.\nThe tweaks can be used to modify the flow's parameters and components.\nTweaks can be overridden by the input values."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"stream"})," (bool, optional): Specifies whether the results should be streamed. Defaults to False."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"session_id"})," (Union[None, str], optional): An optional session ID to utilize existing session data for the flow\nexecution."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"api_key_user"})," (User): The user associated with the current API key. Automatically resolved from the API key."]}),"\n"]}),"\n",(0,i.jsx)(t.h3,{id:"returns",children:"Returns:"}),"\n",(0,i.jsxs)(t.p,{children:["A ",(0,i.jsx)(t.code,{children:"RunResponse"})," object containing the selected outputs (or all if not specified) of the executed flow\nand the session ID.\nThe structure of the response accommodates multiple inputs, providing a nested list of outputs for each input."]}),"\n",(0,i.jsx)(t.h3,{id:"raises",children:"Raises:"}),"\n",(0,i.jsx)(t.p,{children:"HTTPException: Indicates issues with finding the specified flow, invalid input formats, or internal errors during\nflow execution."}),"\n",(0,i.jsx)(t.h3,{id:"example-usage",children:"Example usage:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-json",children:'POST /run/flow_id\nx-api-key: YOUR_API_KEY\nPayload:\n{\n "inputs": [\n {"components": ["component1"], "input_value": "value1"},\n {"components": ["component3"], "input_value": "value2"}\n ],\n "outputs": ["Component Name", "component_id"],\n "tweaks": {"parameter_name": "value", "Component Name": {"parameter_name": "value"}, "component_id": {"parameter_name": "value"}}\n "stream": false\n}\n'})}),"\n",(0,i.jsx)(t.p,{children:"This endpoint facilitates complex flow executions with customized inputs, outputs, and configurations,\ncatering to diverse application requirements."}),"\n",(0,i.jsxs)("table",{style:{display:"table",width:"100%"},children:[(0,i.jsx)("thead",{children:(0,i.jsx)("tr",{children:(0,i.jsx)("th",{style:{textAlign:"left"},children:"Path Parameters"})})}),(0,i.jsx)("tbody",{children:(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsx)("code",{children:"flow_id"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" uuid"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" \u2014 "}),(0,i.jsx)("strong",{style:{fontSize:"var(--ifm-code-font-size)",color:"var(--openapi-required)"},children:" REQUIRED"})]})})})]}),"\n",(0,i.jsxs)("table",{style:{display:"table",width:"100%"},children:[(0,i.jsx)("thead",{children:(0,i.jsx)("tr",{children:(0,i.jsxs)("th",{style:{textAlign:"left"},children:[(0,i.jsx)("span",{children:"Request Body "}),(0,i.jsx)("div",{})]})})}),(0,i.jsxs)("tbody",{children:[(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsx)("code",{children:"inputs"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" Inputs"})]})}),(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsx)("code",{children:"outputs"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" Outputs"})]})}),(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsx)("code",{children:"tweaks"}),(0,i.jsx)("span",{style:{opacity:"0.6"}})]})}),(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsx)("code",{children:"stream"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" Stream"})]})}),(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsx)("code",{children:"session_id"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" Session Id"})]})})]})]}),"\n",(0,i.jsxs)("table",{style:{display:"table",width:"100%"},children:[(0,i.jsx)("thead",{children:(0,i.jsx)("tr",{children:(0,i.jsx)("th",{style:{textAlign:"left"},children:"Responses"})})}),(0,i.jsxs)("tbody",{children:[(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsxs)("div",{style:{display:"flex"},children:[(0,i.jsx)("div",{style:{marginRight:"var(--ifm-table-cell-padding)"},children:(0,i.jsx)("code",{children:"200"})}),(0,i.jsx)("div",{children:(0,i.jsx)(t.p,{children:"Successful Response"})})]}),(0,i.jsx)("div",{children:(0,i.jsxs)("table",{style:{display:"table",width:"100%",marginTop:"var(--ifm-table-cell-padding)",marginBottom:"0px"},children:[(0,i.jsx)("thead",{children:(0,i.jsx)("tr",{children:(0,i.jsxs)("th",{style:{textAlign:"left"},children:[(0,i.jsx)("span",{children:"Schema "}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" \u2014 "}),(0,i.jsx)("strong",{style:{fontSize:"var(--ifm-code-font-size)",color:"var(--openapi-optional)"},children:" OPTIONAL"}),(0,i.jsx)("div",{})]})})}),(0,i.jsxs)("tbody",{children:[(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsx)("code",{children:"outputs"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" Outputs"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" \u2014 "}),(0,i.jsx)("strong",{style:{fontSize:"var(--ifm-code-font-size)",color:"var(--openapi-optional)"},children:" OPTIONAL"})]})}),(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsx)("code",{children:"session_id"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" Session Id"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" \u2014 "}),(0,i.jsx)("strong",{style:{fontSize:"var(--ifm-code-font-size)",color:"var(--openapi-optional)"},children:" OPTIONAL"})]})})]})]})})]})}),(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsxs)("div",{style:{display:"flex"},children:[(0,i.jsx)("div",{style:{marginRight:"var(--ifm-table-cell-padding)"},children:(0,i.jsx)("code",{children:"422"})}),(0,i.jsx)("div",{children:(0,i.jsx)(t.p,{children:"Validation Error"})})]}),(0,i.jsx)("div",{children:(0,i.jsxs)("table",{style:{display:"table",width:"100%",marginTop:"var(--ifm-table-cell-padding)",marginBottom:"0px"},children:[(0,i.jsx)("thead",{children:(0,i.jsx)("tr",{children:(0,i.jsxs)("th",{style:{textAlign:"left"},children:[(0,i.jsx)("span",{children:"Schema "}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" \u2014 "}),(0,i.jsx)("strong",{style:{fontSize:"var(--ifm-code-font-size)",color:"var(--openapi-optional)"},children:" OPTIONAL"}),(0,i.jsx)("div",{})]})})}),(0,i.jsx)("tbody",{children:(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsx)("code",{children:"detail"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" object[]"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" \u2014 "}),(0,i.jsx)("strong",{style:{fontSize:"var(--ifm-code-font-size)",color:"var(--openapi-optional)"},children:" OPTIONAL"}),(0,i.jsx)("table",{style:{display:"table",width:"100%",marginTop:"var(--ifm-table-cell-padding)",marginBottom:"0px"},children:(0,i.jsxs)("tbody",{children:[(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsx)("code",{children:"loc"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" undefined[]"})]})}),(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsx)("code",{children:"msg"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" Message"})]})}),(0,i.jsx)("tr",{children:(0,i.jsxs)("td",{children:[(0,i.jsx)("code",{children:"type"}),(0,i.jsx)("span",{style:{opacity:"0.6"},children:" Error Type"})]})})]})})]})})})]})})]})})]})]})]})}function d(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(p,{...e})}):p(e)}}}]); \ No newline at end of file diff --git a/assets/js/ef9aa223.6a6d3be5.js b/assets/js/ef9aa223.6a6d3be5.js new file mode 100644 index 0000000000..4e88ec5013 --- /dev/null +++ b/assets/js/ef9aa223.6a6d3be5.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[6224],{7089:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>c,contentTitle:()=>d,default:()=>m,frontMatter:()=>o,metadata:()=>s,toc:()=>l});const s=JSON.parse('{"id":"Components/bundles-datastax","title":"DataStax","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/bundles-datastax.mdx","sourceDirName":"Components","slug":"/bundles-datastax","permalink":"/bundles-datastax","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"DataStax","slug":"/bundles-datastax"},"sidebar":"docs","previous":{"title":"Composio","permalink":"/integrations-composio"},"next":{"title":"DeepSeek","permalink":"/bundles-deepseek"}}');var n=r(74848),a=r(28453),i=r(17886);const o={title:"DataStax",slug:"/bundles-datastax"},d=void 0,c={},l=[{value:"Astra DB Chat Memory",id:"astra-db-chat-memory",level:2},{value:"Astra DB Chat Memory parameters",id:"astra-db-chat-memory-parameters",level:3},{value:"Astra DB CQL",id:"astra-db-cql",level:2},{value:"Astra DB CQL parameters",id:"astra-db-cql-parameters",level:3},{value:"Astra DB Tool",id:"astra-db-tool",level:2},{value:"Astra DB Tool parameters",id:"astra-db-tool-parameters",level:3},{value:"Define tool-specific parameters",id:"define-tool-specific-parameters",level:3},{value:"Cassandra Chat Memory",id:"cassandra-chat-memory",level:2},{value:"Cassandra Chat Memory parameters",id:"cassandra-chat-memory-parameters",level:3},{value:"DataStax assistant components",id:"datastax-assistant-components",level:2},{value:"DataStax environment variable components",id:"datastax-environment-variable-components",level:2},{value:"Legacy DataStax components",id:"legacy-datastax-components",level:2}];function h(e){const t={a:"a",admonition:"admonition",code:"code",em:"em",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,a.R)(),...e.components},{Details:s}=t;return s||function(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(t.p,{children:[(0,n.jsx)(t.a,{href:"/components-bundle-components",children:"Bundles"})," contain custom components that support specific third-party integrations with Langflow."]}),"\n",(0,n.jsxs)(t.p,{children:["This page describes the components that are available in the ",(0,n.jsx)(t.strong,{children:"DataStax"})," bundle."]}),"\n",(0,n.jsx)(t.h2,{id:"astra-db-chat-memory",children:"Astra DB Chat Memory"}),"\n",(0,n.jsxs)(t.p,{children:["The ",(0,n.jsx)(t.strong,{children:"Astra DB Chat Memory"})," component retrieves and stores chat messages using an Astra DB database."]}),"\n",(0,n.jsxs)(t.p,{children:["Chat memories are passed between memory storage components as the ",(0,n.jsx)(t.a,{href:"/data-types#memory",children:(0,n.jsx)(t.code,{children:"Memory"})})," data type.\nSpecifically, the component creates an instance of ",(0,n.jsx)(t.code,{children:"AstraDBChatMessageHistory"}),", which is a LangChain chat message history class that uses Astra DB for storage."]}),"\n",(0,n.jsxs)(t.admonition,{type:"important",children:[(0,n.jsxs)(t.p,{children:["The ",(0,n.jsx)(t.strong,{children:"Astra DB Chat Memory"})," component isn't recommended for most memory storage because memories tend to be long JSON objects or strings, often exceeding the maximum size of a document or object supported by Astra DB."]}),(0,n.jsxs)(t.p,{children:["However, Langflow's ",(0,n.jsx)(t.strong,{children:"Agent"})," component includes built-in chat memory that is enabled by default.\nYour agentic flows don't need an external database to store chat memory.\nFor more information, see ",(0,n.jsx)(t.a,{href:"/memory",children:"Memory management options"}),"."]})]}),"\n",(0,n.jsxs)(t.p,{children:["For more information about using external chat memory in flows, see the ",(0,n.jsxs)(t.a,{href:"/components-helpers#message-history",children:[(0,n.jsx)(t.strong,{children:"Message History"})," component"]}),"."]}),"\n",(0,n.jsx)(t.h3,{id:"astra-db-chat-memory-parameters",children:"Astra DB Chat Memory parameters"}),"\n",(0,n.jsxs)(t.p,{children:["Some component input parameters are hidden by default in the visual editor.\nYou can toggle parameters through the ",(0,n.jsx)(i.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,n.jsx)(t.strong,{children:"Controls"})," in the ",(0,n.jsx)(t.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]}),"\n",(0,n.jsxs)(t.table,{children:[(0,n.jsx)(t.thead,{children:(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.th,{children:"Name"}),(0,n.jsx)(t.th,{children:"Type"}),(0,n.jsx)(t.th,{children:"Description"})]})}),(0,n.jsxs)(t.tbody,{children:[(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"collection_name"}),(0,n.jsx)(t.td,{children:"String"}),(0,n.jsx)(t.td,{children:"Input parameter. The name of the Astra DB collection for storing messages. Required."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"token"}),(0,n.jsx)(t.td,{children:"SecretString"}),(0,n.jsx)(t.td,{children:"Input parameter. The authentication token for Astra DB access. Required."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"api_endpoint"}),(0,n.jsx)(t.td,{children:"SecretString"}),(0,n.jsx)(t.td,{children:"Input parameter. The API endpoint URL for the Astra DB service. Required."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"namespace"}),(0,n.jsx)(t.td,{children:"String"}),(0,n.jsx)(t.td,{children:"Input parameter. The optional namespace within Astra DB for the collection."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"session_id"}),(0,n.jsx)(t.td,{children:"MessageText"}),(0,n.jsx)(t.td,{children:"Input parameter. The unique identifier for the chat session. Uses the current session ID if not provided."})]})]})]}),"\n",(0,n.jsx)(t.h2,{id:"astra-db-cql",children:"Astra DB CQL"}),"\n",(0,n.jsxs)(t.p,{children:["The ",(0,n.jsx)(t.strong,{children:"Astra DB CQL"})," component allows agents to query data from CQL tables in Astra DB."]}),"\n",(0,n.jsxs)(t.p,{children:["The output is a list of ",(0,n.jsx)(t.a,{href:"/data-types#data",children:(0,n.jsx)(t.code,{children:"Data"})})," objects containing the query results from the Astra DB CQL table. Each Data object contains the document fields specified by the projection fields. Limited by the ",(0,n.jsx)(t.code,{children:"number_of_results"})," parameter."]}),"\n",(0,n.jsx)(t.h3,{id:"astra-db-cql-parameters",children:"Astra DB CQL parameters"}),"\n",(0,n.jsxs)(t.p,{children:["Some component input parameters are hidden by default in the visual editor.\nYou can toggle parameters through the ",(0,n.jsx)(i.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,n.jsx)(t.strong,{children:"Controls"})," in the ",(0,n.jsx)(t.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]}),"\n",(0,n.jsxs)(t.table,{children:[(0,n.jsx)(t.thead,{children:(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.th,{children:"Name"}),(0,n.jsx)(t.th,{children:"Type"}),(0,n.jsx)(t.th,{children:"Description"})]})}),(0,n.jsxs)(t.tbody,{children:[(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Tool Name"}),(0,n.jsx)(t.td,{children:"String"}),(0,n.jsx)(t.td,{children:"Input parameter. The name used to reference the tool in the agent's prompt."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Tool Description"}),(0,n.jsx)(t.td,{children:"String"}),(0,n.jsx)(t.td,{children:"Input parameter. A brief description of the tool to guide the model in using it."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Keyspace"}),(0,n.jsx)(t.td,{children:"String"}),(0,n.jsx)(t.td,{children:"Input parameter. The name of the keyspace."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Table Name"}),(0,n.jsx)(t.td,{children:"String"}),(0,n.jsx)(t.td,{children:"Input parameter. The name of the Astra DB CQL table to query."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Token"}),(0,n.jsx)(t.td,{children:"SecretString"}),(0,n.jsx)(t.td,{children:"Input parameter. The authentication token for Astra DB."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"API Endpoint"}),(0,n.jsx)(t.td,{children:"String"}),(0,n.jsx)(t.td,{children:"Input parameter. The Astra DB API endpoint."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Projection Fields"}),(0,n.jsx)(t.td,{children:"String"}),(0,n.jsx)(t.td,{children:'Input parameter. The attributes to return, separated by commas. Default: "*".'})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Partition Keys"}),(0,n.jsx)(t.td,{children:"Dict"}),(0,n.jsx)(t.td,{children:"Input parameter. Required parameters that the model must fill to query the tool."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Clustering Keys"}),(0,n.jsx)(t.td,{children:"Dict"}),(0,n.jsxs)(t.td,{children:["Input parameter. Optional parameters the model can fill to refine the query. Required parameters should be marked with an exclamation mark, for example, ",(0,n.jsx)(t.code,{children:"!customer_id"}),"."]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Static Filters"}),(0,n.jsx)(t.td,{children:"Dict"}),(0,n.jsx)(t.td,{children:"Input parameter. Attribute-value pairs used to filter query results."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Limit"}),(0,n.jsx)(t.td,{children:"String"}),(0,n.jsx)(t.td,{children:"Input parameter. The number of records to return."})]})]})]}),"\n",(0,n.jsx)(t.h2,{id:"astra-db-tool",children:"Astra DB Tool"}),"\n",(0,n.jsxs)(t.p,{children:["The ",(0,n.jsx)(t.strong,{children:"Astra DB Tool"})," component enables searching data in Astra DB collections, including hybrid search, vector search, and regular filter-based search.\nSpecialized searches require that the collection is pre-configured with the required parameters."]}),"\n",(0,n.jsxs)(t.p,{children:["Outputs a list of ",(0,n.jsx)(t.a,{href:"/data-types#data",children:(0,n.jsx)(t.code,{children:"Data"})})," objects containing the query results from Astra DB. Each ",(0,n.jsx)(t.code,{children:"Data"})," object contains the document fields specified by the projection attributes. Limited by the ",(0,n.jsx)(t.code,{children:"number_of_results"})," parameter and the upper limit of the Astra DB Data API, depending on the type of search."]}),"\n",(0,n.jsxs)(t.p,{children:["You can use the component to execute queries directly as isolated steps in a flow, or you can connect it as a ",(0,n.jsx)(t.a,{href:"/agents-tools",children:"tool for an agent"})," to allow the agent to query data from Astra DB collections as needed to respond to user queries.\nFor more information, see ",(0,n.jsx)(t.a,{href:"/agents",children:"Use Langflow agents"}),"."]}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{alt:"Astra DB Tool component connected as a tool to an Agent component",src:r(68335).A+"",width:"4000",height:"2742"})}),"\n",(0,n.jsx)(t.h3,{id:"astra-db-tool-parameters",children:"Astra DB Tool parameters"}),"\n",(0,n.jsxs)(t.p,{children:["The following parameters are for the ",(0,n.jsx)(t.strong,{children:"Astra DB Tool"})," component overall."]}),"\n",(0,n.jsxs)(t.p,{children:["The values for ",(0,n.jsx)(t.strong,{children:"Collection Name"}),", ",(0,n.jsx)(t.strong,{children:"Astra DB Application Token"}),", and ",(0,n.jsx)(t.strong,{children:"Astra DB API Endpoint"})," are found in your Astra DB deployment. For more information, see the ",(0,n.jsx)(t.a,{href:"https://docs.datastax.com/en/astra-db-serverless/databases/create-database.html",children:"Astra DB Serverless documentation"}),"."]}),"\n",(0,n.jsxs)(t.table,{children:[(0,n.jsx)(t.thead,{children:(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.th,{children:"Name"}),(0,n.jsx)(t.th,{children:"Type"}),(0,n.jsx)(t.th,{children:"Description"})]})}),(0,n.jsxs)(t.tbody,{children:[(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Tool Name"}),(0,n.jsx)(t.td,{children:"String"}),(0,n.jsx)(t.td,{children:"Input parameter. The name used to reference the tool in the agent's prompt."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Tool Description"}),(0,n.jsx)(t.td,{children:"String"}),(0,n.jsx)(t.td,{children:"Input parameter. A brief description of the tool. This helps the model decide when to use it."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Keyspace Name"}),(0,n.jsx)(t.td,{children:"String"}),(0,n.jsxs)(t.td,{children:["Input parameter. The name of the keyspace in Astra DB. Default: ",(0,n.jsx)(t.code,{children:"default_keyspace"})]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Collection Name"}),(0,n.jsx)(t.td,{children:"String"}),(0,n.jsx)(t.td,{children:"Input parameter. The name of the Astra DB collection to query."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Token"}),(0,n.jsx)(t.td,{children:"SecretString"}),(0,n.jsx)(t.td,{children:"Input parameter. The authentication token for accessing Astra DB."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"API Endpoint"}),(0,n.jsx)(t.td,{children:"String"}),(0,n.jsx)(t.td,{children:"Input parameter. The Astra DB API endpoint."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Projection Fields"}),(0,n.jsx)(t.td,{children:"String"}),(0,n.jsxs)(t.td,{children:["Input parameter. Comma-separated list of attributes to return from matching documents. The default is the default projection, ",(0,n.jsx)(t.code,{children:"*"}),", which returns all attributes except reserved fields like ",(0,n.jsx)(t.code,{children:"$vector"}),"."]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Tool Parameters"}),(0,n.jsx)(t.td,{children:"Dict"}),(0,n.jsxs)(t.td,{children:["Input parameter. ",(0,n.jsxs)(t.a,{href:"https://docs.datastax.com/en/astra-db-serverless/api-reference/document-methods/find-many.html#parameters",children:["Astra DB Data API ",(0,n.jsx)(t.code,{children:"find"})," filters"]})," that become tools for an agent. These Filters ",(0,n.jsx)(t.em,{children:"may"})," be used in a search, if the agent selects them. See ",(0,n.jsx)(t.a,{href:"#define-tool-specific-parameters",children:"Define tool-specific parameters"}),"."]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Static Filters"}),(0,n.jsx)(t.td,{children:"Dict"}),(0,n.jsxs)(t.td,{children:["Input parameter. Attribute-value pairs used to filter query results. Equivalent to ",(0,n.jsxs)(t.a,{href:"https://docs.datastax.com/en/astra-db-serverless/api-reference/document-methods/find-many.html#parameters",children:["Astra DB Data API ",(0,n.jsx)(t.code,{children:"find"})," filters"]}),". ",(0,n.jsx)(t.strong,{children:"Static Filters"})," are included with ",(0,n.jsx)(t.em,{children:"every"})," query. Use ",(0,n.jsx)(t.strong,{children:"Static Filters"})," without semantic search to perform a regular filter search."]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Number of Results"}),(0,n.jsx)(t.td,{children:"Int"}),(0,n.jsx)(t.td,{children:"Input parameter. The maximum number of documents to return."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Semantic Search"}),(0,n.jsx)(t.td,{children:"Boolean"}),(0,n.jsxs)(t.td,{children:["Input parameter. Whether to run a similarity search by generating a vector embedding from the chat input and following the ",(0,n.jsx)(t.strong,{children:"Semantic Search Instruction"}),". Default: false. If true, you must attach an ",(0,n.jsxs)(t.a,{href:"/components-embedding-models",children:[(0,n.jsx)(t.strong,{children:"Embedding Model"})," component"]})," or have vectorize pre-enabled on your collection."]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Use Astra DB Vectorize"}),(0,n.jsx)(t.td,{children:"Boolean"}),(0,n.jsx)(t.td,{children:"Input parameter. Whether to use the Astra DB vectorize feature for embedding generation when running a semantic search. Default: false. If true, you must have vectorize pre-enabled on your collection."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Embedding Model"}),(0,n.jsx)(t.td,{children:"Embedding"}),(0,n.jsxs)(t.td,{children:["Input parameter. A port to attach an ",(0,n.jsx)(t.strong,{children:"Embedding Model"})," component to generate a vector from input text for semantic search. This can be used when ",(0,n.jsx)(t.strong,{children:"Semantic Search"})," is true, with or without vectorize. Be sure to use a model that aligns with the dimensions of the embeddings already present in the collection."]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Semantic Search Instruction"}),(0,n.jsx)(t.td,{children:"String"}),(0,n.jsxs)(t.td,{children:["Input parameter. The query to use for similarity search. Default: ",(0,n.jsx)(t.code,{children:'"Find documents similar to the query."'}),". This instruction is used to guide the model in performing semantic search."]})]})]})]}),"\n",(0,n.jsx)(t.h3,{id:"define-tool-specific-parameters",children:"Define tool-specific parameters"}),"\n",(0,n.jsxs)(t.admonition,{type:"tip",children:[(0,n.jsxs)(t.p,{children:[(0,n.jsx)(t.strong,{children:"Tool Parameters"})," are small functions that you create within the ",(0,n.jsx)(t.strong,{children:"Astra DB Tool"})," component.\nThey give the LLM pre-defined ways to interact with the data in your collection."]}),(0,n.jsx)(t.p,{children:"Without these filters, the LLM has no concept of the data in your collection or which attributes are important."}),(0,n.jsx)(t.p,{children:"At runtime, the LLM can decide which filters are relevant to the current query."}),(0,n.jsxs)(t.p,{children:["Filters in ",(0,n.jsx)(t.strong,{children:"Tool Parameters"})," aren't always applied.\nIf you want to enforce filters for ",(0,n.jsx)(t.em,{children:"every"})," query, use the ",(0,n.jsx)(t.strong,{children:"Static Filters"})," parameter.\nYou can use both ",(0,n.jsx)(t.strong,{children:"Tool Parameters"})," and ",(0,n.jsx)(t.strong,{children:"Static Filters"})," to set some required filters and some optional filters."]})]}),"\n",(0,n.jsxs)(t.p,{children:["In the ",(0,n.jsx)(t.strong,{children:"Astra DB Tool"})," component's ",(0,n.jsx)(t.strong,{children:"Tool Parameters"})," field, you can create filters to query documents in your collection."]}),"\n",(0,n.jsxs)(t.p,{children:["When used in ",(0,n.jsx)(t.strong,{children:"Tool Mode"})," with an agent, these filters tell the agent which document attributes are most important, which are required in searches, and which operators to use on certain attributes.\nThe filters become available as parameters that the LLM can use when calling the tool, with a better understanding of each parameter provided by the ",(0,n.jsx)(t.strong,{children:"Description"})," field."]}),"\n",(0,n.jsxs)(t.p,{children:["In the ",(0,n.jsx)(t.strong,{children:"Tool Parameters"})," pane, click ",(0,n.jsx)(i.A,{name:"Plus","aria-hidden":"true"})," ",(0,n.jsx)(t.strong,{children:"Add a new row"}),", and then edit each cell in the row.\nFor example, the following filter allows an LLM to filter by unique ",(0,n.jsx)(t.code,{children:"customer_id"})," values:"]}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsxs)(t.li,{children:["Name: ",(0,n.jsx)(t.code,{children:"customer_id"})]}),"\n",(0,n.jsx)(t.li,{children:"Attribute Name: Leave empty if the attribute matches the field name in the database."}),"\n",(0,n.jsxs)(t.li,{children:["Description: ",(0,n.jsx)(t.code,{children:'"The unique identifier of the customer to filter by"'}),"."]}),"\n",(0,n.jsxs)(t.li,{children:["Is Metadata: Select ",(0,n.jsx)(t.strong,{children:"False"})," unless the value is stored in the metadata field."]}),"\n",(0,n.jsxs)(t.li,{children:["Is Mandatory: Set to ",(0,n.jsx)(t.strong,{children:"True"})," to make the filter required."]}),"\n",(0,n.jsxs)(t.li,{children:["Is Timestamp: For this example, select ",(0,n.jsx)(t.strong,{children:"False"})," because the value is an ID, not a timestamp."]}),"\n",(0,n.jsxs)(t.li,{children:["Operator: ",(0,n.jsx)(t.code,{children:"$eq"})," to look for an exact match."]}),"\n"]}),"\n",(0,n.jsxs)(t.p,{children:["The following fields are available for each row in the ",(0,n.jsx)(t.strong,{children:"Tool Parameters"})," pane:"]}),"\n",(0,n.jsxs)(t.table,{children:[(0,n.jsx)(t.thead,{children:(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.th,{children:"Parameter"}),(0,n.jsx)(t.th,{children:"Description"})]})}),(0,n.jsxs)(t.tbody,{children:[(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Name"}),(0,n.jsx)(t.td,{children:"The name of the parameter that is exposed to the LLM. It can be the same as the underlying field name or a more descriptive label. The LLM uses this name, along with the description, to infer what value to provide during execution."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Attribute Name"}),(0,n.jsxs)(t.td,{children:["When the parameter name shown to the LLM differs from the actual field or property in the database, use this setting to map the user-facing name to the correct attribute. For example, to apply a range filter to the timestamp field, define two separate parameters, such as ",(0,n.jsx)(t.code,{children:"start_date"})," and ",(0,n.jsx)(t.code,{children:"end_date"}),", that both reference the same timestamp attribute."]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Description"}),(0,n.jsxs)(t.td,{children:["Provides instructions to the LLM on how the parameter should be used. Clear and specific guidance helps the LLM provide valid input. For example, if a field such as ",(0,n.jsx)(t.code,{children:"specialty"})," is stored in lowercase, the description should indicate that the input must be lowercase."]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Is Metadata"}),(0,n.jsxs)(t.td,{children:["When loading data using LangChain or Langflow, additional attributes may be stored under a metadata object. If the target attribute is stored this way, enable this option. It adjusts the query by generating a filter in the format: ",(0,n.jsx)(t.code,{children:'{"metadata.": ""}'})]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Is Timestamp"}),(0,n.jsx)(t.td,{children:"For date or time-based filters, enable this option to automatically convert values to the timestamp format that the Astrapy client expects. This ensures compatibility with the underlying API without requiring manual formatting."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Operator"}),(0,n.jsxs)(t.td,{children:["Defines the filtering logic applied to the attribute. You can use any valid ",(0,n.jsx)(t.a,{href:"https://docs.datastax.com/en/astra-db-serverless/api-reference/filter-operator-collections.html",children:"Data API filter operator"}),". For example, to filter a time range on the timestamp attribute, use two parameters: one with the ",(0,n.jsx)(t.code,{children:"$gt"}),' operator for "greater than", and another with the ',(0,n.jsx)(t.code,{children:"$lt"}),' operator for "less than".']})]})]})]}),"\n",(0,n.jsx)(t.h2,{id:"cassandra-chat-memory",children:"Cassandra Chat Memory"}),"\n",(0,n.jsxs)(t.p,{children:["The ",(0,n.jsx)(t.strong,{children:"Cassandra Chat Memory"})," component retrieves and stores chat messages using an Apache Cassandra-based database, including Astra DB and Hyper-Converged Database (HCD)."]}),"\n",(0,n.jsxs)(t.p,{children:["Chat memories are passed between memory storage components as the ",(0,n.jsx)(t.a,{href:"/data-types#memory",children:(0,n.jsx)(t.code,{children:"Memory"})})," data type.\nSpecifically, the component creates an instance of ",(0,n.jsx)(t.code,{children:"CassandraChatMessageHistory"}),", which is a LangChain chat message history class that uses a Cassandra database for storage."]}),"\n",(0,n.jsxs)(t.p,{children:["For more information about using external chat memory in flows, see the ",(0,n.jsxs)(t.a,{href:"/components-helpers#message-history",children:[(0,n.jsx)(t.strong,{children:"Message History"})," component"]}),"."]}),"\n",(0,n.jsx)(t.h3,{id:"cassandra-chat-memory-parameters",children:"Cassandra Chat Memory parameters"}),"\n",(0,n.jsxs)(t.p,{children:["Some component input parameters are hidden by default in the visual editor.\nYou can toggle parameters through the ",(0,n.jsx)(i.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,n.jsx)(t.strong,{children:"Controls"})," in the ",(0,n.jsx)(t.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]}),"\n",(0,n.jsxs)(t.table,{children:[(0,n.jsx)(t.thead,{children:(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.th,{children:"Name"}),(0,n.jsx)(t.th,{children:"Type"}),(0,n.jsx)(t.th,{children:"Description"})]})}),(0,n.jsxs)(t.tbody,{children:[(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"database_ref"}),(0,n.jsx)(t.td,{children:"MessageText"}),(0,n.jsx)(t.td,{children:"Input parameter. The contact points for the Cassandra database or Astra DB database ID. Required."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"username"}),(0,n.jsx)(t.td,{children:"MessageText"}),(0,n.jsx)(t.td,{children:"Input parameter. The username for Cassandra. Leave empty for Astra DB."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"token"}),(0,n.jsx)(t.td,{children:"SecretString"}),(0,n.jsx)(t.td,{children:"Input parameter. The password for Cassandra or the token for Astra DB. Required."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"keyspace"}),(0,n.jsx)(t.td,{children:"MessageText"}),(0,n.jsx)(t.td,{children:"Input parameter. The keyspace in Cassandra or namespace in Astra DB. Required."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"table_name"}),(0,n.jsx)(t.td,{children:"MessageText"}),(0,n.jsx)(t.td,{children:"Input parameter. The name of the table or collection for storing messages. Required."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"session_id"}),(0,n.jsx)(t.td,{children:"MessageText"}),(0,n.jsx)(t.td,{children:"Input parameter. The unique identifier for the chat session. Optional."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"cluster_kwargs"}),(0,n.jsx)(t.td,{children:"Dictionary"}),(0,n.jsx)(t.td,{children:"Input parameter. Additional keyword arguments for the Cassandra cluster configuration. Optional."})]})]})]}),"\n",(0,n.jsx)(t.h2,{id:"datastax-assistant-components",children:"DataStax assistant components"}),"\n",(0,n.jsx)(t.p,{children:"The following DataStax components are used to create and manage Assistants API functions in a flow:"}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsx)(t.li,{children:(0,n.jsx)(t.strong,{children:"Astra Assistant Agent"})}),"\n",(0,n.jsx)(t.li,{children:(0,n.jsx)(t.strong,{children:"Create Assistant"})}),"\n",(0,n.jsx)(t.li,{children:(0,n.jsx)(t.strong,{children:"Create Assistant Thread"})}),"\n",(0,n.jsx)(t.li,{children:(0,n.jsx)(t.strong,{children:"Get Assistant Name"})}),"\n",(0,n.jsx)(t.li,{children:(0,n.jsx)(t.strong,{children:"List Assistants"})}),"\n",(0,n.jsx)(t.li,{children:(0,n.jsx)(t.strong,{children:"Run Assistant"})}),"\n"]}),"\n",(0,n.jsx)(t.h2,{id:"datastax-environment-variable-components",children:"DataStax environment variable components"}),"\n",(0,n.jsx)(t.p,{children:"The following DataStax components are used to load and retrieve environment variables in a flow:"}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsx)(t.li,{children:(0,n.jsx)(t.strong,{children:"Dotenv"})}),"\n",(0,n.jsx)(t.li,{children:(0,n.jsx)(t.strong,{children:"Get Environment Variable"})}),"\n"]}),"\n",(0,n.jsx)(t.h2,{id:"legacy-datastax-components",children:"Legacy DataStax components"}),"\n",(0,n.jsx)(t.p,{children:"The following components are considered legacy or deprecated.\nThese components are no longer being developed and can be removed in future releases."}),"\n",(0,n.jsx)(t.p,{children:"Replace them with the suggested alternatives as soon as possible."}),"\n",(0,n.jsxs)(s,{children:[(0,n.jsx)("summary",{children:"Astra DB Vectorize"}),(0,n.jsxs)(t.p,{children:["This component was deprecated in Langflow version 1.1.2.\nReplace it with the ",(0,n.jsxs)(t.a,{href:"/components-vector-stores#astra-db",children:[(0,n.jsx)(t.strong,{children:"Astra DB"})," vector store component"]})," as soon as possible."]}),(0,n.jsxs)(t.p,{children:["The ",(0,n.jsx)(t.strong,{children:"Astra DB Vectorize"})," component was used to generate embeddings with Astra DB's vectorize feature in conjunction with an ",(0,n.jsx)(t.strong,{children:"Astra DB"})," vector store component."]}),(0,n.jsxs)(t.p,{children:["The vectorize functionality is now built into the ",(0,n.jsx)(t.strong,{children:"Astra DB"})," vector store component.\nYou no longer need a separate component for vectorize embedding generation."]})]})]})}function m(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(h,{...e})}):h(e)}},17886:(e,t,r)=>{r.d(t,{A:()=>a});r(96540);var s=r(64058),n=r(74848);function a({name:e,...t}){const r=s[e];return r?(0,n.jsx)(r,{...t}):null}},68335:(e,t,r)=>{r.d(t,{A:()=>s});const s=r.p+"assets/images/component-astra-db-json-tool-117aff566c0df01a555264bb128b3693.png"}}]); \ No newline at end of file diff --git a/assets/js/ef9aa223.f8d8d85f.js b/assets/js/ef9aa223.f8d8d85f.js deleted file mode 100644 index 95a9911aa9..0000000000 --- a/assets/js/ef9aa223.f8d8d85f.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[6224],{7089:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>c,contentTitle:()=>d,default:()=>m,frontMatter:()=>o,metadata:()=>s,toc:()=>l});const s=JSON.parse('{"id":"Components/bundles-datastax","title":"DataStax","description":"Bundles contain custom components that support specific third-party integrations with Langflow.","source":"@site/docs/Components/bundles-datastax.mdx","sourceDirName":"Components","slug":"/bundles-datastax","permalink":"/bundles-datastax","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"DataStax","slug":"/bundles-datastax"},"sidebar":"docs","previous":{"title":"Composio","permalink":"/integrations-composio"},"next":{"title":"DeepSeek","permalink":"/bundles-deepseek"}}');var n=r(74848),a=r(28453),i=r(17886);const o={title:"DataStax",slug:"/bundles-datastax"},d=void 0,c={},l=[{value:"Astra DB Chat Memory",id:"astra-db-chat-memory",level:2},{value:"Astra DB Chat Memory parameters",id:"astra-db-chat-memory-parameters",level:3},{value:"Astra DB CQL",id:"astra-db-cql",level:2},{value:"Astra DB CQL parameters",id:"astra-db-cql-parameters",level:3},{value:"Astra DB Tool",id:"astra-db-tool",level:2},{value:"Astra DB Tool parameters",id:"astra-db-tool-parameters",level:3},{value:"Define tool-specific parameters",id:"define-tool-specific-parameters",level:3},{value:"Cassandra Chat Memory",id:"cassandra-chat-memory",level:2},{value:"Cassandra Chat Memory parameters",id:"cassandra-chat-memory-parameters",level:3},{value:"DataStax assistant components",id:"datastax-assistant-components",level:2},{value:"DataStax environment variable components",id:"datastax-environment-variable-components",level:2},{value:"Legacy DataStax components",id:"legacy-datastax-components",level:2}];function h(e){const t={a:"a",admonition:"admonition",code:"code",em:"em",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,a.R)(),...e.components},{Details:s}=t;return s||function(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(t.p,{children:[(0,n.jsx)(t.a,{href:"/components-bundle-components",children:"Bundles"})," contain custom components that support specific third-party integrations with Langflow."]}),"\n",(0,n.jsxs)(t.p,{children:["This page describes the components that are available in the ",(0,n.jsx)(t.strong,{children:"DataStax"})," bundle."]}),"\n",(0,n.jsx)(t.h2,{id:"astra-db-chat-memory",children:"Astra DB Chat Memory"}),"\n",(0,n.jsxs)(t.p,{children:["The ",(0,n.jsx)(t.strong,{children:"Astra DB Chat Memory"})," component retrieves and stores chat messages using an Astra DB database."]}),"\n",(0,n.jsxs)(t.p,{children:["Chat memories are passed between memory storage components as the ",(0,n.jsx)(t.a,{href:"/data-types#memory",children:(0,n.jsx)(t.code,{children:"Memory"})})," data type.\nSpecifically, the component creates an instance of ",(0,n.jsx)(t.code,{children:"AstraDBChatMessageHistory"}),", which is a LangChain chat message history class that uses Astra DB for storage."]}),"\n",(0,n.jsxs)(t.admonition,{type:"important",children:[(0,n.jsxs)(t.p,{children:["The ",(0,n.jsx)(t.strong,{children:"Astra DB Chat Memory"})," component isn't recommended for most memory storage because memories tend to be long JSON objects or strings, often exceeding the maximum size of a document or object supported by Astra DB."]}),(0,n.jsxs)(t.p,{children:["However, Langflow's ",(0,n.jsx)(t.strong,{children:"Agent"})," and ",(0,n.jsx)(t.strong,{children:"Language Model"})," components include built-in chat memory that is enabled by default.\nYour flows don't need an external database to store chat memory.\nFor more information, see ",(0,n.jsx)(t.a,{href:"/memory",children:"Memory management options"}),"."]})]}),"\n",(0,n.jsxs)(t.p,{children:["For more information about using external chat memory in flows, see the ",(0,n.jsxs)(t.a,{href:"/components-helpers#message-history",children:[(0,n.jsx)(t.strong,{children:"Message History"})," component"]}),"."]}),"\n",(0,n.jsx)(t.h3,{id:"astra-db-chat-memory-parameters",children:"Astra DB Chat Memory parameters"}),"\n",(0,n.jsxs)(t.p,{children:["Some component input parameters are hidden by default in the visual editor.\nYou can toggle parameters through the ",(0,n.jsx)(i.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,n.jsx)(t.strong,{children:"Controls"})," in the ",(0,n.jsx)(t.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]}),"\n",(0,n.jsxs)(t.table,{children:[(0,n.jsx)(t.thead,{children:(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.th,{children:"Name"}),(0,n.jsx)(t.th,{children:"Type"}),(0,n.jsx)(t.th,{children:"Description"})]})}),(0,n.jsxs)(t.tbody,{children:[(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"collection_name"}),(0,n.jsx)(t.td,{children:"String"}),(0,n.jsx)(t.td,{children:"Input parameter. The name of the Astra DB collection for storing messages. Required."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"token"}),(0,n.jsx)(t.td,{children:"SecretString"}),(0,n.jsx)(t.td,{children:"Input parameter. The authentication token for Astra DB access. Required."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"api_endpoint"}),(0,n.jsx)(t.td,{children:"SecretString"}),(0,n.jsx)(t.td,{children:"Input parameter. The API endpoint URL for the Astra DB service. Required."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"namespace"}),(0,n.jsx)(t.td,{children:"String"}),(0,n.jsx)(t.td,{children:"Input parameter. The optional namespace within Astra DB for the collection."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"session_id"}),(0,n.jsx)(t.td,{children:"MessageText"}),(0,n.jsx)(t.td,{children:"Input parameter. The unique identifier for the chat session. Uses the current session ID if not provided."})]})]})]}),"\n",(0,n.jsx)(t.h2,{id:"astra-db-cql",children:"Astra DB CQL"}),"\n",(0,n.jsxs)(t.p,{children:["The ",(0,n.jsx)(t.strong,{children:"Astra DB CQL"})," component allows agents to query data from CQL tables in Astra DB."]}),"\n",(0,n.jsxs)(t.p,{children:["The output is a list of ",(0,n.jsx)(t.a,{href:"/data-types#data",children:(0,n.jsx)(t.code,{children:"Data"})})," objects containing the query results from the Astra DB CQL table. Each Data object contains the document fields specified by the projection fields. Limited by the ",(0,n.jsx)(t.code,{children:"number_of_results"})," parameter."]}),"\n",(0,n.jsx)(t.h3,{id:"astra-db-cql-parameters",children:"Astra DB CQL parameters"}),"\n",(0,n.jsxs)(t.p,{children:["Some component input parameters are hidden by default in the visual editor.\nYou can toggle parameters through the ",(0,n.jsx)(i.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,n.jsx)(t.strong,{children:"Controls"})," in the ",(0,n.jsx)(t.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]}),"\n",(0,n.jsxs)(t.table,{children:[(0,n.jsx)(t.thead,{children:(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.th,{children:"Name"}),(0,n.jsx)(t.th,{children:"Type"}),(0,n.jsx)(t.th,{children:"Description"})]})}),(0,n.jsxs)(t.tbody,{children:[(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Tool Name"}),(0,n.jsx)(t.td,{children:"String"}),(0,n.jsx)(t.td,{children:"Input parameter. The name used to reference the tool in the agent's prompt."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Tool Description"}),(0,n.jsx)(t.td,{children:"String"}),(0,n.jsx)(t.td,{children:"Input parameter. A brief description of the tool to guide the model in using it."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Keyspace"}),(0,n.jsx)(t.td,{children:"String"}),(0,n.jsx)(t.td,{children:"Input parameter. The name of the keyspace."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Table Name"}),(0,n.jsx)(t.td,{children:"String"}),(0,n.jsx)(t.td,{children:"Input parameter. The name of the Astra DB CQL table to query."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Token"}),(0,n.jsx)(t.td,{children:"SecretString"}),(0,n.jsx)(t.td,{children:"Input parameter. The authentication token for Astra DB."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"API Endpoint"}),(0,n.jsx)(t.td,{children:"String"}),(0,n.jsx)(t.td,{children:"Input parameter. The Astra DB API endpoint."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Projection Fields"}),(0,n.jsx)(t.td,{children:"String"}),(0,n.jsx)(t.td,{children:'Input parameter. The attributes to return, separated by commas. Default: "*".'})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Partition Keys"}),(0,n.jsx)(t.td,{children:"Dict"}),(0,n.jsx)(t.td,{children:"Input parameter. Required parameters that the model must fill to query the tool."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Clustering Keys"}),(0,n.jsx)(t.td,{children:"Dict"}),(0,n.jsxs)(t.td,{children:["Input parameter. Optional parameters the model can fill to refine the query. Required parameters should be marked with an exclamation mark, for example, ",(0,n.jsx)(t.code,{children:"!customer_id"}),"."]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Static Filters"}),(0,n.jsx)(t.td,{children:"Dict"}),(0,n.jsx)(t.td,{children:"Input parameter. Attribute-value pairs used to filter query results."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Limit"}),(0,n.jsx)(t.td,{children:"String"}),(0,n.jsx)(t.td,{children:"Input parameter. The number of records to return."})]})]})]}),"\n",(0,n.jsx)(t.h2,{id:"astra-db-tool",children:"Astra DB Tool"}),"\n",(0,n.jsxs)(t.p,{children:["The ",(0,n.jsx)(t.strong,{children:"Astra DB Tool"})," component enables searching data in Astra DB collections, including hybrid search, vector search, and regular filter-based search.\nSpecialized searches require that the collection is pre-configured with the required parameters."]}),"\n",(0,n.jsxs)(t.p,{children:["Outputs a list of ",(0,n.jsx)(t.a,{href:"/data-types#data",children:(0,n.jsx)(t.code,{children:"Data"})})," objects containing the query results from Astra DB. Each ",(0,n.jsx)(t.code,{children:"Data"})," object contains the document fields specified by the projection attributes. Limited by the ",(0,n.jsx)(t.code,{children:"number_of_results"})," parameter and the upper limit of the Astra DB Data API, depending on the type of search."]}),"\n",(0,n.jsxs)(t.p,{children:["You can use the component to execute queries directly as isolated steps in a flow, or you can connect it as a ",(0,n.jsx)(t.a,{href:"/agents-tools",children:"tool for an agent"})," to allow the agent to query data from Astra DB collections as needed to respond to user queries.\nFor more information, see ",(0,n.jsx)(t.a,{href:"/agents",children:"Use Langflow agents"}),"."]}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{alt:"Astra DB Tool component connected as a tool to an Agent component",src:r(68335).A+"",width:"4000",height:"2742"})}),"\n",(0,n.jsx)(t.h3,{id:"astra-db-tool-parameters",children:"Astra DB Tool parameters"}),"\n",(0,n.jsxs)(t.p,{children:["The following parameters are for the ",(0,n.jsx)(t.strong,{children:"Astra DB Tool"})," component overall."]}),"\n",(0,n.jsxs)(t.p,{children:["The values for ",(0,n.jsx)(t.strong,{children:"Collection Name"}),", ",(0,n.jsx)(t.strong,{children:"Astra DB Application Token"}),", and ",(0,n.jsx)(t.strong,{children:"Astra DB API Endpoint"})," are found in your Astra DB deployment. For more information, see the ",(0,n.jsx)(t.a,{href:"https://docs.datastax.com/en/astra-db-serverless/databases/create-database.html",children:"Astra DB Serverless documentation"}),"."]}),"\n",(0,n.jsxs)(t.table,{children:[(0,n.jsx)(t.thead,{children:(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.th,{children:"Name"}),(0,n.jsx)(t.th,{children:"Type"}),(0,n.jsx)(t.th,{children:"Description"})]})}),(0,n.jsxs)(t.tbody,{children:[(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Tool Name"}),(0,n.jsx)(t.td,{children:"String"}),(0,n.jsx)(t.td,{children:"Input parameter. The name used to reference the tool in the agent's prompt."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Tool Description"}),(0,n.jsx)(t.td,{children:"String"}),(0,n.jsx)(t.td,{children:"Input parameter. A brief description of the tool. This helps the model decide when to use it."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Keyspace Name"}),(0,n.jsx)(t.td,{children:"String"}),(0,n.jsxs)(t.td,{children:["Input parameter. The name of the keyspace in Astra DB. Default: ",(0,n.jsx)(t.code,{children:"default_keyspace"})]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Collection Name"}),(0,n.jsx)(t.td,{children:"String"}),(0,n.jsx)(t.td,{children:"Input parameter. The name of the Astra DB collection to query."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Token"}),(0,n.jsx)(t.td,{children:"SecretString"}),(0,n.jsx)(t.td,{children:"Input parameter. The authentication token for accessing Astra DB."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"API Endpoint"}),(0,n.jsx)(t.td,{children:"String"}),(0,n.jsx)(t.td,{children:"Input parameter. The Astra DB API endpoint."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Projection Fields"}),(0,n.jsx)(t.td,{children:"String"}),(0,n.jsxs)(t.td,{children:["Input parameter. Comma-separated list of attributes to return from matching documents. The default is the default projection, ",(0,n.jsx)(t.code,{children:"*"}),", which returns all attributes except reserved fields like ",(0,n.jsx)(t.code,{children:"$vector"}),"."]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Tool Parameters"}),(0,n.jsx)(t.td,{children:"Dict"}),(0,n.jsxs)(t.td,{children:["Input parameter. ",(0,n.jsxs)(t.a,{href:"https://docs.datastax.com/en/astra-db-serverless/api-reference/document-methods/find-many.html#parameters",children:["Astra DB Data API ",(0,n.jsx)(t.code,{children:"find"})," filters"]})," that become tools for an agent. These Filters ",(0,n.jsx)(t.em,{children:"may"})," be used in a search, if the agent selects them. See ",(0,n.jsx)(t.a,{href:"#define-tool-specific-parameters",children:"Define tool-specific parameters"}),"."]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Static Filters"}),(0,n.jsx)(t.td,{children:"Dict"}),(0,n.jsxs)(t.td,{children:["Input parameter. Attribute-value pairs used to filter query results. Equivalent to ",(0,n.jsxs)(t.a,{href:"https://docs.datastax.com/en/astra-db-serverless/api-reference/document-methods/find-many.html#parameters",children:["Astra DB Data API ",(0,n.jsx)(t.code,{children:"find"})," filters"]}),". ",(0,n.jsx)(t.strong,{children:"Static Filters"})," are included with ",(0,n.jsx)(t.em,{children:"every"})," query. Use ",(0,n.jsx)(t.strong,{children:"Static Filters"})," without semantic search to perform a regular filter search."]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Number of Results"}),(0,n.jsx)(t.td,{children:"Int"}),(0,n.jsx)(t.td,{children:"Input parameter. The maximum number of documents to return."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Semantic Search"}),(0,n.jsx)(t.td,{children:"Boolean"}),(0,n.jsxs)(t.td,{children:["Input parameter. Whether to run a similarity search by generating a vector embedding from the chat input and following the ",(0,n.jsx)(t.strong,{children:"Semantic Search Instruction"}),". Default: false. If true, you must attach an ",(0,n.jsxs)(t.a,{href:"/components-embedding-models",children:[(0,n.jsx)(t.strong,{children:"Embedding Model"})," component"]})," or have vectorize pre-enabled on your collection."]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Use Astra DB Vectorize"}),(0,n.jsx)(t.td,{children:"Boolean"}),(0,n.jsx)(t.td,{children:"Input parameter. Whether to use the Astra DB vectorize feature for embedding generation when running a semantic search. Default: false. If true, you must have vectorize pre-enabled on your collection."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Embedding Model"}),(0,n.jsx)(t.td,{children:"Embedding"}),(0,n.jsxs)(t.td,{children:["Input parameter. A port to attach an ",(0,n.jsx)(t.strong,{children:"Embedding Model"})," component to generate a vector from input text for semantic search. This can be used when ",(0,n.jsx)(t.strong,{children:"Semantic Search"})," is true, with or without vectorize. Be sure to use a model that aligns with the dimensions of the embeddings already present in the collection."]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Semantic Search Instruction"}),(0,n.jsx)(t.td,{children:"String"}),(0,n.jsxs)(t.td,{children:["Input parameter. The query to use for similarity search. Default: ",(0,n.jsx)(t.code,{children:'"Find documents similar to the query."'}),". This instruction is used to guide the model in performing semantic search."]})]})]})]}),"\n",(0,n.jsx)(t.h3,{id:"define-tool-specific-parameters",children:"Define tool-specific parameters"}),"\n",(0,n.jsxs)(t.admonition,{type:"tip",children:[(0,n.jsxs)(t.p,{children:[(0,n.jsx)(t.strong,{children:"Tool Parameters"})," are small functions that you create within the ",(0,n.jsx)(t.strong,{children:"Astra DB Tool"})," component.\nThey give the LLM pre-defined ways to interact with the data in your collection."]}),(0,n.jsx)(t.p,{children:"Without these filters, the LLM has no concept of the data in your collection or which attributes are important."}),(0,n.jsx)(t.p,{children:"At runtime, the LLM can decide which filters are relevant to the current query."}),(0,n.jsxs)(t.p,{children:["Filters in ",(0,n.jsx)(t.strong,{children:"Tool Parameters"})," aren't always applied.\nIf you want to enforce filters for ",(0,n.jsx)(t.em,{children:"every"})," query, use the ",(0,n.jsx)(t.strong,{children:"Static Filters"})," parameter.\nYou can use both ",(0,n.jsx)(t.strong,{children:"Tool Parameters"})," and ",(0,n.jsx)(t.strong,{children:"Static Filters"})," to set some required filters and some optional filters."]})]}),"\n",(0,n.jsxs)(t.p,{children:["In the ",(0,n.jsx)(t.strong,{children:"Astra DB Tool"})," component's ",(0,n.jsx)(t.strong,{children:"Tool Parameters"})," field, you can create filters to query documents in your collection."]}),"\n",(0,n.jsxs)(t.p,{children:["When used in ",(0,n.jsx)(t.strong,{children:"Tool Mode"})," with an agent, these filters tell the agent which document attributes are most important, which are required in searches, and which operators to use on certain attributes.\nThe filters become available as parameters that the LLM can use when calling the tool, with a better understanding of each parameter provided by the ",(0,n.jsx)(t.strong,{children:"Description"})," field."]}),"\n",(0,n.jsxs)(t.p,{children:["In the ",(0,n.jsx)(t.strong,{children:"Tool Parameters"})," pane, click ",(0,n.jsx)(i.A,{name:"Plus","aria-hidden":"true"})," ",(0,n.jsx)(t.strong,{children:"Add a new row"}),", and then edit each cell in the row.\nFor example, the following filter allows an LLM to filter by unique ",(0,n.jsx)(t.code,{children:"customer_id"})," values:"]}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsxs)(t.li,{children:["Name: ",(0,n.jsx)(t.code,{children:"customer_id"})]}),"\n",(0,n.jsx)(t.li,{children:"Attribute Name: Leave empty if the attribute matches the field name in the database."}),"\n",(0,n.jsxs)(t.li,{children:["Description: ",(0,n.jsx)(t.code,{children:'"The unique identifier of the customer to filter by"'}),"."]}),"\n",(0,n.jsxs)(t.li,{children:["Is Metadata: Select ",(0,n.jsx)(t.strong,{children:"False"})," unless the value is stored in the metadata field."]}),"\n",(0,n.jsxs)(t.li,{children:["Is Mandatory: Set to ",(0,n.jsx)(t.strong,{children:"True"})," to make the filter required."]}),"\n",(0,n.jsxs)(t.li,{children:["Is Timestamp: For this example, select ",(0,n.jsx)(t.strong,{children:"False"})," because the value is an ID, not a timestamp."]}),"\n",(0,n.jsxs)(t.li,{children:["Operator: ",(0,n.jsx)(t.code,{children:"$eq"})," to look for an exact match."]}),"\n"]}),"\n",(0,n.jsxs)(t.p,{children:["The following fields are available for each row in the ",(0,n.jsx)(t.strong,{children:"Tool Parameters"})," pane:"]}),"\n",(0,n.jsxs)(t.table,{children:[(0,n.jsx)(t.thead,{children:(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.th,{children:"Parameter"}),(0,n.jsx)(t.th,{children:"Description"})]})}),(0,n.jsxs)(t.tbody,{children:[(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Name"}),(0,n.jsx)(t.td,{children:"The name of the parameter that is exposed to the LLM. It can be the same as the underlying field name or a more descriptive label. The LLM uses this name, along with the description, to infer what value to provide during execution."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Attribute Name"}),(0,n.jsxs)(t.td,{children:["When the parameter name shown to the LLM differs from the actual field or property in the database, use this setting to map the user-facing name to the correct attribute. For example, to apply a range filter to the timestamp field, define two separate parameters, such as ",(0,n.jsx)(t.code,{children:"start_date"})," and ",(0,n.jsx)(t.code,{children:"end_date"}),", that both reference the same timestamp attribute."]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Description"}),(0,n.jsxs)(t.td,{children:["Provides instructions to the LLM on how the parameter should be used. Clear and specific guidance helps the LLM provide valid input. For example, if a field such as ",(0,n.jsx)(t.code,{children:"specialty"})," is stored in lowercase, the description should indicate that the input must be lowercase."]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Is Metadata"}),(0,n.jsxs)(t.td,{children:["When loading data using LangChain or Langflow, additional attributes may be stored under a metadata object. If the target attribute is stored this way, enable this option. It adjusts the query by generating a filter in the format: ",(0,n.jsx)(t.code,{children:'{"metadata.": ""}'})]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Is Timestamp"}),(0,n.jsx)(t.td,{children:"For date or time-based filters, enable this option to automatically convert values to the timestamp format that the Astrapy client expects. This ensures compatibility with the underlying API without requiring manual formatting."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"Operator"}),(0,n.jsxs)(t.td,{children:["Defines the filtering logic applied to the attribute. You can use any valid ",(0,n.jsx)(t.a,{href:"https://docs.datastax.com/en/astra-db-serverless/api-reference/filter-operator-collections.html",children:"Data API filter operator"}),". For example, to filter a time range on the timestamp attribute, use two parameters: one with the ",(0,n.jsx)(t.code,{children:"$gt"}),' operator for "greater than", and another with the ',(0,n.jsx)(t.code,{children:"$lt"}),' operator for "less than".']})]})]})]}),"\n",(0,n.jsx)(t.h2,{id:"cassandra-chat-memory",children:"Cassandra Chat Memory"}),"\n",(0,n.jsxs)(t.p,{children:["The ",(0,n.jsx)(t.strong,{children:"Cassandra Chat Memory"})," component retrieves and stores chat messages using an Apache Cassandra-based database, including Astra DB and Hyper-Converged Database (HCD)."]}),"\n",(0,n.jsxs)(t.p,{children:["Chat memories are passed between memory storage components as the ",(0,n.jsx)(t.a,{href:"/data-types#memory",children:(0,n.jsx)(t.code,{children:"Memory"})})," data type.\nSpecifically, the component creates an instance of ",(0,n.jsx)(t.code,{children:"CassandraChatMessageHistory"}),", which is a LangChain chat message history class that uses a Cassandra database for storage."]}),"\n",(0,n.jsxs)(t.p,{children:["For more information about using external chat memory in flows, see the ",(0,n.jsxs)(t.a,{href:"/components-helpers#message-history",children:[(0,n.jsx)(t.strong,{children:"Message History"})," component"]}),"."]}),"\n",(0,n.jsx)(t.h3,{id:"cassandra-chat-memory-parameters",children:"Cassandra Chat Memory parameters"}),"\n",(0,n.jsxs)(t.p,{children:["Some component input parameters are hidden by default in the visual editor.\nYou can toggle parameters through the ",(0,n.jsx)(i.A,{name:"SlidersHorizontal","aria-hidden":"true"})," ",(0,n.jsx)(t.strong,{children:"Controls"})," in the ",(0,n.jsx)(t.a,{href:"/concepts-components#component-menus",children:"component's header menu"}),"."]}),"\n",(0,n.jsxs)(t.table,{children:[(0,n.jsx)(t.thead,{children:(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.th,{children:"Name"}),(0,n.jsx)(t.th,{children:"Type"}),(0,n.jsx)(t.th,{children:"Description"})]})}),(0,n.jsxs)(t.tbody,{children:[(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"database_ref"}),(0,n.jsx)(t.td,{children:"MessageText"}),(0,n.jsx)(t.td,{children:"Input parameter. The contact points for the Cassandra database or Astra DB database ID. Required."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"username"}),(0,n.jsx)(t.td,{children:"MessageText"}),(0,n.jsx)(t.td,{children:"Input parameter. The username for Cassandra. Leave empty for Astra DB."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"token"}),(0,n.jsx)(t.td,{children:"SecretString"}),(0,n.jsx)(t.td,{children:"Input parameter. The password for Cassandra or the token for Astra DB. Required."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"keyspace"}),(0,n.jsx)(t.td,{children:"MessageText"}),(0,n.jsx)(t.td,{children:"Input parameter. The keyspace in Cassandra or namespace in Astra DB. Required."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"table_name"}),(0,n.jsx)(t.td,{children:"MessageText"}),(0,n.jsx)(t.td,{children:"Input parameter. The name of the table or collection for storing messages. Required."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"session_id"}),(0,n.jsx)(t.td,{children:"MessageText"}),(0,n.jsx)(t.td,{children:"Input parameter. The unique identifier for the chat session. Optional."})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"cluster_kwargs"}),(0,n.jsx)(t.td,{children:"Dictionary"}),(0,n.jsx)(t.td,{children:"Input parameter. Additional keyword arguments for the Cassandra cluster configuration. Optional."})]})]})]}),"\n",(0,n.jsx)(t.h2,{id:"datastax-assistant-components",children:"DataStax assistant components"}),"\n",(0,n.jsx)(t.p,{children:"The following DataStax components are used to create and manage Assistants API functions in a flow:"}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsx)(t.li,{children:(0,n.jsx)(t.strong,{children:"Astra Assistant Agent"})}),"\n",(0,n.jsx)(t.li,{children:(0,n.jsx)(t.strong,{children:"Create Assistant"})}),"\n",(0,n.jsx)(t.li,{children:(0,n.jsx)(t.strong,{children:"Create Assistant Thread"})}),"\n",(0,n.jsx)(t.li,{children:(0,n.jsx)(t.strong,{children:"Get Assistant Name"})}),"\n",(0,n.jsx)(t.li,{children:(0,n.jsx)(t.strong,{children:"List Assistants"})}),"\n",(0,n.jsx)(t.li,{children:(0,n.jsx)(t.strong,{children:"Run Assistant"})}),"\n"]}),"\n",(0,n.jsx)(t.h2,{id:"datastax-environment-variable-components",children:"DataStax environment variable components"}),"\n",(0,n.jsx)(t.p,{children:"The following DataStax components are used to load and retrieve environment variables in a flow:"}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsx)(t.li,{children:(0,n.jsx)(t.strong,{children:"Dotenv"})}),"\n",(0,n.jsx)(t.li,{children:(0,n.jsx)(t.strong,{children:"Get Environment Variable"})}),"\n"]}),"\n",(0,n.jsx)(t.h2,{id:"legacy-datastax-components",children:"Legacy DataStax components"}),"\n",(0,n.jsx)(t.p,{children:"The following components are considered legacy or deprecated.\nThese components are no longer being developed and can be removed in future releases."}),"\n",(0,n.jsx)(t.p,{children:"Replace them with the suggested alternatives as soon as possible."}),"\n",(0,n.jsxs)(s,{children:[(0,n.jsx)("summary",{children:"Astra DB Vectorize"}),(0,n.jsxs)(t.p,{children:["This component was deprecated in Langflow version 1.1.2.\nReplace it with the ",(0,n.jsxs)(t.a,{href:"/components-vector-stores#astra-db",children:[(0,n.jsx)(t.strong,{children:"Astra DB"})," vector store component"]})," as soon as possible."]}),(0,n.jsxs)(t.p,{children:["The ",(0,n.jsx)(t.strong,{children:"Astra DB Vectorize"})," component was used to generate embeddings with Astra DB's vectorize feature in conjunction with an ",(0,n.jsx)(t.strong,{children:"Astra DB"})," vector store component."]}),(0,n.jsxs)(t.p,{children:["The vectorize functionality is now built into the ",(0,n.jsx)(t.strong,{children:"Astra DB"})," vector store component.\nYou no longer need a separate component for vectorize embedding generation."]})]})]})}function m(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(h,{...e})}):h(e)}},17886:(e,t,r)=>{r.d(t,{A:()=>a});r(96540);var s=r(64058),n=r(74848);function a({name:e,...t}){const r=s[e];return r?(0,n.jsx)(r,{...t}):null}},68335:(e,t,r)=>{r.d(t,{A:()=>s});const s=r.p+"assets/images/component-astra-db-json-tool-117aff566c0df01a555264bb128b3693.png"}}]); \ No newline at end of file diff --git a/assets/js/runtime~main.c7e61c3e.js b/assets/js/runtime~main.f2ef26c2.js similarity index 97% rename from assets/js/runtime~main.c7e61c3e.js rename to assets/js/runtime~main.f2ef26c2.js index dcd453579e..4e935f5ec6 100644 --- a/assets/js/runtime~main.c7e61c3e.js +++ b/assets/js/runtime~main.f2ef26c2.js @@ -1 +1 @@ -(()=>{"use strict";var e,f,a,d,c,b={},t={};function r(e){var f=t[e];if(void 0!==f)return f.exports;var a=t[e]={id:e,loaded:!1,exports:{}};return b[e].call(a.exports,a,a.exports,r),a.loaded=!0,a.exports}r.m=b,r.c=t,e=[],r.O=(f,a,d,c)=>{if(!a){var b=1/0;for(i=0;i=c)&&Object.keys(r.O).every(e=>r.O[e](a[o]))?a.splice(o--,1):(t=!1,c0&&e[i-1][2]>c;i--)e[i]=e[i-1];e[i]=[a,d,c]},r.n=e=>{var f=e&&e.__esModule?()=>e.default:()=>e;return r.d(f,{a:f}),f},a=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,r.t=function(e,d){if(1&d&&(e=this(e)),8&d)return e;if("object"==typeof e&&e){if(4&d&&e.__esModule)return e;if(16&d&&"function"==typeof e.then)return e}var c=Object.create(null);r.r(c);var b={};f=f||[null,a({}),a([]),a(a)];for(var t=2&d&&e;"object"==typeof t&&!~f.indexOf(t);t=a(t))Object.getOwnPropertyNames(t).forEach(f=>b[f]=()=>e[f]);return b.default=()=>e,r.d(c,b),c},r.d=(e,f)=>{for(var a in f)r.o(f,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:f[a]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((f,a)=>(r.f[a](e,f),f),[])),r.u=e=>"assets/js/"+({11:"d2df9b4e",15:"d803fa53",31:"03e862ce",38:"a99a45c9",78:"b768a3a5",118:"650a6085",126:"ae70dfbf",129:"dfa3dc90",188:"7f7a8893",191:"c643a6d5",230:"bc63ae25",253:"bb45d4f9",299:"9b5a408c",351:"b9acb8d9",368:"07c30ae4",375:"3d81f1cf",417:"93e16042",548:"37f47bc1",598:"db4f3bbd",606:"1d59d55f",692:"393c45a3",743:"e0f2017c",750:"33b5ee95",768:"6d684b63",785:"5f59ded8",787:"672a0eba",800:"a4c0ff01",824:"5015646b",879:"8bee5443",957:"c141421f",964:"05d835b4",1006:"47e58a89",1022:"1f19c1a1",1035:"24d32e91",1068:"f4c28b6b",1162:"f7e6b9d6",1185:"c2de64b8",1193:"444a6da6",1303:"41d45d82",1308:"ec030ab7",1361:"ff296c8d",1399:"16ceb5d2",1408:"2fc7e024",1426:"220d55f5",1488:"ac3cc3f5",1490:"0f761898",1500:"1e9025f7",1515:"2c05a87f",1556:"264ffc80",1567:"22dd74f7",1625:"92852ade",1628:"07e388ca",1690:"41a97a99",1845:"2ab0d4f5",1895:"d375ca1d",1956:"fe6f9601",2073:"7b7db446",2089:"ad06d5f0",2100:"9cc9f218",2138:"1a4e3797",2272:"ca5faf5d",2273:"e756fa26",2307:"8bd4a540",2323:"b9f9404d",2348:"f2da9399",2360:"017d425f",2423:"19bcb67f",2457:"46abd5bb",2469:"cd086441",2475:"1ab69cbd",2495:"f735f5f3",2551:"394022bb",2565:"622fd833",2624:"5aaddd60",2642:"ad13630c",2651:"8cd0650d",2777:"b3ba68b4",2818:"a9b73094",3094:"46d346a5",3147:"4e56251d",3164:"67f2dc6c",3225:"99a4401d",3240:"b079b393",3247:"f0b67137",3263:"730da84e",3274:"564a0250",3347:"b5257597",3361:"8f633f11",3468:"c76bd485",3549:"6d20d6ec",3576:"64045095",3694:"c2b1730c",3795:"c85076de",3832:"c3d82421",3859:"7679ca6e",3934:"e190040d",3953:"238e6167",4036:"fbcfc90d",4085:"cb17b4e0",4218:"d5bb0e16",4223:"f01590dc",4314:"f6a246db",4341:"e1a0f423",4384:"622bdc6f",4573:"baacc2a1",4614:"e55b8e98",4645:"fef056e9",4656:"b37620f5",4778:"e189eece",4784:"438e4337",4841:"8298c1cb",4867:"d73246f8",4876:"44691977",4891:"ca67d85f",4907:"86116998",4954:"a71efd4a",5107:"10156854",5110:"e9fe1d10",5138:"309383dc",5144:"944c5f91",5179:"41e3c105",5200:"ff7f32ba",5281:"a0511a5b",5284:"64ca91f1",5339:"9447891f",5352:"e627b1b2",5412:"a6d50436",5467:"40d13080",5474:"d175aa8b",5482:"9895db20",5513:"20d49d07",5514:"02955c09",5628:"bd7ab245",5657:"e82d58ff",5673:"73af8c33",5716:"946d1cee",5739:"69079906",5742:"aba21aa0",5757:"ad42ff54",5761:"7f193c41",5772:"4e7126f8",5799:"364e949f",5838:"bbb8ec1d",5865:"e1766139",5866:"3b577cbb",5883:"61cfab8e",5894:"f178e9b3",6003:"4d983c8e",6006:"7819cc1c",6010:"60c70af6",6053:"dfc50084",6063:"464a5f06",6080:"4d15791b",6108:"2fed9fb3",6214:"b1220dbd",6224:"ef9aa223",6281:"c96ce3ed",6311:"cce672fb",6330:"5d73b2d0",6332:"873508e7",6350:"188ee668",6419:"96eb0e67",6445:"9fb9a766",6473:"4c5e977b",6559:"6f13807a",6608:"391afd3f",6649:"02e43f39",6682:"5a6d6120",6688:"388c3769",6753:"ff349d2f",6757:"86bd0a2e",6801:"acefda8b",6855:"0d8750f2",6920:"c817e236",6934:"d745f4e6",6949:"b36bb719",7098:"a7bd4aaa",7108:"688feaef",7142:"d0c1f670",7165:"547df4a1",7253:"709203b3",7257:"8321259f",7324:"ab072087",7339:"7a774ddf",7356:"2ea623f2",7414:"7a88e433",7472:"744aaf8b",7507:"651ef245",7512:"4c09a7b3",7713:"3a82b27e",7774:"8e9a8774",7800:"f48363a4",7807:"1a8a0a64",7824:"2b56b65e",7841:"0132780e",7859:"593d9d00",7894:"0f44198a",7902:"619c7267",7968:"9b0af131",8064:"274fd934",8069:"e267ad05",8082:"08d5c80a",8085:"cc44357e",8102:"019dbd1f",8184:"222029a9",8188:"ecd67556",8196:"75a9e1e0",8208:"216e3ed7",8268:"a4b6c971",8298:"153f2b62",8304:"73d1a090",8323:"b109d082",8374:"261f8123",8392:"20177945",8401:"17896441",8483:"a84e1c02",8504:"e6c6a4d2",8571:"da1ad91e",8593:"56350599",8607:"681e5335",8641:"8a61012d",8649:"7de42fc9",8667:"4bc8c03c",8679:"3705a9c0",8702:"42962acd",8750:"8a484c94",8790:"bfca1e36",8963:"56c23a02",8978:"aeae39fc",8990:"5f1a63c6",9033:"9f55b2fc",9036:"850d3674",9048:"a94703ab",9099:"b1bc5ffe",9126:"169603ea",9213:"62d1268c",9227:"7e40e6b3",9264:"c7f32161",9315:"16faf8bf",9331:"ffcd190c",9363:"f3312674",9371:"991799c5",9431:"cd8dccb5",9459:"97254d1d",9476:"57c9a2b8",9479:"4e038a6a",9483:"7823fa72",9509:"49311ca0",9555:"dedd5914",9592:"e24b341f",9610:"453ae64a",9619:"29b8e27a",9640:"3b25a2ae",9647:"5e95c892",9648:"e3230154",9705:"ee3b5967",9712:"d8c8efb9",9731:"52edee88",9751:"25255263",9752:"72d61395",9781:"b796be74",9839:"54980a8a",9857:"09f5326a",9888:"be76515e",9897:"f0eeb72e",9905:"43df3697",9976:"230d5fdc",9986:"d1f3cfe5"}[e]||e)+"."+{11:"d5ff4a36",15:"de4e342e",31:"78b50a4c",38:"a852dec5",78:"4574df70",118:"79568170",126:"cb14c9cb",129:"7127ec5b",188:"7c73e87e",191:"06742bab",230:"89c910c4",253:"88866337",299:"7f27e9b0",351:"7d92181c",368:"52ece150",375:"3139e828",416:"3c613765",417:"8f2aad0f",548:"0c5a2ccd",598:"0aa82d65",606:"1d972c5c",692:"a88f2240",743:"fbeb6a8b",750:"15800d8b",768:"9cf95467",785:"ddbc79b6",787:"61de6127",800:"3590ed9d",824:"3dbc4b4b",879:"11221aaa",957:"da9e1d2b",964:"2c95f308",1006:"60c6ebd1",1022:"a3a1b6a9",1035:"537b6cad",1068:"1aa07666",1162:"846917f8",1185:"d3dd3b47",1193:"fe9ec445",1303:"5a4c1534",1308:"788cb4bd",1361:"829ab8ba",1399:"018fc91b",1408:"4a9c7470",1426:"83c9e864",1488:"feb8009a",1490:"b32793df",1500:"939bd059",1515:"0452f57f",1556:"dab86421",1567:"d1c29daf",1625:"14cdddbe",1628:"aa9d9dc2",1690:"233f9ea1",1845:"932761f6",1895:"5ee6b671",1956:"bad0948c",2073:"908ae64e",2089:"fc5c42cb",2100:"7620fbc7",2138:"f62f93d0",2237:"8bc4ac99",2272:"ee9648c5",2273:"869d0cd0",2307:"1111abcf",2323:"076495eb",2348:"0a8e65d8",2360:"72c911f5",2423:"8b04bffc",2457:"27675ca8",2469:"960c2e83",2475:"14b3e131",2495:"82190a3e",2551:"8d428f35",2565:"9772c05d",2624:"260a6367",2642:"93efaedc",2651:"6337b7d2",2777:"ea4ac225",2818:"749ec2f7",3094:"cf5052ec",3147:"625c5c7c",3164:"c41fea74",3225:"5d5c6c59",3240:"5a8d148c",3247:"2df6cb53",3263:"5c11b90a",3274:"91369ce9",3347:"0cb92093",3361:"a08cd1a6",3468:"261e627c",3477:"a7eba177",3549:"cc0ea13d",3576:"7effeb6f",3694:"e49ae4f2",3795:"8922e3a4",3832:"188494ba",3859:"fe9642bf",3934:"60d1fa30",3953:"166f30e1",4036:"b12cb74d",4085:"8800737e",4218:"6999489d",4223:"7eb36a75",4314:"499c51f9",4341:"c2d39d8a",4384:"e786f853",4573:"e7ddc6f8",4614:"df33c9e2",4645:"90f165b9",4656:"28b34199",4754:"5b9f9c4a",4778:"05c0a98c",4784:"50569749",4841:"59d02440",4867:"2b2ad468",4876:"0577edc0",4891:"390a6e31",4907:"55c92890",4954:"2783d86b",5107:"815ec989",5110:"e0d499d5",5138:"9eabd8c1",5144:"34cdb9e6",5179:"218a0f52",5200:"ac2c7408",5281:"f7dbe404",5284:"70b0fd8d",5339:"625a4df3",5352:"9fcb9075",5412:"bc61f482",5467:"15021cf2",5474:"fefcc336",5482:"f26fbe46",5513:"589a75b8",5514:"2253cbd9",5628:"577f580a",5657:"1237f227",5673:"1b4d72ab",5716:"0263ef7b",5739:"fc012235",5742:"60b1d5b2",5757:"efbc375f",5761:"0846ef5d",5772:"3e9c54c0",5799:"af1e8ee8",5838:"5766cfc9",5865:"3e108d34",5866:"656169e0",5883:"ce124431",5894:"8bd35b39",6003:"88b5ae24",6006:"4fbc21ff",6010:"0548b1ac",6053:"f0ef4b60",6063:"11a344d5",6080:"ee762398",6108:"fe18abd0",6214:"bddc61db",6224:"f8d8d85f",6281:"7b4c11aa",6311:"57c7829d",6330:"c1cc298a",6332:"80b65183",6350:"b5266339",6419:"3a113e81",6445:"01501475",6473:"b5e32ff9",6559:"61c3b369",6608:"963a3f2b",6649:"8c08c095",6682:"553b82ee",6688:"94eedc0d",6753:"21cd6866",6757:"b5693997",6801:"04870418",6855:"ae79082f",6920:"e6592c1b",6934:"80a34a76",6949:"f53658de",7098:"fc1f6434",7108:"f3483d74",7142:"36655dba",7165:"8960ad8b",7253:"7c36c923",7257:"13c9c8f5",7324:"38ca3a01",7339:"1c2df3a0",7356:"d381c765",7397:"385da999",7414:"eab03115",7472:"0b0a5a2d",7507:"26567835",7512:"e8c30b47",7713:"8936c8d8",7774:"8abc7031",7800:"04f79cf2",7807:"6de21041",7824:"c88c4b56",7841:"f18fc120",7859:"a94b7977",7894:"da9118e9",7902:"e75cc5aa",7968:"c9a8f1d4",8064:"f87e91fe",8069:"1b71e9ca",8082:"d5616cb6",8085:"a52f9777",8102:"880b800f",8158:"20de8b80",8184:"2cfa1e91",8188:"e9ecdb7d",8196:"2d4fce49",8208:"d167542f",8268:"5bfb5097",8298:"b27a6e24",8304:"e7ec2758",8323:"2ba7e517",8374:"94a69c0f",8392:"c5c5bc37",8401:"23c55f2d",8483:"3534b6c7",8504:"daf51668",8571:"7ba5573d",8593:"2c78f81a",8607:"097e3679",8641:"20035178",8649:"f40201c4",8667:"aa64adbd",8679:"17fe083a",8702:"a7523d67",8750:"ac2a10e3",8790:"6089c12e",8913:"47209f3b",8963:"bfa09799",8978:"87dbf693",8990:"55e64b78",9033:"61d4719f",9036:"4511c466",9048:"bdc69ee3",9099:"52569916",9126:"49ea8054",9148:"2b76b49f",9213:"255d7637",9227:"1f2c6944",9264:"f2a5ff70",9315:"0e58f6cd",9331:"17f4fc3c",9363:"9fe9d801",9371:"0c49b9ff",9431:"49b50a59",9459:"2ac13b55",9476:"85415d9a",9479:"8f7257f5",9483:"7fb4c888",9495:"49162ef8",9509:"ff091211",9555:"fa95ab3d",9592:"66f5442d",9610:"5b9bae34",9619:"61531ad1",9640:"8d5d1da2",9647:"5cb928a1",9648:"0ec9668a",9705:"46865692",9712:"48987fcd",9731:"f1bacc22",9751:"38357c8c",9752:"61c90f27",9781:"207b4d64",9839:"228637e3",9857:"33e763ea",9888:"4b26dfe8",9897:"da7686fd",9905:"b9989c34",9976:"59155fa1",9986:"9b2b9b3e"}[e]+".js",r.miniCssF=e=>{},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,f)=>Object.prototype.hasOwnProperty.call(e,f),d={},c="langflow-docs:",r.l=(e,f,a,b)=>{if(d[e])d[e].push(f);else{var t,o;if(void 0!==a)for(var n=document.getElementsByTagName("script"),i=0;i{t.onerror=t.onload=null,clearTimeout(s);var c=d[e];if(delete d[e],t.parentNode&&t.parentNode.removeChild(t),c&&c.forEach(e=>e(a)),f)return f(a)},s=setTimeout(u.bind(null,void 0,{type:"timeout",target:t}),12e4);t.onerror=u.bind(null,t.onerror),t.onload=u.bind(null,t.onload),o&&document.head.appendChild(t)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r.p="/",r.gca=function(e){return e={10156854:"5107",17896441:"8401",20177945:"8392",25255263:"9751",44691977:"4876",56350599:"8593",64045095:"3576",69079906:"5739",86116998:"4907",d2df9b4e:"11",d803fa53:"15","03e862ce":"31",a99a45c9:"38",b768a3a5:"78","650a6085":"118",ae70dfbf:"126",dfa3dc90:"129","7f7a8893":"188",c643a6d5:"191",bc63ae25:"230",bb45d4f9:"253","9b5a408c":"299",b9acb8d9:"351","07c30ae4":"368","3d81f1cf":"375","93e16042":"417","37f47bc1":"548",db4f3bbd:"598","1d59d55f":"606","393c45a3":"692",e0f2017c:"743","33b5ee95":"750","6d684b63":"768","5f59ded8":"785","672a0eba":"787",a4c0ff01:"800","5015646b":"824","8bee5443":"879",c141421f:"957","05d835b4":"964","47e58a89":"1006","1f19c1a1":"1022","24d32e91":"1035",f4c28b6b:"1068",f7e6b9d6:"1162",c2de64b8:"1185","444a6da6":"1193","41d45d82":"1303",ec030ab7:"1308",ff296c8d:"1361","16ceb5d2":"1399","2fc7e024":"1408","220d55f5":"1426",ac3cc3f5:"1488","0f761898":"1490","1e9025f7":"1500","2c05a87f":"1515","264ffc80":"1556","22dd74f7":"1567","92852ade":"1625","07e388ca":"1628","41a97a99":"1690","2ab0d4f5":"1845",d375ca1d:"1895",fe6f9601:"1956","7b7db446":"2073",ad06d5f0:"2089","9cc9f218":"2100","1a4e3797":"2138",ca5faf5d:"2272",e756fa26:"2273","8bd4a540":"2307",b9f9404d:"2323",f2da9399:"2348","017d425f":"2360","19bcb67f":"2423","46abd5bb":"2457",cd086441:"2469","1ab69cbd":"2475",f735f5f3:"2495","394022bb":"2551","622fd833":"2565","5aaddd60":"2624",ad13630c:"2642","8cd0650d":"2651",b3ba68b4:"2777",a9b73094:"2818","46d346a5":"3094","4e56251d":"3147","67f2dc6c":"3164","99a4401d":"3225",b079b393:"3240",f0b67137:"3247","730da84e":"3263","564a0250":"3274",b5257597:"3347","8f633f11":"3361",c76bd485:"3468","6d20d6ec":"3549",c2b1730c:"3694",c85076de:"3795",c3d82421:"3832","7679ca6e":"3859",e190040d:"3934","238e6167":"3953",fbcfc90d:"4036",cb17b4e0:"4085",d5bb0e16:"4218",f01590dc:"4223",f6a246db:"4314",e1a0f423:"4341","622bdc6f":"4384",baacc2a1:"4573",e55b8e98:"4614",fef056e9:"4645",b37620f5:"4656",e189eece:"4778","438e4337":"4784","8298c1cb":"4841",d73246f8:"4867",ca67d85f:"4891",a71efd4a:"4954",e9fe1d10:"5110","309383dc":"5138","944c5f91":"5144","41e3c105":"5179",ff7f32ba:"5200",a0511a5b:"5281","64ca91f1":"5284","9447891f":"5339",e627b1b2:"5352",a6d50436:"5412","40d13080":"5467",d175aa8b:"5474","9895db20":"5482","20d49d07":"5513","02955c09":"5514",bd7ab245:"5628",e82d58ff:"5657","73af8c33":"5673","946d1cee":"5716",aba21aa0:"5742",ad42ff54:"5757","7f193c41":"5761","4e7126f8":"5772","364e949f":"5799",bbb8ec1d:"5838",e1766139:"5865","3b577cbb":"5866","61cfab8e":"5883",f178e9b3:"5894","4d983c8e":"6003","7819cc1c":"6006","60c70af6":"6010",dfc50084:"6053","464a5f06":"6063","4d15791b":"6080","2fed9fb3":"6108",b1220dbd:"6214",ef9aa223:"6224",c96ce3ed:"6281",cce672fb:"6311","5d73b2d0":"6330","873508e7":"6332","188ee668":"6350","96eb0e67":"6419","9fb9a766":"6445","4c5e977b":"6473","6f13807a":"6559","391afd3f":"6608","02e43f39":"6649","5a6d6120":"6682","388c3769":"6688",ff349d2f:"6753","86bd0a2e":"6757",acefda8b:"6801","0d8750f2":"6855",c817e236:"6920",d745f4e6:"6934",b36bb719:"6949",a7bd4aaa:"7098","688feaef":"7108",d0c1f670:"7142","547df4a1":"7165","709203b3":"7253","8321259f":"7257",ab072087:"7324","7a774ddf":"7339","2ea623f2":"7356","7a88e433":"7414","744aaf8b":"7472","651ef245":"7507","4c09a7b3":"7512","3a82b27e":"7713","8e9a8774":"7774",f48363a4:"7800","1a8a0a64":"7807","2b56b65e":"7824","0132780e":"7841","593d9d00":"7859","0f44198a":"7894","619c7267":"7902","9b0af131":"7968","274fd934":"8064",e267ad05:"8069","08d5c80a":"8082",cc44357e:"8085","019dbd1f":"8102","222029a9":"8184",ecd67556:"8188","75a9e1e0":"8196","216e3ed7":"8208",a4b6c971:"8268","153f2b62":"8298","73d1a090":"8304",b109d082:"8323","261f8123":"8374",a84e1c02:"8483",e6c6a4d2:"8504",da1ad91e:"8571","681e5335":"8607","8a61012d":"8641","7de42fc9":"8649","4bc8c03c":"8667","3705a9c0":"8679","42962acd":"8702","8a484c94":"8750",bfca1e36:"8790","56c23a02":"8963",aeae39fc:"8978","5f1a63c6":"8990","9f55b2fc":"9033","850d3674":"9036",a94703ab:"9048",b1bc5ffe:"9099","169603ea":"9126","62d1268c":"9213","7e40e6b3":"9227",c7f32161:"9264","16faf8bf":"9315",ffcd190c:"9331",f3312674:"9363","991799c5":"9371",cd8dccb5:"9431","97254d1d":"9459","57c9a2b8":"9476","4e038a6a":"9479","7823fa72":"9483","49311ca0":"9509",dedd5914:"9555",e24b341f:"9592","453ae64a":"9610","29b8e27a":"9619","3b25a2ae":"9640","5e95c892":"9647",e3230154:"9648",ee3b5967:"9705",d8c8efb9:"9712","52edee88":"9731","72d61395":"9752",b796be74:"9781","54980a8a":"9839","09f5326a":"9857",be76515e:"9888",f0eeb72e:"9897","43df3697":"9905","230d5fdc":"9976",d1f3cfe5:"9986"}[e]||e,r.p+r.u(e)},(()=>{var e={5354:0,1869:0};r.f.j=(f,a)=>{var d=r.o(e,f)?e[f]:void 0;if(0!==d)if(d)a.push(d[2]);else if(/^(1869|5354)$/.test(f))e[f]=0;else{var c=new Promise((a,c)=>d=e[f]=[a,c]);a.push(d[2]=c);var b=r.p+r.u(f),t=new Error;r.l(b,a=>{if(r.o(e,f)&&(0!==(d=e[f])&&(e[f]=void 0),d)){var c=a&&("load"===a.type?"missing":a.type),b=a&&a.target&&a.target.src;t.message="Loading chunk "+f+" failed.\n("+c+": "+b+")",t.name="ChunkLoadError",t.type=c,t.request=b,d[1](t)}},"chunk-"+f,f)}},r.O.j=f=>0===e[f];var f=(f,a)=>{var d,c,b=a[0],t=a[1],o=a[2],n=0;if(b.some(f=>0!==e[f])){for(d in t)r.o(t,d)&&(r.m[d]=t[d]);if(o)var i=o(r)}for(f&&f(a);n{"use strict";var e,f,a,d,c,b={},t={};function r(e){var f=t[e];if(void 0!==f)return f.exports;var a=t[e]={id:e,loaded:!1,exports:{}};return b[e].call(a.exports,a,a.exports,r),a.loaded=!0,a.exports}r.m=b,r.c=t,e=[],r.O=(f,a,d,c)=>{if(!a){var b=1/0;for(i=0;i=c)&&Object.keys(r.O).every(e=>r.O[e](a[o]))?a.splice(o--,1):(t=!1,c0&&e[i-1][2]>c;i--)e[i]=e[i-1];e[i]=[a,d,c]},r.n=e=>{var f=e&&e.__esModule?()=>e.default:()=>e;return r.d(f,{a:f}),f},a=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,r.t=function(e,d){if(1&d&&(e=this(e)),8&d)return e;if("object"==typeof e&&e){if(4&d&&e.__esModule)return e;if(16&d&&"function"==typeof e.then)return e}var c=Object.create(null);r.r(c);var b={};f=f||[null,a({}),a([]),a(a)];for(var t=2&d&&e;"object"==typeof t&&!~f.indexOf(t);t=a(t))Object.getOwnPropertyNames(t).forEach(f=>b[f]=()=>e[f]);return b.default=()=>e,r.d(c,b),c},r.d=(e,f)=>{for(var a in f)r.o(f,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:f[a]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((f,a)=>(r.f[a](e,f),f),[])),r.u=e=>"assets/js/"+({11:"d2df9b4e",15:"d803fa53",31:"03e862ce",38:"a99a45c9",78:"b768a3a5",118:"650a6085",126:"ae70dfbf",129:"dfa3dc90",188:"7f7a8893",191:"c643a6d5",230:"bc63ae25",253:"bb45d4f9",299:"9b5a408c",351:"b9acb8d9",368:"07c30ae4",375:"3d81f1cf",417:"93e16042",548:"37f47bc1",598:"db4f3bbd",606:"1d59d55f",692:"393c45a3",743:"e0f2017c",750:"33b5ee95",768:"6d684b63",785:"5f59ded8",787:"672a0eba",800:"a4c0ff01",824:"5015646b",879:"8bee5443",957:"c141421f",964:"05d835b4",1006:"47e58a89",1022:"1f19c1a1",1035:"24d32e91",1068:"f4c28b6b",1162:"f7e6b9d6",1185:"c2de64b8",1193:"444a6da6",1303:"41d45d82",1308:"ec030ab7",1361:"ff296c8d",1399:"16ceb5d2",1408:"2fc7e024",1426:"220d55f5",1488:"ac3cc3f5",1490:"0f761898",1500:"1e9025f7",1515:"2c05a87f",1556:"264ffc80",1567:"22dd74f7",1625:"92852ade",1628:"07e388ca",1690:"41a97a99",1845:"2ab0d4f5",1895:"d375ca1d",1956:"fe6f9601",2073:"7b7db446",2089:"ad06d5f0",2100:"9cc9f218",2138:"1a4e3797",2272:"ca5faf5d",2273:"e756fa26",2307:"8bd4a540",2323:"b9f9404d",2348:"f2da9399",2360:"017d425f",2423:"19bcb67f",2457:"46abd5bb",2469:"cd086441",2475:"1ab69cbd",2495:"f735f5f3",2551:"394022bb",2565:"622fd833",2624:"5aaddd60",2642:"ad13630c",2651:"8cd0650d",2777:"b3ba68b4",2818:"a9b73094",3094:"46d346a5",3147:"4e56251d",3164:"67f2dc6c",3225:"99a4401d",3240:"b079b393",3247:"f0b67137",3263:"730da84e",3274:"564a0250",3347:"b5257597",3361:"8f633f11",3468:"c76bd485",3549:"6d20d6ec",3576:"64045095",3694:"c2b1730c",3795:"c85076de",3832:"c3d82421",3859:"7679ca6e",3934:"e190040d",3953:"238e6167",4036:"fbcfc90d",4085:"cb17b4e0",4218:"d5bb0e16",4223:"f01590dc",4314:"f6a246db",4341:"e1a0f423",4384:"622bdc6f",4573:"baacc2a1",4614:"e55b8e98",4645:"fef056e9",4656:"b37620f5",4778:"e189eece",4784:"438e4337",4841:"8298c1cb",4867:"d73246f8",4876:"44691977",4891:"ca67d85f",4907:"86116998",4954:"a71efd4a",5107:"10156854",5110:"e9fe1d10",5138:"309383dc",5144:"944c5f91",5179:"41e3c105",5200:"ff7f32ba",5281:"a0511a5b",5284:"64ca91f1",5339:"9447891f",5352:"e627b1b2",5412:"a6d50436",5467:"40d13080",5474:"d175aa8b",5482:"9895db20",5513:"20d49d07",5514:"02955c09",5628:"bd7ab245",5657:"e82d58ff",5673:"73af8c33",5716:"946d1cee",5739:"69079906",5742:"aba21aa0",5757:"ad42ff54",5761:"7f193c41",5772:"4e7126f8",5799:"364e949f",5838:"bbb8ec1d",5865:"e1766139",5866:"3b577cbb",5883:"61cfab8e",5894:"f178e9b3",6003:"4d983c8e",6006:"7819cc1c",6010:"60c70af6",6053:"dfc50084",6063:"464a5f06",6080:"4d15791b",6108:"2fed9fb3",6214:"b1220dbd",6224:"ef9aa223",6281:"c96ce3ed",6311:"cce672fb",6330:"5d73b2d0",6332:"873508e7",6350:"188ee668",6419:"96eb0e67",6445:"9fb9a766",6473:"4c5e977b",6559:"6f13807a",6608:"391afd3f",6649:"02e43f39",6682:"5a6d6120",6688:"388c3769",6753:"ff349d2f",6757:"86bd0a2e",6801:"acefda8b",6855:"0d8750f2",6920:"c817e236",6934:"d745f4e6",6949:"b36bb719",7098:"a7bd4aaa",7108:"688feaef",7142:"d0c1f670",7165:"547df4a1",7253:"709203b3",7257:"8321259f",7324:"ab072087",7339:"7a774ddf",7356:"2ea623f2",7414:"7a88e433",7472:"744aaf8b",7507:"651ef245",7512:"4c09a7b3",7713:"3a82b27e",7774:"8e9a8774",7800:"f48363a4",7807:"1a8a0a64",7824:"2b56b65e",7841:"0132780e",7859:"593d9d00",7894:"0f44198a",7902:"619c7267",7968:"9b0af131",8064:"274fd934",8069:"e267ad05",8082:"08d5c80a",8085:"cc44357e",8102:"019dbd1f",8184:"222029a9",8188:"ecd67556",8196:"75a9e1e0",8208:"216e3ed7",8268:"a4b6c971",8298:"153f2b62",8304:"73d1a090",8323:"b109d082",8374:"261f8123",8392:"20177945",8401:"17896441",8483:"a84e1c02",8504:"e6c6a4d2",8571:"da1ad91e",8593:"56350599",8607:"681e5335",8641:"8a61012d",8649:"7de42fc9",8667:"4bc8c03c",8679:"3705a9c0",8702:"42962acd",8750:"8a484c94",8790:"bfca1e36",8963:"56c23a02",8978:"aeae39fc",8990:"5f1a63c6",9033:"9f55b2fc",9036:"850d3674",9048:"a94703ab",9099:"b1bc5ffe",9126:"169603ea",9213:"62d1268c",9227:"7e40e6b3",9264:"c7f32161",9315:"16faf8bf",9331:"ffcd190c",9363:"f3312674",9371:"991799c5",9431:"cd8dccb5",9459:"97254d1d",9476:"57c9a2b8",9479:"4e038a6a",9483:"7823fa72",9509:"49311ca0",9555:"dedd5914",9592:"e24b341f",9610:"453ae64a",9619:"29b8e27a",9640:"3b25a2ae",9647:"5e95c892",9648:"e3230154",9705:"ee3b5967",9712:"d8c8efb9",9731:"52edee88",9751:"25255263",9752:"72d61395",9781:"b796be74",9839:"54980a8a",9857:"09f5326a",9888:"be76515e",9897:"f0eeb72e",9905:"43df3697",9976:"230d5fdc",9986:"d1f3cfe5"}[e]||e)+"."+{11:"d5ff4a36",15:"de4e342e",31:"78b50a4c",38:"a852dec5",78:"4574df70",118:"79568170",126:"cb14c9cb",129:"7127ec5b",188:"7c73e87e",191:"06742bab",230:"89c910c4",253:"88866337",299:"7f27e9b0",351:"7d92181c",368:"52ece150",375:"3139e828",416:"3c613765",417:"8f2aad0f",548:"0c5a2ccd",598:"0aa82d65",606:"1d972c5c",692:"a88f2240",743:"fbeb6a8b",750:"15800d8b",768:"9cf95467",785:"ddbc79b6",787:"61de6127",800:"3590ed9d",824:"61eb2fc0",879:"11221aaa",957:"da9e1d2b",964:"2c95f308",1006:"48978cd6",1022:"a3a1b6a9",1035:"537b6cad",1068:"1aa07666",1162:"846917f8",1185:"d3dd3b47",1193:"fe9ec445",1303:"5a4c1534",1308:"788cb4bd",1361:"829ab8ba",1399:"018fc91b",1408:"4a9c7470",1426:"83c9e864",1488:"feb8009a",1490:"b32793df",1500:"939bd059",1515:"0452f57f",1556:"dab86421",1567:"d1c29daf",1625:"14cdddbe",1628:"aa9d9dc2",1690:"233f9ea1",1845:"7d26814a",1895:"5ee6b671",1956:"bad0948c",2073:"908ae64e",2089:"fc5c42cb",2100:"7620fbc7",2138:"f62f93d0",2237:"8bc4ac99",2272:"ee9648c5",2273:"869d0cd0",2307:"1111abcf",2323:"076495eb",2348:"0a8e65d8",2360:"8f8d01b2",2423:"8b04bffc",2457:"27675ca8",2469:"960c2e83",2475:"14b3e131",2495:"82190a3e",2551:"8d428f35",2565:"9772c05d",2624:"260a6367",2642:"93efaedc",2651:"6337b7d2",2777:"ea4ac225",2818:"749ec2f7",3094:"cf5052ec",3147:"625c5c7c",3164:"c41fea74",3225:"5d5c6c59",3240:"5a8d148c",3247:"2df6cb53",3263:"5c11b90a",3274:"91369ce9",3347:"0cb92093",3361:"a08cd1a6",3468:"261e627c",3477:"a7eba177",3549:"cc0ea13d",3576:"7effeb6f",3694:"e49ae4f2",3795:"8922e3a4",3832:"188494ba",3859:"fe9642bf",3934:"60d1fa30",3953:"166f30e1",4036:"b12cb74d",4085:"8800737e",4218:"6999489d",4223:"7eb36a75",4314:"499c51f9",4341:"c2d39d8a",4384:"e786f853",4573:"e7ddc6f8",4614:"df33c9e2",4645:"90f165b9",4656:"28b34199",4754:"5b9f9c4a",4778:"05c0a98c",4784:"50569749",4841:"59d02440",4867:"2b2ad468",4876:"0577edc0",4891:"390a6e31",4907:"55c92890",4954:"2783d86b",5107:"815ec989",5110:"e0d499d5",5138:"9eabd8c1",5144:"34cdb9e6",5179:"218a0f52",5200:"ac2c7408",5281:"f7dbe404",5284:"70b0fd8d",5339:"625a4df3",5352:"9fcb9075",5412:"bc61f482",5467:"15021cf2",5474:"fefcc336",5482:"f26fbe46",5513:"589a75b8",5514:"2253cbd9",5628:"577f580a",5657:"1237f227",5673:"1b4d72ab",5716:"0263ef7b",5739:"fc012235",5742:"60b1d5b2",5757:"efbc375f",5761:"0846ef5d",5772:"3e9c54c0",5799:"af1e8ee8",5838:"5766cfc9",5865:"3e108d34",5866:"656169e0",5883:"ce124431",5894:"8bd35b39",6003:"88b5ae24",6006:"4fbc21ff",6010:"0548b1ac",6053:"f0ef4b60",6063:"11a344d5",6080:"ee762398",6108:"fe18abd0",6214:"bddc61db",6224:"6a6d3be5",6281:"7b4c11aa",6311:"57c7829d",6330:"c1cc298a",6332:"80b65183",6350:"b5266339",6419:"3a113e81",6445:"01501475",6473:"b5e32ff9",6559:"61c3b369",6608:"963a3f2b",6649:"8c08c095",6682:"553b82ee",6688:"94eedc0d",6753:"21cd6866",6757:"b5693997",6801:"04870418",6855:"ae79082f",6920:"e6592c1b",6934:"80a34a76",6949:"f53658de",7098:"fc1f6434",7108:"f3483d74",7142:"36655dba",7165:"8960ad8b",7253:"7c36c923",7257:"13c9c8f5",7324:"38ca3a01",7339:"1c2df3a0",7356:"d381c765",7397:"385da999",7414:"eab03115",7472:"0b0a5a2d",7507:"26567835",7512:"e8c30b47",7713:"8936c8d8",7774:"8abc7031",7800:"04f79cf2",7807:"6de21041",7824:"c88c4b56",7841:"4cf7ec16",7859:"a94b7977",7894:"da9118e9",7902:"e75cc5aa",7968:"c9a8f1d4",8064:"f87e91fe",8069:"1b71e9ca",8082:"d5616cb6",8085:"a52f9777",8102:"880b800f",8158:"20de8b80",8184:"2cfa1e91",8188:"e9ecdb7d",8196:"2d4fce49",8208:"d167542f",8268:"5bfb5097",8298:"b27a6e24",8304:"e7ec2758",8323:"2ba7e517",8374:"94a69c0f",8392:"c5c5bc37",8401:"23c55f2d",8483:"3534b6c7",8504:"83ee7202",8571:"7ba5573d",8593:"2c78f81a",8607:"097e3679",8641:"20035178",8649:"f40201c4",8667:"aa64adbd",8679:"17fe083a",8702:"a7523d67",8750:"ac2a10e3",8790:"6089c12e",8913:"47209f3b",8963:"bfa09799",8978:"87dbf693",8990:"55e64b78",9033:"61d4719f",9036:"4511c466",9048:"bdc69ee3",9099:"52569916",9126:"49ea8054",9148:"2b76b49f",9213:"255d7637",9227:"1f2c6944",9264:"f2a5ff70",9315:"0e58f6cd",9331:"17f4fc3c",9363:"9fe9d801",9371:"0c49b9ff",9431:"49b50a59",9459:"2ac13b55",9476:"85415d9a",9479:"8f7257f5",9483:"7fb4c888",9495:"49162ef8",9509:"ff091211",9555:"fa95ab3d",9592:"66f5442d",9610:"5b9bae34",9619:"61531ad1",9640:"8d5d1da2",9647:"5cb928a1",9648:"0ec9668a",9705:"46865692",9712:"48987fcd",9731:"f1bacc22",9751:"38357c8c",9752:"61c90f27",9781:"207b4d64",9839:"228637e3",9857:"33e763ea",9888:"4b26dfe8",9897:"da7686fd",9905:"b9989c34",9976:"59155fa1",9986:"9b2b9b3e"}[e]+".js",r.miniCssF=e=>{},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,f)=>Object.prototype.hasOwnProperty.call(e,f),d={},c="langflow-docs:",r.l=(e,f,a,b)=>{if(d[e])d[e].push(f);else{var t,o;if(void 0!==a)for(var n=document.getElementsByTagName("script"),i=0;i{t.onerror=t.onload=null,clearTimeout(s);var c=d[e];if(delete d[e],t.parentNode&&t.parentNode.removeChild(t),c&&c.forEach(e=>e(a)),f)return f(a)},s=setTimeout(u.bind(null,void 0,{type:"timeout",target:t}),12e4);t.onerror=u.bind(null,t.onerror),t.onload=u.bind(null,t.onload),o&&document.head.appendChild(t)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r.p="/",r.gca=function(e){return e={10156854:"5107",17896441:"8401",20177945:"8392",25255263:"9751",44691977:"4876",56350599:"8593",64045095:"3576",69079906:"5739",86116998:"4907",d2df9b4e:"11",d803fa53:"15","03e862ce":"31",a99a45c9:"38",b768a3a5:"78","650a6085":"118",ae70dfbf:"126",dfa3dc90:"129","7f7a8893":"188",c643a6d5:"191",bc63ae25:"230",bb45d4f9:"253","9b5a408c":"299",b9acb8d9:"351","07c30ae4":"368","3d81f1cf":"375","93e16042":"417","37f47bc1":"548",db4f3bbd:"598","1d59d55f":"606","393c45a3":"692",e0f2017c:"743","33b5ee95":"750","6d684b63":"768","5f59ded8":"785","672a0eba":"787",a4c0ff01:"800","5015646b":"824","8bee5443":"879",c141421f:"957","05d835b4":"964","47e58a89":"1006","1f19c1a1":"1022","24d32e91":"1035",f4c28b6b:"1068",f7e6b9d6:"1162",c2de64b8:"1185","444a6da6":"1193","41d45d82":"1303",ec030ab7:"1308",ff296c8d:"1361","16ceb5d2":"1399","2fc7e024":"1408","220d55f5":"1426",ac3cc3f5:"1488","0f761898":"1490","1e9025f7":"1500","2c05a87f":"1515","264ffc80":"1556","22dd74f7":"1567","92852ade":"1625","07e388ca":"1628","41a97a99":"1690","2ab0d4f5":"1845",d375ca1d:"1895",fe6f9601:"1956","7b7db446":"2073",ad06d5f0:"2089","9cc9f218":"2100","1a4e3797":"2138",ca5faf5d:"2272",e756fa26:"2273","8bd4a540":"2307",b9f9404d:"2323",f2da9399:"2348","017d425f":"2360","19bcb67f":"2423","46abd5bb":"2457",cd086441:"2469","1ab69cbd":"2475",f735f5f3:"2495","394022bb":"2551","622fd833":"2565","5aaddd60":"2624",ad13630c:"2642","8cd0650d":"2651",b3ba68b4:"2777",a9b73094:"2818","46d346a5":"3094","4e56251d":"3147","67f2dc6c":"3164","99a4401d":"3225",b079b393:"3240",f0b67137:"3247","730da84e":"3263","564a0250":"3274",b5257597:"3347","8f633f11":"3361",c76bd485:"3468","6d20d6ec":"3549",c2b1730c:"3694",c85076de:"3795",c3d82421:"3832","7679ca6e":"3859",e190040d:"3934","238e6167":"3953",fbcfc90d:"4036",cb17b4e0:"4085",d5bb0e16:"4218",f01590dc:"4223",f6a246db:"4314",e1a0f423:"4341","622bdc6f":"4384",baacc2a1:"4573",e55b8e98:"4614",fef056e9:"4645",b37620f5:"4656",e189eece:"4778","438e4337":"4784","8298c1cb":"4841",d73246f8:"4867",ca67d85f:"4891",a71efd4a:"4954",e9fe1d10:"5110","309383dc":"5138","944c5f91":"5144","41e3c105":"5179",ff7f32ba:"5200",a0511a5b:"5281","64ca91f1":"5284","9447891f":"5339",e627b1b2:"5352",a6d50436:"5412","40d13080":"5467",d175aa8b:"5474","9895db20":"5482","20d49d07":"5513","02955c09":"5514",bd7ab245:"5628",e82d58ff:"5657","73af8c33":"5673","946d1cee":"5716",aba21aa0:"5742",ad42ff54:"5757","7f193c41":"5761","4e7126f8":"5772","364e949f":"5799",bbb8ec1d:"5838",e1766139:"5865","3b577cbb":"5866","61cfab8e":"5883",f178e9b3:"5894","4d983c8e":"6003","7819cc1c":"6006","60c70af6":"6010",dfc50084:"6053","464a5f06":"6063","4d15791b":"6080","2fed9fb3":"6108",b1220dbd:"6214",ef9aa223:"6224",c96ce3ed:"6281",cce672fb:"6311","5d73b2d0":"6330","873508e7":"6332","188ee668":"6350","96eb0e67":"6419","9fb9a766":"6445","4c5e977b":"6473","6f13807a":"6559","391afd3f":"6608","02e43f39":"6649","5a6d6120":"6682","388c3769":"6688",ff349d2f:"6753","86bd0a2e":"6757",acefda8b:"6801","0d8750f2":"6855",c817e236:"6920",d745f4e6:"6934",b36bb719:"6949",a7bd4aaa:"7098","688feaef":"7108",d0c1f670:"7142","547df4a1":"7165","709203b3":"7253","8321259f":"7257",ab072087:"7324","7a774ddf":"7339","2ea623f2":"7356","7a88e433":"7414","744aaf8b":"7472","651ef245":"7507","4c09a7b3":"7512","3a82b27e":"7713","8e9a8774":"7774",f48363a4:"7800","1a8a0a64":"7807","2b56b65e":"7824","0132780e":"7841","593d9d00":"7859","0f44198a":"7894","619c7267":"7902","9b0af131":"7968","274fd934":"8064",e267ad05:"8069","08d5c80a":"8082",cc44357e:"8085","019dbd1f":"8102","222029a9":"8184",ecd67556:"8188","75a9e1e0":"8196","216e3ed7":"8208",a4b6c971:"8268","153f2b62":"8298","73d1a090":"8304",b109d082:"8323","261f8123":"8374",a84e1c02:"8483",e6c6a4d2:"8504",da1ad91e:"8571","681e5335":"8607","8a61012d":"8641","7de42fc9":"8649","4bc8c03c":"8667","3705a9c0":"8679","42962acd":"8702","8a484c94":"8750",bfca1e36:"8790","56c23a02":"8963",aeae39fc:"8978","5f1a63c6":"8990","9f55b2fc":"9033","850d3674":"9036",a94703ab:"9048",b1bc5ffe:"9099","169603ea":"9126","62d1268c":"9213","7e40e6b3":"9227",c7f32161:"9264","16faf8bf":"9315",ffcd190c:"9331",f3312674:"9363","991799c5":"9371",cd8dccb5:"9431","97254d1d":"9459","57c9a2b8":"9476","4e038a6a":"9479","7823fa72":"9483","49311ca0":"9509",dedd5914:"9555",e24b341f:"9592","453ae64a":"9610","29b8e27a":"9619","3b25a2ae":"9640","5e95c892":"9647",e3230154:"9648",ee3b5967:"9705",d8c8efb9:"9712","52edee88":"9731","72d61395":"9752",b796be74:"9781","54980a8a":"9839","09f5326a":"9857",be76515e:"9888",f0eeb72e:"9897","43df3697":"9905","230d5fdc":"9976",d1f3cfe5:"9986"}[e]||e,r.p+r.u(e)},(()=>{var e={5354:0,1869:0};r.f.j=(f,a)=>{var d=r.o(e,f)?e[f]:void 0;if(0!==d)if(d)a.push(d[2]);else if(/^(1869|5354)$/.test(f))e[f]=0;else{var c=new Promise((a,c)=>d=e[f]=[a,c]);a.push(d[2]=c);var b=r.p+r.u(f),t=new Error;r.l(b,a=>{if(r.o(e,f)&&(0!==(d=e[f])&&(e[f]=void 0),d)){var c=a&&("load"===a.type?"missing":a.type),b=a&&a.target&&a.target.src;t.message="Loading chunk "+f+" failed.\n("+c+": "+b+")",t.name="ChunkLoadError",t.type=c,t.request=b,d[1](t)}},"chunk-"+f,f)}},r.O.j=f=>0===e[f];var f=(f,a)=>{var d,c,b=a[0],t=a[1],o=a[2],n=0;if(b.some(f=>0!==e[f])){for(d in t)r.o(t,d)&&(r.m[d]=t[d]);if(o)var i=o(r)}for(f&&f(a);n - + diff --git a/bundles-amazon.html b/bundles-amazon.html index 4bed695d8a..8d895bcd94 100644 --- a/bundles-amazon.html +++ b/bundles-amazon.html @@ -23,7 +23,7 @@ - + diff --git a/bundles-anthropic.html b/bundles-anthropic.html index 9db2931ecb..caa7a4ad6b 100644 --- a/bundles-anthropic.html +++ b/bundles-anthropic.html @@ -23,7 +23,7 @@ - + diff --git a/bundles-arxiv.html b/bundles-arxiv.html index 80ef13fdf7..8eb6270708 100644 --- a/bundles-arxiv.html +++ b/bundles-arxiv.html @@ -23,7 +23,7 @@ - + diff --git a/bundles-azure.html b/bundles-azure.html index 05f03a502a..d863a394bf 100644 --- a/bundles-azure.html +++ b/bundles-azure.html @@ -23,7 +23,7 @@ - + diff --git a/bundles-baidu.html b/bundles-baidu.html index 2c639569bf..c9ca259c80 100644 --- a/bundles-baidu.html +++ b/bundles-baidu.html @@ -23,7 +23,7 @@ - + diff --git a/bundles-bing.html b/bundles-bing.html index 92f764a167..1b41a64275 100644 --- a/bundles-bing.html +++ b/bundles-bing.html @@ -23,7 +23,7 @@ - + diff --git a/bundles-cloudflare.html b/bundles-cloudflare.html index d98e02c731..9006561644 100644 --- a/bundles-cloudflare.html +++ b/bundles-cloudflare.html @@ -23,7 +23,7 @@ - + diff --git a/bundles-cohere.html b/bundles-cohere.html index e288a1c141..b7c06713ed 100644 --- a/bundles-cohere.html +++ b/bundles-cohere.html @@ -23,7 +23,7 @@ - + diff --git a/bundles-datastax.html b/bundles-datastax.html index 8112b39f1a..a68f7f95f6 100644 --- a/bundles-datastax.html +++ b/bundles-datastax.html @@ -23,7 +23,7 @@ - + @@ -53,8 +53,8 @@

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.

-
important

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. +

important

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.

Astra DB Chat Memory parameters

diff --git a/bundles-deepseek.html b/bundles-deepseek.html index 1030cf2aa8..4935cb1f19 100644 --- a/bundles-deepseek.html +++ b/bundles-deepseek.html @@ -23,7 +23,7 @@ - + diff --git a/bundles-duckduckgo.html b/bundles-duckduckgo.html index cc8c65ed5d..578e524e16 100644 --- a/bundles-duckduckgo.html +++ b/bundles-duckduckgo.html @@ -23,7 +23,7 @@ - + diff --git a/bundles-exa.html b/bundles-exa.html index 99d2d80aff..0756975dfe 100644 --- a/bundles-exa.html +++ b/bundles-exa.html @@ -23,7 +23,7 @@ - + diff --git a/bundles-glean.html b/bundles-glean.html index 0575dbe427..509cfe7ef6 100644 --- a/bundles-glean.html +++ b/bundles-glean.html @@ -23,7 +23,7 @@ - + diff --git a/bundles-google.html b/bundles-google.html index 1675194eaf..d94216a4d6 100644 --- a/bundles-google.html +++ b/bundles-google.html @@ -23,7 +23,7 @@ - + diff --git a/bundles-groq.html b/bundles-groq.html index 28bb36bd60..626cf07d97 100644 --- a/bundles-groq.html +++ b/bundles-groq.html @@ -23,7 +23,7 @@ - + diff --git a/bundles-huggingface.html b/bundles-huggingface.html index 530da89eb1..bee1d1822c 100644 --- a/bundles-huggingface.html +++ b/bundles-huggingface.html @@ -23,7 +23,7 @@ - + diff --git a/bundles-ibm.html b/bundles-ibm.html index 11eff7d9b7..820caca5f4 100644 --- a/bundles-ibm.html +++ b/bundles-ibm.html @@ -23,7 +23,7 @@ - + diff --git a/bundles-icosacomputing.html b/bundles-icosacomputing.html index 8fc15ac4d4..65a8661406 100644 --- a/bundles-icosacomputing.html +++ b/bundles-icosacomputing.html @@ -23,7 +23,7 @@ - + diff --git a/bundles-langchain.html b/bundles-langchain.html index 2b86c0c710..fee4afaac1 100644 --- a/bundles-langchain.html +++ b/bundles-langchain.html @@ -23,7 +23,7 @@ - + diff --git a/bundles-lmstudio.html b/bundles-lmstudio.html index 76d4eb7d58..4975337212 100644 --- a/bundles-lmstudio.html +++ b/bundles-lmstudio.html @@ -23,7 +23,7 @@ - + diff --git a/bundles-maritalk.html b/bundles-maritalk.html index 1d3cc603e7..0987a0b542 100644 --- a/bundles-maritalk.html +++ b/bundles-maritalk.html @@ -23,7 +23,7 @@ - + diff --git a/bundles-mem0.html b/bundles-mem0.html index eeabbdddb3..7a470398c4 100644 --- a/bundles-mem0.html +++ b/bundles-mem0.html @@ -23,7 +23,7 @@ - + diff --git a/bundles-mistralai.html b/bundles-mistralai.html index 5bc3545953..35d8f70536 100644 --- a/bundles-mistralai.html +++ b/bundles-mistralai.html @@ -23,7 +23,7 @@ - + diff --git a/bundles-novita.html b/bundles-novita.html index c89e8235a9..855e259855 100644 --- a/bundles-novita.html +++ b/bundles-novita.html @@ -23,7 +23,7 @@ - + diff --git a/bundles-nvidia.html b/bundles-nvidia.html index 41c9b87408..62085df4b7 100644 --- a/bundles-nvidia.html +++ b/bundles-nvidia.html @@ -23,7 +23,7 @@ - + diff --git a/bundles-ollama.html b/bundles-ollama.html index ec2a2ccb49..849d9233c7 100644 --- a/bundles-ollama.html +++ b/bundles-ollama.html @@ -23,7 +23,7 @@ - + diff --git a/bundles-openai.html b/bundles-openai.html index 8f49191983..639a38d461 100644 --- a/bundles-openai.html +++ b/bundles-openai.html @@ -23,7 +23,7 @@ - + diff --git a/bundles-openrouter.html b/bundles-openrouter.html index d036e3bad3..62a013b341 100644 --- a/bundles-openrouter.html +++ b/bundles-openrouter.html @@ -23,7 +23,7 @@ - + diff --git a/bundles-perplexity.html b/bundles-perplexity.html index be4e21b63a..2d957d1334 100644 --- a/bundles-perplexity.html +++ b/bundles-perplexity.html @@ -23,7 +23,7 @@ - + diff --git a/bundles-redis.html b/bundles-redis.html index 85d38c846a..9b446f6612 100644 --- a/bundles-redis.html +++ b/bundles-redis.html @@ -23,7 +23,7 @@ - + diff --git a/bundles-sambanova.html b/bundles-sambanova.html index ac7664cc09..03c14a24be 100644 --- a/bundles-sambanova.html +++ b/bundles-sambanova.html @@ -23,7 +23,7 @@ - + diff --git a/bundles-searchapi.html b/bundles-searchapi.html index 7c4b7c6467..f1e299cc6a 100644 --- a/bundles-searchapi.html +++ b/bundles-searchapi.html @@ -23,7 +23,7 @@ - + diff --git a/bundles-vertexai.html b/bundles-vertexai.html index 6cfc6d77f6..04506940e0 100644 --- a/bundles-vertexai.html +++ b/bundles-vertexai.html @@ -23,7 +23,7 @@ - + diff --git a/bundles-wikipedia.html b/bundles-wikipedia.html index 065e154e62..ecd096f715 100644 --- a/bundles-wikipedia.html +++ b/bundles-wikipedia.html @@ -23,7 +23,7 @@ - + diff --git a/bundles-xai.html b/bundles-xai.html index e551c1b8ff..4990374bd5 100644 --- a/bundles-xai.html +++ b/bundles-xai.html @@ -23,7 +23,7 @@ - + diff --git a/chat-with-files.html b/chat-with-files.html index f3a79b37d8..469dc4d9d7 100644 --- a/chat-with-files.html +++ b/chat-with-files.html @@ -23,7 +23,7 @@ - + diff --git a/chat-with-rag.html b/chat-with-rag.html index 8359d3d261..d69b87fd8b 100644 --- a/chat-with-rag.html +++ b/chat-with-rag.html @@ -23,7 +23,7 @@ - + diff --git a/components-agents.html b/components-agents.html index 6219904c1d..c0f7e494ba 100644 --- a/components-agents.html +++ b/components-agents.html @@ -23,7 +23,7 @@ - + diff --git a/components-bundle-components.html b/components-bundle-components.html index 118876714f..5ffaca27a9 100644 --- a/components-bundle-components.html +++ b/components-bundle-components.html @@ -23,7 +23,7 @@ - + diff --git a/components-custom-components.html b/components-custom-components.html index 81fc416f63..c31fd3d830 100644 --- a/components-custom-components.html +++ b/components-custom-components.html @@ -23,7 +23,7 @@ - + diff --git a/components-data.html b/components-data.html index 427f98d664..d024a85713 100644 --- a/components-data.html +++ b/components-data.html @@ -23,7 +23,7 @@ - + diff --git a/components-embedding-models.html b/components-embedding-models.html index 3fd7da3a8f..7bf72dc860 100644 --- a/components-embedding-models.html +++ b/components-embedding-models.html @@ -23,7 +23,7 @@ - + diff --git a/components-helpers.html b/components-helpers.html index 0e4dcf46af..794c7bbfd0 100644 --- a/components-helpers.html +++ b/components-helpers.html @@ -23,7 +23,7 @@ - + @@ -63,8 +63,12 @@ It supports addition, subtraction, multiplication, division, and exponentiation

Message History

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.

-
important

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.

+
important

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:

    +
  • You need to store and retrieve chat memory for a language model component (not an agent).
  • +
  • You need to retrieve chat memories outside the chat context, such as a sentiment analysis flow that retrieves and analyzes recently stored memories.
  • +
  • You want to store memories in a specific database that is separate from Langflow storage.
  • +

For more information, see Store chat memory.

Use the Message History component in a flow

The Message History component has two modes, depending on where you want to use it in your flow:

    @@ -92,10 +96,10 @@ The template can include any text and variables that you want to supply to the L
  • 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 L

    Connect 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.

  • -