Creates an AI agent. This operation returns the channel in which the AI agent resides, the username of the AI agent in the channel, and the token that you can use to join the channel.
Operation description
Request description
You can call this operation to create an AI agent based on the provided ID. You can join the channel based on the returned information and talk to the agent.
Note: Make sure that the provided AI agent ID is valid and configure optional parameters based on your business requirements.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- For mandatory resource types, indicate with a prefix of * .
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
ice:GenerateAIAgentCall | none | *All Resources * |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
AIAgentId | string | Yes | The ID of the AI agent. | 39f8e0bc005e4f309379701645f4**** |
Expire | long | No | The time when the token expires. Unit: seconds. Default value: 3600. Valid values: 0 to 604800. | 3600 |
UserId | string | No | The username of the AI agent in the channel. If you do not specify this parameter, the system automatically generates a username. The value can be up to 64 characters in length. | 877ae632caae49b1afc81c2e8194ffb4 |
TemplateConfig | AIAgentTemplateConfig | No | The template configurations of the AI agent. The specified configurations are merged with the template configurations that are specified in the console. If you do not specify this parameter, the system uses the default configurations for an AI agent created in the console. |
Response parameters
Examples
Sample success responses
JSON
format
{
"AIAgentUserId": "877ae632caae49b1afc81c2e8194ffb4",
"ChannelId": "70f22d5784194938a7e387052f2b3208",
"InstanceId": "39f8e0bc005e4f309379701645f4****",
"RequestId": "7B117AF5-2A16-412C-B127-FA6175ED1AD0",
"Token": "eyJhcHBpZCI6ICIxMjM0MTIzNxxxxx",
"UserId": "user123"
}
Error codes
For a list of error codes, visit the Service error codes.