diff --git a/docs/docs/components/helpers.mdx b/docs/docs/components/helpers.mdx index 142ea8783..d965761aa 100644 --- a/docs/docs/components/helpers.mdx +++ b/docs/docs/components/helpers.mdx @@ -2,17 +2,57 @@ import Admonition from '@theme/Admonition'; # Helpers -### Custom Component +### Chat Memory -This component serves as a template for creating your own custom components. +This component retrieves stored chat messages given a specific Session ID. **Params** -- **Display Name:** Parameter +- **Sender Type:** Choose the sender type from options like "Machine", "User", or "Machine and User". +- **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 order of the messages, either "Ascending" or "Descending". +- **Record Template:** (Optional) Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key. -**Usage** +--- -To use this component, provide the required parameter as specified. +### Combine Text + +This component concatenates two text sources into a single text chunk using a specified delimiter. + +**Params** + +- **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 whitespace. + +--- + +### Create Record + +This component dynamically creates a Record with a specified number of fields. + +**Params** + +- **Number of Fields:** Number of fields to be added to the record. +- **Text Key:** Key to be used as text. + +--- + +### Custom Component + +Use this component as a template to create your own custom component. + +**Params** + +- **Parameter:** Describe the purpose of this parameter. + + +

+ Customize the build_config and build methods according to your requirements. +

