Integrate Model Studio models

更新时间:
复制 MD 格式

The Mobi platform lets you integrate with Alibaba Cloud Model Studio models. You can connect to these models and exchange data with simple configuration steps. This document explains how to create and use a Model Studio model integration.

Features

The database integration feature of the Mobi Platform provides the following capabilities:

  • Streaming support: You can enable Server-Sent Events (SSE) in the configuration panel to support streaming data transmission.

  • Custom trigger methods: You can set integration operations to trigger manually or run automatically to meet different business needs.

  • Callbacks and data transformation: You can execute specific integration events when a query succeeds or fails. You can also perform custom processing on the returned data.

  • Advanced settings: You can use advanced configurations, such as debouncing and execution prevention conditions, to optimize the performance of integration operations.

For more information about events, see Integration operation events.

Use a Model Studio model integration

1. Create a Model Studio model integration

  1. Log on to the Mobi platform and go to the console.

  2. Navigate to Resources > Integration and click Create Integration.

  3. Select Model Studio Large Language Model, and then enter a name and description for the integration.

  4. Configure the connection information for the Model Studio model in different environments. This includes the API-KEY and workspace.

  5. Click the OK button to create a Bailian model ensemble.

2. Create an integration operation within an application

  1. Open the Code panel, click the + icon for the relevant scope, and select Integration Operation.

  2. Select the Model Studio Large Language Model integration that you created as the resource. Select an appropriate operation model and enter the user input. Then, you can select a trigger method and configure other settings for the integration operation as needed.

  1. Click Run to preview the query result.

Note

For more information about the parameters for Model Studio models, see Qwen large language model.

Configuration panel details

General configurations

You must configure different parameters for different operation types. The operation types are as follows:

  • Invoke Qwen large language model: Quickly invoke the Qwen large language model with a few parameters and a simple configuration. The parameters are as follows:

    • Model: The Qwen large language model. Options include qwen-max, qwen-max-0403, qwen-max-0107, qwen-max-1201, qwen-turbo, and qwen-plus.

    • User input: The user's question as an input string.

    • Prompt: The prompt for the large language model.

    • Chat input: An array of messages that form the conversation history. A message object includes a role and content. For example: image

    • temperature: The sampling temperature, which controls the diversity of the text generated by the model.

    • enableSearch: Specifies whether the model uses web search results as a reference when generating text.

    • sse: Specifies whether to enable streaming responses.

  • Invoke Qwen large language model (Advanced): Customize the invocation of the Qwen large language model with detailed parameters and complex configurations. The parameters are as follows:

    • Model: The Qwen large language model. Options include qwen-max, qwen-max-0403, qwen-max-0107, qwen-max-1201, qwen-turbo, and qwen-plus.

    • Chat context: An array of message objects. A message object includes a role and content.

    • sse: Specifies whether to enable streaming responses.

    • parameters: Additional configuration parameters. For more information about the parameters and their meanings, see Qwen.

  • Invoke open source Qwen large language model: Quickly invoke the open source Qwen large language model with a few parameters and a simple configuration. The parameters are as follows:

    • Model: The open source Qwen large language model. Options include qwen1.5-72b-chat, qwen1.5-14b-chat, qwen1.5-7b-chat, qwen-72b-chat, qwen-14b-chat, and qwen-7b-chat.

    • User input: The user's question as an input string.

    • Prompt: The prompt for the large language model.

    • Chat input: An array of messages that form the conversation history. A message object includes a role and content.

    • temperature: The sampling temperature, which controls the diversity of the text generated by the model.

    • enableSearch: Specifies whether the model uses web search results as a reference when generating text.

    • sse: Specifies whether to enable streaming responses.

  • Invoke open source Qwen large language model (Advanced): Customize the invocation of the open source Qwen large language model with detailed parameters and complex configurations. The parameters are as follows:

    • Model: The open source Qwen large language model. Options include qwen1.5-72b-chat, qwen1.5-14b-chat, qwen1.5-7b-chat, qwen-72b-chat, qwen-14b-chat, and qwen-7b-chat.

    • Chat context: An array of message objects. A message object includes a role and content.

    • sse: Specifies whether to enable streaming responses.

    • parameters: Additional configuration parameters. For more information about the parameters and their meanings, see Qwen.

  • Invoke DeepSeek series models: Quickly invoke a Model Studio DeepSeek model with a few parameters and a simple configuration. The parameters are as follows:

    • Model: The Model Studio DeepSeek series models. Options include deepseek-r1, deepseek-r1-distill-qwen-1.5b, deepseek-r1-distill-qwen-7b, deepseek-r1-distill-qwen-14b, deepseek-r1-distill-qwen-32b, deepseek-r1-distill-llama-8b, and deepseek-r1-distill-llama-70b.

    • User input: The user's question as an input string.

    • Prompt: The prompt for the large language model.

    • Chat input: An array of messages that form the conversation history. A message object includes a role and content.

    • sse: Specifies whether to enable streaming responses.

      Note

      When you call a DeepSeek series model, the response first returns the thinking process enclosed in <think></think> tags. The content after the </think> tag is the large language model's reply. If you use a chat component to render the content, enable the Enable Mobi Enhanced Rendering option to render the corresponding HTML content.

Callback configuration

  • Data transformation: Processes the data returned by the API. The default value is return data, which means that no processing is performed.

  • Success callback: Configures the event to trigger when the API call is successful.

  • Failure callback: Configures the event to trigger when the API call fails.

Advanced configuration

  • Debounce: You can set a debounce expression to prevent frequent API calls.

  • Execution prevention condition: You can determine whether to execute this integration operation based on a conditional expression.

Trigger an integration manually

Event trigger

  1. In the component where you want to trigger the integration operation, you can configure an event handler.

  2. Set the action type to Integration Operation and select the appropriate integration.

  3. Enter the configured parameters as an object.

API trigger

If the name of the integration operation is action1, you can use the action1.trigger() method to trigger the operation anywhere a script can be executed. If the integration operation has configured parameters, you must provide them as an object.