For a smoother experience with multimodal web search, use the file interface to pre-upload images to OSS and provide their OSS URLs to the web search agent during the Q&A session.
Get a pre-signed OSS upload URL
Retrieves a pre-signed URL for uploading files to OSS.
Request parameters
Parameter | Type | Required | Description |
|---|---|---|---|
input | object | Yes | A container for the request parameters. |
input.session_id | str | Yes | A user-defined session ID for the file operation. |
input.files | array | Yes | A list of files to upload. |
input.files[].file_name | str | Yes | The name of the file. |
input.files[].file_size | int | Yes | The size of the file in bytes. |
input.files[].content_type | str | Yes | The MIME type of the file. |
parameters | object | Yes | Configuration parameters. |
parameters.agent_options | object | Yes | Configuration options for the Agent. |
parameters.agent_options.agent_id | str | Yes | The Agent ID. |
Response parameters
Parameter | Type | Required | Description |
|---|---|---|---|
code | str | Yes | The status code. A value of |
message | str | Yes | The status message. |
output | object | Yes | A container for the response data. |
output.request_id | str | No | The request ID. |
output.result | object | Yes | The file processing result. |
output.result.upload_tasks | array | Yes | A list of upload tasks. |
output.result.upload_tasks[].file_id | str | Yes | The file ID. |
output.result.upload_tasks[].file_name | str | Yes | The name of the file. |
output.result.upload_tasks[].upload_url | str | Yes | The OSS pre-signed URL for the upload. |
output.result.upload_tasks[].expire_at | int | Yes | The Unix timestamp indicating when the upload URL expires. By default, the URL is valid for one hour. |
Upload the file
After you get the OSS presigned upload URL, run the following command to upload your local file. The ${output.result.upload_tasks[].upload_url} placeholder is the presigned upload URL returned by the Get a pre-signed OSS upload URL operation.
Check file upload status
Call this endpoint to check the result of a file upload.
Request parameters
Parameter | Type | Required | Description |
|---|---|---|---|
input | object | Yes | Contains the request parameters. |
input.session_id | str | Yes | A user-defined session ID for the file operation. |
input.file_id | str | Yes | The ID of the file. You receive this ID when you request an upload URL. |
parameters | object | Yes | Configuration parameters. |
parameters.agent_options | object | Yes | Configuration options for the Agent. |
parameters.agent_options.agent_id | str | Yes | The Agent ID. |
Response parameters
Parameter | Type | Required | Description |
|---|---|---|---|
code | str | Yes | The status code. A value of 200 indicates success. |
message | str | Yes | The status message. |
output | object | Yes | Contains the response data. |
output.request_id | str | No | The unique ID for the request, which can be used for troubleshooting. |
output.result | object | Yes | Contains the result of the operation. |
output.result.status | str | Yes | The upload status. A value of SUCCESS indicates a successful upload. |
Get file information
Returns the status of one or more uploaded files.
Request parameters
Parameter | Type | Required | Description |
|---|---|---|---|
input | object | Yes | The request parameters. |
input.session_id | str | Yes | A user-defined ID for the file operation session. |
input.file_ids | array[str] | Yes | An array of file IDs. |
parameters | object | Yes | Configuration parameters. |
parameters.agent_options | object | Yes | Agent configuration options. Configuration options |
parameters.agent_options.agent_id | str | Yes | The agent ID. |
Response parameters
Parameter | Type | Required | Description |
|---|---|---|---|
code | str | Yes | The status code. A value of 200 indicates success. |
message | str | Yes | The status message. |
output | object | Yes | The response data. |
output.request_id | str | No | The request ID. |
output.result | object | Yes | The result of the operation. |
output.result[].file_id | str | Yes | The file ID. |
output.result[].file_name | str | Yes | The file name. |
output.result[].file_size | int | Yes | The file size, in bytes. |
output.result[].content_type | str | Yes | The MIME type of the file. Type |
output.result[].preview_url | str | Yes | An OSS presigned URL for file preview. pre-signed URL) |
output.result[].expire_at | int | Yes | The preview URL's expiration time, as a Unix timestamp. Expiration time (Unix timestamp) |
output.result[].status | str | Yes | The status of the file. For example, 'done'. |
Delete file
Deletes uploaded files.
Request parameters
Parameter | Type | Required | Description |
|---|---|---|---|
input | object | Yes | A container for the input parameters. |
input.session_id | str | Yes | The session ID for the file operation. A user-defined identifier. |
input.file_ids | array[str] | Yes | A list of IDs for the files to be deleted. |
parameters | object | Yes | Specifies configuration parameters for the operation. |
parameters.agent_options | object | Yes | Configuration options for the agent. Configuration options |
parameters.agent_options.agent_id | str | Yes | The ID of the agent that performs the operation. |
Response parameters
Parameter | Type | Required | Description |
|---|---|---|---|
code | str | Yes | The status code. A value of |
message | str | Yes | A message that describes the status of the request. |
output | object | Yes | Contains the results of the operation. |
output.request_id | str | No | The unique ID for the request, used for troubleshooting. |
output.result | object | Yes | The results of the file deletion operation. |
output.result[].status | str | Yes | The deletion status. A value of |