DescribeFile

Updated at:

Queries the basic information of a file in application data, including the file name, type, and status.

Operation description

  • A RAM user (sub-account) must first obtain the API permissions for Alibaba Cloud Model Studio (AliyunBailianDataFullAccess or AliyunBailianDataReadOnlyAccess, either of which includes the sfm:DescribeFile permission) and join a business space before they can call this API. An Alibaba Cloud account (primary account) can call this API directly without authorization. We recommend using the latest Alibaba Cloud Model Studio SDK to call this API.
  • This API is idempotent.

Throttling: This API is subject to throttling if called frequently. Do not exceed 10 calls per second. If you are throttled, retry later.

Try it now

You can run this API directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After the API runs successfully, OpenAPI Explorer can automatically generate SDK code examples.

RAM authorization

The following table lists the authorization information for this API. You can use it in the Action element of a RAM policy statement to grant RAM users or RAM roles the permission to call this API. Details:

  • Action: the specific permission point.

  • Access level: the access level of each operation. Valid values: Write, Read, or List.

  • Resource type: the resource types that support authorization for the operation. Details:

    • Required resource types are marked with a preceding asterisk (*).
    • For operations that do not support resource-level authorization, All Resources is shown.
  • Condition key: the condition keys defined by the cloud service itself.

  • Dependent action: other permissions required for the operation to succeed. The caller must have the permissions of all dependent actions before the operation can succeed.

Action

Access level

Resource type

Condition key

Dependent action

sfm:DescribeFile

none

*All Resource

*

NoneNone

Request syntax

GET /{WorkspaceId}/datacenter/file/{FileId}/ HTTP/1.1

Path parameters

Parameter

Type

Required

Description

Example

WorkspaceId

string

Yes

The ID of the workspace to which the file belongs. For information about how to obtain the workspace ID, see How to use workspaces.

llm-3shx2gu255oqxxxx

FileId

string

Yes

The file ID, which is the FileId returned by the AddFile API. Open Collections and click Details for the target file dataset. Click the ID icon next to the file name, then click the copy icon to copy the file ID.

file_9a65732555b54d5ea10796ca5742ba22_xxxxxxxx

Request parameters

Parameter

Type

Required

Description

Example

No parameters required.

Response elements

Element

Type

Description

Example

object

Schema of Response

Code

string

The error status code.

Success

Data

object

The data field returned by the operation.

CategoryId

string

The ID of the category to which the file belongs.

cate_cdd11b1b79a74e8bbd675c356a91ee3xxxxxxxx

CreateTime

string

The timestamp when the file was added to Model Studio. Format: yyyy-MM-dd HH:mm:ss. Time zone: UTC+8.

2024-09-09 12:45:43

FileId

string

The file ID.

file_9a65732555b54d5ea10796ca5742ba22_xxxxxxxx

FileName

string

The file name.

XXX Product Introduction.pdf

FileType

string

The file type (extension). Possible values: pdf, docx, doc, txt, md, pptx, ppt, xlsx, xls, html, png, jpg, jpeg, bmp, and gif.

pdf

Parser

string

The parser type used to parse the file. Possible values:

  • DASHSCOPE_DOCMIND: the default document parser.

DASHSCOPE_DOCMIND

SizeInBytes

integer

The file size, in bytes.

1234

Status

string

For files used in document-based knowledge bases (type: UNSTRUCTURED), possible values:

  • INIT: Pending parsing.

  • IN_PARSE_QUEUE: Queued for parsing.

  • PARSING: Being parsed.

  • PARSE_SUCCESS: Parsing completed.
    The document can be imported into a knowledge base only after the status changes to PARSE_SUCCESS.
  • PARSE_FAILED: Parsing failed.

For files used in agent application session interaction (type: SESSION_FILE), possible values:

  • INIT: Pending parsing.

  • IN_PARSE_QUEUE: Queued for parsing.

  • PARSING: Being parsed.

  • PARSE_SUCCESS: Parsing completed.

  • PARSE_FAILED: Parsing failed.

  • SAFE_CHECKING: Safety check in progress.

  • SAFE_CHECK_FAILED: Safety check failed.

  • INDEX_BUILDING: Index being built.

  • INDEX_BUILD_SUCCESS: Index built.

  • INDEX_BUILDING_FAILED: Index building failed.

  • INDEX_DELETED: File index deleted.

  • FILE_IS_READY: File is ready.
    Q&A is available only after the status changes to FILE_IS_READY.
  • FILE_EXPIRED: File expired.
    The file is valid only for the current user session. After the user closes the session, the file expires (maximum validity period: 7 days). Long-term retention is not supported.

PARSE_SUCCESS

Tags

array

The list of tags associated with the file. A file can be associated with multiple tags.

string

The tag of the file.

Product Introduction

ParseResultDownloadUrl

string

ParseErrorMessage

string

The reason for the parsing failure.

Error Message

Message

string

The error message.

Requests throttling triggered.

RequestId

string

The request ID.

17204B98-xxxx-4F9A-8464-2446A84821CA

Status

string

The status code returned by the operation.

200

Success

boolean

Indicates whether the call was successful. Valid values:

  • true: Successful.

  • false: Failed.

true

Examples

Success response

JSON format

{
  "Code": "Success",
  "Data": {
    "CategoryId": "cate_cdd11b1b79a74e8bbd675c356a91ee3xxxxxxxx",
    "CreateTime": "2024-09-09 12:45:43",
    "FileId": "file_9a65732555b54d5ea10796ca5742ba22_xxxxxxxx",
    "FileName": "XXX产品介绍.pdf",
    "FileType": "pdf",
    "Parser": "DASHSCOPE_DOCMIND",
    "SizeInBytes": 1234,
    "Status": "PARSE_SUCCESS",
    "Tags": [
      "产品介绍"
    ],
    "ParseResultDownloadUrl": "",
    "ParseErrorMessage": "Error Message"
  },
  "Message": "Requests throttling triggered.",
  "RequestId": "17204B98-xxxx-4F9A-8464-2446A84821CA",
  "Status": "200",
  "Success": true
}

Error codes

Visit the Error Center to view more error codes.

Release notes

For more information, see Change details.