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,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.