Skip to main content

Data Components

Data components load data from a source into your flow. They may perform some processing or type checking, like converting raw HTML data into text, or ensuring your loaded file is of an acceptable type.

Use a data component in a flow

The URL data component loads content from a list of URLs. In the component’s URLs field, enter the URL you want to load To add multiple URL fields, click the add button Alternatively, connect a component that outputs the Message type, like the Chat Input component, to supply your URLs from a component Data Component 1 Pn

API Request Component

This component makes HTTP requests using URLs or cURL commands.

Setup Instructions

  1. Connect the Data output to a component that accepts the input (for example, connect the API Request component to a Chat Output component)
Data Component 2 Pn
  1. In the API component’s URLs field, enter the endpoint for your request
  2. In the Method field, enter the type of request (GET, POST, PATCH, PUT, or DELETE)
  3. Optionally, enable the Use cURL button to create a field for pasting curl requests
  4. Click Playground, then click Run Flow to execute your request
Inputs
NameDisplay NameInfo
urlsURLsEnter one or more URLs, separated by commas.
curlcURLPaste a curl command to populate the dictionary fields for headers and body.
methodMethodThe HTTP method to use.
use_curlUse cURLEnable cURL mode to populate fields from a cURL command.
query_paramsQuery ParametersThe query parameters to append to the URL.
bodyBodyThe body to send with the request as a dictionary (for POST, PATCH, PUT).
headersHeadersThe headers to send with the request as a dictionary.
timeoutTimeoutThe timeout to use for the request.
follow_redirectsFollow RedirectsWhether to follow http redirects.
save_to_fileSave to FileSave the API response to a temporary file.
include_httpx_metadataInclude HTTPx MetadataInclude properties such as headers, status_code, response_headers, and redirection_history in the output.
Outputs
NameDisplay NameInfo
dataDataThe result of the API requests. Returns a Data object containing source URL and results.
dataframeDataFrameConverts the API response data into a tabular DataFrame format.

File

This component loads and parses files of various supported formats and converts the content into a Data object. It supports multiple file types and provides options for parallel processing and error handling. To Load a Document
  1. Click the Select files button
  2. Select a local file or a file loaded with File management
    Inputs
    NameDisplay NameInfo
    pathFilesThe path to files to load. Supports individual files or bundled archives.
    file_pathServer File PathA Data object with a file_path property pointing to the server file or a Message object with a path to the file. Supersedes ‘Path’ but supports the same file types.
    separatorSeparatorThe separator to use between multiple outputs in Message format.
    silent_errorsSilent ErrorsIf true, errors do not raise an exception.
    delete_server_file_after_processingDelete Server File After ProcessingIf true, the Server File Path is deleted after processing.
    ignore_unsupported_extensionsIgnore Unsupported ExtensionsIf true, files with unsupported extensions are not processed.
    ignore_unspecified_filesIgnore Unspecified FilesIf true, Data with no file_path property is ignored.
    use_multithreading[Deprecated] Use MultithreadingSet ‘Processing Concurrency’ greater than 1 to enable multithreading. This option is deprecated.
    concurrency_multithreadingProcessing ConcurrencyWhen multiple files are being processed, the number of files to process concurrently. Default is 1. Values greater than 1 enable parallel processing for 2 or more files.
    Outputs
    NameDisplay NameInfo
    dataDataThe parsed content of the file as a Data object.
    dataframeDataFrameThe file content as a DataFrame object.
    messageMessageThe file content as a Message object.

Supported File Types

Text Files

  • .txt - Plain text files
  • .md, .mdx - Markdown files
  • .csv - Comma-separated values
  • .json - JSON data files
  • .yaml, .yml - YAML configuration files
  • .xml - XML documents
  • .html, .htm - HTML web pages
  • .pdf - PDF documents
  • .docx - Microsoft Word documents

Code Files

  • .py - Python source code
  • .js - JavaScript files
  • .ts, .tsx - TypeScript files
  • .sh - Shell scripts
  • .sql - SQL query files

Archive Formats

For bundling multiple files:
  • .zip - ZIP archives
  • .tar - TAR archives
  • .tgz - Gzipped TAR archives
  • .bz2 - Bzip2 compressed files
  • .gz - Gzip compressed files

SQL Query

This component executes SQL queries on a specified database.
Inputs
NameDisplay NameInfo
queryQueryThe SQL query to execute.
database_urlDatabase URLThe URL of the database.
include_columnsInclude ColumnsInclude columns in the result.
passthroughPassthroughIf an error occurs, return the query instead of raising an exception.
add_errorAdd ErrorAdd the error to the result.
Outputs
NameDisplay NameInfo
resultResultThe result of the SQL query execution.

URL

This component fetches content from one or more URLs, processes the content, and returns it in various formats. It supports output in plain text or raw HTML. In the component’s URLs field, enter the URL you want to load
  1. To use this component in a flow, connect the DataFrame output to a component that accepts the input. For example, connect the URL component to a Chat Output component.
