UpdateAgent
Modifies an agent.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
sca:UpdateAgent |
none |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| BaseMeAgentId |
integer |
No |
The workspace ID. |
12345 |
| JsonStr |
string |
No |
The complete JSON string. For more information, see the following details. |
xxx |
Request parameter description.
1. Overview
The request parameter object for agent management. It consists of two main parts: the basic attribute configuration of the agent and the instruction type parameters.
2. Top-level fields
| Field | Type | Required | Description |
id | Long | Yes | The agent ID. |
agentName | String | Yes | The agent name. |
agentDescription | String | No | The agent description. |
modelType | String | Yes | The large language model (LLM) type. For valid values, see the LLMCodeEnum enumeration. |
inputType | String | Yes | The analysis object type. Valid values: text (text), voice (voice), and image (image). |
instructionType | String | Yes | The instruction type code. For valid values, see the AgentInstructionTypeEnum enumeration in the following table. |
instructionTypeParam | InstructionTypeParam | Yes | The detailed configuration parameters for the instruction type. Pass the corresponding sub-object based on the value of instructionType. |
Valid values for instructionType
| Code | Description | Corresponding parameter |
serviceInspection | Service quality inspection | serviceInspectionParam |
field | Key attribute extraction | fieldsParam |
tagCategory | Tag classification | tagCategoryParam |
multiLevelTag | Multi-level tag recognition | tagTreeLevelParam |
customPrompt | Custom instruction | customPromptParam |
3. InstructionTypeParam (instruction type parameters)
instructionTypeParam is the configuration container for various instruction types. Based on the value of instructionType, you only need to pass the corresponding sub-object. Other sub-objects can be null.
| Field | Type | Description |
fieldsParam | FieldsParam | The key attribute extraction configuration. Pass this parameter when instructionType is set to field. |
serviceInspectionParam | ServiceInspectionParam | The service quality inspection configuration. Pass this parameter when instructionType is set to serviceInspection. |
tagCategoryParam | TagCategoryParam | The tag classification configuration. Pass this parameter when instructionType is set to tagCategory. |
tagTreeLevelParam | TagTreeLevelParam | The multi-level tag analysis configuration. Pass this parameter when instructionType is set to multiLevelTag. |
customPromptParam | CustomPromptParam | The custom instruction configuration. Pass this parameter when instructionType is set to customPrompt. |
3.1 FieldsParam (key attribute extraction)
| Field | Type | Required | Description |
nameDescPairList | List<NameDescPair> | Yes | The list of key attribute dimensions to be extracted. |
NameDescPair structure:
| Field | Type | Required | Description |
name | String | Yes | The attribute name. |
desc | String | Yes | The attribute description. |
value | String | Yes | The attribute value. |
3.2 ServiceInspectionParam (service quality inspection)
| Field | Type | Required | Description |
sceneName | String | Yes | The quality inspection scenario name. |
sceneDescription | String | Yes | The quality inspection scenario description. |
dimensions | List<Dimension> | Yes | The list of quality inspection dimensions, which defines the specific inspection dimensions and their conditions. |
Dimension structure:
| Field | Type | Required | Description |
dimension | String | Yes | The dimension name. The title alias is also accepted during JSON deserialization. |
desc | String | Yes | The dimension description. The content alias is also accepted during JSON deserialization. |
3.3 TagCategoryParam (tag classification)
| Field | Type | Required | Description |
nameDescPairList | List<NameDescValueListPair> | Yes | The list of tag classification dimensions. Each dimension can contain multiple candidate tag values. |
NameDescValueListPair structure:
| Field | Type | Required | Description |
name | String | Yes | The dimension or classification name. |
desc | String | Yes | The dimension description. |
valueList | List<String> | Yes | The list of candidate tag values under this dimension. |
3.4 TagTreeLevelParam (multi-level tag recognition)
| Field | Type | Required | Description |
tagIds | List<Long> | Yes | The list of tag IDs passed at runtime. The first ID is used as the matched starting parent tag, and matching continues from its child nodes. |
tagTreeLevels | List<TagTreeLevelInfoParam> | Yes | The prompt configuration list for each level, arranged in hierarchical order. |
TagTreeLevelInfoParam structure:
| Field | Type | Required | Description |
tagTreeIds | List<Long> | Yes | The list of candidate tag IDs at the current level. A value of -1 indicates all tags (that is, matching all tags at this level). |
prompt | String | Yes | The analysis prompt for this level. It is concatenated with the tag data and sent to the large language model for analysis. |
3.5 CustomPromptParam (custom instruction)
| Field | Type | Required | Description |
customPrompt | String | Yes | The custom prompt instruction content defined by the user. |
nameDescPairList | List<NameDescPair> | No | The list of custom fields, which are used as additional variables referenced in the prompt. |
The NameDescPair structure is the same as that in Section 3.1.
4. Request example
{
"id": 123,
"userGroup": "default",
"aliUid": 1000000001,
"agentName": "Customer service quality inspection agent",
"agentDescription": "Used for the automatic detection of customer service conversation quality",
"modelType": "qwen-max",
"inputType": "text",
"instructionType": "serviceInspection",
"instructionTypeParam": {
"serviceInspectionParam": {
"sceneName": "After-sales customer service scenario",
"sceneDescription": "Checks the service quality of after-sales customer service conversations",
"dimensions": [
{
"dimension": "Service attitude",
"desc": "Checks whether the customer service representative uses polite language",
"includeCondition": "Includes greetings and expressions of gratitude",
"excludeCondition": "Not excluded if no obviously inappropriate language is used"
}
]
}
}
}
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Schema of Response |
||
| RequestId |
string |
Id of the request |
4987D326-83D9-4A42-B9A5-0B27F9B40539 |
| Code |
string |
The status code. A value of 200 indicates success. |
200 |
| Message |
string |
The error message returned if an error occurs. |
successful |
| Success |
boolean |
Indicates whether the request is successful. A value of true indicates success, and a value of false or null indicates failure. |
true |
| Data |
boolean |
The returned result. |
true |
Examples
Success response
JSON format
{
"RequestId": "4987D326-83D9-4A42-B9A5-0B27F9B40539",
"Code": "200",
"Message": "successful",
"Success": true,
"Data": true
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.