CreateMultiModalTask

Updated at:

Performs a synchronous multimodal evaluation on a single image or audio/video file and directly returns the score.

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

agentloop:CreateMultiModalTask

create

*Workspace

acs:agentloop:{#regionId}:{#accountId}:agentspace/{#AgentSpaceName}

None None

Request syntax

POST /api/v1/media-processings HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

body

object

No

The multimodal evaluation request body. Specifies the workspace, evaluator, and input parameters. When using the national subsidy image inspection, specify an image URL accessible to the evaluator in args.imageUrl.

{"agentSpace":"example-space","evaluatorRef":"Builtin.subsidy_api","args":{"imageUrl":"https://example-bucket.oss-cn-hangzhou.aliyuncs.com/label.jpg"}}

agentSpace

string

Yes

The AgentSpace name. It must be 3 to 63 characters in length and can contain only lowercase letters, digits, and hyphens. It must start and end with a letter or a digit.

example-space

evaluatorRef

string

Yes

The name of the evaluator registered as a public API. If the evaluator is not registered, not exposed as a public API, or the current version is invalid, a 400 error is returned.

Builtin.subsidy_api

prompt

string

No

The evaluation prompt. If omitted, it is processed as an empty string. The maximum length is 2,000 characters, counted by Unicode code points.

Verify whether the image is complete

taskName

string

No

The task name, used to group multiple calls of the same business line in the console. If omitted or empty, agentloop-media-process is used. The maximum length is 128 characters. Control characters are not allowed.

agentloop-media-process

ossRegion

string

No

The signature region when the media is stored in OSS or SLS, such as cn-hangzhou. This parameter is used only when the region cannot be determined from the URL itself.

cn-hangzhou

arn

string

No

The ARN of the role used to access OSS or SLS, such as acs:ram:::role/. It is used to derive the signature region.

acs:ram::1234567890123456:role/media-reader

args

object

Yes

The input parameters for the evaluator. The keys are defined by the evaluator specified by evaluatorRef. Example for national subsidy image inspection: {"imageUrl":"https://example.com/label.jpg"}.

{"imageUrl":"https://example-bucket.oss-cn-hangzhou.aliyuncs.com/label.jpg"}

Response elements

Element

Type

Description

Example

object

Schema of Response

{"score":1,"msg":"The image is complete and the inspection is passed.","taskName":"agentloop-media-process","taskId":"eval-task-0123456789abcdef0123456789abcdef"}

score

number

The score, ranging from 0 to 1. It is null when the evaluation fails. If the backend returns a percentage score greater than 1, it is converted to score/100 and rounded to a maximum of 4 decimal places.

1

msg

string

The evaluation message. It is the description returned by the backend upon success, or the customer-visible error message upon failure.

The image is complete and the inspection is passed

taskName

string

The task name used for this call. It is also returned upon failure if the request body has been parsed.

agentloop-media-process

taskId

string

The task ID, in the format of eval-task-<32hex>. It can be used for tracing in the console or query API. It is null if the failure occurs before the task is created.

eval-task-0123456789abcdef0123456789abcdef

Examples

Success response

JSON format

{
  "score": 1,
  "msg": "The image is complete and the inspection is passed",
  "taskName": "agentloop-media-process",
  "taskId": "eval-task-0123456789abcdef0123456789abcdef"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.