Url Pn
  1. In the URL component’s URLs field, enter the URL for your request. This example uses llmc.org.
  2. Optionally, in the Max Depth field, enter how many pages away from the initial URL you want to crawl. Select 1 to crawl only the page specified in the URLs field. Select 2 to crawl all pages linked from that page. The component crawls by link traversal, not by URL path depth.
  3. Click Playground, and then click Run Flow. The text contents of the URL are returned to the Playground as a structured DataFrame.
  4. In the URL component, change the output port to Message, and then run the flow again. The text contents of the URL are returned as unstructured raw text, which you can extract patterns from with the Regex Extractor tool.
  5. Connect the URL component to a Regex Extractor and Chat Output.
Url 4 Pn
  1. In the Regex Extractor tool, enter a pattern to extract text from the URL component’s raw output. This example extracts the first paragraph from the “In the News” section of https://en.wikipedia.org/wiki/Main_Page.
Result:
Inputs
NameDisplay NameInfo
urlsURLsClick the ’+’ button to enter one or more URLs to crawl recursively.
max_depthMax DepthControls how many ‘clicks’ away from the initial page the crawler will go.
prevent_outsidePrevent OutsideIf enabled, only crawls URLs within the same domain as the root URL.
use_asyncUse AsyncIf enabled, uses asynchronous loading which can be significantly faster but might use more system resources.
formatOutput FormatOutput Format. Use Text to extract the text from the HTML or HTML for the raw HTML content.
timeoutTimeoutTimeout for the request in seconds.
headersHeadersThe headers to send with the request.
Outputs
NameDisplay NameInfo
dataDataA list of Data objects containing fetched content and metadata.
textMessageThe fetched content as formatted text.
dataframeDataFrameThe content formatted as a DataFrame object.

Webhook

This component defines a webhook trigger that runs a flow when it receives an HTTP POST request. If the input is not valid JSON, the component wraps it in a payload object so that it can be processed and still trigger the flow. The component does not require an API key. When you add a Webhook component to a flow, the flow’s API access pane exposes an additional Webhook cURL tab that contains a POST /v1/webhook/$FLOW_ID code snippet. You can use this request to send data to the Webhook component and trigger the flow. For example: To test the webhook component:
  1. Add a Webhook component to the flow.
  2. Connect the Webhook component’s Data output to the Data input of a Parser component.
  3. Connect the Parser component’s Parsed Text output to the Text input of a Chat Output component.
  4. In the Parser component, under Mode, select Stringify. This mode passes the webhook’s data as a string for the Chat Output component to print.
  5. To send a POST request, copy the code from the Webhook cURL tab in the API pane and paste it into a terminal.
  6. Send the POST request.
  7. Open the Playground. Your JSON data is posted to the Chat Output component, which indicates that the webhook component is correctly triggering the flow.
Inputs
NameDisplay NameDescription
dataPayloadReceives a payload from external systems through HTTP POST requests.
curlcURLThe cURL command template for making requests to this webhook.
endpointEndpointThe endpoint URL where this webhook receives requests.
Outputs
NameDisplay NameDescription
output_dataDataOutputs processed data from the webhook input, and returns an empty Data object if no input is provided. If the input is not valid JSON, the component wraps it in a payload object.

Gmail Loader

This component loads emails from Gmail using provided credentials and filters. For more information about creating a service account JSON, see Service Account JSON.
Inputs
InputTypeDescription
json_stringSecretStrInputA JSON string containing OAuth 2.0 access token information for service account access.
label_idsMessageTextInputA comma-separated list of label IDs to filter emails.
max_resultsMessageTextInputThe maximum number of emails to load.
Outputs
OutputTypeDescription
dataDataThe loaded email data.

Google Drive Loader

This component loads documents from Google Drive using the provided credentials and a single document ID. For more information about creating a service account JSON, see Service Account JSON.
Inputs
InputTypeDescription
json_stringSecretStrInputA JSON string containing OAuth 2.0 access token information for service account access.
document_idMessageTextInputA single Google Drive document ID.
Outputs
OutputTypeDescription
docsDataThe loaded document data.
This component searches Google Drive files using provided credentials and query parameters. For more information about creating a service account JSON, see Service Account JSON.
Inputs
InputTypeDescription
token_stringSecretStrInputA JSON string containing OAuth 2.0 access token information for service account access.
query_itemDropdownInputThe field to query.
valid_operatorDropdownInputThe operator to use in the query.
search_termMessageTextInputThe value to search for in the specified query item.
query_stringMessageTextInputThe query string used for searching.
Outputs
OutputTypeDescription
doc_urlsList[str]The URLs of the found documents.
doc_idsList[str]The IDs of the found documents.
doc_titlesList[str]The titles of the found documents.
DataDataThe document titles and URLs in a structured format.