你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Files - Delete

删除具有给定文件 ID 的文件。如果使用文件(例如,在微调作业中将训练文件)用作训练文件,则也允许删除。

DELETE {endpoint}/openai/files/{file-id}?api-version=2024-10-21

URI 参数

名称 必需 类型 说明
endpoint
path True

string (url)

支持的认知服务终结点(协议和主机名,例如:https://aoairesource.openai.azure.com。将“aoairesource”替换为 Azure OpenAI 帐户名称。

file-id
path True

string

文件的标识符。

api-version
query True

string

请求的 API 版本。

请求头

名称 必需 类型 说明
api-key True

string

在此处提供认知服务 Azure OpenAI 帐户密钥。

响应

名称 类型 说明
200 OK

FileDelete

已成功删除该文件。

Other Status Codes

ErrorResponse

发生错误。

安全性

api-key

在此处提供认知服务 Azure OpenAI 帐户密钥。

类型: apiKey
在: header

示例

Deleting a file.

示例请求

DELETE https://aoairesource.openai.azure.com/openai/files/file-181a1cbdcdcf4677ada87f63a0928099?api-version=2024-10-21

示例响应

{
  "object": "file",
  "deleted": true,
  "id": "file-181a1cbdcdcf4677ada87f63a0928099"
}

定义

名称 说明
Error

错误

ErrorCode

ErrorCode

ErrorResponse

ErrorResponse

FileDelete

FileDelete

InnerError

InnerError

InnerErrorCode

InnerErrorCode

TypeDiscriminator

TypeDiscriminator

Error

错误

名称 类型 说明
code

ErrorCode

ErrorCode
Microsoft REST 准则(https://github.com/microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses)中定义的错误代码。

details

Error[]

错误详细信息(如果可用)。

innererror

InnerError

InnerError
Microsoft REST 准则(https://github.com/microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses)中定义的内部错误。

message

string

minLength: 1

此错误的消息。

target

string

发生错误的位置(如果可用)。

ErrorCode

ErrorCode

说明
conflict

请求的操作与当前资源状态冲突。

contentFilter

由于我们的安全系统,映像生成失败。

fileImportFailed

导入文件失败。

forbidden

当前用户/API 密钥禁止此操作。

internalFailure

内部错误。 请重试。

invalidPayload

此操作的请求数据无效。

itemDoesAlreadyExist

该项已存在。

jsonlValidationFailed

jsonl 数据的验证失败。

notFound

找不到资源。

quotaExceeded

超出配额。

serviceUnavailable

该服务当前不可用。

tooManyRequests

请求过多。 请稍后重试。

unauthorized

当前用户/API 密钥未获得操作的授权。

unexpectedEntityState

无法以当前资源的状态执行该操作。

ErrorResponse

ErrorResponse

名称 类型 说明
error

Error

错误
Microsoft REST 准则(https://github.com/microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses)中定义的错误内容。

FileDelete

FileDelete

名称 类型 说明
deleted

boolean

一个值,该值指示是否删除了该文件。

id

string

minLength: 1

已删除的文件 ID。

object

TypeDiscriminator

TypeDiscriminator
定义对象的类型。

InnerError

InnerError

名称 类型 说明
code

InnerErrorCode

InnerErrorCode
Microsoft REST 准则(https://github.com/microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses)中定义的内部错误代码。

innererror

InnerError

InnerError
Microsoft REST 准则(https://github.com/microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses)中定义的内部错误。

InnerErrorCode

InnerErrorCode

说明
invalidPayload

此操作的请求数据无效。

TypeDiscriminator

TypeDiscriminator

说明
batch

此对象表示批处理。

file

此对象表示文件。

fine_tuning.job

此对象表示微调作业。

fine_tuning.job.checkpoint

此对象表示微调作业的检查点。

fine_tuning.job.event

此对象表示微调作业的事件。

list

此对象表示其他对象的列表。

model

此对象表示模型(可以是基础模型或微调作业结果)。

upload

此对象表示文件上传。

upload.part

此对象表示文件上传的一部分。