Help Center/ Huawei Cloud Astro Zero/ Best Practices/ Intelligence/ Calling the Foundation Model Connector to Talk with the AI Assistant
Updated on 2025-08-27 GMT+08:00

Calling the Foundation Model Connector to Talk with the AI Assistant

Application Scenarios

When you build a standard page, you can connect to an external foundation model API via the AI assistant widget. First, set up the foundation model connection details in the connector, then choose that connector in the AI assistant widget.

This practice shows you how to configure the connector and use it in the widget for smart chat functionality.

Prerequisites

You have obtained or set up foundation model resources. This practice takes connecting to a self-built foundation model as an example.

Procedure

Figure 1 shows how to set up a foundation model connector and use it with the AI assistant widget to talk with the AI assistant.

Figure 1 Calling a foundation model connector to chat with the AI assistant

Step 1: Create a Foundation Model Connector to Connect to an External Foundation Model

Create a foundation model connector to connect to an external foundation model API.

  1. Create a low-code application.

    1. Apply for a free trial or purchase a commercial instance by referring to Authorization of Users for Huawei Cloud Astro Zero Usage and Instance Purchases.
    2. After you have an instance, click Access Homepage on Homepage. The application development page is displayed.
    3. In the navigation pane, choose Applications. On the displayed page, click Low-Code or .

      When you create an application for the first time, create a namespace as prompted. Once it is created, you cannot change or delete it, so check the details carefully. Use your company or team's abbreviation for the namespace. Enter up to 15 characters. Use only letters, digits, and underscores (_). Start with a letter and end with a letter or digit. Do not enter consecutive underscores.

    4. In the displayed dialog box, choose Standard Applications and click the confirm button.
    5. Enter a label and name of the application, and click the confirm button. The application designer is displayed.
      Figure 2 Creating a blank application
      Table 1 Parameters for creating a blank application

      Parameter

      Description

      Example

      Label

      The label for the new application; Max. 80 characters.

      AI assistant dialog page

      Name

      Name of the new application. After you enter the label value and click the text box of this parameter, the system automatically generates an application name and adds Namespace__ before the name. Naming rules:

      • Max. characters: 31, including the prefix namespace.

        To prevent duplicate data names among different tenants, each tenant must define a unique namespace when first creating an application. A tenant can only create one namespace, and once it is created, it cannot be modified.

      • Start with a letter and can contain only letters, digits, and underscores (_). It cannot end with an underscore (_).

      ChatApp

  2. Create a foundation model connector.

    1. In the application designer, choose Integrations > Connector > Connector Instance.
    2. Choose Foundation Model > Custom Model and click +. The page for creating a custom foundation model connector is displayed.
      Figure 3 Creating a custom foundation model connector
    3. Enter and save the configuration information of the foundation model connector.
      Figure 4 Setting foundation model connector information
      Table 2 Parameters for configuring the custom foundation model connector

      Parameter

      Description

      Example

      Label

      Custom foundation model connector label, which can be modified after being created.

      Value: 1–64 characters.

      DeepSeek-V3

      Name

      Custom connector name, which uniquely identifies the connector in the system and cannot be changed after the connector is created. Naming rules:

      • Max. 64 characters, including the prefix namespace.

        To prevent duplicate data names among different tenants, each tenant must define a unique namespace when first creating an application. A tenant can only create one namespace, and once it is created, it cannot be modified.

      • Start with a letter and can contain only letters, digits, and underscores (_). It cannot end with an underscore (_).

      SelfHostDeepSeek

      Model Name

      Model ID of the specific foundation model. When the connector is called, this field is passed to the model field in the foundation model API.

      DeepSeek-V3-0324-w8a8

      URL

      URL for accessing the foundation model API, provided by the model provider.

      https://*****

  3. Test the connectivity of the foundation model connector.

    1. On the custom foundation model details page, click Test. On the displayed dialog box, click Test. The foundation model connector test page is displayed.
    2. In the Input Content text box, enter the dialog content (for example, "Hello"), and click Test. Check whether the returned message is correct.
      If the returned message contains the streaming response packet, the foundation model connector is configured successfully. Otherwise, check whether the foundation model connector information is correct.
      Figure 5 Foundation model connector test page

Step 2: Create an AI Assistant Page and Add the Foundation Model Connector to the Page

In the AI assistant template application, create a standard page for assembling the dialog page of the AI assistant template.

  1. In the navigation pane, choose Page.
  2. Click next to the page, set the basic information about the standard page, and click Create.

    Figure 6 Creating a standard page
    Table 3 Parameters for creating a standard page

    Parameter

    Description

    Example

    Label

    Label of the standard page, which is displayed on the page and can be modified after being created.

    Value: 1–64 characters.

    AI assistant dialog page

    Name

    Name of the standard page. The name is the unique identifier of the standard page in the system and cannot be changed after being created. Naming rules:

    • Max. 64 characters, including the prefix namespace.

      To prevent duplicate data names among different tenants, each tenant must define a unique namespace when first creating an application. A tenant can only create one namespace, and once it is created, it cannot be modified.

    • Start with a letter and can contain only letters, digits, and underscores (_). It cannot end with an underscore (_).

    chatPage

  3. Drag the AI Assistant widget from Basic > Smart to the canvas.

    Figure 7 Dragging the AI Assistant widget to the page

  4. Click the AI assistant widget, choose Properties > Advanced Properties, and enable Show Model.
  5. Click Set Default Model next to Default Model and select the model connector created in Step 1: Create a Foundation Model Connector to Connect to an External Foundation Model.

    Figure 8 Advanced settings of the AI assistant widget

  6. Click in the upper part of the page to save the standard page.

Step 3: Verify the Chat Function of the AI Assistant

Preview the AI assistant page in the AI assistant template application and verify the chat function of the AI assistant.

  1. On the saved standard page, click . The preview page is displayed.

    Figure 9 Preview page of the AI assistant

  2. In the AI assistant chat box, type something like "How is the weather today?" and click Send.

    If the AI assistant returns the corresponding streaming result, the AI assistant widget is successfully connected to the external foundation model API.