mirror of
https://github.com/langflow-ai/langflow.git
synced 2026-07-24 07:34:10 +08:00
609 lines
157 KiB
HTML
609 lines
157 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-processing" data-has-hydrated="false">
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<meta name="generator" content="Docusaurus v3.8.1">
|
||
<title data-rh="true">Processing components | 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-processing"><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="Processing components | Langflow Documentation"><meta data-rh="true" name="description" content="Langflow's Processing components process and transform data within a flow."><meta data-rh="true" property="og:description" content="Langflow's Processing components process and transform data within a flow."><link data-rh="true" rel="icon" href="/img/favicon.ico"><link data-rh="true" rel="canonical" href="https://docs.langflow.org/components-processing"><link data-rh="true" rel="alternate" href="https://docs.langflow.org/components-processing" hreflang="en"><link data-rh="true" rel="alternate" href="https://docs.langflow.org/components-processing" hreflang="x-default"><link data-rh="true" rel="preconnect" href="https://UZK6BDPCVY-dsn.algolia.net" crossorigin="anonymous"><script data-rh="true" type="application/ld+json">{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Processing components","item":"https://docs.langflow.org/components-processing"}]}</script><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-SLQFLQ3KPT"></script>
|
||
<script>function gtag(){dataLayer.push(arguments)}window.dataLayer=window.dataLayer||[],gtag("js",new Date),gtag("config","G-SLQFLQ3KPT",{})</script>
|
||
|
||
|
||
|
||
|
||
|
||
<link rel="search" type="application/opensearchdescription+xml" title="Langflow Documentation" href="/opensearch.xml">
|
||
|
||
|
||
|
||
<script>!function(){var e="analytics",t=window[e]=window[e]||[];if(!t.initialize)if(t.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{t.invoked=!0,t.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","screen","once","off","on","addSourceMiddleware","addIntegrationMiddleware","setAnonymousId","addDestinationMiddleware","register"],t.factory=function(n){return function(){if(window[e].initialized)return window[e][n].apply(window[e],arguments);var r=Array.prototype.slice.call(arguments);if(["track","screen","alias","group","page","identify"].indexOf(n)>-1){var i=document.querySelector("link[rel='canonical']");r.push({__t:"bpc",c:i&&i.getAttribute("href")||void 0,p:location.pathname,u:location.href,s:location.search,t:document.title,r:document.referrer})}return r.unshift(n),t.push(r),t}};for(var n=0;n<t.methods.length;n++){var r=t.methods[n];t[r]=t.factory(r)}t.load=function(n,r){var i=document.createElement("script");i.type="text/javascript",i.async=!0,i.setAttribute("data-global-segment-analytics-key",e),i.src="https://cdn.segment.com/analytics.js/v1/"+n+"/analytics.min.js";var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(i,a),t._loadOptions=r},t._writeKey="60AfGDrVxy8nAGJngo3fCYWG4LvhMAlG",t.SNIPPET_VERSION="5.2.0",t.load("60AfGDrVxy8nAGJngo3fCYWG4LvhMAlG"),t.page()}}()</script>
|
||
<script>window.__SCROLL_TRACKING_CONFIG__={selectors:[{selector:"h1, h2, h3, h4, h5, h6",eventName:"Docs.langflow.org - Heading Viewed",properties:{element_type:"heading"}},{selector:".ch-codeblock",eventName:"Docs.langflow.org - Codeblock Viewed",properties:{element_type:"code",language:"helper:codeLanguage"}}]}</script>
|
||
|
||
|
||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Sora:wght@550;600&display=swap">
|
||
<script>!function(){window.semaphore=window.semaphore||[],window.ketch=function(){window.semaphore.push(arguments)};var e=document.createElement("script");e.type="text/javascript",e.src="https://global.ketchcdn.com/web/v3/config/datastax/langflow_org_web/boot.js",e.defer=e.async=!0,document.getElementsByTagName("head")[0].appendChild(e)}()</script>
|
||
<script defer="true">!function(){const e=e=>{if(window.gtag&&e.purposes&&"analytics"in e.purposes&&"targeted_advertising"in e.purposes){const n=!0===e.purposes.analytics?"granted":"denied",t=!0===e.purposes.targeted_advertising?"granted":"denied",a={analytics_storage:n,ad_personalization:t,ad_storage:t,ad_user_data:t};window.gtag("consent","update",a)}};window.ketch&&window.ketch("on","consent",e)}()</script><link rel="stylesheet" href="/assets/css/styles.40667d1b.css">
|
||
<script src="/assets/js/runtime~main.77c6ff16.js" defer="defer"></script>
|
||
<script src="/assets/js/main.6b3faa68.js" defer="defer"></script>
|
||
</head>
|
||
<body class="navigation-with-keyboard">
|
||
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;"><defs>
|
||
<symbol id="theme-svg-external-link" viewBox="0 0 24 24"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"/></symbol>
|
||
</defs></svg>
|
||
<script>!function(){var t=function(){try{return new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}}()||function(){try{return window.localStorage.getItem("theme")}catch(t){}}();document.documentElement.setAttribute("data-theme",t||(window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light")),document.documentElement.setAttribute("data-theme-choice",t||"system")}(),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="theme-layout-navbar navbar navbar--fixed-top navbarHideable_m1mJ"><div class="navbar__inner"><div class="theme-layout-navbar-left 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/lf-docs-light.svg" alt="Langflow" class="themedComponent_mlkZ themedComponent--light_NVdE"><img src="/img/lf-docs-dark.svg" alt="Langflow" class="themedComponent_mlkZ themedComponent--dark_xIcU"></div></a></div><div class="theme-layout-navbar-right navbar__items navbar__items--right"><a href="https://github.com/langflow-ai/langflow" target="_blank" class="navbar__item navbar__link header-github-link" data-event="Docs.langflow.org - Social Clicked" data-platform="github"></a><a href="https://twitter.com/langflow_ai" target="_blank" class="navbar__item navbar__link header-twitter-link" data-event="Docs.langflow.org - Social Clicked" data-platform="x"></a><a href="https://discord.gg/EqksyE2EX9" target="_blank" class="navbar__item navbar__link header-discord-link" data-event="Docs.langflow.org - Social Clicked" data-platform="discord"></a><div class="toggle_vylO colorModeToggle_DEke"><button class="clean-btn toggleButton_gllP toggleButtonDisabled_aARS" type="button" disabled="" title="system mode" aria-label="Switch between dark and light mode (currently system mode)"><svg viewBox="0 0 24 24" width="24" height="24" aria-hidden="true" class="toggleIcon_g3eP 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" aria-hidden="true" class="toggleIcon_g3eP 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><svg viewBox="0 0 24 24" width="24" height="24" aria-hidden="true" class="toggleIcon_g3eP systemToggleIcon_QzmC"><path fill="currentColor" d="m12 21c4.971 0 9-4.029 9-9s-4.029-9-9-9-9 4.029-9 9 4.029 9 9 9zm4.95-13.95c1.313 1.313 2.05 3.093 2.05 4.95s-0.738 3.637-2.05 4.95c-1.313 1.313-3.093 2.05-4.95 2.05v-14c1.857 0 3.637 0.737 4.95 2.05z"></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="theme-layout-main 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/lf-docs-light.svg" alt="Langflow" class="themedComponent_mlkZ themedComponent--light_NVdE"><img src="/img/lf-docs-dark.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="/about-langflow">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="/concepts-overview">Flows</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="/agents">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="/mcp-client">Model Context Protocol (MCP)</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-keys-and-authentication">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">Deploy</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="/concepts-components">Components reference</a></div><ul 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="/concepts-components">Components overview</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 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" tabindex="0" href="/components-io">Core components</a></div><ul class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/components-io">Input / Output</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/components-agents">Agents</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-3 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" tabindex="0" href="/components-models">Models</a></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 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-3 menu__list-item"><a class="menu__link" tabindex="0" href="/components-vector-stores">Vector Stores</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-3 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" tabindex="0" href="/components-processing">Processing</a></div><ul class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-4 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/components-processing">Processing components</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-4 menu__list-item"><a class="menu__link" tabindex="0" href="/components-prompts">Prompt Template</a></li></ul></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 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-3 menu__list-item"><a class="menu__link" tabindex="0" href="/components-helpers">Helpers</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 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-3 menu__list-item"><a class="menu__link" tabindex="0" href="/components-memories">Memories</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 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" tabindex="0" href="/components-bundle-components">Bundles</a></div></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></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="/api-reference-api-examples">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="/contributing-community">Contribute</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="/release-notes">Release notes</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="/troubleshoot">Support</a></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 sidebar-ad">
|
||
<a href="https://www.langflow.org/desktop" target="_blank" class="menu__link">
|
||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||
<g clip-path="url(#clip0_1645_37)">
|
||
<path d="M12 17H20C21.1046 17 22 16.1046 22 15V13M12 17H4C2.89543 17 2 16.1046 2 15V5C2 3.89543 2.89543 3 4 3H10M12 17V21M8 21H12M12 21H16M11.75 10.2917H13.2083L16.125 7.375H17.5833L20.5 4.45833H21.9583M16.125 11.75H17.5833L20.5 8.83333H21.9583M11.75 5.91667H13.2083L16.125 3H17.5833" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||
</g>
|
||
<defs>
|
||
<clipPath id="clip0_1645_37">
|
||
<rect width="24" height="24" fill="white"/>
|
||
</clipPath>
|
||
</defs>
|
||
</svg>
|
||
<div class="sidebar-ad-text-container">
|
||
<span class="sidebar-ad-text">Get started in minutes</span>
|
||
<span class="sidebar-ad-text sidebar-ad-text-gradient">Download Langflow Desktop</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"><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 reference</span></li><li class="breadcrumbs__item"><span class="breadcrumbs__link">Core components</span></li><li class="breadcrumbs__item"><span class="breadcrumbs__link">Processing</span></li><li class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link">Processing components</span></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"><header><h1>Processing components</h1></header><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>
|
||
<!-- -->
|
||
<p>Langflow's <strong>Processing</strong> components process and transform data within a flow.
|
||
They have many uses, including:</p>
|
||
<ul>
|
||
<li>Feed instructions and context to your LLMs and agents with the <a href="#prompt-template"><strong>Prompt Template</strong> component</a>.</li>
|
||
<li>Extract content from larger chunks of data with a <a href="#parser"><strong>Parser</strong> component</a>.</li>
|
||
<li>Filter data with natural language with the <a href="#smart-function"><strong>Smart Function</strong> component</a>.</li>
|
||
<li>Save data to your local machine with the <a href="#save-file"><strong>Save File</strong> component</a>.</li>
|
||
<li>Transform data into a different data type with the <a href="#type-convert"><strong>Type Convert</strong> component</a> to pass it between incompatible components.</li>
|
||
</ul>
|
||
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="prompt-template">Prompt Template<a href="#prompt-template" class="hash-link" aria-label="Direct link to Prompt Template" title="Direct link to Prompt Template"></a></h2>
|
||
<p>See <a href="/components-prompts">Prompt Template</a>.</p>
|
||
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="batch-run">Batch Run<a href="#batch-run" class="hash-link" aria-label="Direct link to Batch Run" title="Direct link to Batch Run"></a></h2>
|
||
<p>The <strong>Batch Run</strong> component runs a language model over <em>each row of one text column</em> in a <a href="/data-types#dataframe"><code>DataFrame</code></a>, and then returns a new <code>DataFrame</code> with the original text and an LLM response.
|
||
The output contains the following columns:</p>
|
||
<ul>
|
||
<li><code>text_input</code>: The original text from the input <code>DataFrame</code></li>
|
||
<li><code>model_response</code>: The model's response for each input</li>
|
||
<li><code>batch_index</code>: The 0-indexed processing order for all rows in the <code>DataFrame</code></li>
|
||
<li><code>metadata</code> (optional): Additional information about the processing</li>
|
||
</ul>
|
||
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="use-the-batch-run-component-in-a-flow">Use the Batch Run component in a flow<a href="#use-the-batch-run-component-in-a-flow" class="hash-link" aria-label="Direct link to Use the Batch Run component in a flow" title="Direct link to Use the Batch Run component in a flow"></a></h3>
|
||
<p>If you pass the <strong>Batch Run</strong> output to a <a href="/components-processing#parser"><strong>Parser</strong> component</a>, you can use variables in the parsing template to reference these keys, such as <code>{text_input}</code> and <code>{model_response}</code>.
|
||
This is demonstrated in the following example.</p>
|
||
<p><img decoding="async" loading="lazy" alt="A batch run component connected to OpenAI and a Parser" src="/assets/images/component-batch-run-19c94fbb0646b2731b37013b84dff1f6.png" width="4000" height="2728" class="img_ev3q"></p>
|
||
<ol>
|
||
<li>
|
||
<p>Connect a <strong>Language Model</strong> component to a <strong>Batch Run</strong> component's <strong>Language model</strong> port.</p>
|
||
</li>
|
||
<li>
|
||
<p>Connect <code>DataFrame</code> output from another component to the <strong>Batch Run</strong> component's <strong>DataFrame</strong> input.
|
||
For example, you could connect a <strong>File</strong> component with a CSV file.</p>
|
||
</li>
|
||
<li>
|
||
<p>In the <strong>Batch Run</strong> component's <strong>Column Name</strong> field, enter the name of the column in the incoming <code>DataFrame</code> that contains the text to process.
|
||
For example, if you want to extract text from a <code>name</code> column in a CSV file, enter <code>name</code> in the <strong>Column Name</strong> field.</p>
|
||
</li>
|
||
<li>
|
||
<p>Connect the <strong>Batch Run</strong> component's <strong>Batch Results</strong> output to a <strong>Parser</strong> component's <strong>DataFrame</strong> input.</p>
|
||
</li>
|
||
<li>
|
||
<p>Optional: In the <strong>Batch Run</strong> <a href="/concepts-components#component-menus">component's header menu</a>, click <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-sliders-horizontal" aria-hidden="true"><line x1="21" x2="14" y1="4" y2="4"></line><line x1="10" x2="3" y1="4" y2="4"></line><line x1="21" x2="12" y1="12" y2="12"></line><line x1="8" x2="3" y1="12" y2="12"></line><line x1="21" x2="16" y1="20" y2="20"></line><line x1="12" x2="3" y1="20" y2="20"></line><line x1="14" x2="14" y1="2" y2="6"></line><line x1="8" x2="8" y1="10" y2="14"></line><line x1="16" x2="16" y1="18" y2="22"></line></svg> <strong>Controls</strong>, enable the <strong>System Message</strong> parameter, click <strong>Close</strong>, and then enter an instruction for how you want the LLM to process each cell extracted from the file.
|
||
For example, <code>Create a business card for each name.</code></p>
|
||
</li>
|
||
<li>
|
||
<p>In the <strong>Parser</strong> component's <strong>Template</strong> field, enter a template for processing the <strong>Batch Run</strong> component's new <code>DataFrame</code> columns (<code>text_input</code>, <code>model_response</code>, and <code>batch_index</code>):</p>
|
||
<p>For example, this template uses three columns from the resulting, post-batch <code>DataFrame</code>:</p>
|
||
<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>record_number: {batch_index}, name: {text_input}, summary: {model_response}</span></div></div><br></code></div></div>
|
||
</li>
|
||
<li>
|
||
<p>To test the processing, click the <strong>Parser</strong> component, click <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-play" aria-hidden="True"><polygon points="6 3 20 12 6 21 6 3"></polygon></svg> <strong>Run component</strong>, and then click <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-text-search" aria-hidden="True"><path d="M21 6H3"></path><path d="M10 12H3"></path><path d="M10 18H3"></path><circle cx="17" cy="15" r="3"></circle><path d="m21 19-1.9-1.9"></path></svg> <strong>Inspect output</strong> to view the final <code>DataFrame</code>.</p>
|
||
<p>You can also connect a <strong>Chat Output</strong> component to the <strong>Parser</strong> component if you want to see the output in the <strong>Playground</strong>.</p>
|
||
</li>
|
||
</ol>
|
||
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="batch-run-parameters">Batch Run parameters<a href="#batch-run-parameters" class="hash-link" aria-label="Direct link to Batch Run parameters" title="Direct link to Batch Run parameters"></a></h3>
|
||
<p>Some <strong>Batch Run</strong> component input parameters are hidden by default in the visual editor.
|
||
You can toggle parameters through the <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-sliders-horizontal" aria-hidden="true"><line x1="21" x2="14" y1="4" y2="4"></line><line x1="10" x2="3" y1="4" y2="4"></line><line x1="21" x2="12" y1="12" y2="12"></line><line x1="8" x2="3" y1="12" y2="12"></line><line x1="21" x2="16" y1="20" y2="20"></line><line x1="12" x2="3" y1="20" y2="20"></line><line x1="14" x2="14" y1="2" y2="6"></line><line x1="8" x2="8" y1="10" y2="14"></line><line x1="16" x2="16" y1="18" y2="22"></line></svg> <strong>Controls</strong> in the <a href="/concepts-components#component-menus">component's header menu</a>.</p>
|
||
<table><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>model</td><td>HandleInput</td><td>Input parameter. Connect the 'Language Model' output from a <strong>Language Model</strong> component. Required.</td></tr><tr><td>system_message</td><td>MultilineInput</td><td>Input parameter. A multi-line system instruction for all rows in the DataFrame.</td></tr><tr><td>df</td><td>DataFrameInput</td><td>Input parameter. The DataFrame whose column is treated as text messages, as specified by 'column_name'. Required.</td></tr><tr><td>column_name</td><td>MessageTextInput</td><td>Input parameter. The name of the DataFrame column to treat as text messages. If empty, all columns are formatted in TOML.</td></tr><tr><td>output_column_name</td><td>MessageTextInput</td><td>Input parameter. Name of the column where the model's response is stored. Default=<code>model_response</code>.</td></tr><tr><td>enable_metadata</td><td>BoolInput</td><td>Input parameter. If True, add metadata to the output DataFrame.</td></tr><tr><td>batch_results</td><td>DataFrame</td><td>Output parameter. A DataFrame with all original columns plus the model's response column.</td></tr></tbody></table>
|
||
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="data-operations">Data Operations<a href="#data-operations" class="hash-link" aria-label="Direct link to Data Operations" title="Direct link to Data Operations"></a></h2>
|
||
<p>The <strong>Data Operations</strong> component performs operations on <a href="/data-types#data"><code>Data</code></a> objects, including extracting, filtering, and editing keys and values in the <code>Data</code>.
|
||
For all options, see <a href="#available-data-operations">Available data operations</a>.
|
||
The output is a new <code>Data</code> object containing the modified data after running the selected operation.</p>
|
||
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="use-the-data-operations-component-in-a-flow">Use the Data Operations component in a flow<a href="#use-the-data-operations-component-in-a-flow" class="hash-link" aria-label="Direct link to Use the Data Operations component in a flow" title="Direct link to Use the Data Operations component in a flow"></a></h3>
|
||
<p>The following example demonstrates how to use a <strong>Data Operations</strong> component in a flow using data from a webhook payload:</p>
|
||
<ol>
|
||
<li>
|
||
<p>Create a flow with a <strong>Webhook</strong> component and a <strong>Data Operations</strong> component, and then connect the <strong>Webhook</strong> component's output to the <strong>Data Operations</strong> component's <strong>Data</strong> input.</p>
|
||
<p>All operations in the <strong>Data Operations</strong> component require at least one <code>Data</code> input from another component.
|
||
If the preceding component doesn't produce <code>Data</code> output, you can use another component, such as the <strong>Type Convert</strong> component, to reformat the data before passing it to the <strong>Data Operations</strong> component.
|
||
Alternatively, you could consider using a component that is designed to process the original data type, such as the <strong>Parser</strong> or <strong>DataFrame Operations</strong> components.</p>
|
||
</li>
|
||
<li>
|
||
<p>In the <strong>Operations</strong> field, select the operation you want to perform on the incoming <code>Data</code>.
|
||
For this example, select the <strong>Select Keys</strong> operation.</p>
|
||
<div class="theme-admonition theme-admonition-tip admonition_xJq3 alert alert--success"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 12 16"><path fill-rule="evenodd" d="M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"></path></svg></span>tip</div><div class="admonitionContent_BuS1"><p>You can select only one operation.
|
||
If you need to perform multiple operations on the data, you can chain multiple <strong>Data Operations</strong> components together to execute each operation in sequence.
|
||
For more complex multi-step operations, consider using a component like the <strong>Smart Function</strong> component.</p></div></div>
|
||
</li>
|
||
<li>
|
||
<p>Under <strong>Select Keys</strong>, add keys for <code>name</code>, <code>username</code>, and <code>email</code>.
|
||
Click <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-plus" aria-hidden="True"><path d="M5 12h14"></path><path d="M12 5v14"></path></svg> <strong>Add more</strong> to add a field for each key.</p>
|
||
<p>For this example, assume that the webhook will receive consistent payloads that always contain <code>name</code>, <code>username</code>, and <code>email</code> keys.
|
||
The <strong>Select Keys</strong> operation extracts the value of these keys from each incoming payload.</p>
|
||
</li>
|
||
<li>
|
||
<p>Optional: If you want to view the output in the <strong>Playground</strong>, connect the <strong>Data Operations</strong> component's output to a <strong>Chat Output</strong> component.</p>
|
||
<p><img decoding="async" loading="lazy" alt="A flow with Webhook, Data Operations, and Chat Output components" src="/assets/images/component-data-operations-select-key-80bade862d29f2851b01ee26413d495f.png" width="4000" height="1920" class="img_ev3q"></p>
|
||
</li>
|
||
<li>
|
||
<p>To test the flow, send the following request to your flow's webhook endpoint.
|
||
For more information about the webhook endpoint, see <a href="/webhook">Trigger flows with webhooks</a>.</p>
|
||
<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">_<!-- -->26</span><div style="display:inline-block;margin-left:16px"><span>curl -X POST "http://$LANGFLOW_SERVER_URL/api/v1/webhook/$FLOW_ID" \</span></div></div><div><span class="ch-code-line-number">_<!-- -->26</span><div style="display:inline-block;margin-left:16px"><span>-H "Content-Type: application/json" \</span></div></div><div><span class="ch-code-line-number">_<!-- -->26</span><div style="display:inline-block;margin-left:16px"><span>-H "x-api-key: $LANGFLOW_API_KEY" \</span></div></div><div><span class="ch-code-line-number">_<!-- -->26</span><div style="display:inline-block;margin-left:16px"><span>-d '{</span></div></div><div><span class="ch-code-line-number">_<!-- -->26</span><div style="display:inline-block;margin-left:16px"><span> "id": 1,</span></div></div><div><span class="ch-code-line-number">_<!-- -->26</span><div style="display:inline-block;margin-left:16px"><span> "name": "Leanne Graham",</span></div></div><div><span class="ch-code-line-number">_<!-- -->26</span><div style="display:inline-block;margin-left:16px"><span> "username": "Bret",</span></div></div><div><span class="ch-code-line-number">_<!-- -->26</span><div style="display:inline-block;margin-left:16px"><span> "email": "Sincere@april.biz",</span></div></div><div><span class="ch-code-line-number">_<!-- -->26</span><div style="display:inline-block;margin-left:16px"><span> "address": {</span></div></div><div><span class="ch-code-line-number">_<!-- -->26</span><div style="display:inline-block;margin-left:16px"><span> "street": "Main Street",</span></div></div><div><span class="ch-code-line-number">_<!-- -->26</span><div style="display:inline-block;margin-left:16px"><span> "suite": "Apt. 556",</span></div></div><div><span class="ch-code-line-number">_<!-- -->26</span><div style="display:inline-block;margin-left:16px"><span> "city": "Springfield",</span></div></div><div><span class="ch-code-line-number">_<!-- -->26</span><div style="display:inline-block;margin-left:16px"><span> "zipcode": "92998-3874",</span></div></div><div><span class="ch-code-line-number">_<!-- -->26</span><div style="display:inline-block;margin-left:16px"><span> "geo": {</span></div></div><div><span class="ch-code-line-number">_<!-- -->26</span><div style="display:inline-block;margin-left:16px"><span> "lat": "-37.3159",</span></div></div><div><span class="ch-code-line-number">_<!-- -->26</span><div style="display:inline-block;margin-left:16px"><span> "lng": "81.1496"</span></div></div><div><span class="ch-code-line-number">_<!-- -->26</span><div style="display:inline-block;margin-left:16px"><span> }</span></div></div><div><span class="ch-code-line-number">_<!-- -->26</span><div style="display:inline-block;margin-left:16px"><span> },</span></div></div><div><span class="ch-code-line-number">_<!-- -->26</span><div style="display:inline-block;margin-left:16px"><span> "phone": "1-770-736-8031 x56442",</span></div></div><div><span class="ch-code-line-number">_<!-- -->26</span><div style="display:inline-block;margin-left:16px"><span> "website": "hildegard.org",</span></div></div><div><span class="ch-code-line-number">_<!-- -->26</span><div style="display:inline-block;margin-left:16px"><span> "company": {</span></div></div><div><span class="ch-code-line-number">_<!-- -->26</span><div style="display:inline-block;margin-left:16px"><span> "name": "Acme-Corp",</span></div></div><div><span class="ch-code-line-number">_<!-- -->26</span><div style="display:inline-block;margin-left:16px"><span> "catchPhrase": "Multi-layered client-server neural-net",</span></div></div><div><span class="ch-code-line-number">_<!-- -->26</span><div style="display:inline-block;margin-left:16px"><span> "bs": "harness real-time e-markets"</span></div></div><div><span class="ch-code-line-number">_<!-- -->26</span><div style="display:inline-block;margin-left:16px"><span> }</span></div></div><div><span class="ch-code-line-number">_<!-- -->26</span><div style="display:inline-block;margin-left:16px"><span>}'</span></div></div><br></code></div></div>
|
||
</li>
|
||
<li>
|
||
<p>To view the <code>Data</code> resulting from the <strong>Select Keys</strong> operation, do one of the following:</p>
|
||
<ul>
|
||
<li>If you attached a <strong>Chat Output</strong> component, open the <strong>Playground</strong> to see the result as a chat message.</li>
|
||
<li>Click <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-text-search" aria-hidden="true"><path d="M21 6H3"></path><path d="M10 12H3"></path><path d="M10 18H3"></path><circle cx="17" cy="15" r="3"></circle><path d="m21 19-1.9-1.9"></path></svg> <strong>Inspect output</strong> on the <strong>Data Operations</strong> component.</li>
|
||
</ul>
|
||
</li>
|
||
</ol>
|
||
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="data-operations-parameters">Data Operations parameters<a href="#data-operations-parameters" class="hash-link" aria-label="Direct link to Data Operations parameters" title="Direct link to Data Operations parameters"></a></h3>
|
||
<p>Many <strong>Data Operations</strong> component input parameters are conditional based on the selected <strong>Operation</strong> (<code>operation</code>).</p>
|
||
<table><thead><tr><th>Name</th><th>Display Name</th><th>Info</th></tr></thead><tbody><tr><td>data</td><td>Data</td><td>Input parameter. The <code>Data</code> object to operate on.</td></tr><tr><td>operation</td><td>Operation</td><td>Input parameter. The operation to perform on the data. See <a href="#available-data-operations">Available data operations</a></td></tr><tr><td>select_keys_input</td><td>Select Keys</td><td>Input parameter. A list of keys to select from the data.</td></tr><tr><td>filter_key</td><td>Filter Key</td><td>Input parameter. The key to filter by.</td></tr><tr><td>operator</td><td>Comparison Operator</td><td>Input parameter. The operator to apply for comparing values.</td></tr><tr><td>filter_values</td><td>Filter Values</td><td>Input parameter. A list of values to filter by.</td></tr><tr><td>append_update_data</td><td>Append or Update</td><td>Input parameter. The data to append or update the existing data with.</td></tr><tr><td>remove_keys_input</td><td>Remove Keys</td><td>Input parameter. A list of keys to remove from the data.</td></tr><tr><td>rename_keys_input</td><td>Rename Keys</td><td>Input parameter. A list of keys to rename in the data.</td></tr></tbody></table>
|
||
<h4 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="available-data-operations">Available data operations<a href="#available-data-operations" class="hash-link" aria-label="Direct link to Available data operations" title="Direct link to Available data operations"></a></h4>
|
||
<p>Options for the <code>operations</code> input parameter are as follows.
|
||
All operations act on an incoming <code>Data</code> object.</p>
|
||
<table><thead><tr><th>Name</th><th>Required Inputs</th><th>Process</th></tr></thead><tbody><tr><td>Select Keys</td><td><code>select_keys_input</code></td><td>Selects specific keys from the data.</td></tr><tr><td>Literal Eval</td><td>None</td><td>Evaluates string values as Python literals.</td></tr><tr><td>Combine</td><td>None</td><td>Combines multiple data objects into one.</td></tr><tr><td>Filter Values</td><td><code>filter_key</code>, <code>filter_values</code>, <code>operator</code></td><td>Filters data based on key-value pair.</td></tr><tr><td>Append or Update</td><td><code>append_update_data</code></td><td>Adds or updates key-value pairs.</td></tr><tr><td>Remove Keys</td><td><code>remove_keys_input</code></td><td>Removes specified keys from the data.</td></tr><tr><td>Rename Keys</td><td><code>rename_keys_input</code></td><td>Renames keys in the data.</td></tr></tbody></table>
|
||
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="dataframe-operations">DataFrame Operations<a href="#dataframe-operations" class="hash-link" aria-label="Direct link to DataFrame Operations" title="Direct link to DataFrame Operations"></a></h2>
|
||
<p>The <strong>DataFrame Operations</strong> component performs operations on <a href="/data-types#dataframe"><code>DataFrame</code></a> (table) rows and columns, including schema changes, record changes, sorting, and filtering.
|
||
For all options, see <a href="#dataframe-operations-parameters">DataFrame Operations parameters</a>.</p>
|
||
<p>The output is a new <code>DataFrame</code> containing the modified data after running the selected operation.</p>
|
||
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="use-the-dataframe-operations-component-in-a-flow">Use the DataFrame Operations component in a flow<a href="#use-the-dataframe-operations-component-in-a-flow" class="hash-link" aria-label="Direct link to Use the DataFrame Operations component in a flow" title="Direct link to Use the DataFrame Operations component in a flow"></a></h3>
|
||
<p>The following steps explain how to configure a <strong>DataFrame Operations</strong> component in a flow.
|
||
You can follow along with an example or use your own flow.
|
||
The only requirement is that the preceding component must create <code>DataFrame</code> output that you can pass to the <strong>DataFrame Operations</strong> component.</p>
|
||
<ol>
|
||
<li>
|
||
<p>Create a new flow or use an existing flow.</p>
|
||
<details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>API response extraction flow example</summary><div><div class="collapsibleContent_i85q"><p>The following example flow uses five components to extract <code>Data</code> from an API response, transform it to a <code>DataFrame</code>, and then perform further processing on the tabular data using a <strong>DataFrame Operations</strong> component.
|
||
The sixth component, <strong>Chat Output</strong>, is optional in this example.
|
||
It only serves as a convenient way for you to view the final output in the <strong>Playground</strong>, rather than inspecting the component logs.</p><p><img decoding="async" loading="lazy" alt="A flow that ingests an API response, extracts it to a DataFrame with a Smart Function component, and the processes it through a DataFrame Operations component" src="/assets/images/component-dataframe-operations-031488ccf4e3d3378f8842f0ea10682c.png" width="4000" height="2120" class="img_ev3q"></p><p>If you want to use this example to test the <strong>DataFrame Operations</strong> component, do the following:</p><ol>
|
||
<li>
|
||
<p>Create a flow with the following components:</p>
|
||
<ul>
|
||
<li><strong>API Request</strong></li>
|
||
<li><strong>Language Model</strong></li>
|
||
<li><strong>Smart Function</strong></li>
|
||
<li><strong>Type Convert</strong></li>
|
||
</ul>
|
||
</li>
|
||
<li>
|
||
<p>Configure the <a href="#smart-function"><strong>Smart Function</strong> component</a> and its dependencies:</p>
|
||
<ul>
|
||
<li><strong>API Request</strong>: Configure the <a href="/components-data#api-request"><strong>API Request</strong> component</a> to get JSON data from an endpoint of your choice, and then connect the <strong>API Response</strong> output to the <strong>Smart Function</strong> component's <strong>Data</strong> input.</li>
|
||
<li><strong>Language Model</strong>: Select your preferred provider and model, and then enter a valid API key.
|
||
Change the output to <strong>Language Model</strong>, and then connect the <code>LanguageModel</code> output to the <strong>Smart Function</strong> component's <strong>Language Model</strong> input.</li>
|
||
<li><strong>Smart Function</strong>: In the <strong>Instructions</strong> field, enter natural language instructions to extract data from the API response.
|
||
Your instructions depend on the response content and desired outcome.
|
||
For example, if the response contains a large <code>result</code> field, you might provide instructions like <code>explode the result field out into a Data object</code>.</li>
|
||
</ul>
|
||
</li>
|
||
<li>
|
||
<p>Convert the <strong>Smart Function</strong> component's <code>Data</code> output to <code>DataFrame</code>:</p>
|
||
<ol>
|
||
<li>Connect the <strong>Filtered Data</strong> output to the <strong>Type Convert</strong> component's <strong>Data</strong> input.</li>
|
||
<li>Set the <strong>Type Convert</strong> component's <strong>Output Type</strong> to <strong>DataFrame</strong>.</li>
|
||
</ol>
|
||
</li>
|
||
</ol><p>Now the flow is ready for you to add the <strong>DataFrame Operations</strong> component.</p></div></div></details>
|
||
</li>
|
||
<li>
|
||
<p>Add a <strong>DataFrame Operations</strong> component to the flow, and then connect <code>DataFrame</code> output from another component to the <strong>DataFrame</strong> input.</p>
|
||
<p>All operations in the <strong>DataFrame Operations</strong> component require at least one <code>DataFrame</code> input from another component.
|
||
If a component doesn't produce <code>DataFrame</code> output, you can use another component, such as the <strong>Type Convert</strong> component, to reformat the data before passing it to the <strong>DataFrame Operations</strong> component.
|
||
Alternatively, you could consider using a component that is designed to process the original data type, such as the <strong>Parser</strong> or <strong>Data Operations</strong> components.</p>
|
||
<p>If you are following along with the example flow, connect the <strong>Type Convert</strong> component's <strong>DataFrame Output</strong> port to the <strong>DataFrame</strong> input.</p>
|
||
</li>
|
||
<li>
|
||
<p>In the <strong>Operations</strong> field, select the operation you want to perform on the incoming <code>DataFrame</code>.
|
||
For example, the <strong>Filter</strong> operation filters the rows based on a specified column and value.</p>
|
||
<div class="theme-admonition theme-admonition-tip admonition_xJq3 alert alert--success"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 12 16"><path fill-rule="evenodd" d="M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"></path></svg></span>tip</div><div class="admonitionContent_BuS1"><p>You can select only one operation.
|
||
If you need to perform multiple operations on the data, you can chain multiple <strong>DataFrame Operations</strong> components together to execute each operation in sequence.
|
||
For more complex multi-step operations, like dramatic schema changes or pivots, consider using an LLM-powered component, like the <strong>Structured Output</strong> or <strong>Smart Function</strong> component, as a replacement or preparation for the <strong>DataFrame Operations</strong> component.</p></div></div>
|
||
<p>If you're following along with the example flow, select any operation that you want to apply to the data that was extracted by the <strong>Smart Function</strong> component.
|
||
To view the contents of the incoming <code>DataFrame</code>, click <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-play" aria-hidden="true"><polygon points="6 3 20 12 6 21 6 3"></polygon></svg> <strong>Run component</strong> on the <strong>Type Convert</strong> component, and then <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-text-search" aria-hidden="true"><path d="M21 6H3"></path><path d="M10 12H3"></path><path d="M10 18H3"></path><circle cx="17" cy="15" r="3"></circle><path d="m21 19-1.9-1.9"></path></svg> <strong>Inspect output</strong>.
|
||
If the <code>DataFrame</code> seems malformed, click <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-text-search" aria-hidden="true"><path d="M21 6H3"></path><path d="M10 12H3"></path><path d="M10 18H3"></path><circle cx="17" cy="15" r="3"></circle><path d="m21 19-1.9-1.9"></path></svg> <strong>Inspect output</strong> on each upstream component to determine where the error occurs, and then modify your flow's configuration as needed.
|
||
For example, if the <strong>Smart Function</strong> component didn't extract the expected fields, modify your instructions or verify that the given fields are present in the <strong>API Response</strong> output.</p>
|
||
</li>
|
||
<li>
|
||
<p>Configure the operation's parameters.
|
||
The specific parameters depend on the selected operation.
|
||
For example, if you select the <strong>Filter</strong> operation, you must define a filter condition using the <strong>Column Name</strong>, <strong>Filter Value</strong>, and <strong>Filter Operator</strong> parameters.
|
||
For more information, see <a href="#dataframe-operations-parameters">DataFrame Operations parameters</a></p>
|
||
</li>
|
||
<li>
|
||
<p>To test the flow, click <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-play" aria-hidden="true"><polygon points="6 3 20 12 6 21 6 3"></polygon></svg> <strong>Run component</strong> on the <strong>DataFrame Operations</strong> component, and then click <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-text-search" aria-hidden="true"><path d="M21 6H3"></path><path d="M10 12H3"></path><path d="M10 18H3"></path><circle cx="17" cy="15" r="3"></circle><path d="m21 19-1.9-1.9"></path></svg> <strong>Inspect output</strong> to view the new <code>DataFrame</code> created from the <strong>Filter</strong> operation.</p>
|
||
<p>If you want to view the output in the <strong>Playground</strong>, connect the <strong>DataFrame Operations</strong> component's output to a <strong>Chat Output</strong> component, rerun the <strong>DataFrame Operations</strong> component, and then click <strong>Playground</strong>.</p>
|
||
</li>
|
||
</ol>
|
||
<p>For another example, see <a href="/components-logic#conditional-looping">Conditional looping</a>.</p>
|
||
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="dataframe-operations-parameters">DataFrame Operations parameters<a href="#dataframe-operations-parameters" class="hash-link" aria-label="Direct link to DataFrame Operations parameters" title="Direct link to DataFrame Operations parameters"></a></h3>
|
||
<p>Most <strong>DataFrame Operations</strong> parameters are conditional because they only apply to specific operations.</p>
|
||
<p>The only permanent parameters are <strong>DataFrame</strong> (<code>df</code>), which is the <code>DataFrame</code> input, and <strong>Operation</strong> (<code>operation</code>), which is the operation to perform on the <code>DataFrame</code>.
|
||
Once you select an operation, the conditional parameters for that operation appear on the <strong>DataFrame Operations</strong> component.</p>
|
||
<div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Add Column</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Drop Column</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Filter</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Head</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Rename Column</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Replace Value</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Select Columns</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Sort</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Tail</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Drop Duplicates</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><p>The <strong>Add Column</strong> operation allows you to add a new column to the <code>DataFrame</code> with a constant value.</p><p>The parameters are <strong>New Column Name</strong> (<code>new_column_name</code>) and <strong>New Column Value</strong> (<code>new_column_value</code>).</p></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><p>The <strong>Drop Column</strong> operation allows you to remove a column from the <code>DataFrame</code>, specified by <strong>Column Name</strong> (<code>column_name</code>).</p></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><p>The <strong>Filter</strong> operation allows you to filter the <code>DataFrame</code> based on a specified condition.
|
||
The output is a <code>DataFrame</code> containing only the rows that matched the filter condition.</p><p>Provide the following parameters:</p><ul>
|
||
<li><strong>Column Name</strong> (<code>column_name</code>): The name of the column to filter on.</li>
|
||
<li><strong>Filter Value</strong> (<code>filter_value</code>): The value to filter on.</li>
|
||
<li><strong>Filter Operator</strong> (<code>filter_operator</code>): The operator to use for filtering, one of <code>equals</code> (default), <code>not equals</code>, <code>contains</code>, <code>starts with</code>, <code>ends with</code>, <code>greater than</code>, or <code>less than</code>.</li>
|
||
</ul></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><p>The <strong>Head</strong> operation allows you to retrieve the first <code>n</code> rows of the <code>DataFrame</code>, where <code>n</code> is set in <strong>Number of Rows</strong> (<code>num_rows</code>).
|
||
The default is <code>5</code>.</p><p>The output is a <code>DataFrame</code> containing only the selected rows.</p></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><p>The <strong>Rename Column</strong> operation allows you to rename an existing column in the <code>DataFrame</code>.</p><p>The parameters are <strong>Column Name</strong> (<code>column_name</code>), which is the current name, and <strong>New Column Name</strong> (<code>new_column_name</code>).</p></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><p>The <strong>Replace Value</strong> operation allows you to replace values in a specific column of the <code>DataFrame</code>.
|
||
This operation replaces a target value with a new value.
|
||
All cells matching the target value are replaced with the new value in the new <code>DataFrame</code> output.</p><p>Provide the following parameters:</p><ul>
|
||
<li><strong>Column Name</strong> (<code>column_name</code>): The name of the column to modify.</li>
|
||
<li><strong>Value to Replace</strong> (<code>replace_value</code>): The value that you want to replace.</li>
|
||
<li><strong>Replacement Value</strong> (<code>replacement_value</code>): The new value to use.</li>
|
||
</ul></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><p>The <strong>Select Columns</strong> operation allows you to select one or more specific columns from the <code>DataFrame</code>.</p><p>Provide a list of column names in <strong>Columns to Select</strong> (<code>columns_to_select</code>).
|
||
In the visual editor, click <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-plus" aria-hidden="true"><path d="M5 12h14"></path><path d="M12 5v14"></path></svg> <strong>Add More</strong> to add multiple fields, and then enter one column name in each field.</p><p>The output is a <code>DataFrame</code> containing only the specified columns.</p></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><p>The <strong>Sort</strong> operation allows you to sort the <code>DataFrame</code> on a specific column in ascending or descending order.</p><p>Provide the following parameters:</p><ul>
|
||
<li><strong>Column Name</strong> (<code>column_name</code>): The name of the column to sort on.</li>
|
||
<li><strong>Sort Ascending</strong> (<code>ascending</code>): Whether to sort in ascending or descending order. If enabled (true), sorts in ascending order; if disabled (false), sorts in descending order. Default: Enabled (true)</li>
|
||
</ul></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><p>The <strong>Tail</strong> operation allows you to retrieve the last <code>n</code> rows of the <code>DataFrame</code>, where <code>n</code> is set in <strong>Number of Rows</strong> (<code>num_rows</code>).
|
||
The default is <code>5</code>.</p><p>The output is a <code>DataFrame</code> containing only the selected rows.</p></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><p>The <strong>Drop Duplicates</strong> operation removes rows from the <code>DataFrame</code> by identifying all duplicate values within a single column.</p><p>The only parameter is the <strong>Column Name</strong> (<code>column_name</code>).</p><p>When the flow runs, all rows with duplicate values in the given column are removed.
|
||
The output is a <code>DataFrame</code> containing all columns from the original <code>DataFrame</code>, but only rows with non-duplicate values.</p></div></div></div>
|
||
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="llm-router">LLM Router<a href="#llm-router" class="hash-link" aria-label="Direct link to LLM Router" title="Direct link to LLM Router"></a></h2>
|
||
<p>The <strong>LLM Router</strong> component routes requests to the most appropriate LLM based on <a href="https://openrouter.ai/docs/quickstart" target="_blank" rel="noopener noreferrer">OpenRouter</a> model specifications.</p>
|
||
<p>To use the component in a flow, you connect multiple <strong>Language Model</strong> components to the <strong>LLM Router</strong> components.
|
||
One model is the judge LLM that analyzes input messages to understand the evaluation context, selects the most appropriate model from the other attached LLMs, and then routes the input to the selected model.
|
||
The selected model processes the input, and then returns the generated response.</p>
|
||
<p>The following example flow has three <strong>Language Model</strong> components.
|
||
One is the judge LLM, and the other two are in the LLM pool for request routing.
|
||
The <strong>Chat Input</strong> and <strong>Chat Output</strong> components create a seamless chat interaction where you send a message and receive a response without any user awareness of the underlying routing.</p>
|
||
<p><img decoding="async" loading="lazy" alt="LLM Router component" src="/assets/images/component-llm-router-1b417082a0208a70065bc177a78fab67.png" width="3316" height="2492" class="img_ev3q"></p>
|
||
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="llm-router-parameters">LLM Router parameters<a href="#llm-router-parameters" class="hash-link" aria-label="Direct link to LLM Router parameters" title="Direct link to LLM Router parameters"></a></h3>
|
||
<p>Some <strong>LLM Router</strong> component input parameters are hidden by default in the visual editor.
|
||
You can toggle parameters through the <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-sliders-horizontal" aria-hidden="true"><line x1="21" x2="14" y1="4" y2="4"></line><line x1="10" x2="3" y1="4" y2="4"></line><line x1="21" x2="12" y1="12" y2="12"></line><line x1="8" x2="3" y1="12" y2="12"></line><line x1="21" x2="16" y1="20" y2="20"></line><line x1="12" x2="3" y1="20" y2="20"></line><line x1="14" x2="14" y1="2" y2="6"></line><line x1="8" x2="8" y1="10" y2="14"></line><line x1="16" x2="16" y1="18" y2="22"></line></svg> <strong>Controls</strong> in the <a href="/concepts-components#component-menus">component's header menu</a>.</p>
|
||
<table><thead><tr><th>Name</th><th>Display Name</th><th>Info</th></tr></thead><tbody><tr><td><code>models</code></td><td><strong>Language Models</strong></td><td>Input parameter. Connect <a href="/data-types#languagemodel"><code>LanguageModel</code></a> output from multiple <a href="/components-models"><strong>Language Model</strong> components</a> to create a pool of models. The <code>judge_llm</code> selects models from this pool when routing requests. The first model you connect is the default model if there is a problem with model selection or routing.</td></tr><tr><td><code>input_value</code></td><td><strong>Input</strong></td><td>Input parameter. The incoming query to be routed to the model selected by the judge LLM.</td></tr><tr><td><code>judge_llm</code></td><td><strong>Judge LLM</strong></td><td>Input parameter. Connect <code>LanguageModel</code> output from <em>one</em> <strong>Language Model</strong> component to serve as the judge LLM for request routing.</td></tr><tr><td><code>optimization</code></td><td><strong>Optimization</strong></td><td>Input parameter. Set a preferred characteristic for model selection by the judge LLM. The options are <code>quality</code> (highest response quality), <code>speed</code> (fastest response time), <code>cost</code> (most cost-effective model), or <code>balanced</code> (equal weight for quality, speed, and cost). Default: <code>balanced</code></td></tr><tr><td><code>use_openrouter_specs</code></td><td><strong>Use OpenRouter Specs</strong></td><td>Input parameter. Whether to fetch model specifications from the OpenRouter API.</td></tr><tr><td>If false, only the model name is provided to the judge LLM. Default: Enabled (true)</td><td></td><td></td></tr><tr><td><code>timeout</code></td><td><strong>API Timeout</strong></td><td>Input parameter. Set a timeout duration in seconds for API requests made by the router. Default: <code>10</code></td></tr><tr><td><code>fallback_to_first</code></td><td><strong>Fallback to First Model</strong></td><td>Input parameter. Whether to use the first LLM in <code>models</code> as a backup if routing fails to reach the selected model. Default: Enabled (true)</td></tr></tbody></table>
|
||
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="llm-router-outputs">LLM Router outputs<a href="#llm-router-outputs" class="hash-link" aria-label="Direct link to LLM Router outputs" title="Direct link to LLM Router outputs"></a></h3>
|
||
<p>The <strong>LLM Router</strong> component provides three output options.
|
||
You can set the desired output type near the component's output port.</p>
|
||
<ul>
|
||
<li>
|
||
<p><strong>Output</strong>: A <code>Message</code> containing the response to the original query as generated by the selected LLM.
|
||
Use this output for regular chat interactions.</p>
|
||
</li>
|
||
<li>
|
||
<p><strong>Selected Model Info</strong>: A <code>Data</code> object containing information about the selected model, such as its name and version.</p>
|
||
</li>
|
||
<li>
|
||
<p><strong>Routing Decision</strong>: A <code>Message</code> containing the judge model's reasoning for selecting a particular model, including input query length and number of models considered.
|
||
For example:</p>
|
||
<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>Model Selection Decision:</span></div></div><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span>- Selected Model Index: 0</span></div></div><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span>- Selected Langflow Model Name: gpt-4o-mini</span></div></div><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span>- Selected API Model ID (if resolved): openai/gpt-4o-mini</span></div></div><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span>- Optimization Preference: cost</span></div></div><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span>- Input Query Length: 27 characters (~5 tokens)</span></div></div><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span>- Number of Models Considered: 2</span></div></div><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span>- Specifications Source: OpenRouter API</span></div></div><br></code></div></div>
|
||
<p>This is useful for debugging if you feel the judge model isn't selecting the best model.</p>
|
||
</li>
|
||
</ul>
|
||
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="parser">Parser<a href="#parser" class="hash-link" aria-label="Direct link to Parser" title="Direct link to Parser"></a></h2>
|
||
<p>The <strong>Parser</strong> component extracts text from structured data (<code>DataFrame</code> or <code>Data</code>) using a template or direct stringification.
|
||
The output is a <code>Message</code> containing the parsed text.</p>
|
||
<p>This is a versatile component for data extraction and manipulation in your flows.
|
||
For examples of <strong>Parser</strong> components in flows, see the following:</p>
|
||
<ul>
|
||
<li><a href="#batch-run"><strong>Batch Run</strong> component</a></li>
|
||
<li><a href="#structured-output"><strong>Structured Output</strong> component</a></li>
|
||
<li><strong>Financial Report Parser</strong> template</li>
|
||
<li><a href="/components-vector-stores"><strong>Vector Store</strong> components</a></li>
|
||
<li><a href="/webhook">Trigger flows with webhooks</a></li>
|
||
<li><a href="/chat-with-rag">Create a vector RAG chatbot</a></li>
|
||
</ul>
|
||
<p><img decoding="async" loading="lazy" alt="A flow that uses a Parser component to extract text from a Structured Output component." src="/assets/images/component-parser-1d1d72593f02991e5b14b6b1c112a744.png" width="4000" height="2202" class="img_ev3q"></p>
|
||
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="parsing-modes">Parsing modes<a href="#parsing-modes" class="hash-link" aria-label="Direct link to Parsing modes" title="Direct link to Parsing modes"> |