docs: update components (#3756)

* prompts

* data-components

* embedding-models

* helpers

* vector-stores

* models

* vectara-rag

* io

* cleanup-prompts

* hub-prompt

* escape-chars
This commit is contained in:
Mendon Kissling 2024-09-13 11:22:24 -04:00 committed by GitHub
commit eb3bf824a3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 1200 additions and 1074 deletions

View file

@ -4,95 +4,160 @@ sidebar_position: 3
slug: /components-data
---
:::info
This page may contain outdated information. It will be updated as soon as possible.
:::
## API Request {#23da589293f74016a1f70d6d7c0fdc55}
---
## API Request
This component sends HTTP requests to the specified URLs.
Use this component to interact with external APIs or services and retrieve data. Ensure that the URLs are valid and that you configure the method, headers, body, and timeout correctly.
### Parameters
**Parameters:**
#### Inputs
- **URLs:** The URLs to target.
- **Method:** The HTTP method, such as GET or POST.
- **Headers:** The headers to include with the request.
- **Body:** The data to send with the request (for methods like POST, PATCH, PUT).
- **Timeout:** The maximum time to wait for a response.
| Name | Display Name | Info |
|----------|----------------|-------------------------------------------------------------|
| URLs | URLs | The URLs to target |
| curl | curl | Paste a curl command to fill in the dictionary fields for headers and body |
| Method | HTTP Method | The HTTP method to use, such as GET or POST |
| Headers | Headers | The headers to include with the request |
| Body | Request Body | The data to send with the request (for methods like POST, PATCH, PUT) |
| Timeout | Timeout | The maximum time to wait for a response |
## Directory {#4fe56acaaac847029ace173dc793f8f4}
## Directory
This component recursively loads files from a directory, with options for file types, depth, and concurrency.
### Parameters
| Input | Type | Description |
|-------|------|-------------|
| path | MessageTextInput | Path to the directory to load files from |
| types | MessageTextInput | File types to load (leave empty to load all types) |
| depth | IntInput | Depth to search for files |
| max_concurrency | IntInput | Maximum concurrency for loading files |
| load_hidden | BoolInput | If true, hidden files will be loaded |
| recursive | BoolInput | If true, the search will be recursive |
| silent_errors | BoolInput | If true, errors will not raise an exception |
| use_multithreading | BoolInput | If true, multithreading will be used |
| Output | Type | Description |
|--------|------|-------------|
| data | List[Data] | Loaded file data from the directory |
## 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.
### Parameters
#### Inputs
| Name | Display Name | Info |
|----------------|----------------|----------------------------------------------|
| path | Path | File path to load. |
| silent_errors | Silent Errors | If true, errors will not raise an exception. |
#### Outputs
| Name | Display Name | Info |
|------|--------------|-------------------------------------------|
| data | Data | Parsed content of the file as a Data object. |
---
## URL
The URLComponent is a class that fetches content from one or more URLs, processes the content, and returns it as a list of Data objects. It ensures that the provided URLs are valid and uses WebBaseLoader to fetch the content.
### Parameters
#### Inputs
| Name | Display Name | Info |
|------|--------------|-------------------------|
| urls | URLs | Enter one or more URLs |
#### Outputs
| Name | Display Name | Info |
|------|--------------|----------------------------------------------------------------|
| data | Data | List of Data objects containing fetched content and metadata |
This component recursively retrieves files from a specified directory.
## Gmail Loader
This component loads emails from Gmail using provided credentials and filters.
Use this component to retrieve various file types, such as text or JSON files, from a directory. Make sure to provide the correct path and configure the other parameters as needed.
For more on creating a service account JSON, see [Service Account JSON](https://developers.google.com/identity/protocols/oauth2/service-account).
### Parameters
**Parameters:**
| Input | Type | Description |
|-------|------|-------------|
| json_string | SecretStrInput | JSON string containing OAuth 2.0 access token information for service account access |
| label_ids | MessageTextInput | Comma-separated list of label IDs to filter emails |
| max_results | MessageTextInput | Maximum number of emails to load |
- **Path:** The directory path.
- **Types:** The types of files to retrieve. Leave this blank to retrieve all file types.
- **Depth:** The level of directory depth to search.
- **Max Concurrency:** The maximum number of simultaneous file loading operations.
- **Load Hidden:** Set to true to include hidden files.
- **Recursive:** Set to true to enable recursive search.
- **Silent Errors:** Set to true to suppress exceptions on errors.
- **Use Multithreading:** Set to true to use multithreading in file loading.
| Output | Type | Description |
|--------|------|-------------|
| data | Data | Loaded email data |
## File {#d5d4bb78ce0a473d8a3b6a296d3e8383}
## Google Drive Loader
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).
### Parameters
This component loads a file.
| Input | Type | Description |
|-------|------|-------------|
| json_string | SecretStrInput | JSON string containing OAuth 2.0 access token information for service account access |
| document_id | MessageTextInput | Single Google Drive document ID |
| Output | Type | Description |
|--------|------|-------------|
| docs | Data | Loaded document data |
Use this component to load files, such as text or JSON files. Ensure you specify the correct path and configure other parameters as necessary.
## Google Drive Search
This component searches Google Drive files using provided credentials and query parameters.
**Parameters:**
For more on creating a service account JSON, see [Service Account JSON](https://developers.google.com/identity/protocols/oauth2/service-account).
- **Path:** The file path.
- **Silent Errors:** Set to true to prevent exceptions on errors.
### Parameters
## URL {#1cc513827a0942d6885b3a9168eabc97}
| Input | Type | Description |
|-------|------|-------------|
| token_string | SecretStrInput | JSON string containing OAuth 2.0 access token information for service account access |
| query_item | DropdownInput | The field to query |
| valid_operator | DropdownInput | Operator to use in the query |
| search_term | MessageTextInput | The value to search for in the specified query item |
| query_string | MessageTextInput | The query string used for searching (can be edited manually) |
| Output | Type | Description |
|--------|------|-------------|
| doc_urls | List[str] | URLs of the found documents |
| doc_ids | List[str] | IDs of the found documents |
| doc_titles | List[str] | Titles of the found documents |
| Data | Data | Document titles and URLs in a structured format |
---
## Webhook Input
This component defines a webhook input for the flow. The flow can be triggered by an external HTTP POST request (webhook) sending a JSON payload.
This component retrieves content from specified URLs.
If the input is not valid JSON, the component will wrap it in a "payload" field. The component's status will reflect any errors or the processed data.
### Parameters
Ensure the URLs are valid and adjust other parameters as needed. **Parameters:**
#### Inputs
- **URLs:** The URLs to retrieve content from.
| Name | Type | Description |
|------|--------|-----------------------------------------------|
| data | String | JSON payload for testing the webhook component |
## Create Data {#aac4cad0cd38426191c2e7516285877b}
#### Outputs
---
This component allows you to create a `Data` from a number of inputs. You can add as many key-value pairs as you want (as long as it is less than 15). Once you've picked that number you'll need to write the name of the Key and can pass `Text` values from other components to it.
| Name | Type | Description |
|-------------|------|----------------------------------------|
| output_data | Data | Processed data from the webhook input |

View file

@ -4,170 +4,268 @@ sidebar_position: 6
slug: /components-embedding-models
---
# Embedding Models
Embeddings models are used to convert text into numerical vectors. These vectors can be used for various tasks such as similarity search, clustering, and classification.
## AI/ML
This component generates embeddings using the [AI/ML API](https://docs.aimlapi.com/api-overview/embeddings).
### Parameters
#### Inputs
| Name | Type | Description |
|------|------|-------------|
| model_name | String | The name of the AI/ML embedding model to use |
| aiml_api_key | SecretString | API key for authenticating with the AI/ML service |
#### Outputs
| Name | Type | Description |
|------|------|-------------|
| embeddings | Embeddings | An instance of AIMLEmbeddingsImpl for generating embeddings |
## Amazon Bedrock Embeddings
This component is used to load embedding models from [Amazon Bedrock](https://aws.amazon.com/bedrock/).
### Parameters
#### Inputs
| Name | Type | Description |
|------|------|-------------|
| credentials_profile_name | String | Name of the AWS credentials profile in ~/.aws/credentials or ~/.aws/config, which has access keys or role information |
| model_id | String | ID of the model to call, e.g., `amazon.titan-embed-text-v1`. This is equivalent to the `modelId` property in the `list-foundation-models` API |
| endpoint_url | String | URL to set a specific service endpoint other than the default AWS endpoint |
| region_name | String | AWS region to use, e.g., `us-west-2`. Falls back to `AWS_DEFAULT_REGION` environment variable or region specified in ~/.aws/config if not provided |
#### Outputs
| Name | Type | Description |
|------|------|-------------|
| embeddings | Embeddings | An instance for generating embeddings using Amazon Bedrock |
:::info
## Astra vectorize
This page may contain outdated information. It will be updated as soon as possible.
This component is used to generate server-side embeddings using [DataStax Astra](https://docs.datastax.com/en/astra-db-serverless/databases/embedding-generation.html).
:::
### Parameters
#### Inputs
| Name | Type | Description |
|------|------|-------------|
| provider | String | The embedding provider to use |
| model_name | String | The embedding model to use |
| authentication | Dict | Authentication parameters. Use the Astra Portal to add the embedding provider integration to your Astra organization |
| provider_api_key | String | An alternative to the Astra Authentication that lets you use directly the API key of the provider |
| model_parameters | Dict | Additional model parameters |
#### Outputs
## Amazon Bedrock Embeddings {#4ddcfde8c1664e358d3f16d718e944d8}
| Name | Type | Description |
|------|------|-------------|
| embeddings | Embeddings | An instance for generating embeddings using Astra vectorize | | |
## Azure OpenAI Embeddings
Used to load embedding models from [Amazon Bedrock](https://aws.amazon.com/bedrock/).
This component generates embeddings using Azure OpenAI models.
### Parameters
| **Parameter** | **Type** | **Description** | **Default** |
| -------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- |
| `credentials_profile_name` | `str` | Name of the AWS credentials profile in ~/.aws/credentials or ~/.aws/config, which has access keys or role information. | |
| `model_id` | `str` | ID of the model to call, e.g., `amazon.titan-embed-text-v1`. This is equivalent to the `modelId` property in the `list-foundation-models` API. | |
| `endpoint_url` | `str` | URL to set a specific service endpoint other than the default AWS endpoint. | |
| `region_name` | `str` | AWS region to use, e.g., `us-west-2`. Falls back to `AWS_DEFAULT_REGION` environment variable or region specified in ~/.aws/config if not provided. | |
#### Inputs
| Name | Type | Description |
|------|------|-------------|
| Azure Endpoint | String | Your Azure endpoint, including the resource. Example: `https://example-resource.azure.openai.com/` |
| Deployment Name | String | The name of the deployment |
| API Version | String | The API version to use, options include various dates |
| API Key | String | The API key to access the Azure OpenAI service |
## Astra vectorize {#c1e6d1373824424ea130e052ba0f46af}
#### Outputs
| Name | Type | Description |
|------|------|-------------|
| embeddings | Embeddings | An instance for generating embeddings using Azure OpenAI |
Used to generate server-side embeddings using [DataStax Astra](https://docs.datastax.com/en/astra-db-serverless/databases/embedding-generation.html).
## Cohere Embeddings
This component is used to load embedding models from [Cohere](https://cohere.com/).
| **Parameter** | **Type** | **Description** | **Default** |
| ------------------ | -------- | --------------------------------------------------------------------------------------------------------------------- | ----------- |
| `provider` | `str` | The embedding provider to use. | |
| `model_name` | `str` | The embedding model to use. | |
| `authentication` | `dict` | Authentication parameters. Use the Astra Portal to add the embedding provider integration to your Astra organization. | |
| `provider_api_key` | `str` | An alternative to the Astra Authentication that let you use directly the API key of the provider. | |
| `model_parameters` | `dict` | Additional model parameters. | |
### Parameters
#### Inputs
## Cohere Embeddings {#0c5b7b8790da448fabd4c5ddba1fcbde}
| Name | Type | Description |
|------|------|-------------|
| cohere_api_key | String | API key required to authenticate with the Cohere service |
| model | String | Language model used for embedding text documents and performing queries (default: `embed-english-v2.0`) |
| truncate | Boolean | Whether to truncate the input text to fit within the model's constraints (default: `False`) |
#### Outputs
Used to load embedding models from [Cohere](https://cohere.com/).
| Name | Type | Description |
|------|------|-------------|
| embeddings | Embeddings | An instance for generating embeddings using Cohere |
## Hugging Face Inference API Embeddings
| **Parameter** | **Type** | **Description** | **Default** |
| ---------------- | -------- | ------------------------------------------------------------------------- | -------------------- |
| `cohere_api_key` | `str` | API key required to authenticate with the Cohere service. | |
| `model` | `str` | Language model used for embedding text documents and performing queries. | `embed-english-v2.0` |
| `truncate` | `bool` | Whether to truncate the input text to fit within the model's constraints. | `False` |
This component generates embeddings using Hugging Face Inference API models.
### Parameters
## Azure OpenAI Embeddings {#8ffb790d5a6c484dab3fe6c777638a44}
#### Inputs
| Name | Type | Description |
|------|------|-------------|
| API Key | String | API key for accessing the Hugging Face Inference API |
| API URL | String | URL of the Hugging Face Inference API (default: `http://localhost:8080`) |
| Model Name | String | Name of the model to use for embeddings (default: `BAAI/bge-large-en-v1.5`) |
| Cache Folder | String | Folder path to cache Hugging Face models |
| Encode Kwargs | Dict | Additional arguments for the encoding process |
| Model Kwargs | Dict | Additional arguments for the model |
| Multi Process | Boolean | Whether to use multiple processes (default: `False`) |
Generate embeddings using Azure OpenAI models.
#### Outputs
| Name | Type | Description |
|------|------|-------------|
| embeddings | Embeddings | An instance for generating embeddings using Hugging Face Inference API |
| **Parameter** | **Type** | **Description** | **Default** |
| ----------------- | -------- | -------------------------------------------------------------------------------------------------- | ----------- |
| `Azure Endpoint` | `str` | Your Azure endpoint, including the resource. Example: `https://example-resource.azure.openai.com/` | |
| `Deployment Name` | `str` | The name of the deployment. | |
| `API Version` | `str` | The API version to use, options include various dates. | |
| `API Key` | `str` | The API key to access the Azure OpenAI service. | |
## MistralAI
This component generates embeddings using MistralAI models.
## Hugging Face API Embeddings {#8536e4ee907b48688e603ae9bf7822cb}
### Parameters
#### Inputs
Generate embeddings using Hugging Face Inference API models.
| Name | Type | Description |
|------|------|-------------|
| model | String | The MistralAI model to use (default: "mistral-embed") |
| mistral_api_key | SecretString | API key for authenticating with MistralAI |
| max_concurrent_requests | Integer | Maximum number of concurrent API requests (default: 64) |
| max_retries | Integer | Maximum number of retry attempts for failed requests (default: 5) |
| timeout | Integer | Request timeout in seconds (default: 120) |
| endpoint | String | Custom API endpoint URL (default: "https://api.mistral.ai/v1/") |
#### Outputs
| **Parameter** | **Type** | **Description** | **Default** |
| --------------- | -------- | ----------------------------------------------------- | ------------------------ |
| `API Key` | `str` | API key for accessing the Hugging Face Inference API. | |
| `API URL` | `str` | URL of the Hugging Face Inference API. | `http://localhost:8080` |
| `Model Name` | `str` | Name of the model to use for embeddings. | `BAAI/bge-large-en-v1.5` |
| `Cache Folder` | `str` | Folder path to cache Hugging Face models. | |
| `Encode Kwargs` | `dict` | Additional arguments for the encoding process. | |
| `Model Kwargs` | `dict` | Additional arguments for the model. | |
| `Multi Process` | `bool` | Whether to use multiple processes. | `False` |
| Name | Type | Description |
|------|------|-------------|
| embeddings | Embeddings | MistralAIEmbeddings instance for generating embeddings |
## NVIDIA
## Hugging Face Embeddings {#b2b74732874743d3be6fdf8aae049e74}
This component generates embeddings using NVIDIA models.
### Parameters
Used to load embedding models from [HuggingFace](https://huggingface.co/).
#### Inputs
| Name | Type | Description |
|------|------|-------------|
| model | String | The NVIDIA model to use for embeddings (e.g., nvidia/nv-embed-v1) |
| base_url | String | Base URL for the NVIDIA API (default: https://integrate.api.nvidia.com/v1) |
| nvidia_api_key | SecretString | API key for authenticating with NVIDIA's service |
| temperature | Float | Model temperature for embedding generation (default: 0.1) |
| **Parameter** | **Type** | **Description** | **Default** |
| --------------- | -------- | ---------------------------------------------- | ----------------------------------------- |
| `Cache Folder` | `str` | Folder path to cache HuggingFace models. | |
| `Encode Kwargs` | `dict` | Additional arguments for the encoding process. | |
| `Model Kwargs` | `dict` | Additional arguments for the model. | |
| `Model Name` | `str` | Name of the HuggingFace model to use. | `sentence-transformers/all-mpnet-base-v2` |
| `Multi Process` | `bool` | Whether to use multiple processes. | `False` |
#### Outputs
| Name | Type | Description |
|------|------|-------------|
| embeddings | Embeddings | NVIDIAEmbeddings instance for generating embeddings |
## OpenAI Embeddings {#af7630df05a245d1a632e1bf6db2a4c5}
## Ollama Embeddings
This component generates embeddings using Ollama models.
Used to load embedding models from [OpenAI](https://openai.com/).
### Parameters
#### Inputs
| **Parameter** | **Type** | **Description** | **Default** |
| -------------------------- | ---------------- | ------------------------------------------------ | ------------------------ |
| `OpenAI API Key` | `str` | The API key to use for accessing the OpenAI API. | |
| `Default Headers` | `Dict[str, str]` | Default headers for the HTTP requests. | |
| `Default Query` | `NestedDict` | Default query parameters for the HTTP requests. | |
| `Allowed Special` | `List[str]` | Special tokens allowed for processing. | `[]` |
| `Disallowed Special` | `List[str]` | Special tokens disallowed for processing. | `["all"]` |
| `Chunk Size` | `int` | Chunk size for processing. | `1000` |
| `Client` | `Any` | HTTP client for making requests. | |
| `Deployment` | `str` | Deployment name for the model. | `text-embedding-3-small` |
| `Embedding Context Length` | `int` | Length of embedding context. | `8191` |
| `Max Retries` | `int` | Maximum number of retries for failed requests. | `6` |
| `Model` | `str` | Name of the model to use. | `text-embedding-3-small` |
| `Model Kwargs` | `NestedDict` | Additional keyword arguments for the model. | |
| `OpenAI API Base` | `str` | Base URL of the OpenAI API. | |
| `OpenAI API Type` | `str` | Type of the OpenAI API. | |
| `OpenAI API Version` | `str` | Version of the OpenAI API. | |
| `OpenAI Organization` | `str` | Organization associated with the API key. | |
| `OpenAI Proxy` | `str` | Proxy server for the requests. | |
| `Request Timeout` | `float` | Timeout for the HTTP requests. | |
| `Show Progress Bar` | `bool` | Whether to show a progress bar for processing. | `False` |
| `Skip Empty` | `bool` | Whether to skip empty inputs. | `False` |
| `TikToken Enable` | `bool` | Whether to enable TikToken. | `True` |
| `TikToken Model Name` | `str` | Name of the TikToken model. | |
| Name | Type | Description |
|------|------|-------------|
| Ollama Model | String | Name of the Ollama model to use (default: `llama2`) |
| Ollama Base URL | String | Base URL of the Ollama API (default: `http://localhost:11434`) |
| Model Temperature | Float | Temperature parameter for the model. Adjusts the randomness in the generated embeddings |
#### Outputs
## Ollama Embeddings {#a26d2cb92e6d44669c2cfff71a5e9431}
| Name | Type | Description |
|------|------|-------------|
| embeddings | Embeddings | An instance for generating embeddings using Ollama |
## OpenAI Embeddings
Generate embeddings using Ollama models.
This component is used to load embedding models from [OpenAI](https://openai.com/).
### Parameters
| **Parameter** | **Type** | **Description** | **Default** |
| ------------------- | -------- | ---------------------------------------------------------------------------------------- | ------------------------ |
| `Ollama Model` | `str` | Name of the Ollama model to use. | `llama2` |
| `Ollama Base URL` | `str` | Base URL of the Ollama API. | `http://localhost:11434` |
| `Model Temperature` | `float` | Temperature parameter for the model. Adjusts the randomness in the generated embeddings. | |
#### Inputs
| Name | Type | Description |
|------|------|-------------|
| OpenAI API Key | String | The API key to use for accessing the OpenAI API |
| Default Headers | Dict | Default headers for the HTTP requests |
| Default Query | NestedDict | Default query parameters for the HTTP requests |
| Allowed Special | List | Special tokens allowed for processing (default: `[]`) |
| Disallowed Special | List | Special tokens disallowed for processing (default: `["all"]`) |
| Chunk Size | Integer | Chunk size for processing (default: `1000`) |
| Client | Any | HTTP client for making requests |
| Deployment | String | Deployment name for the model (default: `text-embedding-3-small`) |
| Embedding Context Length | Integer | Length of embedding context (default: `8191`) |
| Max Retries | Integer | Maximum number of retries for failed requests (default: `6`) |
| Model | String | Name of the model to use (default: `text-embedding-3-small`) |
| Model Kwargs | NestedDict | Additional keyword arguments for the model |
| OpenAI API Base | String | Base URL of the OpenAI API |
| OpenAI API Type | String | Type of the OpenAI API |
| OpenAI API Version | String | Version of the OpenAI API |
| OpenAI Organization | String | Organization associated with the API key |
| OpenAI Proxy | String | Proxy server for the requests |
| Request Timeout | Float | Timeout for the HTTP requests |
| Show Progress Bar | Boolean | Whether to show a progress bar for processing (default: `False`) |
| Skip Empty | Boolean | Whether to skip empty inputs (default: `False`) |
| TikToken Enable | Boolean | Whether to enable TikToken (default: `True`) |
| TikToken Model Name | String | Name of the TikToken model |
## VertexAI Embeddings {#707b38c23cb9413fbbaab1ae7b872311}
#### Outputs
| Name | Type | Description |
|------|------|-------------|
| embeddings | Embeddings | An instance for generating embeddings using OpenAI |
Wrapper around [Google Vertex AI](https://cloud.google.com/vertex-ai) [Embeddings API](https://cloud.google.com/vertex-ai/docs/generative-ai/embeddings/get-text-embeddings).
## VertexAI Embeddings
This component is a wrapper around [Google Vertex AI](https://cloud.google.com/vertex-ai) [Embeddings API](https://cloud.google.com/vertex-ai/docs/generative-ai/embeddings/get-text-embeddings).
| **Parameter** | **Type** | **Description** | **Default** |
| --------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------ | ------------- |
| `credentials` | `Credentials` | The default custom credentials to use. | |
| `location` | `str` | The default location to use when making API calls. | `us-central1` |
| `max_output_tokens` | `int` | Token limit determines the maximum amount of text output from one prompt. | `128` |
| `model_name` | `str` | The name of the Vertex AI large language model. | `text-bison` |
| `project` | `str` | The default GCP project to use when making Vertex API calls. | |
| `request_parallelism` | `int` | The amount of parallelism allowed for requests issued to VertexAI models. | `5` |
| `temperature` | `float` | Tunes the degree of randomness in text generations. Should be a non-negative value. | `0` |
| `top_k` | `int` | How the model selects tokens for output, the next token is selected from the top `k` tokens. | `40` |
| `top_p` | `float` | Tokens are selected from the most probable to least until the sum of their probabilities exceeds the top `p` value. | `0.95` |
| `tuned_model_name` | `str` | The name of a tuned model. If provided, `model_name` is ignored. | |
| `verbose` | `bool` | This parameter controls the level of detail in the output. When set to `True`, it prints internal states of the chain to help debug. | `False` |
### Parameters
#### Inputs
| Name | Type | Description |
|------|------|-------------|
| credentials | Credentials | The default custom credentials to use |
| location | String | The default location to use when making API calls (default: `us-central1`) |
| max_output_tokens | Integer | Token limit determines the maximum amount of text output from one prompt (default: `128`) |
| model_name | String | The name of the Vertex AI large language model (default: `text-bison`) |
| project | String | The default GCP project to use when making Vertex API calls |
| request_parallelism | Integer | The amount of parallelism allowed for requests issued to VertexAI models (default: `5`) |
| temperature | Float | Tunes the degree of randomness in text generations. Should be a non-negative value (default: `0`) |
| top_k | Integer | How the model selects tokens for output, the next token is selected from the top `k` tokens (default: `40`) |
| top_p | Float | Tokens are selected from the most probable to least until the sum of their probabilities exceeds the top `p` value (default: `0.95`) |
| tuned_model_name | String | The name of a tuned model. If provided, `model_name` is ignored |
| verbose | Boolean | This parameter controls the level of detail in the output. When set to `True`, it prints internal states of the chain to help debug (default: `False`) |
#### Outputs
| Name | Type | Description |
|------|------|-------------|
| embeddings | Embeddings | An instance for generating embeddings using VertexAI |
[Previous Vector Stores](/components-vector-stores)

View file

@ -4,167 +4,189 @@ sidebar_position: 4
slug: /components-helpers
---
# Helpers
Helper components provide utility functions to help manage data, tasks, and other components in your flow.
:::info
## Chat Memory
This page may contain outdated information. It will be updated as soon as possible.
This component retrieves and manages chat messages from Langflow tables or an external memory.
:::
### Parameters
#### Inputs
| Name | Display Name | Info |
|------|--------------|------|
| memory | External Memory | Retrieve messages from an external memory. If empty, it will use the Langflow tables. |
| sender | Sender Type | Filter by sender type. |
| sender_name | Sender Name | Filter by sender name. |
| n_messages | Number of Messages | Number of messages to retrieve. |
| session_id | Session ID | The session ID of the chat. If empty, the current session ID parameter will be used. |
| order | Order | Order of the messages. |
| template | Template | The template to use for formatting the data. It can contain the keys `{text}`, `{sender}` or any other key in the message data. |
#### Outputs
## Chat memory {#304dc4a3bea74efb9068093ff18a56ad}
This component retrieves stored chat messages based on a specific session ID.
### Parameters {#e0af57d97f844ce99789958161d19767}
- **Sender type:** Choose the sender type from options like "Machine", "User", or "Both".
- **Sender name:** (Optional) The name of the sender.
- **Number of messages:** Number of messages to retrieve.
- **Session ID:** The session ID of the chat history.
- **Order:** Choose the message order, either "Ascending" or "Descending".
- **Data template:** (Optional) Template to convert a record to text. If left empty, the system dynamically sets it to the record's text key.
---
### Combine text {#13443183e6054d0694d65f8df08833d5}
| Name | Display Name | Info |
|------|--------------|------|
| messages | Messages (Data) | Retrieved messages as Data objects. |
| messages_text | Messages (Text) | Retrieved messages formatted as text. |
| lc_memory | Memory | Built LangChain memory object. |
## Combine Text
This component concatenates two text sources into a single text chunk using a specified delimiter.
### Parameters
### Parameters {#246676d119604fc5bf1be85fe93044aa}
#### Inputs
- **First text:** The first text input to concatenate.
- **Second text:** The second text input to concatenate.
- **Delimiter:** A string used to separate the two text inputs. Defaults to a space.
---
### Create record {#506f43345854473b8199631bf68a3b4a}
| Name | Display Name | Info |
|------|--------------|------|
| first_text | First Text | The first text input to concatenate. |
| second_text | Second Text | The second text input to concatenate. |
| delimiter | Delimiter | A string used to separate the two text inputs. Defaults to a space. |
## Create List
This component dynamically creates a record with a specified number of fields.
### Parameters
### Parameters {#08735e90bd10406695771bad8a95976a}
#### Inputs
- **Number of fields:** Number of fields to be added to the record.
- **Text key:** Key used as text.
---
### Custom component {#cda421d4bccb4e7db2e48615884ed753}
| Name | Display Name | Info |
|------|--------------|------|
| n_fields | Number of Fields | Number of fields to be added to the record. |
| text_key | Text Key | Key used as text. |
## Custom Component
Use this component as a template to create your custom component.
## Filter Data
### Parameters {#04f9eb5e6da4431593a5bee8831f2327}
This component converts LangChain documents into Data.
- **Parameter:** Describe the purpose of this parameter.
## Hierarchical Task
INFO
This component creates and manages hierarchical tasks for CrewAI agents in a Playground environment.
For more information, see the [CrewAI documentation](https://docs.crewai.com/how-to/Hierarchical/).
Customize the `build_config` and `build` methods according to your requirements.
### Parameters
#### Inputs
Learn more about creating custom components at [Custom Component](http://docs.langflow.org/components/custom).
| Name | Display Name | Info |
|------|--------------|------|
| task_description | Description | Descriptive text detailing task's purpose and execution. |
| expected_output | Expected Output | Clear definition of expected task outcome. |
| tools | Tools | List of tools/resources limited for task execution. Uses the Agent tools by default. |
#### Outputs
---
| Name | Display Name | Info |
|------|--------------|------|
| task_output | Task | The built hierarchical task. |
## ID Generator
### Documents to Data {#53a6a99a54f0435e9209169cf7730c55}
This component generates a unique ID.
### Parameters
Convert LangChain documents into Data.
#### Outputs
| Name | Display Name | Info |
|------|--------------|------|
| value | Value | Unique ID generated. |
### Parameters {#0eb5fce528774c2db4a3677973e75cf8}
## Merge Data
- **Documents:** Documents to be converted into Data.
## Parse Data
---
The ParseData component converts Data objects into plain text using a specified template.
This component transforms structured data into human-readable text formats, allowing for customizable output through the use of templates.
### Parameters
### ID generator {#4a8fbfb95ebe44ee8718725546db5393}
#### Inputs
| Name | Display Name | Info |
|------|--------------|------|
| data | Data | The data to convert to text |
| template | Template | The template to use for formatting the data. It can contain the keys `{text}`, `{data}` or any other key in the Data |
| sep | Separator | The separator to use between multiple data items |
Generates a unique ID.
#### Outputs
| Name | Display Name | Info |
|------|--------------|------|
| text | Text | The resulting formatted text string as a Message object |
### Parameters {#4629dd15594c47399c97d9511060e114}
## Sequential Task
- **Value:** Unique ID generated.
This component creates and manage sequential tasks for CrewAI agents. It builds a SequentialTask object with the provided description, expected output, and agent, allowing for the specification of tools and asynchronous execution.
---
For more information, see the [CrewAI documentation](https://docs.crewai.com/how-to/Sequential/).
### Parameters
### Message history {#6a1a60688641490197c6443df573960e}
#### Inputs
| Name | Display Name | Info |
|------|--------------|------|
| task_description | Description | Descriptive text detailing task's purpose and execution. |
| expected_output | Expected Output | Clear definition of expected task outcome. |
| tools | Tools | List of tools/resources limited for task execution. Uses the Agent tools by default. |
| agent | Agent | CrewAI Agent that will perform the task. |
| task | Task | CrewAI Task that will perform the task. |
| async_execution | Async Execution | Boolean flag indicating asynchronous task execution. |
Retrieves stored chat messages based on a specific session ID.
#### Outputs
| Name | Display Name | Info |
|------|--------------|------|
| task_output | Task | The built sequential task or list of tasks. |
### Parameters {#31c7fc2a3e8c4f7c89f923e700f4ea34}
## Split Text
- **Sender type:** Options for the sender type.
- **Sender name:** Sender name.
- **Number of messages:** Number of messages to retrieve.
- **Session ID:** Session ID of the chat history.
- **Order:** Order of the messages.
This component splits text into chunks of a specified length.
---
### Parameters
#### Inputs
### Data to text {#f60ab5bbc0db4b27b427897eba97fe29}
| Name | Display Name | Info |
|------|--------------|------|
| texts | Texts | Texts to split. |
| separators | Separators | Characters to split on. Defaults to a space. |
| max_chunk_size | Max Chunk Size | The maximum length (in characters) of each chunk. |
| chunk_overlap | Chunk Overlap | The amount of character overlap between chunks. |
| recursive | Recursive | Whether to split recursively. |
## Store Message
Convert Data into plain text following a specified template.
This component stores chat messages or text into Langflow tables or an external memory.
It provides flexibility in managing message storage and retrieval within a chat system.
### Parameters {#01b91376569149a49cfcfd9321323688}
### Parameters
- **Data:** The Data to convert to text.
- **Template:** The template used for formatting the Data. It can contain keys like `{text}`, `{data}`, or any other key in the record.
#### Inputs
---
| Name | Display Name | Info |
|------|--------------|------|
| message | Message | The chat message to be stored. (Required) |
| memory | External Memory | The external memory to store the message. If empty, it will use the Langflow tables. |
| sender | Sender | The sender of the message. Can be Machine or User. If empty, the current sender parameter will be used. |
| sender_name | Sender Name | The name of the sender. Can be AI or User. If empty, the current sender parameter will be used. |
| session_id | Session ID | The session ID of the chat. If empty, the current session ID parameter will be used. |
#### Outputs
### Split text {#210be0ae518d411695d6caafdd7700eb}
Split text into chunks of a specified length.
### Parameters {#04197fcd05e64e10b189de1171a32682}
- **Texts:** Texts to split.
- **Separators:** Characters to split on. Defaults to a space.
- **Max chunk size:** The maximum length (in characters) of each chunk.
- **Chunk overlap:** The amount of character overlap between chunks.
- **Recursive:** Whether to split recursively.
---
### Update record {#d3b6116dfd8d4af080ad01bc8fd2b0b3}
Update a record with text-based key/value pairs, similar to updating a Python dictionary.
### Parameters {#c830224edc1d486aaaa5e2889f4f6689}
- **Data:** The record to update.
- **New data:** The new data to update the record with.
| Name | Display Name | Info |
|------|--------------|------|
| stored_messages | Stored Messages | The list of stored messages after the current message has been added. |

View file

@ -4,126 +4,86 @@ sidebar_position: 1
slug: /components-io
---
# Inputs & Outputs
This category of components defines where data enters and exits your flow. They dynamically alter the Playground and can be renamed to facilitate building and maintaining your flows.
Inputs and Outputs are a category of components that are used to define where data comes in and out of your flow. They also dynamically change the Playground and can be renamed to facilitate building and maintaining your flows.
## Inputs
Inputs are components used to define where data enters your flow. They can receive data from various sources, such as users, databases, or any other source that can be converted to Text or Data.
## Inputs {#6b1421ec66994d5ebe9fcce000829328}
---
Inputs are components used to define where data enters your flow. They can receive data from the user, a database, or any other source that can be converted to Text or Data.
The difference between Chat Input and other Input components is the output format, the number of configurable fields, and the way they are displayed in the Playground.
Chat Input components can output `Text` or `Data`. When you want to pass the sender name or sender to the next component, use the `Data` output. To pass only the message, use the `Text` output, useful when saving the message to a database or memory system like Zep.
You can find out more about Chat Input and other Inputs [here](/components-io).
### Chat Input {#2a5f02262f364f8fb75bcfa246e7bb26}
### Chat Input
This component collects user input from the chat.
The difference between Chat Input and other Input components is the output format, the number of configurable fields, and the way they are displayed in the Playground.
**Parameters**
Chat Input components can output Text or Data. When you want to pass the sender name or sender to the next component, use the Data output. To pass only the message, use the Text output. Passing only the message is useful when saving the message to a database or a memory system like Zep.
- **Sender Type:** Specifies the sender type. Defaults to `User`. Options are `Machine` and `User`.
- **Sender Name:** Specifies the name of the sender. Defaults to `User`.
- **Message:** Specifies the message text. It is a multiline text input.
- **Session ID:** Specifies the session ID of the chat history. If provided, the message will be saved in the Message History.
#### Parameters
| Name | Display Name | Info |
|--------------|--------------|---------------------------------------------------------------------|
| Sender Type | Sender Type | Specifies the sender type (User or Machine). Defaults to User |
| Sender Name | Sender Name | Specifies the name of the sender. Defaults to User |
| Message | Message | Specifies the message text. Multiline text input |
| Session ID | Session ID | Specifies the session ID of the chat history |
:::note
If `As Data` is `true` and the `Message` is a `Data`, the data of the `Data` will be updated with the `Sender`, `Sender Name`, and `Session ID`.
If "As Data" is true and the "Message" is a Data, the data will be updated with the Sender, Sender Name, and Session ID.
:::
### Text Input
This component adds an Input field on the Playground, allowing parameter definition while running and testing your flow.
The Data Template field specifies how a Data should be converted into Text. This is particularly useful when you want to extract specific information from a Data and pass it as text to the next component in the sequence.
One significant capability of the Chat Input component is its ability to transform the Playground into a chat window. This feature is particularly valuable for scenarios requiring user input to initiate or influence the flow.
For example, if you have a Data with the following structure:
```json
{ "name": "John Doe", "age": 30, "email": "johndoe@email.com"}
```
### Text Input {#260aef3726834896b496b56cdefb6d4a}
A template with Name: `{name}, Age: {age}` will convert the Data into a text string of `Name: John Doe, Age: 30`.
If you pass more than one Data, the text will be concatenated with a new line separator.
The **Text Input** component adds an **Input** field on the Playground. This enables you to define parameters while running and testing your flow.
#### Parameters
| Name | Display Name | Info |
|---------------|---------------|--------------------------------------------------------------------|
| Value | Value | Specifies the text input value. Defaults to an empty string |
| Data Template | Data Template | Specifies how a Data should be converted into Text |
**Parameters**
## Outputs
- **Value:** Specifies the text input value. This is where the user inputs text data that will be passed to the next component in the sequence. If no value is provided, it defaults to an empty string.
- **Data Template:** Specifies how a `Data` should be converted into `Text`.
The **Data Template** field is used to specify how a `Data` should be converted into `Text`. This is particularly useful when you want to extract specific information from a `Data` and pass it as text to the next component in the sequence.
For example, if you have a `Data` with the following structure:
`{ "name": "John Doe", "age": 30, "email": "johndoe@email.com"}`
A template with `Name: {name}, Age: {age}` will convert the `Data` into a text string of `Name: John Doe, Age: 30`.
If you pass more than one `Data`, the text will be concatenated with a new line separator.
## Outputs {#f62c5ad37a6f45a39b463c9b35ce7842}
---
Outputs are components that are used to define where data comes out of your flow. They can be used to send data to the user, to the Playground, or to define how the data will be displayed in the Playground.
The Chat Output works similarly to the Chat Input but does not have a field that allows for written input. It is used as an Output definition and can be used to send data to the user.
You can find out more about it and the other Outputs [here](/components-io).
### Chat Output {#1edd49b72781432ea29d70acbda4e7e7}
Outputs define where data exits your flow. They can send data to the user, the Playground, or define how data will be displayed in the Playground.
### Chat Output
This component sends a message to the chat.
#### Parameters
**Parameters**
- **Sender Type:** Specifies the sender type. Default is `"Machine"`. Options are `"Machine"` and `"User"`.
- **Sender Name:** Specifies the sender's name. Default is `"AI"`.
- **Session ID:** Specifies the session ID of the chat history. If provided, messages are saved in the Message History.
- **Message:** Specifies the text of the message.
| Name | Display Name | Info |
|--------------|--------------|---------------------------------------------------------------------|
| Sender Type | Sender Type | Specifies the sender type (Machine or User). Defaults to Machine |
| Sender Name | Sender Name | Specifies the sender's name. Defaults to AI |
| Session ID | Session ID | Specifies the session ID of the chat history |
| Message | Message | Specifies the text of the message |
:::note
If `As Data` is `true` and the `Message` is a `Data`, the data in the `Data` is updated with the `Sender`, `Sender Name`, and `Session ID`.
If "As Data" is true and the "Message" is a Data, the data will be updated with the Sender, Sender Name, and Session ID.
:::
### Text Output
This component displays text data to the user without sending it to the chat. Defaults to an empty string.
#### Parameters
### Text Output {#b607000bc0c5402db0433c1a7d734d01}
This component displays text data to the user. It is useful when you want to show text without sending it to the chat.
**Parameters**
- **Value:** Specifies the text data to be displayed. Defaults to an empty string.
The `TextOutput` component provides a simple way to display text data. It allows textual data to be visible in the chat window during your interaction flow.
| Name | Display Name | Info |
|-------|--------------|----------------------------------------------------------|
| Value | Value | Specifies the text data to be displayed |

View file

@ -4,315 +4,359 @@ sidebar_position: 5
slug: /components-models
---
# Models
Model components are used to generate text using language models. These components can be used to generate text for various tasks such as chatbots, content generation, and more.
:::info
## AI/ML API
This page may contain outdated information. It will be updated as soon as possible.
This component creates a ChatOpenAI model instance using the AIML API.
:::
For more information, see [AIML documentation](https://docs.aimlapi.com/).
### Parameters
#### Inputs
| Name | Type | Description |
|--------------|-------------|---------------------------------------------------------------------------------------------|
| max_tokens | Integer | The maximum number of tokens to generate. Set to 0 for unlimited tokens. Range: 0-128000. |
| model_kwargs | Dictionary | Additional keyword arguments for the model. |
| model_name | String | The name of the AIML model to use. Options are predefined in AIML_CHAT_MODELS. |
| aiml_api_base| String | The base URL of the AIML API. Defaults to https://api.aimlapi.com. |
| api_key | SecretString| The AIML API Key to use for the model. |
| temperature | Float | Controls randomness in the output. Default: 0.1. |
| seed | Integer | Controls reproducibility of the job. |
## Amazon Bedrock {#3b8ceacef3424234814f95895a25bf43}
#### Outputs
| Name | Type | Description |
|-------|---------------|------------------------------------------------------------------|
| model | LanguageModel | An instance of ChatOpenAI configured with the specified parameters. |
This component facilitates the generation of text using the LLM (Large Language Model) model from Amazon Bedrock.
## Amazon Bedrock
This component generates text using Amazon Bedrock LLMs.
**Params**
For more information, see [Amazon Bedrock documentation](https://docs.aws.amazon.com/bedrock).
- **Input Value:** Specifies the input text for text generation.
- **System Message (Optional):** A system message to pass to the model.
- **Model ID (Optional):** Specifies the model ID to be used for text generation. Defaults to `"anthropic.claude-instant-v1"`. Available options include:
- `"ai21.j2-grande-instruct"`
- `"ai21.j2-jumbo-instruct"`
- `"ai21.j2-mid"`
- `"ai21.j2-mid-v1"`
- `"ai21.j2-ultra"`
- `"ai21.j2-ultra-v1"`
- `"anthropic.claude-instant-v1"`
- `"anthropic.claude-v1"`
- `"anthropic.claude-v2"`
- `"cohere.command-text-v14"`
- **Credentials Profile Name (Optional):** Specifies the name of the credentials profile.
- **Region Name (Optional):** Specifies the region name.
- **Model Kwargs (Optional):** Additional keyword arguments for the model.
- **Endpoint URL (Optional):** Specifies the endpoint URL.
- **Streaming (Optional):** Specifies whether to stream the response from the model. Defaults to `False`.
- **Cache (Optional):** Specifies whether to cache the response.
- **Stream (Optional):** Specifies whether to stream the response from the model. Defaults to `False`.
### Parameters
NOTE
#### Inputs
| Name | Type | Description |
|------------------------|--------------|-------------------------------------------------------------------------------------|
| model_id | String | The ID of the Amazon Bedrock model to use. Options include various models. |
| aws_access_key | SecretString | AWS Access Key for authentication. |
| aws_secret_key | SecretString | AWS Secret Key for authentication. |
| credentials_profile_name | String | Name of the AWS credentials profile to use (advanced). |
| region_name | String | AWS region name. Default: "us-east-1". |
| model_kwargs | Dictionary | Additional keyword arguments for the model (advanced). |
| endpoint_url | String | Custom endpoint URL for the Bedrock service (advanced). |
Ensure that necessary credentials are provided to connect to the Amazon Bedrock API. If connection fails, a ValueError will be raised.
#### Outputs
| Name | Type | Description |
|-------|---------------|-------------------------------------------------------------------|
| model | LanguageModel | An instance of ChatBedrock configured with the specified parameters. |
---
## Anthropic
This component allows the generation of text using Anthropic Chat and Language models.
## Anthropic {#a6ae46f98c4c4d389d44b8408bf151a1}
For more information, see the [Anthropic documentation](https://docs.anthropic.com/en/docs/welcome).
### Parameters
This component allows the generation of text using Anthropic Chat&Completion large language models.
#### Inputs
| Name | Type | Description |
|---------------------|-------------|----------------------------------------------------------------------------------------|
| max_tokens | Integer | The maximum number of tokens to generate. Set to 0 for unlimited tokens. Default: 4096.|
| model | String | The name of the Anthropic model to use. Options include various Claude 3 models. |
| anthropic_api_key | SecretString| Your Anthropic API key for authentication. |
| temperature | Float | Controls randomness in the output. Default: 0.1. |
| anthropic_api_url | String | Endpoint of the Anthropic API. Defaults to 'https://api.anthropic.com' if not specified (advanced). |
| prefill | String | Prefill text to guide the model's response (advanced). |
**Params**
#### Outputs
- **Model Name:** Specifies the name of the Anthropic model to be used for text generation. Available options include (and not limited to):
- `"claude-2.1"`
- `"claude-2.0"`
- `"claude-instant-1.2"`
- `"claude-instant-1"`
- **Anthropic API Key:** Your Anthropic API key.
- **Max Tokens (Optional):** Specifies the maximum number of tokens to generate. Defaults to `256`.
- **Temperature (Optional):** Specifies the sampling temperature. Defaults to `0.7`.
- **API Endpoint (Optional):** Specifies the endpoint of the Anthropic API. Defaults to `"https://api.anthropic.com"`if not specified.
- **Input Value:** Specifies the input text for text generation.
- **Stream (Optional):** Specifies whether to stream the response from the model. Defaults to `False`.
- **System Message (Optional):** A system message to pass to the model.
| Name | Type | Description |
|-------|---------------|------------------------------------------------------------------|
| model | LanguageModel | An instance of ChatAnthropic configured with the specified parameters. |
For detailed documentation and integration guides, please refer to the [Anthropic Component Documentation](https://python.langchain.com/docs/integrations/chat/anthropic).
## Azure OpenAI
This component generates text using Azure OpenAI LLM.
---
For more information, see the [Azure OpenAI documentation](https://learn.microsoft.com/en-us/azure/ai-services/openai/).
### Parameters
## Azure OpenAI {#7e3bff29ce714479b07feeb4445680cd}
#### Inputs
| Name | Display Name | Info |
|---------------------|---------------------|---------------------------------------------------------------------------------|
| Model Name | Model Name | Specifies the name of the Azure OpenAI model to be used for text generation. |
| Azure Endpoint | Azure Endpoint | Your Azure endpoint, including the resource. |
| Deployment Name | Deployment Name | Specifies the name of the deployment. |
| API Version | API Version | Specifies the version of the Azure OpenAI API to be used. |
| API Key | API Key | Your Azure OpenAI API key. |
| Temperature | Temperature | Specifies the sampling temperature. Defaults to `0.7`. |
| Max Tokens | Max Tokens | Specifies the maximum number of tokens to generate. Defaults to `1000`. |
| Input Value | Input Value | Specifies the input text for text generation. |
| Stream | Stream | Specifies whether to stream the response from the model. Defaults to `False`. |
This component allows the generation of text using the LLM (Large Language Model) model from Azure OpenAI.
## Cohere
This component generates text using Cohere's language models.
**Params**
For more information, see the [Cohere documentation](https://cohere.ai/).
- **Model Name:** Specifies the name of the Azure OpenAI model to be used for text generation. Available options include:
- `"gpt-35-turbo"`
- `"gpt-35-turbo-16k"`
- `"gpt-35-turbo-instruct"`
- `"gpt-4"`
- `"gpt-4-32k"`
- `"gpt-4-vision"`
- `"gpt-4o"`
- **Azure Endpoint:** Your Azure endpoint, including the resource. Example: `https://example-resource.azure.openai.com/`.
- **Deployment Name:** Specifies the name of the deployment.
- **API Version:** Specifies the version of the Azure OpenAI API to be used. Available options include:
- `"2023-03-15-preview"`
- `"2023-05-15"`
- `"2023-06-01-preview"`
- `"2023-07-01-preview"`
- `"2023-08-01-preview"`
- `"2023-09-01-preview"`
- `"2023-12-01-preview"`
- **API Key:** Your Azure OpenAI API key.
- **Temperature (Optional):** Specifies the sampling temperature. Defaults to `0.7`.
- **Max Tokens (Optional):** Specifies the maximum number of tokens to generate. Defaults to `1000`.
- **Input Value:** Specifies the input text for text generation.
- **Stream (Optional):** Specifies whether to stream the response from the model. Defaults to `False`.
- **System Message (Optional):** A system message to pass to the model.
### Parameters
For detailed documentation and integration guides, please refer to the [Azure OpenAI Component Documentation](https://python.langchain.com/docs/integrations/llms/azure_openai).
#### Inputs
| Name | Display Name | Info |
|---------------------|--------------------|----------------------------------------------------------|
| Cohere API Key | Cohere API Key | Your Cohere API key. |
| Max Tokens | Max Tokens | Specifies the maximum number of tokens to generate. Defaults to `256`. |
| Temperature | Temperature | Specifies the sampling temperature. Defaults to `0.75`. |
| Input Value | Input Value | Specifies the input text for text generation. |
---
## Google Generative AI
This component generates text using Google's Generative AI models.
## Cohere {#706396a33bf94894966c95571252d78b}
For more information, see the [Google Generative AI documentation](https://cloud.google.com/ai-platform/training/docs/algorithms/gpt-3).
### Parameters
This component enables text generation using Cohere large language models.
#### Inputs
| Name | Display Name | Info |
|---------------------|--------------------|-----------------------------------------------------------------------|
| Google API Key | Google API Key | Your Google API key to use for the Google Generative AI. |
| Model | Model | The name of the model to use, such as `"gemini-pro"`. |
| Max Output Tokens | Max Output Tokens | The maximum number of tokens to generate. |
| Temperature | Temperature | Run inference with this temperature. |
| Top K | Top K | Consider the set of top K most probable tokens. |
| Top P | Top P | The maximum cumulative probability of tokens to consider when sampling. |
| N | N | Number of chat completions to generate for each prompt. |
**Params**
## Groq
- **Cohere API Key:** Your Cohere API key.
- **Max Tokens (Optional):** Specifies the maximum number of tokens to generate. Defaults to `256`.
- **Temperature (Optional):** Specifies the sampling temperature. Defaults to `0.75`.
- **Input Value:** Specifies the input text for text generation.
- **Stream (Optional):** Specifies whether to stream the response from the model. Defaults to `False`.
- **System Message (Optional):** A system message to pass to the model.
This component generates text using Groq's language models.
---
For more information, see the [Groq documentation](https://groq.com/).
### Parameters
## Google Generative AI {#074d9623463449f99d41b44699800e8a}
#### Inputs
| Name | Type | Description |
|----------------|---------------|-----------------------------------------------------------------|
| groq_api_key | SecretString | API key for the Groq API. |
| groq_api_base | String | Base URL path for API requests. Default: "https://api.groq.com" (advanced). |
| max_tokens | Integer | The maximum number of tokens to generate (advanced). |
| temperature | Float | Controls randomness in the output. Range: [0.0, 1.0]. Default: 0.1. |
| n | Integer | Number of chat completions to generate for each prompt (advanced). |
| model_name | String | The name of the Groq model to use. Options are dynamically fetched from the Groq API. |
This component enables text generation using Google Generative AI.
#### Outputs
| Name | Type | Description |
|-------|---------------|------------------------------------------------------------------|
| model | LanguageModel | An instance of ChatGroq configured with the specified parameters. |
**Params**
## Hugging Face API
- **Google API Key:** Your Google API key to use for the Google Generative AI.
- **Model:** The name of the model to use. Supported examples are `"gemini-pro"` and `"gemini-pro-vision"`.
- **Max Output Tokens (Optional):** The maximum number of tokens to generate.
- **Temperature:** Run inference with this temperature. Must be in the closed interval [0.0, 1.0].
- **Top K (Optional):** Decode using top-k sampling: consider the set of top_k most probable tokens. Must be positive.
- **Top P (Optional):** The maximum cumulative probability of tokens to consider when sampling.
- **N (Optional):** Number of chat completions to generate for each prompt. Note that the API may not return the full n completions if duplicates are generated.
- **Input Value:** The input to the model.
- **Stream (Optional):** Specifies whether to stream the response from the model. Defaults to `False`.
- **System Message (Optional):** A system message to pass to the model.
This component generates text using Hugging Face's language models.
---
For more information, see the [Hugging Face documentation](https://huggingface.co/).
### Parameters
## Hugging Face API {#c1267b9a6b36487cb2ee127ce9b64dbb}
#### Inputs
| Name | Display Name | Info |
|---------------------|-------------------|-------------------------------------------|
| Endpoint URL | Endpoint URL | The URL of the Hugging Face Inference API endpoint. |
| Task | Task | Specifies the task for text generation. |
| API Token | API Token | The API token required for authentication.|
| Model Kwargs | Model Kwargs | Additional keyword arguments for the model.|
| Input Value | Input Value | The input text for text generation. |
This component facilitates text generation using LLM models from the Hugging Face Inference API.
## Maritalk
This component generates text using Maritalk LLMs.
**Params**
For more information, see [Maritalk documentation](https://www.maritalk.com/).
- **Endpoint URL:** The URL of the Hugging Face Inference API endpoint. Should be provided along with necessary authentication credentials.
- **Task:** Specifies the task for text generation. Options include `"text2text-generation"`, `"text-generation"`, and `"summarization"`.
- **API Token:** The API token required for authentication with the Hugging Face Hub.
- **Model Keyword Arguments (Optional):** Additional keyword arguments for the model. Should be provided as a Python dictionary.
- **Input Value:** The input text for text generation.
- **Stream (Optional):** Specifies whether to stream the response from the model. Defaults to `False`.
- **System Message (Optional):** A system message to pass to the model.
### Parameters
---
#### Inputs
| Name | Type | Description |
|----------------|---------------|-----------------------------------------------------------------|
| max_tokens | Integer | The maximum number of tokens to generate. Set to 0 for unlimited tokens. Default: 512. |
| model_name | String | The name of the Maritalk model to use. Options: "sabia-2-small", "sabia-2-medium". Default: "sabia-2-small". |
| api_key | SecretString | The Maritalk API Key to use for authentication. |
| temperature | Float | Controls randomness in the output. Range: [0.0, 1.0]. Default: 0.5. |
| endpoint_url | String | The Maritalk API endpoint. Default: https://api.maritalk.com. |
## LiteLLM Model {#9fb59dad3b294a05966320d39f483a50}
#### Outputs
| Name | Type | Description |
|-------|---------------|------------------------------------------------------------------|
| model | LanguageModel | An instance of ChatMaritalk configured with the specified parameters. |
Generates text using the `LiteLLM` collection of large language models.
## Mistral
This component generates text using MistralAI LLMs.
**Parameters**
For more information, see [Mistral AI documentation](https://docs.mistral.ai/).
- **Model name:** The name of the model to use. For example, `gpt-3.5-turbo`. (Type: str)
- **API key:** The API key to use for accessing the provider's API. (Type: str, Optional)
- **Provider:** The provider of the API key. (Type: str, Choices: "OpenAI", "Azure", "Anthropic", "Replicate", "Cohere", "OpenRouter")
- **Temperature:** Controls the randomness of the text generation. (Type: float, Default: 0.7)
- **Model kwargs:** Additional keyword arguments for the model. (Type: Dict, Optional)
- **Top p:** Filter responses to keep the cumulative probability within the top p tokens. (Type: float, Optional)
- **Top k:** Filter responses to only include the top k tokens. (Type: int, Optional)
- **N:** Number of chat completions to generate for each prompt. (Type: int, Default: 1)
- **Max tokens:** The maximum number of tokens to generate for each chat completion. (Type: int, Default: 256)
- **Max retries:** Maximum number of retries for failed requests. (Type: int, Default: 6)
- **Verbose:** Whether to print verbose output. (Type: bool, Default: False)
- **Input:** The input prompt for text generation. (Type: str)
- **Stream:** Whether to stream the output. (Type: bool, Default: False)
- **System message:** System message to pass to the model. (Type: str, Optional)
### Parameters
---
#### Inputs
| Name | Type | Description |
|---------------------|--------------|-----------------------------------------------------------------------------------------------|
| max_tokens | Integer | The maximum number of tokens to generate. Set to 0 for unlimited tokens (advanced). |
| model_name | String | The name of the Mistral AI model to use. Options include "open-mixtral-8x7b", "open-mixtral-8x22b", "mistral-small-latest", "mistral-medium-latest", "mistral-large-latest", and "codestral-latest". Default: "codestral-latest". |
| mistral_api_base | String | The base URL of the Mistral API. Defaults to https://api.mistral.ai/v1 (advanced). |
| api_key | SecretString | The Mistral API Key to use for authentication. |
| temperature | Float | Controls randomness in the output. Default: 0.5. |
| max_retries | Integer | Maximum number of retries for API calls. Default: 5 (advanced). |
| timeout | Integer | Timeout for API calls in seconds. Default: 60 (advanced). |
| max_concurrent_requests | Integer | Maximum number of concurrent API requests. Default: 3 (advanced). |
| top_p | Float | Nucleus sampling parameter. Default: 1 (advanced). |
| random_seed | Integer | Seed for random number generation. Default: 1 (advanced). |
| safe_mode | Boolean | Enables safe mode for content generation (advanced). |
#### Outputs
| Name | Type | Description |
|--------|---------------|-----------------------------------------------------|
| model | LanguageModel | An instance of ChatMistralAI configured with the specified parameters. |
## Ollama {#14e8e411d28d4711add53bfc3e52c6cd}
## NVIDIA
This component generates text using NVIDIA LLMs.
Generate text using Ollama Local LLMs.
For more information, see [NVIDIA AI Foundation Models documentation](https://developer.nvidia.com/ai-foundation-models).
### Parameters
**Parameters**
#### Inputs
| Name | Type | Description |
|---------------------|--------------|-----------------------------------------------------------------------------------------------|
| max_tokens | Integer | The maximum number of tokens to generate. Set to 0 for unlimited tokens (advanced). |
| model_name | String | The name of the NVIDIA model to use. Default: "mistralai/mixtral-8x7b-instruct-v0.1". |
| base_url | String | The base URL of the NVIDIA API. Default: "https://integrate.api.nvidia.com/v1". |
| nvidia_api_key | SecretString | The NVIDIA API Key for authentication. |
| temperature | Float | Controls randomness in the output. Default: 0.1. |
| seed | Integer | The seed controls the reproducibility of the job (advanced). Default: 1. |
- **Base URL:** Endpoint of the Ollama API. Defaults to '[http://localhost:11434](http://localhost:11434/)' if not specified.
- **Model Name:** The model name to use. Refer to [Ollama Library](https://ollama.ai/library) for more models.
- **Temperature:** Controls the creativity of model responses. (Default: 0.8)
- **Cache:** Enable or disable caching. (Default: False)
- **Format:** Specify the format of the output (e.g., json). (Advanced)
- **Metadata:** Metadata to add to the run trace. (Advanced)
- **Mirostat:** Enable/disable Mirostat sampling for controlling perplexity. (Default: Disabled)
- **Mirostat Eta:** Learning rate for Mirostat algorithm. (Default: None) (Advanced)
- **Mirostat Tau:** Controls the balance between coherence and diversity of the output. (Default: None) (Advanced)
- **Context Window Size:** Size of the context window for generating tokens. (Default: None) (Advanced)
- **Number of GPUs:** Number of GPUs to use for computation. (Default: None) (Advanced)
- **Number of Threads:** Number of threads to use during computation. (Default: None) (Advanced)
- **Repeat Last N:** How far back the model looks to prevent repetition. (Default: None) (Advanced)
- **Repeat Penalty:** Penalty for repetitions in generated text. (Default: None) (Advanced)
- **TFS Z:** Tail free sampling value. (Default: None) (Advanced)
- **Timeout:** Timeout for the request stream. (Default: None) (Advanced)
- **Top K:** Limits token selection to top K. (Default: None) (Advanced)
- **Top P:** Works together with top-k. (Default: None) (Advanced)
- **Verbose:** Whether to print out response text.
- **Tags:** Tags to add to the run trace. (Advanced)
- **Stop Tokens:** List of tokens to signal the model to stop generating text. (Advanced)
- **System:** System to use for generating text. (Advanced)
- **Template:** Template to use for generating text. (Advanced)
- **Input:** The input text.
- **Stream:** Whether to stream the response.
- **System Message:** System message to pass to the model. (Advanced)
#### Outputs
| Name | Type | Description |
|--------|---------------|-----------------------------------------------------|
| model | LanguageModel | An instance of ChatNVIDIA configured with the specified parameters. |
---
## Ollama
This component generates text using Ollama's language models.
## OpenAI {#fe6cd793446748eda6eaad72e30f70b3}
For more information, see [Ollama documentation](https://ollama.com/).
### Parameters
This component facilitates text generation using OpenAI's models.
#### Inputs
| Name | Display Name | Info |
|---------------------|---------------|---------------------------------------------|
| Base URL | Base URL | Endpoint of the Ollama API. |
| Model Name | Model Name | The model name to use. |
| Temperature | Temperature | Controls the creativity of model responses. |
## OpenAI
**Params**
This component generates text using OpenAI's language models.
- **Input Value:** The input text for text generation.
- **Max Tokens (Optional):** The maximum number of tokens to generate. Defaults to `256`.
- **Model Kwargs (Optional):** Additional keyword arguments for the model. Should be provided as a nested dictionary.
- **Model Name (Optional):** The name of the model to use. Defaults to `gpt-4-1106-preview`. Supported options include: `gpt-4-turbo-preview`, `gpt-4-0125-preview`, `gpt-4-1106-preview`, `gpt-4-vision-preview`, `gpt-3.5-turbo-0125`, `gpt-3.5-turbo-1106`.
- **OpenAI API Base (Optional):** The base URL of the OpenAI API. Defaults to `https://api.openai.com/v1`.
- **OpenAI API Key (Optional):** The API key for accessing the OpenAI API.
- **Temperature:** Controls the creativity of model responses. Defaults to `0.7`.
- **Stream (Optional):** Specifies whether to stream the response from the model. Defaults to `False`.
- **System Message (Optional):** System message to pass to the model.
For more information, see [OpenAI documentation](https://beta.openai.com/docs/).
---
### Parameters
#### Inputs
## Qianfan {#6e4a6b2370ee4b9f8beb899e7cf9c8f6}
| Name | Type | Description |
|---------------------|---------------|------------------------------------------------------------------|
| api_key | SecretString | Your OpenAI API Key. |
| model | String | The name of the OpenAI model to use. Options include "gpt-3.5-turbo" and "gpt-4". |
| max_tokens | Integer | The maximum number of tokens to generate. Set to 0 for unlimited tokens. |
| temperature | Float | Controls randomness in the output. Range: [0.0, 1.0]. Default: 0.7. |
| top_p | Float | Controls the nucleus sampling. Range: [0.0, 1.0]. Default: 1.0. |
| frequency_penalty | Float | Controls the frequency penalty. Range: [0.0, 2.0]. Default: 0.0. |
| presence_penalty | Float | Controls the presence penalty. Range: [0.0, 2.0]. Default: 0.0. |
#### Outputs
This component facilitates the generation of text using Baidu Qianfan chat models.
| Name | Type | Description |
|-------|---------------|------------------------------------------------------------------|
| model | LanguageModel | An instance of OpenAI model configured with the specified parameters. |
## Qianfan
**Params**
This component generates text using Qianfan's language models.
- **Model Name:** Specifies the name of the Qianfan chat model to be used for text generation. Available options include:
- `"ERNIE-Bot"`
- `"ERNIE-Bot-turbo"`
- `"BLOOMZ-7B"`
- `"Llama-2-7b-chat"`
- `"Llama-2-13b-chat"`
- `"Llama-2-70b-chat"`
- `"Qianfan-BLOOMZ-7B-compressed"`
- `"Qianfan-Chinese-Llama-2-7B"`
- `"ChatGLM2-6B-32K"`
- `"AquilaChat-7B"`
- **Qianfan Ak:** Your Baidu Qianfan access key, obtainable from [here](https://cloud.baidu.com/product/wenxinworkshop).
- **Qianfan Sk:** Your Baidu Qianfan secret key, obtainable from [here](https://cloud.baidu.com/product/wenxinworkshop).
- **Top p (Optional):** Model parameter. Specifies the top-p value. Only supported in ERNIE-Bot and ERNIE-Bot-turbo models. Defaults to `0.8`.
- **Temperature (Optional):** Model parameter. Specifies the sampling temperature. Only supported in ERNIE-Bot and ERNIE-Bot-turbo models. Defaults to `0.95`.
- **Penalty Score (Optional):** Model parameter. Specifies the penalty score. Only supported in ERNIE-Bot and ERNIE-Bot-turbo models. Defaults to `1.0`.
- **Endpoint (Optional):** Endpoint of the Qianfan LLM, required if custom model is used.
- **Input Value:** Specifies the input text for text generation.
- **Stream (Optional):** Specifies whether to stream the response from the model. Defaults to `False`.
- **System Message (Optional):** A system message to pass to the model.
For more information, see [Qianfan documentation](https://github.com/baidubce/bce-qianfan-sdk).
---
## Perplexity
This component generates text using Perplexity's language models.
## Vertex AI {#86b7d539e17c436fb758c47ec3ffb084}
For more information, see [Perplexity documentation](https://perplexity.ai/).
### Parameters
The `ChatVertexAI` is a component for generating text using Vertex AI Chat large language models API.
#### Inputs
| Name | Type | Description |
|---------------------|--------------|-----------------------------------------------------------------------------------------------|
| model_name | String | The name of the Perplexity model to use. Options include various Llama 3.1 models. |
| max_output_tokens | Integer | The maximum number of tokens to generate. |
| api_key | SecretString | The Perplexity API Key for authentication. |
| temperature | Float | Controls randomness in the output. Default: 0.75. |
| top_p | Float | The maximum cumulative probability of tokens to consider when sampling (advanced). |
| n | Integer | Number of chat completions to generate for each prompt (advanced). |
| top_k | Integer | Number of top tokens to consider for top-k sampling. Must be positive (advanced). |
#### Outputs
| Name | Type | Description |
|--------|---------------|-----------------------------------------------------|
| model | LanguageModel | An instance of ChatPerplexity configured with the specified parameters. |
**Params**
## VertexAI
This component generates text using Vertex AI LLMs.
For more information, see [Google Vertex AI documentation](https://cloud.google.com/vertex-ai).
### Parameters
#### Inputs
| Name | Type | Description |
|---------------------|--------------|-----------------------------------------------------------------------------------------------|
| credentials | File | JSON credentials file. Leave empty to fallback to environment variables. File type: JSON. |
| model_name | String | The name of the Vertex AI model to use. Default: "gemini-1.5-pro". |
| project | String | The project ID (advanced). |
| location | String | The location for the Vertex AI API. Default: "us-central1" (advanced). |
| max_output_tokens | Integer | The maximum number of tokens to generate (advanced). |
| max_retries | Integer | Maximum number of retries for API calls. Default: 1 (advanced). |
| temperature | Float | Controls randomness in the output. Default: 0.0. |
| top_k | Integer | The number of highest probability vocabulary tokens to keep for top-k-filtering (advanced). |
| top_p | Float | The cumulative probability of parameter highest probability vocabulary tokens to keep for nucleus sampling. Default: 0.95 (advanced). |
| verbose | Boolean | Whether to print verbose output. Default: False (advanced). |
#### Outputs
| Name | Type | Description |
|--------|---------------|-----------------------------------------------------|
| model | LanguageModel | An instance of ChatVertexAI configured with the specified parameters. |
- **Credentials:** The JSON file containing the credentials for accessing the Vertex AI Chat API.
- **Project:** The name of the project associated with the Vertex AI Chat API.
- **Examples (Optional):** List of examples to provide context for text generation.
- **Location:** The location of the Vertex AI Chat API service. Defaults to `us-central1`.
- **Max Output Tokens:** The maximum number of tokens to generate. Defaults to `128`.
- **Model Name:** The name of the model to use. Defaults to `chat-bison`.
- **Temperature:** Controls the creativity of model responses. Defaults to `0.0`.
- **Input Value:** The input text for text generation.
- **Top K:** Limits token selection to top K. Defaults to `40`.
- **Top P:** Works together with top-k. Defaults to `0.95`.
- **Verbose:** Whether to print out response text. Defaults to `False`.
- **Stream (Optional):** Specifies whether to stream the response from the model. Defaults to `False`.
- **System Message (Optional):** System message to pass to the model.

View file

@ -4,36 +4,43 @@ sidebar_position: 2
slug: /components-prompts
---
# Prompts
A prompt serves as the input to a language model, comprising multiple components that can be parameterized using prompt templates.
:::info
Prompt templates provide a systematic approach for generating prompts, allowing for reproducible customization through defined input variables.
This page may contain outdated information. It will be updated as soon as possible.
### Parameters
:::
#### Inputs
| Name | Display Name | Info |
|----------|--------------|-------------------------------------------------------------------|
| template | Template | Create a prompt template with dynamic variables. |
#### Outputs
| Name | Display Name | Info |
|--------|----------------|--------------------------------------------------------|
| prompt | Prompt Message | The built prompt message returned by the `build_prompt` method. |
A prompt is the input provided to a language model, consisting of multiple components and can be parameterized using prompt templates. A prompt template offers a reproducible method for generating prompts, enabling easy customization through input variables.
## Langchain Hub Prompt Template
This component fetches prompts from the [Langchain Hub](https://docs.smith.langchain.com/old/category/prompt-hub).
### Prompt {#c852d1761e6c46b19ce72e5f7c70958c}
When a prompt is loaded, the component generates input fields for custom variables. For example, the default prompt "efriis/my-first-prompt" generates fields for `profession` and `question`.
### Parameters
This component creates a prompt template with dynamic variables. This is useful for structuring prompts and passing dynamic data to a language model.
#### Inputs
| Name | Display Name | Info |
|--------------------|---------------------------|------------------------------------------|
| langchain_api_key | Your LangChain API Key | The LangChain API Key to use. |
| langchain_hub_prompt| LangChain Hub Prompt | The LangChain Hub prompt to use. |
**Parameters**
#### Outputs
- **Template:** The template for the prompt. This field allows you to create other fields dynamically by using curly brackets `{}`. For example, if you have a template like `Hello {name}, how are you?`, a new field called `name` will be created. Prompt variables can be created with any name inside curly brackets, e.g. `{variable_name}`.
### PromptTemplate {#6e32412f062b42efbdf56857eafb3651}
The `PromptTemplate` component enables users to create prompts and define variables that control how the model is instructed. Users can input a set of variables which the template uses to generate the prompt when a conversation starts.
After defining a variable in the prompt template, it acts as its own component input.
- **template:** The template used to format an individual request.
| Name | Display Name | Info |
|--------|--------------|-------------------------------------------------------------------|
| prompt | Build Prompt | The built prompt message returned by the `build_prompt` method. |

View file

@ -6,23 +6,31 @@ slug: /components-rag
RAG (Retrieval-Augmented Generation) components process a user query by retrieving relevant documents and generating a concise summary that addresses the user's question.
### Vectara
## Vectara RAG
`Vectara` performs RAG using a Vectara corpus, including document retrieval, reranking results, and summary generation.
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/).
**Parameters:**
### Parameters
- **Vectara Customer ID:** Customer ID.
- **Vectara Corpus ID:** Corpus ID.
- **Vectara API Key:** API key.
- **Search Query:** User query.
- **Lexical Interpolation:** How much to weigh lexical vs. embedding scores.
- **Metadata Filters:** Filters to narrow down the search documents and parts.
- **Reranker Type:** How to rerank the retrieved results.
- **Number of Results to Rerank:** Maximum reranked results.
- **Diversity Bias:** How much to diversify retrieved results (only for MMR reranker).
- **Max Results to Summarize:** Maximum search results to provide to summarizer.
- **Response Language:** The language code (use ISO 639-1 or 639-3 codes) of the summary.
- **Prompt Name:** The summarizer prompt.
#### Inputs
For more information, consult the [Vectara documentation](https://docs.vectara.com/docs)
| 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 (e.g., "eng", "auto") |
| prompt | String | Prompt name for summarization |
#### Outputs
| Name | Type | Description |
|--------|---------|-----------------------|
| answer | Message | Generated RAG response|

View file

@ -3,586 +3,508 @@ title: Vector Stores
sidebar_position: 7
slug: /components-vector-stores
---
# Vector Stores
Vector databases are used to store and search for vectors. They can be used to store embeddings, search for similar vectors, and perform other vector operations.
## Astra DB Serverless
This component creates an Astra DB Vector Store with search capabilities.
For more information, see the [DataStax documentation](https://docs.datastax.com/en/astra-db-serverless/databases/create-database.html).
### Parameters
#### Intputs
| Name | Type | Description |
|----------------------|------------------|-------------------------------------------------------|
| collection_name | String | Name of the collection in Astra DB |
| token | SecretString | Astra DB Application Token |
| api_endpoint | SecretString | API endpoint URL for Astra DB |
| search_input | String | Query for similarity search |
| ingest_data | Data | Data to be ingested into the vector store |
| namespace | String | Optional namespace within Astra DB |
| metric | String | Distance metric for vector comparisons |
| batch_size | Integer | Number of data to process in a single batch |
| setup_mode | String | Configuration mode for setting up the vector store |
| pre_delete_collection | Boolean | Whether to delete the collection before creating a new one |
| embedding | Embeddings/Dict | Embedding model or Astra Vectorize configuration |
| number_of_results | Integer | Number of results to return in search |
| search_type | String | Type of search to perform |
| search_score_threshold| Float | Minimum similarity score for search results |
| search_filter | Dict | Metadata filters for search query |
#### Outputs
| Name | Type | Description |
|----------------|-----------|-----------------------------------|
| vector_store | AstraDB | Astra DB vector store instance |
| search_results | List[Data]| Results of similarity search |
## Cassandra
This component creates a Cassandra Vector Store with search capabilities.
For more information, see the [Cassandra documentation](https://cassandra.apache.org/doc/latest/cassandra/vector-search/overview.html).
### Parameters
#### Intputs
| Name | Type | Description |
|---------------------|----------------|----------------------------------------------------|
| database_ref | String | Contact points for the database or AstraDB database ID |
| username | String | Username for the database (leave empty for AstraDB) |
| token | SecretString | User password for the database or AstraDB token |
| keyspace | String | Table Keyspace or AstraDB namespace |
| table_name | String | Name of the table or AstraDB collection |
| ttl_seconds | Integer | Time-to-live for added texts |
| batch_size | Integer | Number of data to process in a single batch |
| setup_mode | String | Configuration mode for setting up the Cassandra table |
| cluster_kwargs | Dict | Additional keyword arguments for the Cassandra cluster |
| search_query | String | Query for similarity search |
| ingest_data | Data | Data to be ingested into the vector store |
| embedding | Embeddings | Embedding function to use |
| number_of_results | Integer | Number of results to return in search |
| search_type | String | Type of search to perform |
| search_score_threshold| Float | Minimum similarity score for search results |
| search_filter | Dict | Metadata filters for search query |
| body_search | String | Document textual search terms |
| enable_body_search | Boolean | Flag to enable body search |
#### Outputs
| Name | Type | Description |
|----------------|------------|----------------------------------|
| vector_store | Cassandra | Cassandra vector store instance |
| search_results | List[Data] | Results of similarity search |
## Chroma DB
This component creates a Chroma Vector Store with search capabilities.
For more information, see the [Chroma documentation](https://docs.trychroma.com/).
### Parameters
#### Intputs
| Name | Type | Description |
|------------------------------|---------------|--------------------------------------------------|
| collection_name | String | The name of the Chroma collection. Default: "langflow". |
| persist_directory | String | The directory to persist the Chroma database. |
| search_query | String | The query to search for in the vector store. |
| ingest_data | Data | The data to ingest into the vector store (list of Data objects). |
| embedding | Embeddings | The embedding function to use for the vector store. |
| chroma_server_cors_allow_origins | String | CORS allow origins for the Chroma server. |
| chroma_server_host | String | Host for the Chroma server. |
| chroma_server_http_port | Integer | HTTP port for the Chroma server. |
| chroma_server_grpc_port | Integer | gRPC port for the Chroma server. |
| chroma_server_ssl_enabled | Boolean | Enable SSL for the Chroma server. |
| allow_duplicates | Boolean | Allow duplicate documents in the vector store. |
| search_type | String | Type of search to perform: "Similarity" or "MMR". |
| number_of_results | Integer | Number of results to return from the search. Default: 10. |
| limit | Integer | Limit the number of records to compare when Allow Duplicates is False. |
#### Outputs
| Name | Type | Description |
|----------------|---------------|--------------------------------|
| vector_store | Chroma | Chroma vector store instance |
| search_results | List[Data] | Results of similarity search |
## Couchbase
This component creates a Couchbase Vector Store with search capabilities.
For more information, see the [Couchbase documentation](https://docs.couchbase.com/home/index.html).
### Parameters
#### Intputs
| Name | Type | Description |
|-------------------------|---------------|--------------------------------------------------|
| couchbase_connection_string | SecretString | Couchbase Cluster connection string (required). |
| couchbase_username | String | Couchbase username (required). |
| couchbase_password | SecretString | Couchbase password (required). |
| bucket_name | String | Name of the Couchbase bucket (required). |
| scope_name | String | Name of the Couchbase scope (required). |
| collection_name | String | Name of the Couchbase collection (required). |
| index_name | String | Name of the Couchbase index (required). |
| search_query | String | The query to search for in the vector store. |
| ingest_data | Data | The data to ingest into the vector store (list of Data objects). |
| embedding | Embeddings | The embedding function to use for the vector store. |
| number_of_results | Integer | Number of results to return from the search. Default: 4 (advanced). |
#### Outputs
| Name | Type | Description |
|----------------|------------------------|--------------------------------|
| vector_store | CouchbaseVectorStore | A Couchbase vector store instance configured with the specified parameters. |
## FAISS
This component creates a FAISS Vector Store with search capabilities.
For more information, see the [FAISS documentation](https://faiss.ai/index.html).
### Parameters
#### Intputs
| Name | Type | Description |
|---------------------------|---------------|--------------------------------------------------|
| index_name | String | The name of the FAISS index. Default: "langflow_index". |
| persist_directory | String | Path to save the FAISS index. It will be relative to where Langflow is running. |
| search_query | String | The query to search for in the vector store. |
| ingest_data | Data | The data to ingest into the vector store (list of Data objects or documents). |
| allow_dangerous_deserialization | Boolean | Set to True to allow loading pickle files from untrusted sources. Default: True (advanced). |
| embedding | Embeddings | The embedding function to use for the vector store. |
| number_of_results | Integer | Number of results to return from the search. Default: 4 (advanced). |
#### Outputs
| Name | Type | Description |
|----------------|------------------------|--------------------------------|
| vector_store | FAISS | A FAISS vector store instance configured with the specified parameters. |
:::info
This page may contain outdated information. It will be updated as soon as possible.
## Milvus
:::
This component creates a Milvus Vector Store with search capabilities.
For more information, see the [Milvus documentation](https://milvus.io/docs).
### Parameters
#### Intputs
| Name | Type | Description |
|-------------------------|---------------|--------------------------------------------------|
| collection_name | String | Name of the Milvus collection |
| collection_description | String | Description of the Milvus collection |
| uri | String | Connection URI for Milvus |
| password | SecretString | Password for Milvus |
| username | SecretString | Username for Milvus |
| batch_size | Integer | Number of data to process in a single batch |
| search_query | String | Query for similarity search |
| ingest_data | Data | Data to be ingested into the vector store |
| embedding | Embeddings | Embedding function to use |
| number_of_results | Integer | Number of results to return in search |
| search_type | String | Type of search to perform |
| search_score_threshold | Float | Minimum similarity score for search results |
| search_filter | Dict | Metadata filters for search query |
| setup_mode | String | Configuration mode for setting up the vector store |
| vector_dimensions | Integer | Number of dimensions of the vectors |
| pre_delete_collection | Boolean | Whether to delete the collection before creating a new one |
### Astra DB {#453bcf5664154e37a920f1b602bd39da}
#### Outputs
| Name | Type | Description |
|----------------|------------------------|--------------------------------|
| vector_store | Milvus | A Milvus vector store instance configured with the specified parameters. |
The `Astra DB` initializes a vector store using Astra DB from Data. It creates Astra DB-based vector indexes to efficiently store and retrieve documents.
## MongoDB Atlas
This component creates a MongoDB Atlas Vector Store with search capabilities.
For more information, see the [MongoDB Atlas documentation](https://www.mongodb.com/docs/atlas/atlas-vector-search/tutorials/vector-search-quick-start/).
**Parameters:**
### Parameters
- **Input:** Documents or Data for input.
- **Embedding or Astra vectorize:** External or server-side model Astra DB uses.
- **Collection Name:** Name of the Astra DB collection.
- **Token:** Authentication token for Astra DB.
- **API Endpoint:** API endpoint for Astra DB.
- **Namespace:** Astra DB namespace.
- **Metric:** Metric used by Astra DB.
- **Batch Size:** Batch size for operations.
- **Bulk Insert Batch Concurrency:** Concurrency level for bulk inserts.
- **Bulk Insert Overwrite Concurrency:** Concurrency level for overwriting during bulk inserts.
- **Bulk Delete Concurrency:** Concurrency level for bulk deletions.
- **Setup Mode:** Setup mode for the vector store.
- **Pre Delete Collection:** Option to delete the collection before setup.
- **Metadata Indexing Include:** Fields to include in metadata indexing.
- **Metadata Indexing Exclude:** Fields to exclude from metadata indexing.
- **Collection Indexing Policy:** Indexing policy for the collection.
###### Intputs
NOTE
| Name | Type | Description |
| ------------------------ | ------------ | ----------------------------------------- |
| mongodb_atlas_cluster_uri | SecretString | MongoDB Atlas Cluster URI |
| db_name | String | Database name |
| collection_name | String | Collection name |
| index_name | String | Index name |
| search_query | String | Query for similarity search |
| ingest_data | Data | Data to be ingested into the vector store |
| embedding | Embeddings | Embedding function to use |
| number_of_results | Integer | Number of results to return in search |
#### Outputs
Ensure you configure the necessary Astra DB token and API endpoint before starting.
| Name | Type | Description |
| ------------- | ---------------------- | ----------------------------------------- |
| vector_store | MongoDBAtlasVectorSearch| MongoDB Atlas vector store instance |
| search_results| List[Data] | Results of similarity search |
---
## PGVector
This component creates a PGVector Vector Store with search capabilities.
For more information, see the [PGVector documentation](https://github.com/pgvector/pgvector).
### Astra DB Search {#26f25d1933a9459bad2d6725f87beb11}
### Parameters
###### Intputs
`Astra DBSearch` searches an existing Astra DB vector store for documents similar to the input. It uses the `Astra DB`component's functionality for efficient retrieval.
| Name | Type | Description |
| --------------- | ------------ | ----------------------------------------- |
| pg_server_url | SecretString | PostgreSQL server connection string |
| collection_name | String | Table name for the vector store |
| search_query | String | Query for similarity search |
| ingest_data | Data | Data to be ingested into the vector store |
| embedding | Embeddings | Embedding function to use |
| number_of_results | Integer | Number of results to return in search |
#### Outputs
**Parameters:**
| Name | Type | Description |
| ------------- | ----------- | ----------------------------------------- |
| vector_store | PGVector | PGVector vector store instance |
| search_results| List[Data] | Results of similarity search |
- **Search Type:** Type of search, such as Similarity or MMR.
- **Input Value:** Value to search for.
- **Embedding or Astra vectorize:** External or server-side model Astra DB uses.
- **Collection Name:** Name of the Astra DB collection.
- **Token:** Authentication token for Astra DB.
- **API Endpoint:** API endpoint for Astra DB.
- **Namespace:** Astra DB namespace.
- **Metric:** Metric used by Astra DB.
- **Batch Size:** Batch size for operations.
- **Bulk Insert Batch Concurrency:** Concurrency level for bulk inserts.
- **Bulk Insert Overwrite Concurrency:** Concurrency level for overwriting during bulk inserts.
- **Bulk Delete Concurrency:** Concurrency level for bulk deletions.
- **Setup Mode:** Setup mode for the vector store.
- **Pre Delete Collection:** Option to delete the collection before setup.
- **Metadata Indexing Include:** Fields to include in metadata indexing.
- **Metadata Indexing Exclude:** Fields to exclude from metadata indexing.
- **Collection Indexing Policy:** Indexing policy for the collection.
---
## Pinecone
This component creates a Pinecone Vector Store with search capabilities.
For more information, see the [Pinecone documentation](https://docs.pinecone.io/home).
### Chroma {#74730795605143cba53e1f4c4f2ef5d6}
### Parameters
#### Inputs
`Chroma` sets up a vector store using Chroma for efficient vector storage and retrieval within language processing workflows.
| Name | Type | Description |
| ----------------- | ------------ | ----------------------------------------- |
| index_name | String | Name of the Pinecone index |
| namespace | String | Namespace for the index |
| distance_strategy | String | Strategy for calculating distance between vectors |
| pinecone_api_key | SecretString | API key for Pinecone |
| text_key | String | Key in the record to use as text |
| search_query | String | Query for similarity search |
| ingest_data | Data | Data to be ingested into the vector store |
| embedding | Embeddings | Embedding function to use |
| number_of_results | Integer | Number of results to return in search |
#### Outputs
**Parameters:**
| Name | Type | Description |
| ------------- | ---------- | ----------------------------------------- |
| vector_store | Pinecone | Pinecone vector store instance |
| search_results| List[Data] | Results of similarity search |
- **Collection Name:** Name of the collection.
- **Persist Directory:** Directory to persist the Vector Store.
- **Server CORS Allow Origins (Optional):** CORS allow origins for the Chroma server.
- **Server Host (Optional):** Host for the Chroma server.
- **Server Port (Optional):** Port for the Chroma server.
- **Server gRPC Port (Optional):** gRPC port for the Chroma server.
- **Server SSL Enabled (Optional):** SSL configuration for the Chroma server.
- **Input:** Input data for creating the Vector Store.
- **Embedding:** Embeddings used for the Vector Store.
For detailed documentation and integration guides, please refer to the [Chroma Component Documentation](https://python.langchain.com/docs/integrations/vectorstores/chroma).
## Qdrant
This component creates a Qdrant Vector Store with search capabilities.
For more information, see the [Qdrant documentation](https://qdrant.tech/documentation/).
---
### Parameters
#### Inputs
### Chroma Search {#5718072a155441f3a443b944ad4d638f}
| Name | Type | Description |
| -------------------- | ------------ | ----------------------------------------- |
| collection_name | String | Name of the Qdrant collection |
| host | String | Qdrant server host |
| port | Integer | Qdrant server port |
| grpc_port | Integer | Qdrant gRPC port |
| api_key | SecretString | API key for Qdrant |
| prefix | String | Prefix for Qdrant |
| timeout | Integer | Timeout for Qdrant operations |
| path | String | Path for Qdrant |
| url | String | URL for Qdrant |
| distance_func | String | Distance function for vector similarity |
| content_payload_key | String | Key for content payload |
| metadata_payload_key | String | Key for metadata payload |
| search_query | String | Query for similarity search |
| ingest_data | Data | Data to be ingested into the vector store |
| embedding | Embeddings | Embedding function to use |
| number_of_results | Integer | Number of results to return in search |
#### Outputs
`ChromaSearch` searches a Chroma collection for documents similar to the input text. It leverages Chroma to ensure efficient document retrieval.
| Name | Type | Description |
| ------------- | -------- | ----------------------------------------- |
| vector_store | Qdrant | Qdrant vector store instance |
| search_results| List[Data] | Results of similarity search |
**Parameters:**
## Redis
- **Input:** Input text for search.
- **Search Type:** Type of search, such as Similarity or MMR.
- **Collection Name:** Name of the Chroma collection.
- **Index Directory:** Directory where the Chroma index is stored.
- **Embedding:** Embedding model used for vectorization.
- **Server CORS Allow Origins (Optional):** CORS allow origins for the Chroma server.
- **Server Host (Optional):** Host for the Chroma server.
- **Server Port (Optional):** Port for the Chroma server.
- **Server gRPC Port (Optional):** gRPC port for the Chroma server.
- **Server SSL Enabled (Optional):** SSL configuration for the Chroma server.
This component creates a Redis Vector Store with search capabilities.
For more information, see the [Redis documentation](https://redis.io/docs/latest/develop/interact/search-and-query/advanced-concepts/vectors/).
---
### Parameters
#### Inputs
### Couchbase {#6900a79347164f35af27ae27f0d64a6d}
| Name | Type | Description |
| ----------------- | ------------ | ----------------------------------------- |
| redis_server_url | SecretString | Redis server connection string |
| redis_index_name | String | Name of the Redis index |
| code | String | Custom code for Redis (advanced) |
| schema | String | Schema for Redis index |
| search_query | String | Query for similarity search |
| ingest_data | Data | Data to be ingested into the vector store |
| number_of_results | Integer | Number of results to return in search |
| embedding | Embeddings | Embedding function to use |
#### Outputs
`Couchbase` builds a Couchbase vector store from Data, streamlining the storage and retrieval of documents.
| Name | Type | Description |
| ------------- | -------- | ----------------------------------------- |
| vector_store | Redis | Redis vector store instance |
| search_results| List[Data]| Results of similarity search |
**Parameters:**
## Supabase
- **Embedding:** Model used by Couchbase.
- **Input:** Documents or Data.
- **Couchbase Cluster Connection String:** Cluster Connection string.
- **Couchbase Cluster Username:** Cluster Username.
- **Couchbase Cluster Password:** Cluster Password.
- **Bucket Name:** Bucket identifier in Couchbase.
- **Scope Name:** Scope identifier in Couchbase.
- **Collection Name:** Collection identifier in Couchbase.
- **Index Name:** Index identifier.
This component creates a Supabase Vector Store with search capabilities.
For more information, see the [Supabase documentation](https://supabase.com/docs/guides/ai).
For detailed documentation and integration guides, please refer to the [Couchbase Component Documentation](https://python.langchain.com/docs/integrations/vectorstores/couchbase).
### Parameters
#### Inputs
---
| Name | Type | Description |
| ------------------- | ------------ | ----------------------------------------- |
| supabase_url | String | URL of the Supabase instance |
| supabase_service_key| SecretString | Service key for Supabase authentication |
| table_name | String | Name of the table in Supabase |
| query_name | String | Name of the query to use |
| search_query | String | Query for similarity search |
| ingest_data | Data | Data to be ingested into the vector store |
| embedding | Embeddings | Embedding function to use |
| number_of_results | Integer | Number of results to return in search |
#### Outputs
### Couchbase Search {#c77bb09425a3426f9677d38d8237d9ba}
| Name | Type | Description |
| ------------- | ------------------ | ----------------------------------------- |
| vector_store | SupabaseVectorStore | Supabase vector store instance |
| search_results| List[Data] | Results of similarity search |
`CouchbaseSearch` leverages the Couchbase component to search for documents based on similarity metric.
## Upstash
This component creates an Upstash Vector Store with search capabilities.
For more information, see the [Upstash documentation](https://upstash.com/docs/introduction).
**Parameters:**
### Parameters
- **Input:** Search query.
- **Embedding:** Model used in the Vector Store.
- **Couchbase Cluster Connection String:** Cluster Connection string.
- **Couchbase Cluster Username:** Cluster Username.
- **Couchbase Cluster Password:** Cluster Password.
- **Bucket Name:** Bucket identifier.
- **Scope Name:** Scope identifier.
- **Collection Name:** Collection identifier in Couchbase.
- **Index Name:** Index identifier.
#### Inputs
---
| Name | Type | Description |
| --------------- | ------------ | ----------------------------------------- |
| index_url | String | The URL of the Upstash index |
| index_token | SecretString | The token for the Upstash index |
| text_key | String | The key in the record to use as text |
| namespace | String | Namespace for the index |
| search_query | String | Query for similarity search |
| metadata_filter | String | Filters documents by metadata |
| ingest_data | Data | Data to be ingested into the vector store |
| embedding | Embeddings | Embedding function to use (optional) |
| number_of_results | Integer | Number of results to return in search |
#### Outputs
### FAISS {#5b3f4e6592a847b69e07df2f674a03f0}
| Name | Type | Description |
| ------------- | ---------------- | ----------------------------------------- |
| vector_store | UpstashVectorStore| Upstash vector store instance |
| search_results| List[Data] | Results of similarity search |
The `FAISS` component manages document ingestion into a FAISS Vector Store, optimizing document indexing and retrieval.
## Vectara
This component creates a Vectara Vector Store with search capabilities.
For more information, see the [Vectara documentation](https://docs.vectara.com/docs/).
**Parameters:**
### Parameters
- **Embedding:** Model used for vectorizing inputs.
- **Input:** Documents to ingest.
- **Folder Path:** Save path for the FAISS index, relative to Langflow.
#### Inputs
For more details, see the [FAISS Component Documentation](https://faiss.ai/index.html).
| Name | Type | Description |
| ---------------- | ------------ | ----------------------------------------- |
| vectara_customer_id | String | Vectara customer ID |
| vectara_corpus_id | String | Vectara corpus ID |
| vectara_api_key | SecretString | Vectara API key |
| embedding | Embeddings | Embedding function to use (optional) |
| ingest_data | List[Document/Data] | Data to be ingested into the vector store |
| search_query | String | Query for similarity search |
| number_of_results | Integer | Number of results to return in search |
#### Outputs
---
| Name | Type | Description |
| ------------- | ----------------- | ----------------------------------------- |
| vector_store | VectaraVectorStore | Vectara vector store instance |
| search_results| List[Data] | Results of similarity search |
## Vectara Search
### FAISS Search {#81ff12d7205940a3b14e3ddf304630f8}
This component searches a Vectara Vector Store for documents based on the provided input.
For more information, see the [Vectara documentation](https://docs.vectara.com/docs/).
### Parameters
`FAISSSearch` searches a FAISS Vector Store for documents similar to a given input, using similarity metrics for efficient retrieval.
#### Inputs
| Name | Type | Description |
|---------------------|--------------|-------------------------------------------|
| search_type | String | Type of search, such as "Similarity" or "MMR" |
| input_value | String | Search query |
| vectara_customer_id | String | Vectara customer ID |
| vectara_corpus_id | String | Vectara corpus ID |
| vectara_api_key | SecretString | Vectara API key |
| files_url | List[String] | Optional URLs for file initialization |
**Parameters:**
#### Outputs
- **Embedding:** Model used in the FAISS Vector Store.
- **Folder Path:** Path to load the FAISS index from, relative to Langflow.
- **Input:** Search query.
- **Index Name:** Index identifier.
| Name | Type | Description |
|----------------|------------|----------------------------|
| search_results | List[Data] | Results of similarity search |
---
## Weaviate
This component facilitates a Weaviate Vector Store setup, optimizing text and document indexing and retrieval.
For more information, see the [Weaviate Documentation](https://weaviate.io/developers/weaviate).
### MongoDB Atlas {#eba8892f7a204b97ad1c353e82948149}
### Parameters
#### Inputs
`MongoDBAtlas` builds a MongoDB Atlas-based vector store from Data, streamlining the storage and retrieval of documents.
| Name | Type | Description |
|---------------|--------------|-------------------------------------------|
| weaviate_url | String | Default instance URL |
| search_by_text| Boolean | Indicates whether to search by text |
| api_key | SecretString | Optional API key for authentication |
| index_name | String | Optional index name |
| text_key | String | Default text extraction key |
| input | Document | Document or record |
| embedding | Embeddings | Model used |
| attributes | List[String] | Optional additional attributes |
#### Outputs
**Parameters:**
| Name | Type | Description |
|--------------|------------------|-------------------------------|
| vector_store | WeaviateVectorStore | Weaviate vector store instance |
- **Embedding:** Model used by MongoDB Atlas.
- **Input:** Documents or Data.
- **Collection Name:** Collection identifier in MongoDB Atlas.
- **Database Name:** Database identifier.
- **Index Name:** Index identifier.
- **MongoDB Atlas Cluster URI:** Cluster URI.
- **Search Kwargs:** Additional search parameters.
**Note:** Ensure Weaviate instance is running and accessible. Verify API key, index name, text key, and attributes are set correctly.
NOTE
## Weaviate Search
This component searches a Weaviate Vector Store for documents similar to the input.
For more information, see the [Weaviate Documentation](https://weaviate.io/developers/weaviate).
Ensure pymongo is installed for using MongoDB Atlas Vector Store.
### Parameters
#### Inputs
---
| Name | Type | Description |
|---------------|--------------|-------------------------------------------|
| search_type | String | Type of search, such as "Similarity" or "MMR" |
| input_value | String | Search query |
| weaviate_url | String | Default instance URL |
| search_by_text| Boolean | Indicates whether to search by text |
| api_key | SecretString | Optional API key for authentication |
| index_name | String | Optional index name |
| text_key | String | Default text extraction key |
| embedding | Embeddings | Model used |
| attributes | List[String] | Optional additional attributes |
#### Outputs
### MongoDB Atlas Search {#686ba0e30a54438cbc7153b81ee4b1df}
`MongoDBAtlasSearch` leverages the MongoDBAtlas component to search for documents based on similarity metrics.
**Parameters:**
- **Search Type:** Type of search, such as "Similarity" or "MMR".
- **Input:** Search query.
- **Embedding:** Model used in the Vector Store.
- **Collection Name:** Collection identifier.
- **Database Name:** Database identifier.
- **Index Name:** Index identifier.
- **MongoDB Atlas Cluster URI:** Cluster URI.
- **Search Kwargs:** Additional search parameters.
---
### PGVector {#7ceebdd84ab14f8e8589c13c58370e5b}
`PGVector` integrates a Vector Store within a PostgreSQL database, allowing efficient storage and retrieval of vectors.
**Parameters:**
- **Input:** Value for the Vector Store.
- **Embedding:** Model used.
- **PostgreSQL Server Connection String:** Server URL.
- **Table:** Table name in the PostgreSQL database.
For more details, see the [PGVector Component Documentation](https://python.langchain.com/docs/integrations/vectorstores/pgvector).
NOTE
Ensure the PostgreSQL server is accessible and configured correctly.
---
### PGVector Search {#196bf22ea2844bdbba971b5082750943}
`PGVectorSearch` extends `PGVector` to search for documents based on similarity metrics.
**Parameters:**
- **Input:** Search query.
- **Embedding:** Model used.
- **PostgreSQL Server Connection String:** Server URL.
- **Table:** Table name.
- **Search Type:** Type of search, such as "Similarity" or "MMR".
---
### Pinecone {#67abbe3e27c34fb4bcb35926ce831727}
`Pinecone` constructs a Pinecone wrapper from Data, setting up Pinecone-based vector indexes for document storage and retrieval.
**Parameters:**
- **Input:** Documents or Data.
- **Embedding:** Model used.
- **Index Name:** Index identifier.
- **Namespace:** Namespace used.
- **Pinecone API Key:** API key.
- **Pinecone Environment:** Environment settings.
- **Search Kwargs:** Additional search parameters.
- **Pool Threads:** Number of threads.
:::info
Ensure the Pinecone API key and environment are correctly configured.
:::
---
### Pinecone Search {#977944558cad4cf2ba332ea4f06bf485}
`PineconeSearch` searches a Pinecone Vector Store for documents similar to the input, using advanced similarity metrics.
**Parameters:**
- **Search Type:** Type of search, such as "Similarity" or "MMR".
- **Input Value:** Search query.
- **Embedding:** Model used.
- **Index Name:** Index identifier.
- **Namespace:** Namespace used.
- **Pinecone API Key:** API key.
- **Pinecone Environment:** Environment settings.
- **Search Kwargs:** Additional search parameters.
- **Pool Threads:** Number of threads.
---
### Qdrant {#88df77f3044e4ac6980950835a919fb0}
`Qdrant` allows efficient similarity searches and retrieval operations, using a list of texts to construct a Qdrant wrapper.
**Parameters:**
- **Input:** Documents or Data.
- **Embedding:** Model used.
- **API Key:** Qdrant API key.
- **Collection Name:** Collection identifier.
- **Advanced Settings:** Includes content payload key, distance function, gRPC port, host, HTTPS, location, metadata payload key, path, port, prefer gRPC, prefix, search kwargs, timeout, URL.
---
### Qdrant Search {#5ba5f8dca0f249d7ad00778f49901e6c}
`QdrantSearch` extends `Qdrant` to search for documents similar to the input based on advanced similarity metrics.
**Parameters:**
- **Search Type:** Type of search, such as "Similarity" or "MMR".
- **Input Value:** Search query.
- **Embedding:** Model used.
- **API Key:** Qdrant API key.
- **Collection Name:** Collection identifier.
- **Advanced Settings:** Includes content payload key, distance function, gRPC port, host, HTTPS, location, metadata payload key, path, port, prefer gRPC, prefix, search kwargs, timeout, URL.
---
### Redis {#a0fb8a9d244a40eb8439d0f8c22a2562}
`Redis` manages a Vector Store in a Redis database, supporting efficient vector storage and retrieval.
**Parameters:**
- **Index Name:** Default index name.
- **Input:** Data for building the Redis Vector Store.
- **Embedding:** Model used.
- **Schema:** Optional schema file (.yaml) for document structure.
- **Redis Server Connection String:** Server URL.
- **Redis Index:** Optional index name.
For detailed documentation, refer to the [Redis Documentation](https://python.langchain.com/docs/integrations/vectorstores/redis).
:::info
Ensure the Redis server URL and index name are configured correctly. Provide a schema if no documents are available.
:::
---
### Redis Search {#80aea4da515f490e979c8576099ee880}
`RedisSearch` searches a Redis Vector Store for documents similar to the input.
**Parameters:**
- **Search Type:** Type of search, such as "Similarity" or "MMR".
- **Input Value:** Search query.
- **Index Name:** Default index name.
- **Embedding:** Model used.
- **Schema:** Optional schema file (.yaml) for document structure.
- **Redis Server Connection String:** Server URL.
- **Redis Index:** Optional index name.
---
### Supabase {#e86fb3cc507e4b5494f0a421f94e853b}
`Supabase` initializes a Supabase Vector Store from texts and embeddings, setting up an environment for efficient document retrieval.
**Parameters:**
- **Input:** Documents or data.
- **Embedding:** Model used.
- **Query Name:** Optional query name.
- **Search Kwargs:** Advanced search parameters.
- **Supabase Service Key:** Service key.
- **Supabase URL:** Instance URL.
- **Table Name:** Optional table name.
:::info
Ensure the Supabase service key, URL, and table name are properly configured.
:::
---
### Supabase Search {#fd02d550b9b2457f91f2f4073656cb09}
`SupabaseSearch` searches a Supabase Vector Store for documents similar to the input.
**Parameters:**
- **Search Type:** Type of search, such as "Similarity" or "MMR".
- **Input Value:** Search query.
- **Embedding:** Model used.
- **Query Name:** Optional query name.
- **Search Kwargs:** Advanced search parameters.
- **Supabase Service Key:** Service key.
- **Supabase URL:** Instance URL.
- **Table Name:** Optional table name.
---
### Upstash Vector
`UpstashVector` searches a Upstash Vector Store for documents similar to the input. It has it's own embedding
model which can be used to search documents without needing an external embedding model.
**Parameters:**
- **Index URL:** The URL of the Upstash index.
- **Index Token:** The token for the Upstash index.
- **Text Key:** The key in the record to use as text.
- **Namespace:** The namespace name. A new namespace is created if not found. Leave empty for default namespace.
- **Search Query:** The search query.
- **Metadata Filter:** The metadata filter. Filters documents by metadata. Look at the [docs](https://upstash.com/docs/vector/features/filtering) for more information.
- **Embedding:** The embedding model used. To use Upstash's embeddings, don't provide an embedding.
- **Number of Results:** The number of results to return.
---
### Vectara {#b4e05230b62a47c792a89c5511af97ac}
`Vectara` sets up a Vectara Vector Store from files or upserted data, optimizing document retrieval.
**Parameters:**
- **Vectara Customer ID:** Customer ID.
- **Vectara Corpus ID:** Corpus ID.
- **Vectara API Key:** API key.
- **Files Url:** Optional URLs for file initialization.
- **Input:** Optional data for corpus upsert.
For more information, consult the [Vectara Component Documentation](https://python.langchain.com/docs/integrations/vectorstores/vectara).
:::info
If inputs or files_url are provided, they will be processed accordingly.
:::
---
### Vectara Search {#31a47221c23f4fbba4a7465cf1d89eb0}
`VectaraSearch` searches a Vectara Vector Store for documents based on the provided input.
**Parameters:**
- **Search Type:** Type of search, such as "Similarity" or "MMR".
- **Input Value:** Search query.
- **Vectara Customer ID:** Customer ID.
- **Vectara Corpus ID:** Corpus ID.
- **Vectara API Key:** API key.
- **Files Url:** Optional URLs for file initialization.
---
### Weaviate {#57c7969574b1418dbb079ac5fc8cd857}
`Weaviate` facilitates a Weaviate Vector Store setup, optimizing text and document indexing and retrieval.
**Parameters:**
- **Weaviate URL:** Default instance URL.
- **Search By Text:** Indicates whether to search by text.
- **API Key:** Optional API key for authentication.
- **Index Name:** Optional index name.
- **Text Key:** Default text extraction key.
- **Input:** Document or record.
- **Embedding:** Model used.
- **Attributes:** Optional additional attributes.
For more details, see the [Weaviate Component Documentation](https://python.langchain.com/docs/integrations/vectorstores/weaviate).
NOTE
Ensure Weaviate instance is running and accessible. Verify API key, index name, text key, and attributes are set correctly.
---
### Weaviate Search {#6d4e616dfd6143b28dc055bc1c40ecae}
`WeaviateSearch` searches a Weaviate Vector Store for documents similar to the input.
**Parameters:**
- **Search Type:** Type of search, such as "Similarity" or "MMR".
- **Input Value:** Search query.
- **Weaviate URL:** Default instance URL.
- **Search By Text:** Indicates whether to search by text.
- **API Key:** Optional API key for authentication.
- **Index Name:** Optional index name.
- **Text Key:** Default text extraction key.
- **Embedding:** Model used.
- **Attributes:** Optional additional attributes.
| Name | Type | Description |
|----------------|------------|----------------------------|
| search_results | List[Data] | Results of similarity search |