UpdateAgent

Updated at:

Modifies an agent.

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

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

FieldTypeRequiredDescription
idLongYesThe agent ID.
agentNameStringYesThe agent name.
agentDescriptionStringNoThe agent description.
modelTypeStringYesThe large language model (LLM) type. For valid values, see the LLMCodeEnum enumeration.
inputTypeStringYesThe analysis object type. Valid values: text (text), voice (voice), and image (image).
instructionTypeStringYesThe instruction type code. For valid values, see the AgentInstructionTypeEnum enumeration in the following table.
instructionTypeParamInstructionTypeParamYesThe detailed configuration parameters for the instruction type. Pass the corresponding sub-object based on the value of instructionType.

Valid values for instructionType

CodeDescriptionCorresponding parameter
serviceInspectionService quality inspectionserviceInspectionParam
fieldKey attribute extractionfieldsParam
tagCategoryTag classificationtagCategoryParam
multiLevelTagMulti-level tag recognitiontagTreeLevelParam
customPromptCustom instructioncustomPromptParam

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.

FieldTypeDescription
fieldsParamFieldsParamThe key attribute extraction configuration. Pass this parameter when instructionType is set to field.
serviceInspectionParamServiceInspectionParamThe service quality inspection configuration. Pass this parameter when instructionType is set to serviceInspection.
tagCategoryParamTagCategoryParamThe tag classification configuration. Pass this parameter when instructionType is set to tagCategory.
tagTreeLevelParamTagTreeLevelParamThe multi-level tag analysis configuration. Pass this parameter when instructionType is set to multiLevelTag.
customPromptParamCustomPromptParamThe custom instruction configuration. Pass this parameter when instructionType is set to customPrompt.

3.1 FieldsParam (key attribute extraction)

FieldTypeRequiredDescription
nameDescPairListList<NameDescPair>YesThe list of key attribute dimensions to be extracted.

NameDescPair structure:

FieldTypeRequiredDescription
nameStringYesThe attribute name.
descStringYesThe attribute description.
valueStringYesThe attribute value.

3.2 ServiceInspectionParam (service quality inspection)

FieldTypeRequiredDescription
sceneNameStringYesThe quality inspection scenario name.
sceneDescriptionStringYesThe quality inspection scenario description.
dimensionsList<Dimension>YesThe list of quality inspection dimensions, which defines the specific inspection dimensions and their conditions.

Dimension structure:

FieldTypeRequiredDescription
dimensionStringYesThe dimension name. The title alias is also accepted during JSON deserialization.
descStringYesThe dimension description. The content alias is also accepted during JSON deserialization.

3.3 TagCategoryParam (tag classification)

FieldTypeRequiredDescription
nameDescPairListList<NameDescValueListPair>YesThe list of tag classification dimensions. Each dimension can contain multiple candidate tag values.

NameDescValueListPair structure:

FieldTypeRequiredDescription
nameStringYesThe dimension or classification name.
descStringYesThe dimension description.
valueListList<String>YesThe list of candidate tag values under this dimension.

3.4 TagTreeLevelParam (multi-level tag recognition)

FieldTypeRequiredDescription
tagIdsList<Long>YesThe 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.
tagTreeLevelsList<TagTreeLevelInfoParam>YesThe prompt configuration list for each level, arranged in hierarchical order.

TagTreeLevelInfoParam structure:

FieldTypeRequiredDescription
tagTreeIdsList<Long>YesThe list of candidate tag IDs at the current level. A value of -1 indicates all tags (that is, matching all tags at this level).
promptStringYesThe 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)

FieldTypeRequiredDescription
customPromptStringYesThe custom prompt instruction content defined by the user.
nameDescPairListList<NameDescPair>NoThe 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.