Updated on 2025-08-26 GMT+08:00

Adding a Foundation Model Diagram Element for a Flow

Function of the Foundation Model Diagram Element

The foundation model diagram element is used to connect to an external foundation model. For example, you can call a custom foundation model diagram element to connect to a custom foundation model.

Prerequisites

  • You have obtained the API address and key needed to access the external foundation model.
  • The external foundation model's request and response formats must adhere to the OpenAI standard; otherwise, errors might arise during streaming calls and response rendering.
  • You have created a foundation model connector by referring to Using a Connector to Call a Foundation Model.

Using the Foundation Model Diagram Element

  1. In Connector > Foundation Model, drag the custom foundation model diagram element to the canvas.
  2. Click the custom foundation model diagram element and click to set basic information.

    Table 1 Parameters

    Parameter

    Description

    Label

    Label of the diagram element, which is displayed on the flow design page. The system automatically assigns a value in a specific customsequence number format, with the sequence number starting at 0 for each type of diagram element.

    Name

    Diagram element name, which must be unique in the current flow. The naming requirements are as follows:

    • Value: 1–80 characters.
    • Start with a letter and can contain letters, digits, and underscores (_). It cannot end with an underscore (_).

    Description

    Description of the diagram element.

    Value: 1–255 characters.

    Connector

    Select a connector from the drop-down list.

  3. Click and set the parameters of the custom foundation model connector.

    Figure 1 Configuring the custom foundation model connector diagram element
    Table 2 Parameters for configuring the custom foundation model connector

    Parameter

    Description

    Input Parameters

    Input parameters for calling the foundation model connector. Click Add Row to add a record.

    • When Target is set to message, configure the dialog array variable transferred to the foundation model in Source. For example, inputMessage can be transferred.
      [
      	{
      		"role": "user",
      		"content": "Who are you?"
      	}
      ]
    • When Target is set to config, configure the parameter dictionary transferred to the foundation model in Source. For example, inputConfig can be transferred.
      {
      	"temperature": 0.8,
      	"top_p": 1.0,
      	"presence_penalty": 0.0
      }