Skip to main content

direct invocation of Model Studio and third-party agents

This document describes how to directly route user requests to applications you create on the Model Studio platform—including agents, workflows, and agent orchestration—along with to third-party agents integrated via the A2A protocol.

Configure Direct Agent Invocation

In the Understanding and Generation configuration panel, enable the Intent Recognition switch, disable the Text Model switch, and enable the Direct Agent switch. After enabling Direct Agent, user requests are directly routed to applications created on the Model Studio platform (including agents, workflows, and agent orchestration) and third-party agents (integrated via the A2A protocol).
  1. This feature currently supports only multimodal applications. Voice applications are not yet supported.
  2. After you disable the Text Model, the system sends only intent recognition results. Welcome messages, prompts, conversational continuations, knowledge bases, and long-term memory are temporarily unavailable. Re-enable the Text Model to restore these features.

Integrate Model Studio agents and third-party agents using the console

You can use this method in multimodal applications. The suite provides two ways to integrate your business agents.
  1. Model Studio agents: For creation and configuration instructions, see Integrate Model Studio Applications.
  2. Third-party agents: After you complete A2A service deployment, integrate them in the console. See AgentCard.
In the Agent configuration panel, click the + button in the upper-right corner of the Model Studio Applications area to add a Model Studio platform application, and click the + button in the upper-right corner of the Third-party Applications area to add an A2A application.

Pass Parameters During Connection Setup

When establishing a connection with a service, configure agent_command to create a service connection pipeline for A2A or Model Studio agents. All text and recognition requests for this session pass directly to the agent for processing. Key parameter: parameters.bizParams.commands[]

bizParams

Parameter

First-level parameter

Type

Description

commands[]

name

String

Fixed value: "agent_command"

exec_params

Object

app_id

String

The `agentId` from the application list in the console.

intent

String

Fixed value: "open_" + `agentId`

user_defined_params

Object

Parameters configured for the agent.

agentId

Object

An object with `agentId` as the key. Parameters within this object pass to the agent.

parameters.bizParams.commands[]
[{
  "name":"agent_command",
  "exec_params":{
    "app_id": "xxxxx",
    "intent": "open_xxxxx"
  }
}]
Example: Set parameters using the Android SDK
private MultiModalRequestParam buildRequestParams() {

    JSONArray commands = new JSONArray();
    try {
        JSONObject command = new JSONObject();
        command.put("name", "agent_command");

        JSONObject execParams = new JSONObject();
        execParams.put("app_id", "tpa_2009506107285893120");
        execParams.put("intent", "open_tpa_2009506107285893120");
        command.put("exec_params", execParams);
        commands.put(command);

    } catch (JSONException e) {
        throw new RuntimeException(e);
    }

    return MultiModalRequestParam.builder()
    .clientInfo(MultiModalRequestParam.ClientInfo.builder()
                .device(MultiModalRequestParam.ClientInfo.Device.builder()
                        .uuid("uuid_12345").build()) // Configure your device UUID.
                .userId("your_user_id")  // The userId must be unique for each user. We recommend using the device UUID. Conversation history associates with the userId.
                .build())
    .upStream(MultiModalRequestParam.UpStream.builder()
              .type("AudioAndVideo")
              .build())
    .downStream(MultiModalRequestParam.DownStream.builder()
                .voice("longanhuan") // The TTS voice model must match the model configured in the console. longxiaochun_v2 corresponds to cosyvoice_v2.
                .sampleRate(48000)
                .intermediateText("transcript")
                .build())
    .bizParams(MultiModalRequestParam.BizParams.builder()
               .userCustomParams(Collections.singletonMap("commands", commands))
               .build())
    .build();
}

Update Parameters Using UpdateInfo

To pass parameters to your agent during a conversation, use this method. The pass-through parameters are included in the next request to the agent service. Parameters set this way are included with every agent request. You can update parameters with the same name using UpdateInfo.

parameters.bizParams

Parameter

First-level parameter

Type

Description

user_defined_params

Object

Parameters configured for the agent.

agentId

Object

An object with `agentId` as the key. Parameters within this object pass to the agent.

user_prompt_params

Object

When using a Model Studio agent application, use this structure to pass parameters defined in the agent prompt.

parameters.bizParams.user_defined_params

"user_defined_params":{
    "xxxxx":{
        "user_prompt_params":{
            "age": 8,
            "text": "Today is January 9, 2025"
        }
    }
}
Example: Set parameters using the Android SDK
private void updateParams(){
        try {
            JSONObject userAgentPromptParams = new JSONObject();
            userAgentPromptParams.put("age", 8);
            userAgentPromptParams.put("text","Today is January 9, 2025");
            JSONObject agentIdParams = new JSONObject();
            agentIdParams.put("user_prompt_params", userAgentPromptParams);

            JSONObject userDefinedParams = new JSONObject();
            userDefinedParams.put("tpa_2009506107285893120", agentIdParams); // The key is app_id.

            MultiModalRequestParam updateParams = MultiModalRequestParam
                    .builder()
                    .bizParams(MultiModalRequestParam.BizParams.builder()
                            .userDefinedParams(userDefinedParams)
                            .build())
                    .build();

            Log.i(TAG, "bizParams: " + updateParams.getParametersAsJson());
            multiModalDialog.updateInfo(updateParams.getParametersAsJson());
        } catch (JSONException e) {
            throw new RuntimeException(e);
        }
    }

Pass Images Using UpdateInfo

If your agent supports image modality interaction, you can pass images to the agent as links or Base64-encoded data. Key parameter: parameters.images[]

images[]

Parameter

Type

Description

type

String

Image type. Supports "url" or "base64".

value

String

Image link or Base64-encoded data. Note that the original image size should not exceed 180 KB when submitting Base64 data.

{
  "images": [{
    "type": "base64",
    "value": "\/9j\/4QDKRXhpZgAATU0AKgAAAAgABgESAAMAAAABAAEAAAEaAAUAAAABAAAAVgEbAAUAAAABAAAAXgEoAAMAAAABAAIAAAITAAMAAAABAAEAAIdpAAQAAAABAAAAZgAAAAAAAABIAAAAAQAAAEgBbEWenR5HJ\/lXXa62IW244FaR0RhN3ZwVp4fkljIRuleZeOtFu4oWAPavdtElAgbPYV5V46uh09KiT90qC1R80y2d---"
  }]
}
Example: Set parameters using the Android SDK
MultiModalRequestParam updateParams = null;
try {
    updateParams = MultiModalRequestParam
    .builder()
    .images(MultimodalDialogActivity.this.getImageList())
    .build();
} catch (JSONException e) {
    e.printStackTrace();
}

multimodalDialog.updateInfo(updateParams);
Agent Development
Agent Context
Agent Governance & Evolution
Store
Application Marketplace