+
Learn more about [Custom Component](http://docs.langflow.org/components/custom). @@ -20,154 +60,68 @@ Learn more about [Custom Component](http://docs.langflow.org/components/custom). ### Documents to Records -This component converts documents to records. +Convert LangChain Documents into Records. -**Params** +**Parameters** -- **Documents:** - - **Display Name:** Documents - -**Usage** - -To use this component, provide a list of documents to be converted into records. +- **Documents:** Documents to be converted into Records. --- -### Unique ID Generator +### ID Generator -This component generates a unique ID. +Generates a unique ID. -**Params** +**Parameters** -- **Value:** - - **Display Name:** Value - - **Real Time Refresh:** True - -**Usage** - -To use this component, simply retrieve the generated unique ID from the provided value parameter. +- **Value:** Unique ID generated. --- ### Message History -This component is used to retrieve stored messages from the message history. +Retrieves stored chat messages given a specific Session ID. -**Params** +**Parameters** -- **Sender Type:** - - **Display Name:** Sender Type - - **Options:** Machine, User, Machine and User - -- **Sender Name:** - - **Display Name:** Sender Name - -- **Number of Messages:** - - **Display Name:** Number of Messages - - **Info:** Number of messages to retrieve. - -- **Session ID:** - - **Display Name:** Session ID - - **Info:** Session ID of the chat history. - - **Input Types:** Text - -**Usage** - -To use this component, configure the parameters as needed to retrieve messages from the message history. - ---- - -### Python Function - -**Params** - -- **Code:** - - **Display Name:** Code - - **Info:** The code for the function. - - **Show:** True - -**Usage** - -To use this component, provide the Python code for the function you want to define. +- **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. --- ### Records to Text -This component converts records into a single piece of text using a template. +Convert Records into plain text following a specified template. -**Params** +**Parameters** -- **Records:** - - **Display Name:** Records - - **Info:** The records to convert to text. - -- **Template:** - - **Display Name:** Template - - **Info:** The template to use for formatting the records. It can contain the keys `{text}`, `{data}` or any other key in the Record. - -**Usage** - -To use this component, provide the records you want to convert to text along with a template for formatting. +- **Records:** The records to convert to text. +- **Template:** The template to use for formatting the records. It can contain the keys `{text}`, `{data}` or any other key in the Record. --- -### SearchApi +### Split Text -This component provides access to the real-time search engine results API. +Split text into chunks of a specified length. -**Params** +**Parameters** -- **Engine:** - - **Display Name:** Engine - - **Info:** The search engine to use. - -- **Parameters:** - - **Display Name:** Parameters - - **Info:** The parameters to send with the request. - -- **API Key:** - - **Display Name:** API Key - - **Info:** The API key to use SearchApi. - - **Required:** True - - **Password:** True - -Learn more about [SearchApi Documentation](https://www.searchapi.io/docs/google). - ---- - -### Text to Record - -This component enables the creation of a record from text data. - -**Params** - -- **Data:** - - **Display Name:** Data - - **Info:** The data to convert to a record. - - **Input Types:** Text - -**Usage** - -To use this component, provide the text data to convert into a record. +- **Texts:** Texts to split. +- **Separators:** The characters to split on. Defaults to [" "]. +- **Max Chunk Size:** The maximum length (in number of characters) of each chunk. +- **Chunk Overlap:** The amount of character overlap between chunks. +- **Recursive:** Whether to split recursively. --- ### Update Record -This component updates a record with new data. +Update Record with text-based key/value pairs, similar to updating a Python dictionary. -**Params** +**Parameters** -- **Record:** - - **Display Name:** Record - - **Info:** The record to update. - -- **New Data:** - - **Display Name:** New Data - - **Info:** The new data to update the record with. - - **Input Types:** Text - -**Usage** - -To use this component, provide the record to be updated along with the new data. +- **Record:** The record to update. +- **New Data:** The new data to update the record with. diff --git a/docs/docs/components/inputs.mdx b/docs/docs/components/inputs.mdx index 2e953d986..78ca6f0f6 100644 --- a/docs/docs/components/inputs.mdx +++ b/docs/docs/components/inputs.mdx @@ -22,6 +22,25 @@ This component is designed to get user input from the chat.

+--- + +### Prompt + +Create a prompt template with dynamic variables. + +**Parameters** + +- **Template:** the template for the prompt. + + +

+ Prompt variables can be created with any chosen name inside curly brackets, e.g. `{variable_name}` +

+
+ +--- + + ### Text Input This component is designed for simple text input, allowing users to pass textual data to subsequent components in the workflow. It's particularly useful for scenarios where a brief user input is required to initiate or influence the flow. diff --git a/docs/docs/components/models.mdx b/docs/docs/components/models.mdx index 9d4f67257..8c47c8c7b 100644 --- a/docs/docs/components/models.mdx +++ b/docs/docs/components/models.mdx @@ -8,7 +8,7 @@ import Admonition from '@theme/Admonition';

-### AmazonBedrock +### Amazon Bedrock This component facilitates the generation of text using the LLM (Large Language Model) model from Amazon Bedrock. @@ -53,7 +53,7 @@ This component facilitates the generation of text using the LLM (Large Language --- -### AnthropicLLM +### Anthropic This component allows the generation of text using Anthropic Chat&Completion large language models. @@ -83,7 +83,7 @@ For detailed documentation and integration guides, please refer to the [Anthropi --- -### AzureChatOpenAI +### Azure OpenAI This component allows the generation of text using the LLM (Large Language Model) model from Azure OpenAI. @@ -125,44 +125,6 @@ This component allows the generation of text using the LLM (Large Language Model For detailed documentation and integration guides, please refer to the [Azure OpenAI Component Documentation](https://python.langchain.com/docs/integrations/llms/azure_openai). ---- - -### QianfanChatEndpoint - -This component facilitates the generation of text using Baidu Qianfan chat models. - -**Params** - -- **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. - --- ### Cohere @@ -185,32 +147,6 @@ This component enables text generation using Cohere large language models. --- -### CTransformers - -This component allows the generation of text using CTransformers large language models. - -**Params** - -- **Model:** Specifies the CTransformers model to be used for text generation. - -- **Model File (Optional):** Path to the model file if using a custom model. Should be a _.bin_ file. - -- **Model Type:** Specifies the type of the CTransformers model. - -- **Config (Optional):** Additional configuration parameters for the model. It should be provided as a JSON object. - - Defaults to: - - `{"top_k":40,"top_p":0.95,"temperature":0.8,"repetition_penalty":1.1,"last_n_tokens":64,"seed":-1,"max_new_tokens":256,"stop":"","stream":"False","reset":"True","batch_size":8,"threads":-1,"context_length":-1,"gpu_layers":0}`. - -- **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. - ---- - ### Google Generative AI This component enables text generation using Google Generative AI. @@ -261,151 +197,42 @@ This component facilitates text generation using LLM models from the Hugging Fac --- -### LlamaCpp +### Ollama -The `LlamaCpp` is a component for generating text using the llama.cpp model. +Generate text using Ollama Local LLMs. -**Params** +**Parameters** -- **Model Path:** The path to the llama.cpp model file. This should be provided as a file type input. - -- **Input Value:** The input text for text generation. - -- **Grammar (Optional):** The grammar for text generation. - -- **Cache (Optional):** Specifies whether to cache the generated text. - -- **Client (Optional):** The client to use for text generation. - -- **Echo (Optional):** Specifies whether to echo the generated text. Defaults to _`False`_. - -- **F16 KV:** Specifies whether to use F16 key-value pairs. Defaults to _`True`_. - -- **Grammar Path (Optional):** The path to the grammar file. - -- **Last N Tokens Size (Optional):** The size of the last N tokens. Defaults to _`64`_. - -- **Logits All:** Specifies whether to include logits for all tokens. Defaults to _`False`_. - -- **Logprobs (Optional):** The log probabilities for text generation. - -- **Lora Base (Optional):** The base URL for Lora. - -- **Lora Path (Optional):** The path for Lora. - -- **Max Tokens (Optional):** The maximum number of tokens to generate. Defaults to _`256`_. - -- **Metadata (Optional):** Additional metadata for the model. - -- **Model Kwargs:** Additional keyword arguments for the model. Should be provided as a Python dictionary. - -- **N Batch (Optional):** The batch size. Defaults to _`8`_. - -- **N Ctx:** The context size. Defaults to _`512`_. - -- **N GPU Layers (Optional):** The number of GPU layers. - -- **N Parts:** The number of parts. - -- **N Threads (Optional):** The number of threads. Defaults to _`1`_. - -- **Repeat Penalty (Optional):** The repeat penalty for text generation. Defaults to _`1.1`_. - -- **Rope Freq Base:** The base frequency for rope. - -- **Rope Freq Scale:** The scale frequency for rope. - -- **Seed:** The seed for random generation. - -- **Stop (Optional):** The stop words for text generation. - -- **Streaming:** Specifies whether to stream the response from the model. Defaults to _`True`_. - -- **Suffix (Optional):** The suffix for text generation. - -- **Tags (Optional):** The tags for text generation. - -- **Temperature (Optional):** The temperature for text generation. Defaults to _`0.8`_. - -- **Top K (Optional):** The top K tokens to consider for text generation. Defaults to _`40`_. - -- **Top P (Optional):** The top P probability threshold for text generation. Defaults to _`0.95`_. - -- **Use Mlock:** Specifies whether to use Mlock. Defaults to _`False`_. - -- **Use Mmap (Optional):** Specifies whether to use Mmap. Defaults to _`True`_. - -- **Verbose:** Specifies whether to enable verbose mode. Defaults to _`True`_. - -- **Vocab Only:** Specifies whether to include vocabulary only. - -- **Stream (Optional):** Specifies whether to stream the response from the model. Defaults to _`False`_. - -For more information, please refer to the [documentation](https://python.langchain.com/docs/modules/model_io/models/llms/integrations/llamacpp). +- **Base URL:** Endpoint of the Ollama API. Defaults to '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) --- -### ChatOllama - -This component facilitates text generation using the Local LLM model for chat with Ollama. - -**Params** - -- **Base URL:** The endpoint of the Ollama API. Defaults to 'http://localhost:11434' if not specified. - -- **Model Name:** The name of the model to use. Refer to [https://ollama.ai/library](https://ollama.ai/library) for more models. - -- **Input Value:** The input text for text generation. - -- **Mirostat:** Enable/disable Mirostat sampling for controlling perplexity. - -- **Mirostat Eta (Optional):** The learning rate for the Mirostat algorithm. (Default: 0.1) - -- **Mirostat Tau (Optional):** Controls the balance between coherence and diversity of the output. (Default: 5.0) - -- **Repeat Last N (Optional):** How far back the model looks to prevent repetition. (Default: 64, 0 = disabled, -1 = num_ctx) - -- **Verbose (Optional):** Whether to print out response text. - -- **Cache (Optional):** Enable or disable caching. Defaults to _`False`_. - -- **Context Window Size (Optional):** Size of the context window for generating tokens. (Default: 2048) - -- **Number of GPUs (Optional):** Number of GPUs to use for computation. (Default: 1 on macOS, 0 to disable) - -- **Format (Optional):** Specify the format of the output (e.g., json). - -- **Metadata (Optional):** Metadata to add to the run trace. - -- **Number of Threads (Optional):** Number of threads to use during computation. (Default: detected for optimal performance) - -- **Repeat Penalty (Optional):** Penalty for repetitions in generated text. (Default: 1.1) - -- **Stop Tokens (Optional):** List of tokens to signal the model to stop generating text. - -- **System (Optional):** System to use for generating text. - -- **Tags (Optional):** Tags to add to the run trace. - -- **Temperature (Optional):** Controls the creativity of model responses. Defaults to _`0.8`_. - -- **Template (Optional):** Template to use for generating text. - -- **TFS Z (Optional):** Tail free sampling value. (Default: 1) - -- **Timeout (Optional):** Timeout for the request stream. - -- **Top K (Optional):** Limits token selection to top K. (Default: 40) - -- **Top P (Optional):** Works together with top-k. (Default: 0.9) - -- **Stream (Optional):** Specifies whether to stream the response from the model. Defaults to _`False`_. - -- **System Message (Optional):** System message to pass to the model. - ---- - -### OpenAIModel +### OpenAI This component facilitates text generation using OpenAI's models. @@ -431,14 +258,50 @@ This component facilitates text generation using OpenAI's models. --- -### ChatVertexAI +### Qianfan + +This component facilitates the generation of text using Baidu Qianfan chat models. + +**Params** + +- **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. + +--- + +### Vertex AI The `ChatVertexAI` is a component for generating text using Vertex AI Chat large language models API. **Params** -- **Input Value:** The input text for text generation. - - **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. @@ -453,6 +316,8 @@ The `ChatVertexAI` is a component for generating text using Vertex AI Chat large - **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`_. diff --git a/docs/docs/components/outputs.mdx b/docs/docs/components/outputs.mdx index a23255a58..6fe3f9d2a 100644 --- a/docs/docs/components/outputs.mdx +++ b/docs/docs/components/outputs.mdx @@ -2,7 +2,7 @@ import Admonition from '@theme/Admonition'; # Outputs -## Chat Output +### Chat Output This component is designed to send a message to the chat. @@ -22,7 +22,7 @@ This component is designed to send a message to the chat.

-## Text Output +### Text Output This component is designed to display text data to the user. It's particularly useful for scenarios where you don't want to send the text data to the chat, but still want to display it. diff --git a/docs/sidebars.js b/docs/sidebars.js index a63add1fc..6f8cd3411 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -74,31 +74,36 @@ module.exports = { }, { type: "category", - label: "Component Reference", + label: "Core Components", collapsed: false, items: [ "components/inputs", "components/outputs", "components/data", - "components/prompts", "components/models", "components/helpers", - "components/experimental", + "components/vector-stores", + "components/embeddings", + ], + }, + { + type: "category", + label: "Extended Components", + collapsed: false, + items: [ "components/agents", "components/chains", - "components/custom", - "components/embeddings", - "components/model_specs", "components/loaders", + "components/experimental", + "components/utilities", "components/memories", - "components/prompts", + "components/model_specs", "components/retrievers", "components/text-splitters", "components/toolkits", "components/tools", - "components/utilities", - "components/vector-stores", "components/wrappers", + // "components/prompts", ], }, {