diff --git a/docs/docs/API-Reference/api-reference-api-examples.md b/docs/docs/API-Reference/api-reference-api-examples.md index 0c7172c37..3001065e3 100644 --- a/docs/docs/API-Reference/api-reference-api-examples.md +++ b/docs/docs/API-Reference/api-reference-api-examples.md @@ -24,8 +24,8 @@ export LANGFLOW_URL="http://127.0.0.1:7860" ``` * Export the `flow-id` in your terminal. -The `flow-id` is found in the [API pane](/concepts-api) or in the flow's URL. -```bash +The `flow-id` is found in the [Publish pane](/concepts-publish) or in the flow's URL. +```plain export FLOW_ID="359cd752-07ea-46f2-9d3b-a4407ef618da" ``` diff --git a/docs/docs/Components/components-agents.md b/docs/docs/Components/components-agents.md index 70757420c..d3b660a42 100644 --- a/docs/docs/Components/components-agents.md +++ b/docs/docs/Components/components-agents.md @@ -253,7 +253,7 @@ For more information, see the [CrewAI documentation](https://docs.crewai.com/how | Name | Display Name | Info | |------|--------------|------| -| task_output | Sequential Task | List of SequentialTask objects representing the created task(s) | +| task_output | Sequential Task | List of SequentialTask objects representing the created tasks | ## Tool Calling Agent diff --git a/docs/docs/Components/components-bundles.md b/docs/docs/Components/components-bundles.md new file mode 100644 index 000000000..20086e509 --- /dev/null +++ b/docs/docs/Components/components-bundles.md @@ -0,0 +1,10 @@ +--- +title: Bundles +slug: /components-bundle-components +--- + +**Bundles** are third-party components grouped by provider. + +For more information on bundled components, see the component provider's documentation. + + diff --git a/docs/docs/Components/components-data.md b/docs/docs/Components/components-data.md index d756fe31c..3f33bb628 100644 --- a/docs/docs/Components/components-data.md +++ b/docs/docs/Components/components-data.md @@ -75,25 +75,73 @@ This component recursively loads files from a directory, with options for file t ## File -The FileComponent is a class that loads and parses text files of various supported formats, converting the content into a Data object. It supports multiple file types and provides an option for silent error handling. +This component loads and parses files of various supported formats and converts the content into a [Data](/concepts-objects) object. It supports multiple file types and provides options for parallel processing and error handling. -The maximum supported file size is 100 MB. +To load a document, follow these steps: + +1. Click the **Select files** button. +2. Select a local file or a file loaded with [File management](/concepts-file-management), and then click **Select file**. + +The loaded file name appears in the component. + +The default maximum supported file size is 100 MB. +To modify this value, see [--max-file-size-upload](/environment-variables#LANGFLOW_MAX_FILE_SIZE_UPLOAD). ### Inputs -| Name | Display Name | Info | -| ------------- | ------------- | -------------------------------------------- | -| path | Path | File path to load. | +| Name | Display Name | Info | +|------|--------------|------| +| path | Files | Path to file(s) to load. Supports individual files or bundled archives. | +| file_path | Server File Path | 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. | +| separator | Separator | Specify the separator to use between multiple outputs in Message format. | | silent_errors | Silent Errors | If true, errors do not raise an exception. | +| delete_server_file_after_processing | Delete Server File After Processing | If true, the Server File Path is deleted after processing. | +| ignore_unsupported_extensions | Ignore Unsupported Extensions | If true, files with unsupported extensions are not processed. | +| ignore_unspecified_files | Ignore Unspecified Files | If true, `Data` with no `file_path` property is ignored. | +| use_multithreading | [Deprecated] Use Multithreading | Set 'Processing Concurrency' greater than `1` to enable multithreading. This option is deprecated. | +| concurrency_multithreading | Processing Concurrency | When 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 -| Name | Display Name | Info | -| ---- | ------------ | -------------------------------------------- | -| data | Data | Parsed content of the file as a Data object. | +| Name | Display Name | Info | +|------|--------------|------| +| data | Data | Parsed content of the file as a [Data](/concepts-objects) object. | +| dataframe | DataFrame | File content as a [DataFrame](/concepts-objects#dataframe-object) object. | +| message | Message | File content as a [Message](/concepts-objects#message-object) object. | + + +### Supported File Types + +Text files: +- `.txt` - Text files +- `.md`, `.mdx` - Markdown files +- `.csv` - CSV files +- `.json` - JSON files +- `.yaml`, `.yml` - YAML files +- `.xml` - XML files +- `.html`, `.htm` - HTML files +- `.pdf` - PDF files +- `.docx` - Word documents +- `.py` - Python files +- `.sh` - Shell scripts +- `.sql` - SQL files +- `.js` - JavaScript files +- `.ts`, `.tsx` - TypeScript 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 ## Gmail Loader +:::info +Google components are available in the **Components** menu under **Bundles**. +For more information, see [Integrate Google OAuth with Langflow](/integrations-setup-google-oauth-langflow). +::: + This component loads emails from Gmail using provided credentials and filters. For more on creating a service account JSON, see [Service Account JSON](https://developers.google.com/identity/protocols/oauth2/service-account). @@ -114,6 +162,11 @@ For more on creating a service account JSON, see [Service Account JSON](https:// ## Google Drive Loader +:::info +Google components are available in the **Components** menu under **Bundles**. +For more information, see [Integrate Google OAuth with Langflow](/integrations-setup-google-oauth-langflow). +::: + This component loads documents from Google Drive using provided credentials and a single document ID. For more on creating a service account JSON, see [Service Account JSON](https://developers.google.com/identity/protocols/oauth2/service-account). @@ -133,6 +186,11 @@ For more on creating a service account JSON, see [Service Account JSON](https:// ## Google Drive Search +:::info +Google components are available in the **Components** menu under **Bundles**. +For more information, see [Integrate Google OAuth with Langflow](/integrations-setup-google-oauth-langflow). +::: + This component searches Google Drive files using provided credentials and query parameters. For more on creating a service account JSON, see [Service Account JSON](https://developers.google.com/identity/protocols/oauth2/service-account). @@ -178,19 +236,24 @@ This component executes SQL queries on a specified database. ## URL -This component fetches content from one or more URLs, processes the content, and returns it as a list of [Data](/concepts-objects) objects. +This component fetches content from one or more URLs, processes the content, and returns it in various formats. It supports output in plain text, raw HTML, or JSON, with options for cleaning and separating multiple outputs. ### Inputs -| Name | Display Name | Info | -| ---- | ------------ | ---------------------- | -| urls | URLs | Enter one or more URLs | +| Name | Display Name | Info | +|------|--------------|------| +| urls | URLs | Enter one or more URLs. URLs are automatically validated and cleaned. | +| format | Output Format | Output Format. Use **Text** to extract text from the HTML, **Raw HTML** for the raw HTML content, or **JSON** to extract JSON from the HTML. | +| separator | Separator | Specify the separator to use between multiple outputs. Default for **Text** is `\n\n`. Default for **Raw HTML** is `\n\n`. | +| clean_extra_whitespace | Clean Extra Whitespace | Whether to clean excessive blank lines in the text output. Only applies to `Text` format. | ### Outputs -| Name | Display Name | Info | -| ---- | ------------ | ------------------------------------------------------------ | -| data | Data | List of Data objects containing fetched content and metadata | +| Name | Display Name | Info | +|------|--------------|------| +| data | Data | List of [Data](/concepts-objects) objects containing fetched content and metadata. | +| text | Text | Fetched content as formatted text, with applied separators and cleaning. | +| dataframe | DataFrame | Content formatted as a [Data](/concepts-objects#dataframe-object) object. | ## Webhook @@ -219,12 +282,14 @@ Your JSON data is posted to the **Chat Output** component, which indicates that ### Inputs -| Name | Type | Description | -| ---- | ------ | ---------------------------------------------- | -| data | String | JSON payload for testing the webhook component | +| Name | Display Name | Description | +|------|--------------|-------------| +| data | Payload | Receives a payload from external systems through HTTP POST requests. | +| curl | cURL | The cURL command template for making requests to this webhook. | +| endpoint | Endpoint | The endpoint URL where this webhook receives requests. | ### Outputs -| Name | Type | Description | -| ----------- | ---- | ------------------------------------- | -| output_data | Data | Processed data from the webhook input | +| Name | Display Name | Description | +|------|--------------|-------------| +| output_data | Data | Outputs processed data from the webhook input, and returns an empty [Data](/concepts-objects) object if no input is provided. If the input is not valid JSON, the component wraps it in a `payload` object. | diff --git a/docs/docs/Components/components-helpers.md b/docs/docs/Components/components-helpers.md index 7a5a1b8c8..c2de8d86b 100644 --- a/docs/docs/Components/components-helpers.md +++ b/docs/docs/Components/components-helpers.md @@ -38,6 +38,10 @@ The Batch Run component runs a language model over each row of a [DataFrame](/co ## Create List +:::important +This component is in **Legacy**, which means it is no longer in active development as of Langflow version 1.3. +::: + This component dynamically creates a record with a specified number of fields. ### Inputs @@ -135,6 +139,48 @@ It provides flexibility in managing message storage and retrieval within a chat |------|--------------|------| | stored_messages | Stored Messages | The list of stored messages after the current message has been added. | +## Output Parser + +:::important +This component is in **Legacy**, which means it is no longer in active development as of Langflow version 1.3. +::: + +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 `CommaSeparatedListOutputParser`. + +:::note +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. +::: + +Both the **Output Parser** and **Structured Output** components format LLM responses, but they have different use cases. +The **Output Parser** is simpler and focused on converting responses into comma-separated lists. Use this when you just need a list of items, for example `["item1", "item2", "item3"]`. +The **Structured Output** 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. + +To use this component: + +1. Create a Prompt component and connect the Output Parser's `format_instructions` output to it. This ensures the LLM knows how to format its response. +2. Write your actual prompt text in the Prompt component, including the `{format_instructions}` variable. +For example, in your Prompt component, the template might look like: +``` +{format_instructions} +Please list three fruits. +``` +3. Connect the `output_parser` output to your LLM model. + +4. The output parser converts this into a Python list: `["apple", "banana", "orange"]`. + +### Inputs + +| Name | Display Name | Info | +|------|--------------|------| +| parser_type | Parser | Select the parser type. Currently supports "CSV". | + +### Outputs + +| Name | Display Name | Info | +|------|--------------|------| +| format_instructions | Format Instructions | Pass to a prompt template to include formatting instructions for LLM responses. | +| output_parser | Output Parser | The constructed output parser that can be used to parse LLM responses. | + ## Structured output This component transforms LLM responses into structured data formats. diff --git a/docs/docs/Components/components-logic.md b/docs/docs/Components/components-logic.md index 04ac64ddf..b87324bbb 100644 --- a/docs/docs/Components/components-logic.md +++ b/docs/docs/Components/components-logic.md @@ -36,9 +36,7 @@ It includes code examples of REST and gRPC implementations to demonstrate integr ## Conditional router (If-Else component) -This component routes an input message to a corresponding output based on text comparison. - -The ConditionalRouterComponent routes messages based on text comparison. It evaluates a condition by comparing two text inputs using a specified operator and routes the message accordingly. +This component routes messages by comparing two strings. It evaluates a condition by comparing two text inputs using the specified operator and routes the message to `true_result` or `false_result`. ### Inputs @@ -46,11 +44,11 @@ The ConditionalRouterComponent routes messages based on text comparison. It eval |----------------|----------|-------------------------------------------------------------------| | input_text | String | The primary text input for the operation. | | match_text | String | The text input to compare against. | -| operator | Dropdown | The operator to apply for comparing the texts. | -| case_sensitive | Boolean | If true, the comparison will be case sensitive. | +| operator | Dropdown | The operator to compare texts. Options: "equals", "not equals", "contains", "starts with", "ends with", "regex". Default: "equals". | +| case_sensitive | Boolean | If true, the comparison is case sensitive. This setting is ignored for regex comparison. Default: false. | | message | Message | The message to pass through either route. | -| max_iterations | Integer | The maximum number of iterations for the conditional router. | -| default_route | Dropdown | The default route to take when max iterations are reached. | +| max_iterations | Integer | (Advanced) The maximum number of iterations for the conditional router. Default: 10. | +| default_route | Dropdown | (Advanced) The default route to take when max iterations are reached. Options: "true_result" or "false_result". Default: "false_result". | ### Outputs @@ -59,9 +57,26 @@ The ConditionalRouterComponent routes messages based on text comparison. It eval | true_result | Message | The output when the condition is true. | | false_result | Message | The output when the condition is false. | -## Data conditional router +### Operator Behavior -This component routes `Data` objects based on a condition applied to a specified key, including boolean validation. +The **If-else** component includes a comparison operator to compare the values in `input_text` and `match_text`. + +All options respect the `case_sensitive` setting except **regex**. + +- **equals**: Exact match comparison +- **not equals**: Inverse of exact match +- **contains**: Checks if match_text is found within input_text +- **starts with**: Checks if input_text begins with match_text +- **ends with**: Checks if input_text ends with match_text +- **regex**: Performs regular expression matching. It is always case sensitive and ignores the case_sensitive setting. + +## Data Conditional Router + +:::important +This component is in **Legacy**, which means it is no longer in active development as of Langflow version 1.3. +::: + +This component routes `Data` objects based on a condition applied to a specified key, including boolean validation. It can process either a single Data object or a list of Data objects. This component is particularly useful in workflows that require conditional routing of complex data structures, enabling dynamic decision-making based on data content. @@ -69,10 +84,10 @@ This component is particularly useful in workflows that require conditional rout | Name | Type | Description | |---------------|----------|-----------------------------------------------------------------------------------| -| data_input | Data | The data object or list of data objects to process. | -| key_name | String | The name of the key in the data object to check. | -| operator | Dropdown | The operator to apply for comparing the values. | -| compare_value | String | The value to compare against (not used for boolean validator). | +| data_input | Data | The Data object or list of Data objects to process. Can handle both single items and lists. | +| key_name | String | The name of the key in the Data object to check. | +| operator | Dropdown | The operator to apply. Options: "equals", "not equals", "contains", "starts with", "ends with", "boolean validator". Default: "equals". | +| compare_value | String | The value to compare against. Not shown/used when operator is "boolean validator". | ### Outputs @@ -81,6 +96,25 @@ This component is particularly useful in workflows that require conditional rout | true_output | Data/List | Output when the condition is met. | | false_output | Data/List | Output when the condition is not met. | +### Operator Behavior + +- **equals**: Exact match comparison between the key's value and compare_value +- **not equals**: Inverse of exact match +- **contains**: Checks if compare_value is found within the key's value +- **starts with**: Checks if the key's value begins with compare_value +- **ends with**: Checks if the key's value ends with compare_value +- **boolean validator**: Treats the key's value as a boolean. The following values are considered true: + - Boolean `true` + - Strings: "true", "1", "yes", "y", "on" (case-insensitive) + - Any other value is converted using Python's `bool()` function + +### List Processing + +The following actions occur when processing a list of Data objects: +- Each object in the list is evaluated individually +- Objects meeting the condition go to true_output +- Objects not meeting the condition go to false_output +- If all objects go to one output, the other output is empty ## Flow as tool {#flow-as-tool} diff --git a/docs/docs/Components/components-models.md b/docs/docs/Components/components-models.md index f2f30e772..885ba09e7 100644 --- a/docs/docs/Components/components-models.md +++ b/docs/docs/Components/components-models.md @@ -247,6 +247,72 @@ For more information, see the [Hugging Face documentation](https://huggingface.c |-------|---------------|------------------------------------------------------------------| | model | LanguageModel | An instance of HuggingFaceHub configured with the specified parameters. | +## IBM watsonx.ai + +This component generates text using [IBM watsonx.ai](https://www.ibm.com/watsonx) foundation models. + +To use **IBM watsonx.ai** model components, replace a model component with the IBM watsonx.ai component in a flow. + +An example flow looks like the following: + +![IBM watsonx model component in a basic prompting flow](/img/component-watsonx-model.png) + +The values for **API endpoint**, **Project ID**, **API key**, and **Model Name** are found in your IBM watsonx.ai deployment. +For more information, see the [Langchain documentation](https://python.langchain.com/docs/integrations/chat/ibm_watsonx/). + +### Inputs + +| Name | Type | Description | +|---------------------|---------------|------------------------------------------------------------------| +| url | String | The base URL of the watsonx API. | +| project_id | String | Your watsonx Project ID. | +| api_key | SecretString | Your IBM watsonx API Key. | +| model_name | String | The name of the watsonx model to use. Options are dynamically fetched from the API. | +| max_tokens | Integer | The maximum number of tokens to generate. Default: `1000`. | +| stop_sequence | String | The sequence where generation should stop. | +| temperature | Float | Controls randomness in the output. Default: `0.1`. | +| top_p | Float | Controls nucleus sampling, which limits the model to tokens whose probability is below the `top_p` value. Range: Default: `0.9`. | +| frequency_penalty | Float | Controls frequency penalty. A positive value decreases the probability of repeating tokens, and a negative value increases the probability. Range: Default: `0.5`. | +| presence_penalty | Float | Controls presence penalty. A positive value increases the likelihood of new topics being introduced. Default: `0.3`. | +| seed | Integer | A random seed for the model. Default: `8`. | +| logprobs | Boolean | Whether to return log probabilities of output tokens or not. Default: `True`. | +| top_logprobs | Integer | The number of most likely tokens to return at each position. Default: `3`. | +| logit_bias | String | A JSON string of token IDs to bias or suppress. | + +### Outputs + +| Name | Type | Description | +|-------|---------------|------------------------------------------------------------------| +| model | LanguageModel | An instance of [ChatWatsonx](https://python.langchain.com/docs/integrations/chat/ibm_watsonx/) configured with the specified parameters. | + +## Language model + +This component generates text using either OpenAI or Anthropic language models. + +Use this component as a drop-in replacement for LLM models to switch between different model providers and models. + +Instead of swapping out model components when you want to try a different provider, like switching between OpenAI and Anthropic components, change the provider dropdown in this single component. This makes it easier to experiment with and compare different models while keeping the rest of your flow intact. + +For more information, see the [OpenAI documentation](https://platform.openai.com/docs) and [Anthropic documentation](https://docs.anthropic.com/). + +### Inputs + +| Name | Type | Description | +|---------------------|--------------|-----------------------------------------------------------------------------------------------| +| provider | String | The model provider to use. Options: "OpenAI", "Anthropic". Default: "OpenAI". | +| model_name | String | The name of the model to use. Options depend on the selected provider. | +| api_key | SecretString | The API Key for authentication with the selected provider. | +| input_value | String | The input text to send to the model. | +| system_message | String | A system message that helps set the behavior of the assistant (advanced). | +| stream | Boolean | Whether to stream the response. Default: `False` (advanced). | +| temperature | Float | Controls randomness in responses. Range: `[0.0, 1.0]`. Default: `0.1` (advanced). | + +### Outputs + +| Name | Type | Description | +|-------|---------------|------------------------------------------------------------------| +| model | LanguageModel | An instance of ChatOpenAI or ChatAnthropic configured with the specified parameters. | + ## LMStudio This component generates text using LM Studio's local language models. diff --git a/docs/docs/Components/components-processing.md b/docs/docs/Components/components-processing.md index 960c60318..20b685068 100644 --- a/docs/docs/Components/components-processing.md +++ b/docs/docs/Components/components-processing.md @@ -137,6 +137,11 @@ This component performs the following operations on Pandas [DataFrame](https://p ## Data to message +:::important +This component is in **Legacy**, which means it is no longer in active development as of Langflow version 1.3. +Instead, use the [Parser](#parser) component. +::: + :::important Prior to Langflow version 1.1.3, this component was named **Parse Data**. ::: @@ -220,6 +225,35 @@ The JSON cleaner component cleans JSON strings to ensure they are fully complian |------|--------------|------| | output | Cleaned JSON String | The resulting cleaned, repaired, and validated JSON string that fully complies with the JSON specification. | +## Lambda filter + +This component uses an LLM to generate a Lambda function for filtering or transforming structured data. + +To use the **Lambda filter** component, you must connect it to a [Language Model](/components-models#language-model) component, which the component uses to generate a function based on the natural language instructions in the **Instructions** field. + +This example gets JSON data from the `https://jsonplaceholder.typicode.com/users` API endpoint. +The **Instructions** field in the **Lambda filter** component specifies the task `extract emails`. +The connected LLM creates a filter based on the instructions, and successfully extracts a list of email addresses from the JSON data. + +![](/img/component-lambda-filter.png) + +### Inputs + +| Name | Display Name | Info | +|------|--------------|------| +| data | Data | The structured data to filter or transform using a Lambda function. | +| llm | Language Model | The connection port for a [Model](/components-models) component. | +| filter_instruction | Instructions | Natural language instructions for how to filter or transform the data using a Lambda function, such as `Filter the data to only include items where the 'status' is 'active'.` | +| sample_size | Sample Size | For large datasets, the number of characters to sample from the dataset head and tail. | +| max_size | Max Size | The number of characters for the data to be considered "large", which triggers sampling by the `sample_size` value. | + +### Outputs + +| Name | Display Name | Info | +|------|--------------|------| +| filtered_data | Filtered Data | The filtered or transformed [Data object](/concepts-objects#data-object). | +| dataframe | DataFrame | The filtered data as a [DataFrame](/concepts-objects#dataframe-object). | + ## LLM router This component routes requests to the most appropriate LLM based on OpenRouter model specifications. @@ -258,23 +292,50 @@ This component converts [Message](/concepts-objects#message-object) objects to [ | data | Data | The converted [Data](/concepts-objects#data-object) object. | +## Parser + +This component formats `DataFrame` or `Data` objects into text using templates, with an option to convert inputs directly to strings using `stringify`. + +To use this component, create variables for values in the `template` the same way you would in a [Prompt](/components-prompts) component. For `DataFrames`, use column names, for example `Name: {Name}`. For `Data` objects, use `{text}`. + +### Inputs + +| Name | Display Name | Info | +|------|--------------|------| +| stringify | Stringify | Enable to convert input to a string instead of using a template. | +| template | Template | Template for formatting using variables in curly brackets. For DataFrames, use column names (e.g. `Name: {Name}`). For Data objects, use `{text}`. | +| input_data | Data or DataFrame | The input to parse - accepts either a DataFrame or Data object. | +| sep | Separator | String used to separate rows/items. Default: newline. | +| clean_data | Clean Data | When stringify is enabled, cleans data by removing empty rows and lines. | + +### Outputs + +| Name | Display Name | Info | +|------|--------------|------| +| parsed_text | Parsed Text | The resulting formatted text as a [Message](/concepts-objects#message-object) object. | + ## Parse DataFrame +:::important +This component is in **Legacy**, which means it is no longer in active development as of Langflow version 1.3. +Instead, use the [Parser](#parser) component. +::: + This component converts DataFrames into plain text using templates. ### Inputs | Name | Display Name | Info | |------|--------------|------| -| df | DataFrame | The DataFrame to convert to text rows | -| template | Template | Template for formatting (use `{column_name}` placeholders) | -| sep | Separator | String to join rows in output | +| df | DataFrame | The DataFrame to convert to text rows. | +| template | Template | Template for formatting (use `{column_name}` placeholders). | +| sep | Separator | String to join rows in output. | ### Outputs | Name | Display Name | Info | |------|--------------|------| -| text | Text | All rows combined into single text | +| text | Text | All rows combined into single text. | ## Parse JSON diff --git a/docs/docs/Components/components-tools.md b/docs/docs/Components/components-tools.md index 418f6fc62..f60482ea1 100644 --- a/docs/docs/Components/components-tools.md +++ b/docs/docs/Components/components-tools.md @@ -220,6 +220,10 @@ This component allows you to call the Glean Search API. ## Google Search API +:::important +This component is in **Legacy**, which means it is no longer in active development as of Langflow version 1.3. +::: + This component allows you to call the Google Search API. ### Inputs @@ -337,6 +341,10 @@ The component dynamically updates its configuration based on the provided Python ## Python REPL Tool +:::important +This component is in **Legacy**, which means it is no longer in active development as of Langflow version 1.3. +::: + This component creates a Python REPL (Read-Eval-Print Loop) tool for executing Python code. ### Inputs @@ -392,6 +400,10 @@ This component creates a tool for searching using SearXNG, a metasearch engine. ## Search API +:::important +This component is in **Legacy**, which means it is no longer in active development as of Langflow version 1.3. +::: + This component calls the `searchapi.io` API. It can be used to search the web for information. For more information, see the [SearchAPI documentation](https://www.searchapi.io/docs/google). @@ -456,6 +468,10 @@ This component performs searches using the Tavily AI search engine, which is opt ## Wikidata +:::important +This component is in **Legacy**, which means it is no longer in active development as of Langflow version 1.3. +::: + This component performs a search using the Wikidata API. ### Inputs @@ -474,6 +490,10 @@ This component performs a search using the Wikidata API. ## Wikipedia API +:::important +This component is in **Legacy**, which means it is no longer in active development as of Langflow version 1.3. +::: + This component creates a tool for searching and retrieving information from Wikipedia. ### Inputs diff --git a/docs/docs/Components/components-vector-stores.md b/docs/docs/Components/components-vector-stores.md index 8fa7ec449..fba582188 100644 --- a/docs/docs/Components/components-vector-stores.md +++ b/docs/docs/Components/components-vector-stores.md @@ -319,6 +319,30 @@ For more information, see the [FAISS documentation](https://faiss.ai/index.html) |----------------|------------------------|--------------------------------| | vector_store | FAISS | A FAISS vector store instance configured with the specified parameters. | +## Graph RAG + +This component performs Graph RAG (Retrieval Augmented Generation) traversal in a vector store, enabling graph-based document retrieval. +For more information, see the [Graph RAG documentation](https://datastax.github.io/graph-rag/). + +For an example flow, see the **Graph RAG** template. + +### Inputs + +| Name | Display Name | Info | +|------|--------------|------| +| embedding_model | Embedding Model | Specify the embedding model. This is not required for collections embedded with [Astra vectorize](https://docs.datastax.com/en/astra-db-serverless/databases/embedding-generation.html). | +| vector_store | Vector Store Connection | Connection to the vector store. | +| edge_definition | Edge Definition | Edge definition for the graph traversal. For more information, see the [GraphRAG documentation](https://datastax.github.io/graph-rag/reference/graph_retriever/edges/). | +| strategy | Traversal Strategies | The strategy to use for graph traversal. Strategy options are dynamically loaded from available strategies. | +| search_query | Search Query | The query to search for in the vector store. | +| graphrag_strategy_kwargs | Strategy Parameters | Optional dictionary of additional parameters for the retrieval strategy. For more information, see the [strategy documentation](https://datastax.github.io/graph-rag/reference/graph_retriever/strategies/). | + +### Outputs + +| Name | Type | Description | +|------|------|-------------| +| search_results | List[Data] | Results of the graph-based document retrieval as a list of [Data](/concepts-objects#data-object) objects. | + ## Hyper-Converged Database (HCD) Vector Store This component implements a Vector Store using HCD. @@ -664,33 +688,6 @@ For more information, see the [Vectara documentation](https://docs.vectara.com/d |----------------|------------|----------------------------| | search_results | List[Data] | Results of similarity search | -## Vectara RAG - -This component leverages Vectara's Retrieval Augmented Generation (RAG) capabilities to search and summarize documents based on the provided input. For more information, see the [Vectara documentation](https://docs.vectara.com/docs/). - -### Inputs - -| Name | Type | Description | -|-----------------------|--------------|------------------------------------------------------------| -| vectara_customer_id | String | Vectara customer ID | -| vectara_corpus_id | String | Vectara corpus ID | -| vectara_api_key | SecretString | Vectara API key | -| search_query | String | The query to receive an answer on | -| lexical_interpolation | Float | Hybrid search factor (0.005 to 0.1) | -| filter | String | Metadata filters to narrow the search | -| reranker | String | Reranker type (mmr, rerank_multilingual_v1, none) | -| reranker_k | Integer | Number of results to rerank (1 to 100) | -| diversity_bias | Float | Diversity bias for MMR reranker (0 to 1) | -| max_results | Integer | Maximum number of search results to summarize (1 to 100) | -| response_lang | String | Language code for the response (for example, "eng", "auto") | -| prompt | String | Prompt name for summarization | - -### Outputs - -| Name | Type | Description | -|--------|---------|-----------------------| -| answer | Message | Generated RAG response| - ## Weaviate This component facilitates a Weaviate Vector Store setup, optimizing text and document indexing and retrieval. diff --git a/docs/docs/Concepts/concepts-file-management.md b/docs/docs/Concepts/concepts-file-management.md new file mode 100644 index 000000000..0ee65016b --- /dev/null +++ b/docs/docs/Concepts/concepts-file-management.md @@ -0,0 +1,67 @@ +--- +title: Manage files +slug: /concepts-file-management +--- + +Upload, store, and manage files in Langflow's **File management** system. + +Uploading files to the **File management** system keeps your files in a central location, and allows you to re-use files across flows without repeated manual uploads. + +## Upload a file + +The **File management** system is available at the `/files` URL. For example, if you're running Langflow at the default `http://127.0.0.1:7860` address, the **File management** system is located at `http://127.0.0.1:7860/files`. + +To upload a file from your local machine: + +1. From the **My Files** window at `http://127.0.0.1:7860/files`, click **Upload**. +2. Select the file to upload. +The file is uploaded to Langflow. + +Files stored in **My Files** can be renamed, downloaded, duplicated, or deleted. + +Files are available to flows stored in different folders. + +## Use uploaded files in a flow + +To use your uploaded files in flows: + +1. Include the [File](/components-data#file) component in a flow. +2. To select a document to load, in the **File** component, click the **Select files** button. +3. Select a file to upload, and then click **Select file**. The loaded file name appears in the component. + +For an example of using the **File** component in a flow, see the [Document QA tutorial project](/tutorials-document-qa). + +:::note +If you prefer a one-time upload, the [File](/components-data#file) component still allows one-time uploads directly from your local machine. +::: + +## Supported file types + +The maximum supported file size is 100 MB. + +Text files: +- `.txt` - Text files +- `.md`, `.mdx` - Markdown files +- `.csv` - CSV files +- `.json` - JSON files +- `.yaml`, `.yml` - YAML files +- `.xml` - XML files +- `.html`, `.htm` - HTML files +- `.pdf` - PDF files +- `.docx` - Word documents +- `.py` - Python files +- `.sh` - Shell scripts +- `.sql` - SQL files +- `.js` - JavaScript files +- `.ts`, `.tsx` - TypeScript 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 + + + + diff --git a/docs/docs/Concepts/concepts-overview.md b/docs/docs/Concepts/concepts-overview.md index 0533b234d..2463ed6fc 100644 --- a/docs/docs/Concepts/concepts-overview.md +++ b/docs/docs/Concepts/concepts-overview.md @@ -36,7 +36,7 @@ The flow storage location can be customized with the [LANGFLOW_CONFIG_DIR](/envi If you're new to Langflow, it's OK to feel a bit lost at first. We’ll take you on a tour, so you can orient yourself and start creating applications quickly. -Langflow has four distinct regions: the [workspace](#workspace) is the main area where you build your flows. The components sidebar is on the left, and lists the available [components](#components). The [playground](#playground) and [API pane](#api-pane) are available in the upper right corner. +Langflow has four distinct regions: the [workspace](#workspace) is the main area where you build your flows. The components sidebar is on the left, and lists the available [components](#components). The [playground](#playground) and [Publish pane](#publish-pane) are available in the upper right corner. ![](/img/workspace.png) @@ -75,11 +75,11 @@ For more information, see the [Playground](/concepts-playground). ![](/img/playground.png) -## API pane {#api-pane} +## Publish pane {#publish-pane} -The **API** pane provides code templates to integrate your flows into external applications. +The **Publish** pane provides code templates to integrate your flows into external applications. -For more information, see the [API pane](/concepts-api). +For more information, see the [Publish pane](/concepts-publish). ![](/img/api-pane.png) @@ -126,6 +126,12 @@ Projects, folders, and flows are exchanged as JSON objects. * To move a flow or component, drag and drop it into the desired folder. +## File management + +Upload, store, and manage files in Langflow's **File management** system. + +For more on managing your files, see [Manage files](/concepts-file-management). + ## Options menu The dropdown menu labeled with the project name offers several management and customization options for the current flow in the Langflow workspace. diff --git a/docs/docs/Concepts/concepts-api.md b/docs/docs/Concepts/concepts-publish.md similarity index 67% rename from docs/docs/Concepts/concepts-api.md rename to docs/docs/Concepts/concepts-publish.md index ff66841a2..392b62029 100644 --- a/docs/docs/Concepts/concepts-api.md +++ b/docs/docs/Concepts/concepts-publish.md @@ -1,44 +1,41 @@ --- -title: API pane -slug: /concepts-api +title: Publish flows +slug: /concepts-publish --- - import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; -The **API** pane presents code templates for integrating your flow into external applications. +Langflow provides several ways to publish and integrate your flows into external applications. Whether you want to expose your flow via API endpoints, embed it as a chat widget in your website, or share it as a public playground, this guide covers the options available for making your flows accessible to users. + +## API access + +The **API** pane presents code templates for integrating your flow into external applications. ![](/img/api-pane.png) - + -The **cURL** tab displays sample code for posting a query to your flow. Modify the `input_value` to change your input message. Copy the code and run it to post a query to your flow and get the result. - - - - - -The **Python API** tab displays code to interact with your flow using the Python HTTP `requests` library. - -To use the `requests` library: +The **Python** tab displays code to interact with your flow using the Python `requests` library. 1. Copy and paste the code into a Python script. -2. Run the script and pass your message with it. +2. Run the script. ```python python3 python-test-script.py --message="tell me about something interesting" ``` +The response content depends on your flow. Make sure the endpoint returns a successful response. + - + -The **JavaScript API** tab displays code to interact with your flow in JavaScript. +The **JavaScript API** tab displays code to interact with your flow in JavaScript. 1. Copy and paste the code into a JavaScript file. -2. Run the script with any necessary arguments for your flow: +2. Run the script. ```plain node test-script.js "tell me about something interesting" @@ -47,43 +44,43 @@ node test-script.js "tell me about something interesting" The response content depends on your flow. Make sure the endpoint returns a successful response. + - +The **cURL** tab displays sample code for posting a query to your flow. +Copy the code and run it to post a query to your flow and get the result. -The **Python Code** tab displays code to interact with your flow's `.json` file using the Langflow runtime. - -To use your code in a Python application using the Langflow runtime, you have to first download your flow’s JSON file. - -1. In your **Workspace**, click **Settings**, and then select **Export**. - -2. Download the flow to your local machine. Make sure the flow path in the script matches the flow’s location on your machine. - -3. Copy and paste the code from the **Python Code** tab into a Python script file. - -4. Run the script: - -```python -python python-test-script.py -``` +The response content depends on your flow. Make sure the endpoint returns a successful response. - -## Chat Widget +### Temporary overrides -The **Chat Widget HTML** tab displays code that can be inserted in the `` of your HTML to interact with your flow. +The **Temporary overrides** tab displays the available parameters for your flow. +Modifying the parameters changes the code parameters across all windows. +For example, changing the **Chat Input** component's `input_value` changes that value across all API calls to the `/run` endpoint of this flow. -The **Langflow Chat Widget** is a powerful web component that enables communication with a Langflow project. This widget allows for a chat interface embedding, allowing the integration of Langflow into web applications effortlessly. +### Send files to your flow with the API -You can get the HTML code embedded with the chat by clicking the Code button at the Sidebar after building a flow. +For information on sending files to the Langflow API, see [API examples](/api-reference-api-examples#upload-image-files). -Clicking the Chat Widget HTML tab, you'll get the code to be inserted. Read below to learn how to use it with HTML, React and Angular. +### Webhook cURL -### Embed the chat widget into HTML +When a **Webhook** component is added to the workspace, a new **Webhook cURL** tab becomes available in the **API** pane that contains an HTTP POST request for triggering the webhook component. For example: -To embed the chat widget into any HTML page, insert the code snippet. inside a `` tag. +```bash +curl -X POST \ + "http://127.0.0.1:7860/api/v1/webhook/**YOUR_FLOW_ID**" \ + -H 'Content-Type: application/json'\ + -d '{"any": "data"}' +``` + +To test the **Webhook** component in your flow, see the [Webhook component](/components-data#webhook). + +## Embed into site + +The **Embed into site** tab displays code that can be inserted in the `` of your HTML to interact with your flow. ```html @@ -98,13 +95,13 @@ To embed the chat widget into any HTML page, insert the code snippet. inside a  ### Embed the chat widget with React -To embed the Chat Widget using React, insert this ` ``` -Declare your Web Component and encapsulate it in a React component. +1. Declare your web component and encapsulate it in a React component. ```javascript declare global { @@ -128,25 +125,25 @@ export default function ChatWidget({ className }) { ); } ``` - -Place the component anywhere in your code to display the Chat Widget. +2. Place the component anywhere in your code to display the chat widget. ### Embed the chat widget with Angular -To use the chat widget in Angular, first add this ` ``` -When you use a custom web component in an Angular template, the Angular compiler might show a warning when it doesn't recognize the custom elements by default. To suppress this warning, add `CUSTOM_ELEMENTS_SCHEMA` to the module's `@NgModule.schemas`. +When you use a custom web component in an Angular template, the Angular compiler might show a warning when it doesn't recognize the custom elements by default. To suppress this warning, add `CUSTOM_ELEMENTS_SCHEMA` to the module's `@NgModule.schemas`. +`CUSTOM_ELEMENTS_SCHEMA` is a built-in schema that allows custom elements in your Angular templates, and suppresses warnings related to unknown elements like `langflow-chat`. -- Open the module file (it typically ends with _.module.ts_) where you'd add the `langflow-chat` web component. -- Import `CUSTOM_ELEMENTS_SCHEMA` at the top of the file: +1. Open the module file `.module.ts` where you want to add the `langflow-chat` web component. +2. Import `CUSTOM_ELEMENTS_SCHEMA` at the top of the `.module.ts` file: `import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';` -- Add `CUSTOM_ELEMENTS_SCHEMA` to the 'schemas' array inside the '@NgModule' decorator: +3. Add `CUSTOM_ELEMENTS_SCHEMA` to the 'schemas' array inside the '@NgModule' decorator: ```javascript @NgModule({ @@ -163,26 +160,17 @@ When you use a custom web component in an Angular template, the Angular compiler export class YourModule { } ``` -In your Angular project, find the component belonging to the module where `CUSTOM_ELEMENTS_SCHEMA` was added. Inside the template, add the `langflow-chat` tag to include the Chat Widget in your component's view: +4. In your Angular project, find the component belonging to the module where `CUSTOM_ELEMENTS_SCHEMA` was added. Inside the template, add the `langflow-chat` tag to include the chat widget in your component's view: ```javascript ``` -:::tip +### Chat widget configuration -`CUSTOM_ELEMENTS_SCHEMA` is a built-in schema that allows Angular to recognize custom elements. Adding `CUSTOM_ELEMENTS_SCHEMA` tells Angular to allow custom elements in your templates, and it will suppress the warning related to unknown elements like `langflow-chat`. Notice that you can only use the Chat Widget in components that are part of the module where you added `CUSTOM_ELEMENTS_SCHEMA`. +Use the widget API to customize your Chat Widget. -::: - -## Chat widget configuration - -Use the widget API to customize your Chat Widget: - -:::caution Props with the type JSON need to be passed as stringified JSONs, with the format \{"key":"value"\}. -::: - | Prop | Type | Required | Description | | --------------------- | ------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -210,25 +198,11 @@ Props with the type JSON need to be passed as stringified JSONs, with the format | width | Number | No | Sets the width of the chat window in pixels. | | window_title | String | No | Sets the title displayed in the chat window's header or title bar. | +## Shareable playground -## Tweaks +The **Shareable playground** exposes your Langflow application's **Playground** at the `/public_flow/{flow-id}` endpoint. -The **Tweaks** tab displays the available parameters for your flow. Modifying the parameters changes the code parameters across all windows. For example, changing the **Chat Input** component's `input_value` will change that value across all API calls. +You can share this endpoint publicly using a sharing platform like [Ngrok](https://ngrok.com/docs/getting-started/?os=macos) or [zrok](https://docs.zrok.io/docs/getting-started). -## Send image files to your flow with the API - -For information on sending files to the Langflow API, see [API examples](/api-reference-api-examples#upload-image-files). - -## Webhook cURL - -When a **Webhook** component is added to the workspace, a new **Webhook cURL** tab becomes available in the **API** pane that contains an HTTP POST request for triggering the webhook component. For example: - -```bash -curl -X POST \ - "http://127.0.0.1:7860/api/v1/webhook/**YOUR_FLOW_ID**" \ - -H 'Content-Type: application/json'\ - -d '{"any": "data"}' - ``` - -To test the **Webhook** component in your flow, see the [Webhook component](/components-data#webhook). +If you're using **Datastax Langflow**, you can share the URL with any users within your **Organization**. diff --git a/docs/docs/Concepts/concepts-voice-mode.md b/docs/docs/Concepts/concepts-voice-mode.md new file mode 100644 index 000000000..e358d382d --- /dev/null +++ b/docs/docs/Concepts/concepts-voice-mode.md @@ -0,0 +1,53 @@ +--- +title: Voice mode +slug: /concepts-voice-mode +--- + +import Icon from "@site/src/components/icon"; + +The Langflow **Playground** supports **voice mode** for interacting with your applications through a microphone. + +An [OpenAI API key](https://platform.openai.com/) is required to use **voice mode**. An [ElevenLabs](https://elevenlabs.io) API key enables more voices in the chat, but is optional. + +Your flow must have a [Chat input](/components-io#chat-input) component to interact with the **Playground**. + +## Prerequisite + +- [OpenAI API key created](https://platform.openai.com/) + +## Use voice mode in the Langflow Playground + +Chat with an agent in the **Playground**, and get more recent results by asking the agent to use tools. + +1. Create a [Simple agent starter project](/starter-projects-simple-agent). +2. Add your **OpenAI API key** credentials to the **Agent** component. +3. To start a chat session, click **Playground**. +4. To enable voice mode, click the icon. +The **Voice mode** pane opens. +5. In the **OpenAI API Key** field, add your **OpenAI API key** credentials. +This key is saved as a [global variable](/configuration-global-variables) in Langflow and is accessible from any component or flow. +6. Your browser may prompt you for microphone access. +Browser access is **required** to use voice mode. +To continue, allow microphone access in your browser. +7. In the **Audio Input** menu, select the input device to use with voice mode. +:::tip +A higher quality microphone improves OpenAI's voice chat comprehension. +::: +8. Optionally, add your **ElevenLabs API key** in the **ElevenLabs API Key** field. +This makes more voices available for your AI responses. +This key is saved as a [global variable](/configuration-global-variables) in Langflow and is accessible from any component or flow. +9. In the **Preferred Language** menu, select your language for conversing with Langflow. +This option changes both the spoken conversation and the chat responses in the **Playground**. +10. Talk into your microphone. +The waveform in the voice mode pane should register your input, and the agent should respond in voice and in the **Playground**. +11. Ask the agent to use the tools available to find recent news about a subject. + +The agent describes its search process, including accessing the **URL** tool to fetch recent news. +The agent summarizes the recent news in speech and in the **Playground**. + +Be aware of the following considerations when using voice mode: + +* Name and describe your tools accurately, so the **Agent** chooses tools correctly. +* Voice mode does not use the instructions in the Agent component's **Agent Instructions** field, because your spoken instructions override this value. +* Voice mode only maintains context within the conversation session you are currently in. +If you exit a conversation and close the **Playground**, your conversational context is not available in the next chat session. diff --git a/docs/docs/Configuration/configuration-global-variables.md b/docs/docs/Configuration/configuration-global-variables.md index 2f327d38c..d38ea6486 100644 --- a/docs/docs/Configuration/configuration-global-variables.md +++ b/docs/docs/Configuration/configuration-global-variables.md @@ -84,7 +84,7 @@ If you installed Langflow locally, you must define the `LANGFLOW_VARIABLES_TO_GE 2. Add the `LANGFLOW_VARIABLES_TO_GET_FROM_ENVIRONMENT` environment variable as follows: - ```plaintext title=".env" + ```text title=".env" LANGFLOW_VARIABLES_TO_GET_FROM_ENVIRONMENT=VARIABLE1,VARIABLE2 ``` @@ -157,7 +157,7 @@ When adding global variables from the environment, the following limitations app :::tip If you want to explicitly prevent Langflow from sourcing global variables from the environment, set `LANGFLOW_STORE_ENVIRONMENT_VARIABLES` to `false` in your `.env` file: -```plaintext title=".env" +```text title=".env" LANGFLOW_STORE_ENVIRONMENT_VARIABLES=false ``` diff --git a/docs/docs/Configuration/environment-variables.md b/docs/docs/Configuration/environment-variables.md index 4be2c9918..63121f1e2 100644 --- a/docs/docs/Configuration/environment-variables.md +++ b/docs/docs/Configuration/environment-variables.md @@ -58,9 +58,35 @@ If it detects a supported environment variable, then it automatically adopts the 2. Add your environment variables to the file: - ```plaintext title=".env" - VARIABLE_NAME='VALUE' - VARIABLE_NAME='VALUE' + ```text title=".env" + DO_NOT_TRACK=true + LANGFLOW_AUTO_LOGIN=false + LANGFLOW_AUTO_SAVING=true + LANGFLOW_AUTO_SAVING_INTERVAL=1000 + LANGFLOW_BACKEND_ONLY=false + LANGFLOW_BUNDLE_URLS=["https://github.com/user/repo/commit/hash"] + LANGFLOW_CACHE_TYPE=async + LANGFLOW_COMPONENTS_PATH=/path/to/components/ + LANGFLOW_CONFIG_DIR=/path/to/config/ + LANGFLOW_DATABASE_URL=postgresql://user:password@localhost:5432/langflow + LANGFLOW_DEV=false + LANGFLOW_FALLBACK_TO_ENV_VAR=false + LANGFLOW_HEALTH_CHECK_MAX_RETRIES=5 + LANGFLOW_HOST=127.0.0.1 + LANGFLOW_LANGCHAIN_CACHE=InMemoryCache + LANGFLOW_MAX_FILE_SIZE_UPLOAD=10000 + LANGFLOW_LOG_LEVEL=error + LANGFLOW_OPEN_BROWSER=false + LANGFLOW_PORT=7860 + LANGFLOW_REMOVE_API_KEYS=false + LANGFLOW_SAVE_DB_IN_CONFIG_DIR=true + LANGFLOW_SECRET_KEY=somesecretkey + LANGFLOW_STORE=true + LANGFLOW_STORE_ENVIRONMENT_VARIABLES=true + LANGFLOW_SUPERUSER=adminuser + LANGFLOW_SUPERUSER_PASSWORD=adminpass + LANGFLOW_WORKER_TIMEOUT=60000 + LANGFLOW_WORKERS=3 ``` :::tip @@ -106,53 +132,102 @@ That means, if you happen to set the same environment variable in both your term The following table lists the environment variables supported by Langflow. -| Variable | Format / Values | Default | Description | -|----------|---------------|---------|-------------| -| `DO_NOT_TRACK` | Boolean | `false` | If enabled, Langflow will not track telemetry. | -| `LANGFLOW_AUTO_LOGIN` | Boolean | `true` | Enable automatic login for Langflow. Set to `false` to disable automatic login and require the login form to log into the Langflow UI. Setting to `false` requires [`LANGFLOW_SUPERUSER`](#LANGFLOW_SUPERUSER) and [`LANGFLOW_SUPERUSER_PASSWORD`](environment-variables.md#LANGFLOW_SUPERUSER_PASSWORD) to be set. | -| `LANGFLOW_AUTO_SAVING` | Boolean | `true` | Enable flow auto-saving.
See [`--auto-saving` option](./configuration-cli.md#run-auto-saving). | -| `LANGFLOW_AUTO_SAVING_INTERVAL` | Integer | `1000` | Set the interval for flow auto-saving in milliseconds.
See [`--auto-saving-interval` option](./configuration-cli.md#run-auto-saving-interval). | -| `LANGFLOW_BACKEND_ONLY` | Boolean | `false` | Only run Langflow's backend server (no frontend).
See [`--backend-only` option](./configuration-cli.md#run-backend-only). | -| `LANGFLOW_CACHE_TYPE` | `async`
`redis`
`memory`
`disk`
`critical` | `async` | Set the cache type for Langflow.
If you set the type to `redis`, then you must also set the following environment variables: [`LANGFLOW_REDIS_HOST`](#LANGFLOW_REDIS_HOST), [`LANGFLOW_REDIS_PORT`](#LANGFLOW_REDIS_PORT), [`LANGFLOW_REDIS_DB`](#LANGFLOW_REDIS_DB), and [`LANGFLOW_REDIS_CACHE_EXPIRE`](#LANGFLOW_REDIS_CACHE_EXPIRE). | -| `LANGFLOW_COMPONENTS_PATH` | String | `langflow/components` | Path to the directory containing custom components.
See [`--components-path` option](./configuration-cli.md#run-components-path). | -| `LANGFLOW_CONFIG_DIR` | String | **Linux/WSL**: `~/.cache/langflow/`
**macOS**: `/Users//Library/Caches/langflow/`
**Windows**: `%LOCALAPPDATA%\langflow\langflow\Cache` | Set the Langflow configuration directory where files, logs, and the Langflow database are stored. | -| `LANGFLOW_DATABASE_URL` | String | Not set | Set the database URL for Langflow. If not provided, Langflow will use a SQLite database. | -| `LANGFLOW_DATABASE_CONNECTION_RETRY` | Boolean | `false` | If True, Langflow will retry to connect to the database if it fails. | -| `LANGFLOW_DB_POOL_SIZE` | Integer | `10` | **DEPRECATED:** Use `LANGFLOW_DB_CONNECTION_SETTINGS` instead. The number of connections to keep open in the connection pool. | -| `LANGFLOW_DB_MAX_OVERFLOW` | Integer | `20` | **DEPRECATED:** Use `LANGFLOW_DB_CONNECTION_SETTINGS` instead. The number of connections to allow that can be opened beyond the pool size. | -| `LANGFLOW_DB_CONNECT_TIMEOUT` | Integer | `20` | The number of seconds to wait before giving up on a lock to be released or establishing a connection to the database. | -| `LANGFLOW_DB_CONNECTION_SETTINGS` | JSON | Not set | A JSON dictionary to centralize database connection parameters. Example: `{"pool_size": 10, "max_overflow": 20}` | -| `LANGFLOW_DEV` | Boolean | `false` | Run Langflow in development mode (may contain bugs).
See [`--dev` option](./configuration-cli.md#run-dev). | -| `LANGFLOW_FALLBACK_TO_ENV_VAR` | Boolean | `true` | If enabled, [global variables](../Configuration/configuration-global-variables.md) set in the Langflow UI fall back to an environment variable with the same name when Langflow fails to retrieve the variable value. | -| `LANGFLOW_FRONTEND_PATH` | String | `./frontend` | Path to the frontend directory containing build files. This is for development purposes only.
See [`--frontend-path` option](./configuration-cli.md#run-frontend-path). | -| `LANGFLOW_HEALTH_CHECK_MAX_RETRIES` | Integer | `5` | Set the maximum number of retries for the health check.
See [`--health-check-max-retries` option](./configuration-cli.md#run-health-check-max-retries). | -| `LANGFLOW_HOST` | String | `127.0.0.1` | The host on which the Langflow server will run.
See [`--host` option](./configuration-cli.md#run-host). | -| `LANGFLOW_LANGCHAIN_CACHE` | `InMemoryCache`
`SQLiteCache` | `InMemoryCache` | Type of cache to use.
See [`--cache` option](./configuration-cli.md#run-cache). | -| `LANGFLOW_LOG_LEVEL` | `DEBUG`
`INFO`
`WARNING`
`ERROR`
`CRITICAL` | `INFO` | Set the logging level for Langflow. | -| `LANGFLOW_LOG_FILE` | String | Not set | Path to the log file. If not set, logs will be written to stdout. | -| `LANGFLOW_MAX_FILE_SIZE_UPLOAD` | Integer | `100` | Set the maximum file size for the upload in megabytes.
See [`--max-file-size-upload` option](./configuration-cli.md#run-max-file-size-upload). | -| `LANGFLOW_MCP_SERVER_ENABLED` | Boolean | `true` | If set to False, Langflow will not enable the MCP server. | -| `LANGFLOW_MCP_SERVER_ENABLE_PROGRESS_NOTIFICATIONS` | Boolean | `false` | If set to True, Langflow will send progress notifications in the MCP server. | -| `LANGFLOW_NEW_USER_IS_ACTIVE` | Boolean | `false` | When enabled, new users are automatically activated and can log in without requiring explicit activation by the superuser. | -| `LANGFLOW_OPEN_BROWSER` | Boolean | `false` | Open the system web browser on startup.
See [`--open-browser` option](./configuration-cli.md#run-open-browser). | -| `LANGFLOW_PORT` | Integer | `7860` | The port on which the Langflow server will run. The server automatically selects a free port if the specified port is in use.
See [`--port` option](./configuration-cli.md#run-port). | -| `LANGFLOW_PROMETHEUS_ENABLED` | Boolean | `false` | Expose Prometheus metrics. | -| `LANGFLOW_PROMETHEUS_PORT` | Integer | `9090` | Set the port on which Langflow exposes Prometheus metrics. | -| `LANGFLOW_REDIS_CACHE_EXPIRE` | Integer | `3600` | See [`LANGFLOW_CACHE_TYPE`](#LANGFLOW_CACHE_TYPE). | -| `LANGFLOW_REDIS_DB` | Integer | `0` | See [`LANGFLOW_CACHE_TYPE`](#LANGFLOW_CACHE_TYPE). | -| `LANGFLOW_REDIS_HOST` | String | `localhost` | See [`LANGFLOW_CACHE_TYPE`](#LANGFLOW_CACHE_TYPE). | -| `LANGFLOW_REDIS_PORT` | String | `6379` | See [`LANGFLOW_CACHE_TYPE`](#LANGFLOW_CACHE_TYPE). | -| `LANGFLOW_REMOVE_API_KEYS` | Boolean | `false` | Remove API keys from the projects saved in the database.
See [`--remove-api-keys` option](./configuration-cli.md#run-remove-api-keys). | -| `LANGFLOW_SAVE_DB_IN_CONFIG_DIR` | Boolean | `false` | Save the Langflow database in [`LANGFLOW_CONFIG_DIR`](#LANGFLOW_CONFIG_DIR) instead of in the Langflow package directory. Note, when this variable is set to default (`false`), the database isn't shared between different virtual environments and the database is deleted when you uninstall Langflow. | -| `LANGFLOW_SECRET_KEY` | String | Auto-generated | Key used for encrypting sensitive data like API keys. If not provided, a secure key will be auto-generated. For production environments with multiple instances, you should explicitly set this to ensure consistent encryption across instances. | -| `LANGFLOW_STORE` | Boolean | `true` | Enable the Langflow Store.
See [`--store` option](./configuration-cli.md#run-store). | -| `LANGFLOW_STORE_ENVIRONMENT_VARIABLES` | Boolean | `true` | Store environment variables as [global variables](../Configuration/configuration-global-variables.md) in the database. | -| `LANGFLOW_SUPERUSER` | String | `langflow` | Set the name for the superuser. Required if [`LANGFLOW_AUTO_LOGIN`](#LANGFLOW_AUTO_LOGIN) is set to `false`.
See [`superuser --username` option](./configuration-cli.md#superuser-username). | -| `LANGFLOW_SUPERUSER_PASSWORD` | String | `langflow` | Set the password for the superuser. Required if [`LANGFLOW_AUTO_LOGIN`](#LANGFLOW_AUTO_LOGIN) is set to `false`.
See [`superuser --password` option](./configuration-cli.md#superuser-password). | -| `LANGFLOW_VARIABLES_TO_GET_FROM_ENVIRONMENT` | String | Not set | Comma-separated list of environment variables to get from the environment and store as [global variables](../Configuration/configuration-global-variables.md). | -| `LANGFLOW_LOAD_FLOWS_PATH` | String | Not set | Path to a directory containing flow JSON files to be loaded on startup. Note that this feature only works if `LANGFLOW_AUTO_LOGIN` is enabled. | -| `LANGFLOW_WORKER_TIMEOUT` | Integer | `300` | Worker timeout in seconds.
See [`--worker-timeout` option](./configuration-cli.md#run-worker-timeout). | -| `LANGFLOW_WORKERS` | Integer | `1` | Number of worker processes.
See [`--workers` option](./configuration-cli.md#run-workers). | + + +
+ +| Variable | Format | Default | Description | +|----------|--------|---------|-------------| +| DO_NOT_TRACK | Boolean | `false` | If this option is enabled, Langflow does not track telemetry. | +| LANGFLOW_AUTO_LOGIN | Boolean | `true` | Enable automatic login for Langflow. Set to `false` to disable automatic login and require the login form to log into the Langflow UI. Setting to `false` requires [`LANGFLOW_SUPERUSER`](#LANGFLOW_SUPERUSER) and [`LANGFLOW_SUPERUSER_PASSWORD`](environment-variables.md#LANGFLOW_SUPERUSER_PASSWORD) to be set. | +| LANGFLOW_AUTO_SAVING | Boolean | `true` | Enable flow auto-saving.
See [`--auto-saving` option](./configuration-cli.md#run-auto-saving). | +| LANGFLOW_AUTO_SAVING_INTERVAL | Integer | `1000` | Set the interval for flow auto-saving in milliseconds.
See [`--auto-saving-interval` option](./configuration-cli.md#run-auto-saving-interval). | +| LANGFLOW_BACKEND_ONLY | Boolean | `false` | Only run Langflow's backend server (no frontend).
See [`--backend-only` option](./configuration-cli.md#run-backend-only). | +| LANGFLOW_BUNDLE_URLS | List[String] | `[]` | A list of URLs from which to load component bundles and flows. Supports GitHub URLs. If LANGFLOW_AUTO_LOGIN is enabled, flows from these bundles are loaded into the database. | +| LANGFLOW_CACHE_TYPE | `async`
`redis`
`memory`
`disk`
`critical` | `async` | Set the cache type for Langflow.
If you set the type to `redis`, then you must also set the following environment variables: LANGFLOW_REDIS_HOST, LANGFLOW_REDIS_PORT, LANGFLOW_REDIS_DB, and LANGFLOW_REDIS_CACHE_EXPIRE. | +| LANGFLOW_COMPONENTS_PATH | String | `langflow/components` | Path to the directory containing custom components.
See [`--components-path` option](./configuration-cli.md#run-components-path). | +| LANGFLOW_CONFIG_DIR | String | See description | Set the Langflow configuration directory where files, logs, and the Langflow database are stored. Defaults: **Linux/WSL**: `~/.cache/langflow/`
**macOS**: `/Users//Library/Caches/langflow/`
**Windows**: `%LOCALAPPDATA%\langflow\langflow\Cache`| +| LANGFLOW_DATABASE_URL | String | Not set | Set the database URL for Langflow. If not provided, Langflow uses a SQLite database. | +| LANGFLOW_DATABASE_CONNECTION_RETRY | Boolean | `false` | If True, Langflow tries to connect to the database again if it fails. | +| LANGFLOW_DB_POOL_SIZE | Integer | `10` | **DEPRECATED:** Use LANGFLOW_DB_CONNECTION_SETTINGS instead. The number of connections to keep open in the connection pool. | +| LANGFLOW_DB_MAX_OVERFLOW | Integer | `20` | **DEPRECATED:** Use LANGFLOW_DB_CONNECTION_SETTINGS instead. The number of connections to allow that can be opened beyond the pool size. | +| LANGFLOW_DB_CONNECT_TIMEOUT | Integer | `20` | The number of seconds to wait before giving up on a lock to be released or establishing a connection to the database. | +| LANGFLOW_DB_CONNECTION_SETTINGS | JSON | Not set | A JSON dictionary to centralize database connection parameters. Example: `{"pool_size": 10, "max_overflow": 20}` | +| LANGFLOW_DEV | Boolean | `false` | Run Langflow in development mode (may contain bugs).
See [`--dev` option](./configuration-cli.md#run-dev). | +| LANGFLOW_ENABLE_LOG_RETRIEVAL | Boolean | `false` | Enable log retrieval functionality. | +| LANGFLOW_FALLBACK_TO_ENV_VAR | Boolean | `true` | If enabled, [global variables](../Configuration/configuration-global-variables.md) set in the Langflow UI fall back to an environment variable with the same name when Langflow fails to retrieve the variable value. | +| LANGFLOW_FRONTEND_PATH | String | `./frontend` | Path to the frontend directory containing build files. This is for development purposes only.
See [`--frontend-path` option](./configuration-cli.md#run-frontend-path). | +| LANGFLOW_HEALTH_CHECK_MAX_RETRIES | Integer | `5` | Set the maximum number of retries for the health check.
See [`--health-check-max-retries` option](./configuration-cli.md#run-health-check-max-retries). | +| LANGFLOW_HOST | String | `127.0.0.1` | The host on which the Langflow server will run.
See [`--host` option](./configuration-cli.md#run-host). | +| LANGFLOW_LANGCHAIN_CACHE | `InMemoryCache`
`SQLiteCache` | `InMemoryCache` | Type of cache to use.
See [`--cache` option](./configuration-cli.md#run-cache). | +| LANGFLOW_LOG_LEVEL | `DEBUG`
`INFO`
`WARNING`
`ERROR`
`CRITICAL` | `INFO` | Set the logging level for Langflow. | +| LANGFLOW_LOG_FILE | String | Not set | Path to the log file. If this option is not set, logs are written to stdout. | +| LANGFLOW_LOG_RETRIEVER_BUFFER_SIZE | Integer | `10000` | Set the buffer size for log retrieval. Only used if `LANGFLOW_ENABLE_LOG_RETRIEVAL` is enabled. | +| LANGFLOW_MAX_FILE_SIZE_UPLOAD | Integer | `100` | Set the maximum file size for the upload in megabytes.
See [`--max-file-size-upload` option](./configuration-cli.md#run-max-file-size-upload). | +| LANGFLOW_MCP_SERVER_ENABLED | Boolean | `true` | If this option is set to False, Langflow does not enable the MCP server. | +| LANGFLOW_MCP_SERVER_ENABLE_PROGRESS_NOTIFICATIONS | Boolean | `false` | If this option is set to True, Langflow sends progress notifications in the MCP server. | +| LANGFLOW_NEW_USER_IS_ACTIVE | Boolean | `false` | When enabled, new users are automatically activated and can log in without requiring explicit activation by the superuser. | +| LANGFLOW_OPEN_BROWSER | Boolean | `false` | Open the system web browser on startup.
See [`--open-browser` option](./configuration-cli.md#run-open-browser). | +| LANGFLOW_PORT | Integer | `7860` | The port on which the Langflow server runs. The server automatically selects a free port if the specified port is in use.
See [`--port` option](./configuration-cli.md#run-port). | +| LANGFLOW_PROMETHEUS_ENABLED | Boolean | `false` | Expose Prometheus metrics. | +| LANGFLOW_PROMETHEUS_PORT | Integer | `9090` | Set the port on which Langflow exposes Prometheus metrics. | +| LANGFLOW_REDIS_CACHE_EXPIRE | Integer | `3600` | See LANGFLOW_CACHE_TYPE. | +| LANGFLOW_REDIS_DB | Integer | `0` | See LANGFLOW_CACHE_TYPE. | +| LANGFLOW_REDIS_HOST | String | `localhost` | See LANGFLOW_CACHE_TYPE. | +| LANGFLOW_REDIS_PORT | String | `6379` | See LANGFLOW_CACHE_TYPE. | +| LANGFLOW_REDIS_PASSWORD | String | Not set | Password for Redis authentication when using Redis cache type. | +| LANGFLOW_REMOVE_API_KEYS | Boolean | `false` | Remove API keys from the projects saved in the database.
See [`--remove-api-keys` option](./configuration-cli.md#run-remove-api-keys). | +| LANGFLOW_SAVE_DB_IN_CONFIG_DIR | Boolean | `false` | Save the Langflow database in LANGFLOW_CONFIG_DIR instead of in the Langflow package directory. Note, when this variable is set to default (`false`), the database isn't shared between different virtual environments and the database is deleted when you uninstall Langflow. | +| LANGFLOW_SECRET_KEY | String | Auto-generated | Key used for encrypting sensitive data like API keys. If a key is not provided, a secure key is auto-generated. For production environments with multiple instances, you should explicitly set this to ensure consistent encryption across instances. | +| LANGFLOW_STORE | Boolean | `true` | Enable the Langflow Store.
See [`--store` option](./configuration-cli.md#run-store). | +| LANGFLOW_STORE_ENVIRONMENT_VARIABLES | Boolean | `true` | Store environment variables as [global variables](../Configuration/configuration-global-variables.md) in the database. | +| LANGFLOW_UPDATE_STARTER_PROJECTS | Boolean | `true` | If this option is enabled, Langflow updates starter projects with the latest component versions when initializing. | +| LANGFLOW_SUPERUSER | String | `langflow` | Set the name for the superuser. Required if LANGFLOW_AUTO_LOGIN is set to `false`.
See [`superuser --username` option](./configuration-cli.md#superuser-username). | +| LANGFLOW_SUPERUSER_PASSWORD | String | `langflow` | Set the password for the superuser. Required if LANGFLOW_AUTO_LOGIN is set to `false`.
See [`superuser --password` option](./configuration-cli.md#superuser-password). | +| LANGFLOW_VARIABLES_TO_GET_FROM_ENVIRONMENT | String | Not set | Comma-separated list of environment variables to get from the environment and store as [global variables](../Configuration/configuration-global-variables.md). | +| LANGFLOW_LOAD_FLOWS_PATH | String | Not set | Path to a directory containing flow JSON files to be loaded on startup. Note that this feature only works if LANGFLOW_AUTO_LOGIN is enabled. | +| LANGFLOW_WORKER_TIMEOUT | Integer | `300` | Worker timeout in seconds.
See [`--worker-timeout` option](./configuration-cli.md#run-worker-timeout). | +| LANGFLOW_WORKERS | Integer | `1` | Number of worker processes.
See [`--workers` option](./configuration-cli.md#run-workers). | + +
## Configure .env, override.conf, and tasks.json files @@ -165,12 +240,13 @@ The `.env` file is a text file that contains key-value pairs of environment vari Create or edit a file named `.env` in your project root directory and add your configuration: -```plaintext title=".env" +```text title=".env" DO_NOT_TRACK=true LANGFLOW_AUTO_LOGIN=false LANGFLOW_AUTO_SAVING=true LANGFLOW_AUTO_SAVING_INTERVAL=1000 LANGFLOW_BACKEND_ONLY=false +LANGFLOW_BUNDLE_URLS=["https://github.com/user/repo/commit/hash"] LANGFLOW_CACHE_TYPE=async LANGFLOW_COMPONENTS_PATH=/path/to/components/ LANGFLOW_CONFIG_DIR=/path/to/config/ @@ -209,6 +285,7 @@ Environment="LANGFLOW_AUTO_LOGIN=false" Environment="LANGFLOW_AUTO_SAVING=true" Environment="LANGFLOW_AUTO_SAVING_INTERVAL=1000" Environment="LANGFLOW_BACKEND_ONLY=false" +Environment="LANGFLOW_BUNDLE_URLS=[\"https://github.com/user/repo/commit/hash\"]" Environment="LANGFLOW_CACHE_TYPE=async" Environment="LANGFLOW_COMPONENTS_PATH=/path/to/components/" Environment="LANGFLOW_CONFIG_DIR=/path/to/config" @@ -235,7 +312,7 @@ Environment="LANGFLOW_WORKER_TIMEOUT=60000" Environment="LANGFLOW_WORKERS=3" ``` -For more information on systemd, see the [Red Hat documentation](https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/9/html/using_systemd_unit_files_to_customize_and_optimize_your_system/assembly_working-with-systemd-unit-files_working-with-systemd#assembly_working-with-systemd-unit-files_working-with-systemd). +For more information on systemd, see the [Red Hat documentation](https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/9/html/using_systemd_unit_files_to_customize_and_optimize_your_system/assembly_working-with-systemd-unit-files_working-with-systemd). @@ -254,6 +331,7 @@ Create or edit the `.vscode/tasks.json` file in your project root: "LANGFLOW_AUTO_SAVING": "true", "LANGFLOW_AUTO_SAVING_INTERVAL": "1000", "LANGFLOW_BACKEND_ONLY": "false", + "LANGFLOW_BUNDLE_URLS": "[\"https://github.com/user/repo/commit/hash\"]", "LANGFLOW_CACHE_TYPE": "async", "LANGFLOW_COMPONENTS_PATH": "D:/path/to/components/", "LANGFLOW_CONFIG_DIR": "D:/path/to/config/", diff --git a/docs/docs/Get-Started/get-started-quickstart.md b/docs/docs/Get-Started/get-started-quickstart.md index 6a041ecd6..fb8392d38 100644 --- a/docs/docs/Get-Started/get-started-quickstart.md +++ b/docs/docs/Get-Started/get-started-quickstart.md @@ -188,6 +188,6 @@ This example used movie data, but the RAG pattern can be used with any data you Make the **Astra DB** database the brain that [Agents](/agents-overview) use to make decisions. -Expose this flow as an [API](/concepts-api) and call it from your external applications. +Publish this flow as an [API](/concepts-publish) and call it from your external applications. For more on the **Astra DB** component, see [Astra DB vector store](/components-vector-stores#astra-db-vector-store). diff --git a/docs/docs/Starter-Projects/starter-projects-simple-agent.md b/docs/docs/Starter-Projects/starter-projects-simple-agent.md index e78650742..79a1fc804 100644 --- a/docs/docs/Starter-Projects/starter-projects-simple-agent.md +++ b/docs/docs/Starter-Projects/starter-projects-simple-agent.md @@ -30,17 +30,15 @@ The **Simple Agent** flow consists of these components: * The **URL** tool component searches a list of URLs for content. * The **Calculator** component performs basic arithmetic operations. * The **Chat Input** component accepts user input to the chat. -* The **Prompt** component combines the user input with a user-defined prompt. * The **Chat Output** component prints the flow's output to the chat. -* The **OpenAI** model component sends the user input and prompt to the OpenAI API and receives a response. ## Run the Simple Agent flow -1. Add your credentials to the Open AI component. +1. Add your credentials to the **Agent** component. 2. Click **Playground** to start a chat session. 3. To confirm the tools are connected, ask the agent, `What tools are available to you?` The response is similar to the following: -```plain +```text I have access to the following tools: Calculator: Perform basic arithmetic operations. fetch_content: Load and retrieve data from specified URLs. @@ -52,7 +50,7 @@ get_current_date: Returns the current date and time in a selected timezone. The agent will tell you when it's using the `URL-fetch_content_text` tool to search for rules information, and when it's using `CalculatorComponent-evaluate_expression` to generate attributes with dice rolls. The final output should be similar to this: -```plain +```text Final Attributes Strength (STR): 10 Constitution (CON): 12 diff --git a/docs/docs/Support/luna-for-langflow.md b/docs/docs/Support/luna-for-langflow.md index 94be3726f..f86b4b406 100644 --- a/docs/docs/Support/luna-for-langflow.md +++ b/docs/docs/Support/luna-for-langflow.md @@ -20,5 +20,5 @@ Luna for Langflow support covers only the following software versions for Langfl Last updated: 2025-03-11 ## Core information -- **Langflow Version**: `1.2.0` +- **Langflow Version**: `1.3.0` - **Python Version Required**: `>=3.10, <3.14` \ No newline at end of file diff --git a/docs/docs/Tutorials/tutorials-document-qa.md b/docs/docs/Tutorials/tutorials-document-qa.md index 614ecef35..7558ad16b 100644 --- a/docs/docs/Tutorials/tutorials-document-qa.md +++ b/docs/docs/Tutorials/tutorials-document-qa.md @@ -3,21 +3,14 @@ title: Document QA slug: /tutorials-document-qa --- - - Build a question-and-answer chatbot with a document loaded from local memory. - -## Prerequisites {#6555c100a30e4a21954af25e2e05403a} - - ---- +## Prerequisites - [Langflow installed and running](/get-started-installation) - [OpenAI API key created](https://platform.openai.com/) - -## Create the document QA flow {#204500104f024553aab2b633bb99f603} +## Create the document QA flow 1. From the Langflow dashboard, click **New Flow**. 2. Select **Document QA**. @@ -25,17 +18,15 @@ Build a question-and-answer chatbot with a document loaded from local memory. ![](/img/starter-flow-document-qa.png) +This flow is composed of a chatbot with the **Chat Input**, **Prompt**, **OpenAI**, and **Chat Output** components, but also incorporates a **File** component, which loads a file from your local machine. **Parse Data** is used to convert the data from **File** into the **Prompt** component as `{Document}`. -This flow is composed of a standard chatbot with the **Chat Input**, **Prompt**, **OpenAI**, and **Chat Output** components, but it also incorporates a **File** component, which loads a file from your local machine. **Parse Data** is used to convert the data from **File** into the **Prompt** component as `{Document}`. The **Prompt** component is instructed to answer questions based on the contents of `{Document}`. This gives the **OpenAI** component context it would not otherwise have access to. +The **Prompt** component is instructed to answer questions based on the contents of `{Document}`. This gives the **OpenAI** component context it would not otherwise have access to. +### Run the document QA flow -### Run the document QA flow {#f58fcc2b9e594156a829b1772b6a7191} +1. Add your **OpenAI API key** to the **Open AI** model component. +2. To select a document to load, in the **File** component, click the **Select files** button. Select a local file or a file loaded with [File management](/concepts-file-management), and then click **Select file**. The file name appears in the component. -1. To select a document to load, in the **File** component, click the **Path** field. Select a local file, and then click **Open**. The file name appears in the field. - -2. Click the **Playground** button. Here you can chat with the AI that has access to your document's content. - - -3. Type in a question about the document content and press Enter. You should see a contextual response. +3. Click the **Playground** button. Enter a question about the loaded document's content. You should receive a contextual response indicating that the AI has read your document. diff --git a/docs/docs/Tutorials/tutorials-math-agent.md b/docs/docs/Tutorials/tutorials-math-agent.md index 857df25ae..54e9caf66 100644 --- a/docs/docs/Tutorials/tutorials-math-agent.md +++ b/docs/docs/Tutorials/tutorials-math-agent.md @@ -30,19 +30,17 @@ The **Math Agent** flow consists of these components: * The **Python REPL tool** component executes Python code in a REPL (Read-Evaluate-Print Loop) interpreter. * The **Calculator** component performs basic arithmetic operations. * The **Chat Input** component accepts user input to the chat. -* The **Prompt** component combines the user input with a user-defined prompt. * The **Chat Output** component prints the flow's output to the chat. -* The **OpenAI** model component sends the user input and prompt to the OpenAI API and receives a response. ## Run the Math Agent flow -1. Add your credentials to the Open AI component. +1. Add your credentials to the **Agent** component. 2. Click **Playground** to start a chat session. 3. Enter a simple math problem, like `2 + 2`, and then make sure the bot responds with the correct answer. 4. To confirm the REPL interpreter is working, prompt the `math` library directly with `math.sqrt(4)` and see if the bot responds with `4`. 5. The agent will also reason through more complex word problems. For example, prompt the agent with the following math problem: -```plain +```text The equation 24x2+25x−47ax−2=−8x−3−53ax−2 is true for all values of x≠2a, where a is a constant. What is the value of a? A) -16 diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index 97ad55f1a..85fa546d4 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -178,8 +178,11 @@ const config = { from: "/components-rag", }, { - to: "/concepts-api", - from: "/workspace-api", + to: "/concepts-publish", + from: [ + "/concepts-api", + "/workspace-api", + ] }, { to: "/components-custom-components", diff --git a/docs/sidebars.js b/docs/sidebars.js index 57eb33b5e..09637c7f2 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -39,7 +39,9 @@ module.exports = { "Concepts/concepts-components", "Concepts/concepts-flows", "Concepts/concepts-objects", - "Concepts/concepts-api", + "Concepts/concepts-publish", + "Concepts/concepts-file-management", + "Concepts/concepts-voice-mode", ], }, { @@ -47,6 +49,7 @@ module.exports = { label: "Components", items: [ "Components/components-agents", + "Components/components-bundles", "Components/components-custom-components", "Components/components-data", "Components/components-embedding-models", diff --git a/docs/static/img/api-pane.png b/docs/static/img/api-pane.png index fcab418c8..cdf82b392 100644 Binary files a/docs/static/img/api-pane.png and b/docs/static/img/api-pane.png differ diff --git a/docs/static/img/component-lambda-filter.png b/docs/static/img/component-lambda-filter.png new file mode 100644 index 000000000..16408866f Binary files /dev/null and b/docs/static/img/component-lambda-filter.png differ diff --git a/docs/static/img/component-watsonx-model.png b/docs/static/img/component-watsonx-model.png new file mode 100644 index 000000000..6c2e945ae Binary files /dev/null and b/docs/static/img/component-watsonx-model.png differ diff --git a/docs/static/img/starter-flow-document-qa.png b/docs/static/img/starter-flow-document-qa.png index 819f07ba0..6768579c2 100644 Binary files a/docs/static/img/starter-flow-document-qa.png and b/docs/static/img/starter-flow-document-qa.png differ