NebulaAIFlow模型组件
模型组件使用大型语言模型生成文本。
有关参数的更多信息,请参阅具体组件的文档。
在流程中使用模型组件
模型组件接收输入和提示来生成文本,生成的文本会发送到输出组件。
模型输出也可以发送到语言模型端口,然后传递给解析数据组件,在那里输出可以被解析成结构化的数据对象。
这个示例在聊天机器人流程中使用了OpenAI模型。更多信息,请参阅基础提示流程。
AI/ML API
此组件使用AIML API创建ChatOpenAI模型实例。
更多信息,请参阅AIML文档。
输入参数
名称 | 类型 | 说明 |
---|---|---|
max_tokens | 整数 | 要生成的最大令牌数。设置为0表示无限制令牌。范围:0-128000。 |
model_kwargs | 字典 | 模型的其他关键字参数。 |
model_name | 字符串 | 要使用的AIML模型名称。选项在AIML_CHAT_MODELS 中预定义。 |
aiml_api_base | 字符串 | AIML API的基础URL。默认为https://api.aimlapi.com 。 |
api_key | 密钥字符串 | 用于模型的AIML API密钥。 |
temperature | 浮点数 | 控制输出的随机性。默认值:0.1 。 |
seed | 整数 | 控制任务的可重复性。 |
输出参数
名称 | 类型 | 说明 |
---|---|---|
model | 语言模型 | 使用指定参数配置的ChatOpenAI实例。 |
Amazon Bedrock
此组件使用Amazon Bedrock LLMs生成文本。
更多信息,请参阅Amazon Bedrock文档。
输入参数
名称 | 类型 | 说明 |
---|---|---|
model_id | 字符串 | 要使用的Amazon Bedrock模型ID。选项包括各种模型。 |
aws_access_key | 密钥字符串 | 用于身份验证的AWS访问密钥。 |
aws_secret_key | 密钥字符串 | 用于身份验证的AWS密钥。 |
credentials_profile_name | 字符串 | 要使用的AWS凭证配置文件名称(高级)。 |
region_name | 字符串 | AWS区域名称。默认值:us-east-1 。 |
model_kwargs | 字典 | 模型的其他关键字参数(高级)。 |
endpoint_url | 字符串 | Bedrock服务的自定义端点URL(高级)。 |
输出参数
名称 | 类型 | 说明 |
---|---|---|
model | 语言模型 | 使用指定参数配置的ChatBedrock实例。 |
Anthropic
此组件允许使用Anthropic聊天和语言模型生成文本。
更多信息,请参阅Anthropic文档。
输入参数
名称 | 类型 | 说明 |
---|---|---|
max_tokens | 整数 | 要生成的最大令牌数。设置为0表示无限制令牌。默认值:4096 。 |
model | 字符串 | 要使用的Anthropic模型名称。选项包括各种Claude 3模型。 |
anthropic_api_key | 密钥字符串 | 用于身份验证的Anthropic API密钥。 |
temperature | 浮点数 | 控制输出的随机性。默认值:0.1 。 |
anthropic_api_url | 字符串 | Anthropic API的端点。如果未指定,默认为https://api.anthropic.com (高级)。 |
prefill | 字符串 | 预填充文本以引导模型的响应(高级)。 |
输出参数
名称 | 类型 | 说明 |
---|---|---|
model | 语言模型 | 使用指定参数配置的ChatAnthropic实例。 |
Azure OpenAI
This component generates text using Azure OpenAI LLM.
For more information, see the Azure OpenAI documentation.
输入参数
名称 | 类型 | 说明 |
---|---|---|
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 . |
输出参数
名称 | 类型 | 说明 |
---|---|---|
model | LanguageModel | An instance of AzureOpenAI configured with the specified parameters. |
Cohere
This component generates text using Cohere's language models.
For more information, see the Cohere documentation.
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. |
输出参数
名称 | 类型 | 说明 |
---|---|---|
model | LanguageModel | An instance of the Cohere model configured with the specified parameters. |
DeepSeek
This component generates text using DeepSeek's language models.
For more information, see the DeepSeek documentation.
Inputs
Name | Type | Description |
---|---|---|
max_tokens | Integer | Maximum number of tokens to generate. Set to 0 for unlimited. Range: 0-128000 . |
model_kwargs | Dictionary | Additional keyword arguments for the model. |
json_mode | Boolean | If True , outputs JSON regardless of passing a schema. |
model_name | String | The DeepSeek model to use. Default: deepseek-chat . |
api_base | String | Base URL for API requests. Default: https://api.deepseek.com . |
api_key | SecretString | Your DeepSeek API key for authentication. |
temperature | Float | Controls randomness in responses. Range: [0.0, 2.0] . Default: 1.0 . |
seed | Integer | Number initialized for random number generation. Use the same seed integer for more reproducible results, and use a different seed number for more random results. |
输出参数
名称 | 类型 | 说明 |
---|---|---|
model | 语言模型 | 使用指定参数配置的ChatOpenAI实例。 |