CreateAppAgentTemplate

Updated at:

Creates an application agent template.

Operation description

QPS limit

The QPS limit per user for this API operation is 10. Exceeding this limit triggers throttling, which may affect your services. Call this operation at a reasonable rate.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

rtc:CreateAppAgentTemplate

none

*App

acs:rtc::{#accountId}:app/{#AppId}

None None

Request parameters

Parameter

Type

Required

Description

Example

AppId

string

Yes

The application ID. You can create and query application IDs in the console. Only a single ID is supported.

ac7N****

Name

string

Yes

The name of the template.

Agent template

Type

integer

No

The agent type. Valid values:

  • 1: Voice call (default).

Valid values:

  • 1

1

ChatMode

integer

No

The conversation mode. Valid values:

  • 1: Natural conversation mode (default).

  • 2: Walkie-talkie mode.

Valid values:

  • 1
  • 2

2

InterruptMode

integer

No

The interruption mode. Valid values:

  • 1: Interruption supported (default).

  • 2: Interruption disabled.

Valid values:

  • 1
  • 2

2

Greeting

string

No

The greeting message. The maximum length is 500 characters.

Good morning, my friend!

AsrConfig

object

No

The speech-to-text settings.

Name

string

Yes

The name.

STT

MaxSentenceSilence

integer

No

The threshold for voice activity detection (VAD) sentence segmentation. Unit: milliseconds. Valid values: 200 to 6000. Default value: 500. If VadConfig is configured, we recommend that you set this value to a number greater than VadConfig.InterruptSpeechDuration and less than 1500.

300

WordWeights

array<object>

No

The hotword weights. Each vocabulary can contain up to 500 hotwords, and each hotword can be up to 10 Chinese characters in length. Hotwords must be UTF-8 encoded and cannot contain punctuation marks or special characters. Otherwise, the hotword feature does not take effect.

object

Yes

The hotword weight.

Word

string

Yes

The text of the hotword. Each hotword can be up to 10 Chinese characters or English words in length.

Apple

Lang

string

No

The language code. This parameter is optional. The large language model (LLM) automatically identifies the language. Valid values:

  • zh: Chinese.

  • en: English.

zh

Weight

integer

Yes

The weight of the hotword. Valid values: integers from 1 to 5. Common value: 4. If the effect is not obvious, you can increase the weight. However, a large weight may cause negative effects and lead to inaccurate recognition of other words.

4

VadConfig

object

No

The VAD configuration.

InterruptSpeechDuration

integer

No

The minimum duration of continuous human voice signals to avoid false interruptions. Unit: milliseconds. Valid values: 0 to 3000. Default value: 300.

1000

LlmConfig

object

No

The large language model (LLM) settings.

Name

string

Yes

The name.

llm

Vendor

string

Yes

The vendor. Alibaba Cloud Model Studio and third-party configurations that comply with the OpenAI API specification are supported.

Valid values:

  • aliyun
  • thirdparty
  • dingtalk

thirdparty

Url

string

No

The endpoint URL for connecting to a third-party LLM.

https://llm.example.aliyuns.com

ApiKey

string

Yes

The API key required by the LLM service provider.

ak-1213123123132123131

Temperature

number

No

The sampling temperature. Valid values: [0, 2). Default value: 0.7.

0.9

TopP

number

No

The top-p sampling range. Valid values: (0, 1]. Default value: 0.8.

0.8

MaxToken

integer

No

The maximum number of tokens for the output text. Default value: 8192.

1024

HistoryDepth

integer

No

The number of historical conversation turns provided to the LLM. Maximum value: 100. Default value: 50.

5

Prompt

string

No

The prompt for the LLM. The maximum length is 5000 characters.

You are a senior psychologist

AgentAppId

string

No

The ID of the Model Studio agent.

1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d

TtsConfig

object

No

The text-to-speech settings.

Name

string

Yes

The name.

Tts

Vendor

string

No

The vendor. Alibaba Cloud Model Studio is supported.

Valid values:

  • aliyun
  • customized
  • dingmaas

aliyun

ApiKey

string

Yes

The API key required by the LLM service provider.

ak-1213123123132123131

Voice

string

No

The voice. Default value: longxiaoxia. Valid values:

  • longwan

  • longcheng

  • longhua

  • longxiaochun

  • longxiaoxia

  • longxiaocheng

  • longxiaobai

  • longlaotie

  • longshu

  • longshuo

  • longjing

  • longmiao

  • longyue

  • longyuan

  • longfei

  • longjielidou

  • longtong

  • longxiang

  • loongstella

  • loongbella

longcheng

Volume

integer

No

The volume. Valid values: 0 to 100. Default value: 50.

70

Rate

number

No

The speech rate. Valid values: 0.5 to 2.0. Default value: 1.0.

0.8

Pitch

number

No

The pitch. Valid values: 0.5 to 2.0. Default value: 1.0.

0.8

FilterBrackets

array

No

The filter settings. Valid values:

  • 1: Chinese parentheses ()

  • 2: English parentheses ()

  • 3: Chinese square brackets 【】

  • 4: English square brackets []

  • 5: English curly braces {}

integer

No

The specific field.

Valid values:

  • 1
  • 2
  • 3
  • 4
  • 5

1

AgentSilenceConfig

object

No

The agent silence configuration.

AlertTimeout

integer

No

The timeout period for silence alerts, in seconds. This alert can be triggered multiple times. If the agent remains silent after the timeout period elapses, the alert is triggered again upon the next timeout. Valid values: 5 to 600. Default value: 0. A value of 0 indicates that no alert is triggered.

30

WebhookTriggerTimeout

integer

No

The silence timeout period for triggering the agent silence timeout webhook, in seconds. This webhook can be triggered multiple times. If the agent remains silent after the webhook timeout period elapses, the webhook is triggered again upon the next timeout. Valid values: 10 to 600. Default value: 0. A value of 0 indicates that the webhook is not triggered.

30

Strategy

integer

No

The handling strategy for silence timeout. Valid values:

  • 1: Broadcast the prompt message specified by Content to the user via voice.

  • 2: Send the prompt message specified by Content and the conversation history to the LLM, and broadcast the model-generated response. Default value: 1.

2

Content

string

No

The content of the silence prompt message.

Hello, please try again later

AmbientSoundConfig

object

No

The ambient environment configuration for the agent. If this parameter is not passed, the ambient environment configuration is not used.

SoundId

string

No

The default ambient sounds provided by the agent. Valid values:

  • white_noise

  • office

white_noise

Volume

integer

No

The volume level.

100

InterruptConfig

object

No

The interruption configuration for the agent.

SemanticsInterrupt

boolean

No

Specifies whether to interrupt based on semantics.

BackChannelConfig

object

No

The backchannel configuration for the agent.

UserTurnEnd

boolean

No

Specifies whether to enable backchannel words.

EnableVideoUnderstanding

boolean

No

Specifies whether to enable video understanding. If enabled, the LLM must support multimodal data.

PreferVideo

integer

No

The preferred video stream for the agent to process after visual understanding is enabled. The agent can process only one video stream. When both the camera stream and the screen sharing stream are pushed, valid values are:

  • 1: The agent preferentially processes the camera stream.

  • 2: The agent preferentially processes the screen sharing stream. Default value: 1.

1

Response elements

Element

Type

Description

Example

object

Schema of Response

RequestId

string

The request ID.

6159ba01-6687-4fb2-a831-f0cd8d188648

Id

string

The template ID.

1223131213231313213

Examples

Success response

JSON format

{
  "RequestId": "6159ba01-6687-4fb2-a831-f0cd8d188648",
  "Id": "1223131213231313213"
}

Error codes

HTTP status code

Error code

Error message

Description

400 ParameterError %s.
404 NotFound %s. The requested resource does not exist

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.