Natural Language Generation

更新时间:
复制 MD 格式

Configure the Natural Language Generation component to use LLMs for multi-turn conversations, knowledge retrieval, and content generation.

Component information

Important

LLM-generated content may be inaccurate. Verify all output before use.

Component icon

Component name

image

Natural Language Generation

Prerequisites

To configure this component, access the flow canvas by using an existing flow or creating a new one.

  • Go to the canvas of an existing flow

    In the Chat Flow > Flow Management > Flow Name

  • Create a new flow to open its canvas. For more information, see Create a flow.

Procedure

  1. On the canvas, click the Natural Language Generation component icon to open its configuration panel.

    In the Model settings area, set the implementation type to Model and the protocol to OpenAI. Enter the baseUrl, apiKey, and model name, then click Save at the top.

  2. Configure the component as needed. Each setting is described in Parameters.

  3. After you finish the configuration, click Save. In the dialog box that appears, click Save.

Parameters

1. Model settings

Click Implementation Type and select either Model or Application. Parameters vary by selection.

Model

Parameter

Description

Protocol

Only OpenAI is supported when the implementation type is Model.

baseUrl

The model service endpoint, such as https://api.openai.com/v1 or any OpenAI-compatible URL.

apiKey

The API key for the model service.

Model Name

The name of the model to use, such as gpt-3.5-turbo or qwen-plus.

Initial Prompt

Sets the context for the model session and guides output. Example: "You are a witty comedian. Use humorous language in your responses."

Model Input

Input for the current conversation turn. Reference variables directly or embed them in text, such as {{incomingMessage}} or Please find information about {{topic}}.

Model Output Variable Name

Variable name for the model output. Use in subsequent steps or as a reply.

Fallback Text

Output when the model service is unavailable. Example: "Sorry, I am unable to answer your question at the moment."

Application

Parameter

Description

Protocol

Only Dashscope is supported when the implementation type is Application.

Note

Learn how to build applications in Application development.

apiKey

The API key for the application service.

workspaceId

The workspace ID containing the application (agent or workflow). Required for sub-workspaces; optional for the default workspace.

appId

The application ID.

Application Input

Input for the current conversation turn. Reference variables directly or embed them in text, such as {{incomingMessage}} or Please find information about {{topic}}.

Custom Pass-through Parameters

Custom parameters passed to the application, such as {"city": "Hangzhou"}.

Application Output Variable Name

Variable name for the application output. Use in subsequent steps or as a reply.

Fallback Text

Output when the application service is unavailable. Example: "Sorry, I am unable to answer your question at the moment."

2. Request header

Note

Request header configuration is Implementation Type when the Application is set to Application.

Parameter

Description

request header configuration

HTTP request headers with the following fields:

  • key

  • value

3. Multi-message processing

Parameter

Description

processing method

Determines how new messages are handled while the LLM processes the current one.

  • Ignore subsequent messages: Drops new messages received during processing.

  • Interrupt current message: Stops current processing and handles the latest message.