Use the global acceleration service
Use the global acceleration domain name to connect to the Multimodal Interaction Developer Suite, reduce network latency and model API call failures, and improve user experience.
For billing details, see Billing.
Connect by using APIs
Replace the default Model Studio domain name dashscope.aliyuncs.com with multimodal-dialog-esa.aliyuncs.com. Use the following endpoints:
- WebSocket:
wss://multimodal-dialog-esa.aliyuncs.com/api-ws/v1/inference - HTTP:
https://multimodal-dialog-esa.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation
Connect by using SDKs
Java SDK
Constants.baseWebsocketApiUrl = "wss://multimodal-dialog-esa.aliyuncs.com/api-ws/v1/inference";
Python SDK
To change the endpoint globally, configure the following endpoint before you initialize the SDK:
dashscope.base_websocket_api_url = "wss://multimodal-dialog-esa.aliyuncs.com/api-ws/v1/inference"
To change the endpoint only for the current call, specify url when you create the MultiModalDialog object:
conversation = MultiModalDialog(
app_id=your_app_id,
workspace_id=your_workspace_id,
url="wss://multimodal-dialog-esa.aliyuncs.com/api-ws/v1/inference",
request_params=request_params,
multimodal_callback=self.callback,
model=self.model,
)
Android SDK
When you create the MultiModalDialog object, pass the global acceleration endpoint to the url parameter:
multiModalDialog = new MultiModalDialog(
this,
"wss://multimodal-dialog-esa.aliyuncs.com/api-ws/v1/inference",
authParams.getChainMode(),
authParams.getWorkspaceId(),
authParams.getAppid(),
authParams.getDialogMode()
);
iOS SDK
When you create the MultiModalDialog object, pass the global acceleration endpoint to the url parameter:
self.conversation = MultiModalDialog(
url: "wss://multimodal-dialog-esa.aliyuncs.com/api-ws/v1/inference",
chainMode: self.chain,
workSpaceId: self.WORKSPACE_ID,
appId: self.APP_ID,
mode: mode
)
RTOS SDK
Upgrade the RTOS SDK to version 1.1.0 or later. Then, call the following functions to obtain the parameters that are required to establish a connection:
#include "c_mmi.h"
char *wss_host = c_mmi_get_wss_host_global();
char *wss_port = c_mmi_get_wss_port();
char *wss_api = c_mmi_get_wss_api();
char *wss_header = c_mmi_get_wss_header();
// Establish a WebSocket connection. You must implement the dummy_wss_connect function.
WSS_HANDLE *wss = dummy_wss_connect(wss_host, wss_port, wss_api, wss_header);