mirror of
https://github.com/langflow-ai/langflow.git
synced 2026-07-24 01:22:23 +08:00
135 lines
43 KiB
HTML
135 lines
43 KiB
HTML
<!doctype html>
|
||
<html lang="en" dir="ltr" class="docs-wrapper plugin-docs plugin-id-default docs-version-current docs-doc-page docs-doc-id-Components/components-helpers" data-has-hydrated="false">
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<meta name="generator" content="Docusaurus v3.7.0">
|
||
<title data-rh="true">Helpers | Langflow Documentation</title><meta data-rh="true" name="viewport" content="width=device-width,initial-scale=1"><meta data-rh="true" name="twitter:card" content="summary_large_image"><meta data-rh="true" property="og:url" content="https://docs.langflow.org/components-helpers"><meta data-rh="true" property="og:locale" content="en"><meta data-rh="true" name="docusaurus_locale" content="en"><meta data-rh="true" name="docsearch:language" content="en"><meta data-rh="true" name="docusaurus_version" content="current"><meta data-rh="true" name="docusaurus_tag" content="docs-default-current"><meta data-rh="true" name="docsearch:version" content="current"><meta data-rh="true" name="docsearch:docusaurus_tag" content="docs-default-current"><meta data-rh="true" property="og:title" content="Helpers | Langflow Documentation"><meta data-rh="true" name="description" content="Helper components provide utility functions to help manage data, tasks, and other components in your flow."><meta data-rh="true" property="og:description" content="Helper components provide utility functions to help manage data, tasks, and other components in your flow."><link data-rh="true" rel="icon" href="/img/favicon.ico"><link data-rh="true" rel="canonical" href="https://docs.langflow.org/components-helpers"><link data-rh="true" rel="alternate" href="https://docs.langflow.org/components-helpers" hreflang="en"><link data-rh="true" rel="alternate" href="https://docs.langflow.org/components-helpers" hreflang="x-default"><link data-rh="true" rel="preconnect" href="https://UZK6BDPCVY-dsn.algolia.net" crossorigin="anonymous"><link rel="preconnect" href="https://www.google-analytics.com">
|
||
<link rel="preconnect" href="https://www.googletagmanager.com">
|
||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XHC7G628ZP"></script>
|
||
<script>function gtag(){dataLayer.push(arguments)}window.dataLayer=window.dataLayer||[],gtag("js",new Date),gtag("config","G-XHC7G628ZP",{anonymize_ip:!0})</script>
|
||
<link rel="preconnect" href="https://www.googletagmanager.com">
|
||
<script>window.dataLayer=window.dataLayer||[]</script>
|
||
<script>!function(e,t,a,n){e[n]=e[n]||[],e[n].push({"gtm.start":(new Date).getTime(),event:"gtm.js"});var g=t.getElementsByTagName(a)[0],m=t.createElement(a);m.async=!0,m.src="https://www.googletagmanager.com/gtm.js?id=GTM-NK5M4ZT8",g.parentNode.insertBefore(m,g)}(window,document,"script","dataLayer")</script>
|
||
|
||
|
||
|
||
|
||
|
||
<link rel="search" type="application/opensearchdescription+xml" title="Langflow Documentation" href="/opensearch.xml">
|
||
|
||
|
||
|
||
|
||
|
||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Sora:wght@550;600&display=swap"><link rel="stylesheet" href="/assets/css/styles.b2eb940a.css">
|
||
<script src="/assets/js/runtime~main.7c47ee98.js" defer="defer"></script>
|
||
<script src="/assets/js/main.ec942a35.js" defer="defer"></script>
|
||
</head>
|
||
<body class="navigation-with-keyboard">
|
||
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-NK5M4ZT8" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
|
||
|
||
|
||
|
||
|
||
<script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){try{return new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}}()||function(){try{return window.localStorage.getItem("theme")}catch(t){}}();null!==e?t(e):window.matchMedia("(prefers-color-scheme: dark)").matches?t("dark"):(window.matchMedia("(prefers-color-scheme: light)").matches,t("light"))}(),function(){try{const c=new URLSearchParams(window.location.search).entries();for(var[t,e]of c)if(t.startsWith("docusaurus-data-")){var a=t.replace("docusaurus-data-","data-");document.documentElement.setAttribute(a,e)}}catch(t){}}()</script><div id="__docusaurus"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top navbarHideable_m1mJ"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" href="/"><div class="navbar__logo"><img src="/img/langflow-logo-black.svg" alt="Langflow" class="themedComponent_mlkZ themedComponent--light_NVdE"><img src="/img/langflow-logo-white.svg" alt="Langflow" class="themedComponent_mlkZ themedComponent--dark_xIcU"></div></a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/langflow-ai/langflow" target="_blank" class="navbar__item navbar__link header-github-link"></a><a href="https://twitter.com/langflow_ai" target="_blank" class="navbar__item navbar__link header-twitter-link"></a><a href="https://discord.gg/EqksyE2EX9" target="_blank" class="navbar__item navbar__link header-discord-link"></a><div class="toggle_vylO colorModeToggle_DEke"><button class="clean-btn toggleButton_gllP toggleButtonDisabled_aARS" type="button" disabled="" title="Switch between dark and light mode (currently light mode)" aria-label="Switch between dark and light mode (currently light mode)" aria-live="polite" aria-pressed="false"><svg viewBox="0 0 24 24" width="24" height="24" class="lightToggleIcon_pyhR"><path fill="currentColor" d="M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"></path></svg><svg viewBox="0 0 24 24" width="24" height="24" class="darkToggleIcon_wfgR"><path fill="currentColor" d="M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"></path></svg></button></div><div class="navbarSearchContainer_Bca1"><button type="button" class="DocSearch DocSearch-Button" aria-label="Search (Command+K)"><span class="DocSearch-Button-Container"><svg width="20" height="20" class="DocSearch-Search-Icon" viewBox="0 0 20 20" aria-hidden="true"><path d="M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z" stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"></path></svg><span class="DocSearch-Button-Placeholder">Search</span></span><span class="DocSearch-Button-Keys"></span></button></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0"><div class="docsWrapper_hBAB"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docRoot_UBD9"><aside class="theme-doc-sidebar-container docSidebarContainer_YfHR"><div class="sidebarViewport_aRkj"><div class="sidebar_njMd sidebarWithHideableNavbar_wUlq"><a tabindex="-1" class="sidebarLogo_isFc" href="/"><img src="/img/langflow-logo-black.svg" alt="Langflow" class="themedComponent_mlkZ themedComponent--light_NVdE"><img src="/img/langflow-logo-white.svg" alt="Langflow" class="themedComponent_mlkZ themedComponent--dark_xIcU"></a><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/">Welcome to Langflow</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" href="/get-started-installation">Get started</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" href="/starter-projects-basic-prompting">Starter projects</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" href="/tutorials-blog-writer">Tutorials</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" href="/concepts-overview">Concepts</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret menu__link--active" role="button" aria-expanded="true" href="/components-agents">Components</a></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/components-agents">Agents</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/components-bundle-components">Bundles</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/components-custom-components">Create custom Python components</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/components-data">Data</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/components-embedding-models">Embeddings</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/components-helpers">Helpers</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/components-io">Inputs and outputs</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/components-loaders">Loaders</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/components-logic">Logic</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/components-memories">Memories</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/components-models">Models</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/components-processing">Processing</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/components-prompts">Prompts</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/components-tools">Tools</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/components-vector-stores">Vector stores</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" href="/agents-overview">Agents</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" href="/configuration-api-keys">Configuration</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" href="/develop-overview">Develop</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" href="/deployment-overview">Deployment</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" href="/api">API reference</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" href="/integrations-apify">Integrations</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" href="/contributing-community">Contributing</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a href="https://github.com/langflow-ai/langflow/releases/latest" target="_blank" rel="noopener noreferrer" class="menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false">Changelog</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" href="/luna-for-langflow">Support</a></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 sidebar-ad">
|
||
<a href="https://astra.datastax.com/signup?type=langflow" target="_blank" class="menu__link">
|
||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-cloud"><path d="M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z"/></svg>
|
||
<div class="sidebar-ad-text-container">
|
||
<span class="sidebar-ad-text">Use Langflow in the cloud</span>
|
||
<span class="sidebar-ad-text sidebar-ad-text-gradient">Sign up for DataStax Langflow</span>
|
||
</div>
|
||
</a>
|
||
</li></ul></nav></div></div></aside><main class="docMainContainer_TBSr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li class="breadcrumbs__item"><span class="breadcrumbs__link">Components</span><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Helpers</span><meta itemprop="position" content="2"></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><style>[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; }</style>
|
||
<header><h1>Helper components in Langflow</h1></header>
|
||
<p>Helper components provide utility functions to help manage data, tasks, and other components in your flow.</p>
|
||
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="use-a-helper-component-in-a-flow">Use a helper component in a flow<a href="#use-a-helper-component-in-a-flow" class="hash-link" aria-label="Direct link to Use a helper component in a flow" title="Direct link to Use a helper component in a flow"></a></h2>
|
||
<p>Chat memory in Langflow is stored either in local Langflow tables with <code>LCBufferMemory</code>, or connected to an external database.</p>
|
||
<p>The <strong>Store Message</strong> helper component stores chat memories as <a href="/concepts-objects">Data</a> objects, and the <strong>Message History</strong> helper component retrieves chat messages as data objects or strings.</p>
|
||
<p>This example flow stores and retrieves chat history from an <a href="/components-memories#astradbchatmemory-component">AstraDBChatMemory</a> component with <strong>Store Message</strong> and <strong>Chat Memory</strong> components.</p>
|
||
<p><img decoding="async" loading="lazy" alt="Sample Flow storing Chat Memory in AstraDB" src="/assets/images/astra_db_chat_memory_rounded-9746ca2bb69d3b07ac0a071f4b9471b3.png" width="3178" height="1228" class="img_ev3q"></p>
|
||
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="batch-run-component">Batch Run Component<a href="#batch-run-component" class="hash-link" aria-label="Direct link to Batch Run Component" title="Direct link to Batch Run Component"></a></h2>
|
||
<p>The Batch Run component runs a language model over each row of a <a href="/concepts-objects#dataframe-object">DataFrame</a> text column and returns a new DataFrame with the original text and the model's response.</p>
|
||
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="inputs">Inputs<a href="#inputs" class="hash-link" aria-label="Direct link to Inputs" title="Direct link to Inputs"></a></h3>
|
||
<table><thead><tr><th>Name</th><th>Display Name</th><th>Type</th><th>Info</th><th>Required</th></tr></thead><tbody><tr><td>model</td><td>Language Model</td><td>HandleInput</td><td>Connect the 'Language Model' output from your LLM component here.</td><td>Yes</td></tr><tr><td>system_message</td><td>System Message</td><td>MultilineInput</td><td>Multi-line system instruction for all rows in the DataFrame.</td><td>No</td></tr><tr><td>df</td><td>DataFrame</td><td>DataFrameInput</td><td>The DataFrame whose column (specified by 'column_name') will be treated as text messages.</td><td>Yes</td></tr><tr><td>column_name</td><td>Column Name</td><td>StrInput</td><td>The name of the DataFrame column to treat as text messages. Default='text'.</td><td>Yes</td></tr></tbody></table>
|
||
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="outputs">Outputs<a href="#outputs" class="hash-link" aria-label="Direct link to Outputs" title="Direct link to Outputs"></a></h3>
|
||
<table><thead><tr><th>Name</th><th>Display Name</th><th>Method</th><th>Info</th></tr></thead><tbody><tr><td>batch_results</td><td>Batch Results</td><td>run_batch</td><td>A DataFrame with two columns: 'text_input' and 'model_response'.</td></tr></tbody></table>
|
||
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="create-list">Create List<a href="#create-list" class="hash-link" aria-label="Direct link to Create List" title="Direct link to Create List"></a></h2>
|
||
<div class="theme-admonition theme-admonition-important admonition_xJq3 alert alert--info"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>important</div><div class="admonitionContent_BuS1"><p>This component is in <strong>Legacy</strong>, which means it is no longer in active development as of Langflow version 1.3.</p></div></div>
|
||
<p>This component dynamically creates a record with a specified number of fields.</p>
|
||
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="inputs-1">Inputs<a href="#inputs-1" class="hash-link" aria-label="Direct link to Inputs" title="Direct link to Inputs"></a></h3>
|
||
<table><thead><tr><th>Name</th><th>Display Name</th><th>Info</th></tr></thead><tbody><tr><td>n_fields</td><td>Number of Fields</td><td>Number of fields to be added to the record.</td></tr><tr><td>text_key</td><td>Text Key</td><td>Key used as text.</td></tr></tbody></table>
|
||
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="outputs-1">Outputs<a href="#outputs-1" class="hash-link" aria-label="Direct link to Outputs" title="Direct link to Outputs"></a></h3>
|
||
<table><thead><tr><th>Name</th><th>Display Name</th><th>Info</th></tr></thead><tbody><tr><td>list</td><td>List</td><td>The dynamically created list with the specified number of fields.</td></tr></tbody></table>
|
||
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="current-date">Current date<a href="#current-date" class="hash-link" aria-label="Direct link to Current date" title="Direct link to Current date"></a></h2>
|
||
<p>The 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.</p>
|
||
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="inputs-2">Inputs<a href="#inputs-2" class="hash-link" aria-label="Direct link to Inputs" title="Direct link to Inputs"></a></h3>
|
||
<table><thead><tr><th>Name</th><th>Display Name</th><th>Info</th></tr></thead><tbody><tr><td>timezone</td><td>Timezone</td><td>Select the timezone for the current date and time.</td></tr></tbody></table>
|
||
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="outputs-2">Outputs<a href="#outputs-2" class="hash-link" aria-label="Direct link to Outputs" title="Direct link to Outputs"></a></h3>
|
||
<table><thead><tr><th>Name</th><th>Display Name</th><th>Info</th></tr></thead><tbody><tr><td>current_date</td><td>Current Date</td><td>The resulting current date and time in the selected timezone.</td></tr></tbody></table>
|
||
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="id-generator">ID Generator<a href="#id-generator" class="hash-link" aria-label="Direct link to ID Generator" title="Direct link to ID Generator"></a></h2>
|
||
<p>This component generates a unique ID.</p>
|
||
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="inputs-3">Inputs<a href="#inputs-3" class="hash-link" aria-label="Direct link to Inputs" title="Direct link to Inputs"></a></h3>
|
||
<table><thead><tr><th>Name</th><th>Display Name</th><th>Info</th></tr></thead><tbody><tr><td>unique_id</td><td>Value</td><td>The generated unique ID.</td></tr></tbody></table>
|
||
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="outputs-3">Outputs<a href="#outputs-3" class="hash-link" aria-label="Direct link to Outputs" title="Direct link to Outputs"></a></h3>
|
||
<table><thead><tr><th>Name</th><th>Display Name</th><th>Info</th></tr></thead><tbody><tr><td>id</td><td>ID</td><td>The generated unique ID.</td></tr></tbody></table>
|
||
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="message-history">Message history<a href="#message-history" class="hash-link" aria-label="Direct link to Message history" title="Direct link to Message history"></a></h2>
|
||
<div class="theme-admonition theme-admonition-info admonition_xJq3 alert alert--info"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_BuS1"><p>Prior to Langflow 1.1, this component was known as the Chat Memory component.</p></div></div>
|
||
<p>This component retrieves and manages chat messages from Langflow tables or an external memory.</p>
|
||
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="inputs-4">Inputs<a href="#inputs-4" class="hash-link" aria-label="Direct link to Inputs" title="Direct link to Inputs"></a></h3>
|
||
<table><thead><tr><th>Name</th><th>Display Name</th><th>Info</th></tr></thead><tbody><tr><td>memory</td><td>External Memory</td><td>Retrieve messages from an external memory. If empty, it will use the Langflow tables.</td></tr><tr><td>sender</td><td>Sender Type</td><td>Filter by sender type.</td></tr><tr><td>sender_name</td><td>Sender Name</td><td>Filter by sender name.</td></tr><tr><td>n_messages</td><td>Number of Messages</td><td>Number of messages to retrieve.</td></tr><tr><td>session_id</td><td>Session ID</td><td>The session ID of the chat. If empty, the current session ID parameter will be used.</td></tr><tr><td>order</td><td>Order</td><td>Order of the messages.</td></tr><tr><td>template</td><td>Template</td><td>The template to use for formatting the data. It can contain the keys <code>{text}</code>, <code>{sender}</code> or any other key in the message data.</td></tr></tbody></table>
|
||
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="outputs-4">Outputs<a href="#outputs-4" class="hash-link" aria-label="Direct link to Outputs" title="Direct link to Outputs"></a></h3>
|
||
<table><thead><tr><th>Name</th><th>Display Name</th><th>Info</th></tr></thead><tbody><tr><td>messages</td><td>Messages (Data)</td><td>Retrieved messages as Data objects.</td></tr><tr><td>messages_text</td><td>Messages (Text)</td><td>Retrieved messages formatted as text.</td></tr><tr><td>lc_memory</td><td>Memory</td><td>A constructed Langchain <a href="https://api.python.langchain.com/en/latest/memory/langchain.memory.buffer.ConversationBufferMemory.html" target="_blank" rel="noopener noreferrer">ConversationBufferMemory</a> object</td></tr></tbody></table>
|
||
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="message-store">Message store<a href="#message-store" class="hash-link" aria-label="Direct link to Message store" title="Direct link to Message store"></a></h2>
|
||
<p>This component stores chat messages or text into Langflow tables or an external memory.</p>
|
||
<p>It provides flexibility in managing message storage and retrieval within a chat system.</p>
|
||
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="inputs-5">Inputs<a href="#inputs-5" class="hash-link" aria-label="Direct link to Inputs" title="Direct link to Inputs"></a></h3>
|
||
<table><thead><tr><th>Name</th><th>Display Name</th><th>Info</th></tr></thead><tbody><tr><td>message</td><td>Message</td><td>The chat message to be stored. (Required)</td></tr><tr><td>memory</td><td>External Memory</td><td>The external memory to store the message. If empty, it will use the Langflow tables.</td></tr><tr><td>sender</td><td>Sender</td><td>The sender of the message. Can be Machine or User. If empty, the current sender parameter will be used.</td></tr><tr><td>sender_name</td><td>Sender Name</td><td>The name of the sender. Can be AI or User. If empty, the current sender parameter will be used.</td></tr><tr><td>session_id</td><td>Session ID</td><td>The session ID of the chat. If empty, the current session ID parameter will be used.</td></tr></tbody></table>
|
||
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="outputs-5">Outputs<a href="#outputs-5" class="hash-link" aria-label="Direct link to Outputs" title="Direct link to Outputs"></a></h3>
|
||
<table><thead><tr><th>Name</th><th>Display Name</th><th>Info</th></tr></thead><tbody><tr><td>stored_messages</td><td>Stored Messages</td><td>The list of stored messages after the current message has been added.</td></tr></tbody></table>
|
||
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="output-parser">Output Parser<a href="#output-parser" class="hash-link" aria-label="Direct link to Output Parser" title="Direct link to Output Parser"></a></h2>
|
||
<div class="theme-admonition theme-admonition-important admonition_xJq3 alert alert--info"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>important</div><div class="admonitionContent_BuS1"><p>This component is in <strong>Legacy</strong>, which means it is no longer in active development as of Langflow version 1.3.</p></div></div>
|
||
<p>This component transforms the output of a language model into a specified format. It supports CSV format parsing, which converts LLM responses into comma-separated lists using Langchain's <code>CommaSeparatedListOutputParser</code>.</p>
|
||
<div class="theme-admonition theme-admonition-note admonition_xJq3 alert alert--secondary"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</div><div class="admonitionContent_BuS1"><p>This component only provides formatting instructions and parsing functionality. It does not include a prompt. You'll need to connect it to a separate Prompt component to create the actual prompt template for the LLM to use.</p></div></div>
|
||
<p>Both the <strong>Output Parser</strong> and <strong>Structured Output</strong> components format LLM responses, but they have different use cases.
|
||
The <strong>Output Parser</strong> is simpler and focused on converting responses into comma-separated lists. Use this when you just need a list of items, for example <code>["item1", "item2", "item3"]</code>.
|
||
The <strong>Structured Output</strong> is more complex and flexible, and allows you to define custom schemas with multiple fields of different types. Use this when you need to extract structured data with specific fields and types.</p>
|
||
<p>To use this component:</p>
|
||
<ol>
|
||
<li>Create a Prompt component and connect the Output Parser's <code>format_instructions</code> output to it. This ensures the LLM knows how to format its response.</li>
|
||
<li>Write your actual prompt text in the Prompt component, including the <code>{format_instructions}</code> variable.
|
||
For example, in your Prompt component, the template might look like:</li>
|
||
</ol>
|
||
<div class="ch-codeblock not-prose" data-ch-theme="github-dark"><div class="ch-code-wrapper ch-code" data-ch-measured="false"><code class="ch-code-scroll-parent"><br><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span>{format_instructions}</span></div></div><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span>Please list three fruits.</span></div></div><br></code></div></div>
|
||
<ol start="3">
|
||
<li>
|
||
<p>Connect the <code>output_parser</code> output to your LLM model.</p>
|
||
</li>
|
||
<li>
|
||
<p>The output parser converts this into a Python list: <code>["apple", "banana", "orange"]</code>.</p>
|
||
</li>
|
||
</ol>
|
||
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="inputs-6">Inputs<a href="#inputs-6" class="hash-link" aria-label="Direct link to Inputs" title="Direct link to Inputs"></a></h3>
|
||
<table><thead><tr><th>Name</th><th>Display Name</th><th>Info</th></tr></thead><tbody><tr><td>parser_type</td><td>Parser</td><td>Select the parser type. Currently supports "CSV".</td></tr></tbody></table>
|
||
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="outputs-6">Outputs<a href="#outputs-6" class="hash-link" aria-label="Direct link to Outputs" title="Direct link to Outputs"></a></h3>
|
||
<table><thead><tr><th>Name</th><th>Display Name</th><th>Info</th></tr></thead><tbody><tr><td>format_instructions</td><td>Format Instructions</td><td>Pass to a prompt template to include formatting instructions for LLM responses.</td></tr><tr><td>output_parser</td><td>Output Parser</td><td>The constructed output parser that can be used to parse LLM responses.</td></tr></tbody></table>
|
||
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="structured-output">Structured output<a href="#structured-output" class="hash-link" aria-label="Direct link to Structured output" title="Direct link to Structured output"></a></h2>
|
||
<p>This component transforms LLM responses into structured data formats.</p>
|
||
<p>In this example from the <strong>Financial Support Parser</strong> template, the <strong>Structured Output</strong> component transforms unstructured financial reports into structured data.</p>
|
||
<p><img decoding="async" loading="lazy" alt="Structured output example" src="/assets/images/component-structured-output-7bb5a996464cb83d4c94a893419bb176.png" width="2554" height="1548" class="img_ev3q"></p>
|
||
<p>The connected LLM model is prompted by the <strong>Structured Output</strong> component's <code>Format Instructions</code> parameter to extract structured output from the unstructured text. <code>Format Instructions</code> is utilized as the system prompt for the <strong>Structured Output</strong> component.</p>
|
||
<p>In the <strong>Structured Output</strong> component, click the <strong>Open table</strong> button to view the <code>Output Schema</code> table.
|
||
The <code>Output Schema</code> parameter defines the structure and data types for the model's output using a table with the following fields:</p>
|
||
<ul>
|
||
<li><strong>Name</strong>: The name of the output field.</li>
|
||
<li><strong>Description</strong>: The purpose of the output field.</li>
|
||
<li><strong>Type</strong>: The data type of the output field. The available types are <code>str</code>, <code>int</code>, <code>float</code>, <code>bool</code>, <code>list</code>, or <code>dict</code>. The default is <code>text</code>.</li>
|
||
<li><strong>Multiple</strong>: This feature is deprecated. Currently, it is set to <code>True</code> by default if you expect multiple values for a single field. For example, a <code>list</code> of <code>features</code> is set to <code>True</code> to contain multiple values, such as <code>["waterproof", "durable", "lightweight"]</code>. Default: <code>True</code>.</li>
|
||
</ul>
|
||
<p>The <strong>Parse DataFrame</strong> component parses the structured output into a template for orderly presentation in chat output. The template receives the values from the <code>output_schema</code> table with curly braces.</p>
|
||
<p>For example, the template <code>EBITDA: {EBITDA} , Net Income: {NET_INCOME} , GROSS_PROFIT: {GROSS_PROFIT}</code> presents the extracted values in the <strong>Playground</strong> as <code>EBITDA: 900 million , Net Income: 500 million , GROSS_PROFIT: 1.2 billion</code>.</p>
|
||
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="inputs-7">Inputs<a href="#inputs-7" class="hash-link" aria-label="Direct link to Inputs" title="Direct link to Inputs"></a></h3>
|
||
<table><thead><tr><th>Name</th><th>Display Name</th><th>Info</th></tr></thead><tbody><tr><td>llm</td><td>Language Model</td><td>The language model to use to generate the structured output.</td></tr><tr><td>input_value</td><td>Input Message</td><td>The input message to the language model.</td></tr><tr><td>system_prompt</td><td>Format Instructions</td><td>Instructions to the language model for formatting the output.</td></tr><tr><td>schema_name</td><td>Schema Name</td><td>The name for the output data schema.</td></tr><tr><td>output_schema</td><td>Output Schema</td><td>Defines the structure and data types for the model's output.</td></tr><tr><td>multiple</td><td>Generate Multiple</td><td>[Deprecated] Always set to <code>True</code>.</td></tr></tbody></table>
|
||
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="outputs-7">Outputs<a href="#outputs-7" class="hash-link" aria-label="Direct link to Outputs" title="Direct link to Outputs"></a></h3>
|
||
<table><thead><tr><th>Name</th><th>Display Name</th><th>Info</th></tr></thead><tbody><tr><td>structured_output</td><td>Structured Output</td><td>The structured output is a Data object based on the defined schema.</td></tr><tr><td>structured_output_dataframe</td><td>DataFrame</td><td>The structured output converted to a <a href="/concepts-objects#dataframe-object">DataFrame</a> format.</td></tr></tbody></table></div></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/components-embedding-models"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Embeddings</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/components-io"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Inputs and outputs</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#use-a-helper-component-in-a-flow" class="table-of-contents__link toc-highlight">Use a helper component in a flow</a></li><li><a href="#batch-run-component" class="table-of-contents__link toc-highlight">Batch Run Component</a><ul><li><a href="#inputs" class="table-of-contents__link toc-highlight">Inputs</a></li><li><a href="#outputs" class="table-of-contents__link toc-highlight">Outputs</a></li></ul></li><li><a href="#create-list" class="table-of-contents__link toc-highlight">Create List</a><ul><li><a href="#inputs-1" class="table-of-contents__link toc-highlight">Inputs</a></li><li><a href="#outputs-1" class="table-of-contents__link toc-highlight">Outputs</a></li></ul></li><li><a href="#current-date" class="table-of-contents__link toc-highlight">Current date</a><ul><li><a href="#inputs-2" class="table-of-contents__link toc-highlight">Inputs</a></li><li><a href="#outputs-2" class="table-of-contents__link toc-highlight">Outputs</a></li></ul></li><li><a href="#id-generator" class="table-of-contents__link toc-highlight">ID Generator</a><ul><li><a href="#inputs-3" class="table-of-contents__link toc-highlight">Inputs</a></li><li><a href="#outputs-3" class="table-of-contents__link toc-highlight">Outputs</a></li></ul></li><li><a href="#message-history" class="table-of-contents__link toc-highlight">Message history</a><ul><li><a href="#inputs-4" class="table-of-contents__link toc-highlight">Inputs</a></li><li><a href="#outputs-4" class="table-of-contents__link toc-highlight">Outputs</a></li></ul></li><li><a href="#message-store" class="table-of-contents__link toc-highlight">Message store</a><ul><li><a href="#inputs-5" class="table-of-contents__link toc-highlight">Inputs</a></li><li><a href="#outputs-5" class="table-of-contents__link toc-highlight">Outputs</a></li></ul></li><li><a href="#output-parser" class="table-of-contents__link toc-highlight">Output Parser</a><ul><li><a href="#inputs-6" class="table-of-contents__link toc-highlight">Inputs</a></li><li><a href="#outputs-6" class="table-of-contents__link toc-highlight">Outputs</a></li></ul></li><li><a href="#structured-output" class="table-of-contents__link toc-highlight">Structured output</a><ul><li><a href="#inputs-7" class="table-of-contents__link toc-highlight">Inputs</a></li><li><a href="#outputs-7" class="table-of-contents__link toc-highlight">Outputs</a></li></ul></li></ul></div></div></div></div></main></div></div></div><div style="position:fixed;right:20px;bottom:20px;z-index:100;display:flex;align-items:center;gap:10px;cursor:pointer"><div style="background-color:#f6f6f6;border-radius:50%;width:48px;height:48px;display:flex;align-items:center;justify-content:center;box-shadow:0 2px 4px rgba(0,0,0,0.1)"><img src="/img/langflow-icon-black-transparent.svg" style="width:40px" alt="Search"></div></div></div>
|
||
</body>
|
||
</html> |