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

Files - Get Content

获取由给定文件 ID 指定的文件的内容。文件可以是用户上传的内容,也可以由服务生成,例如微调作业的结果指标。

GET {endpoint}/openai/files/{file-id}/content?api-version=2024-07-01-preview

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 版本。

响应

名称 类型 说明
200 OK

file

成功

Media Types: "application/octet-stream", "application/json"

Other Status Codes

ErrorResponse

发生错误。

Media Types: "application/octet-stream", "application/json"

安全性

api-key

API 密钥身份验证

类型: apiKey
在: header

OAuth2Auth

OAuth2 身份验证

类型: oauth2
流向: implicit
授权 URL: https://login.microsoftonline.com/common/oauth2/v2.0/authorize

作用域

名称 说明
https://cognitiveservices.azure.com/.default

示例

Getting the file content.

示例请求

GET https://aoairesource.openai.azure.com/openai/files/file-181a1cbdcdcf4677ada87f63a0928099/content?api-version=2024-07-01-preview

示例响应

"raw file content"

定义

名称 说明
Error

错误

ErrorCode

ErrorCode

ErrorResponse

ErrorResponse

InnerError

InnerError

InnerErrorCode

InnerErrorCode

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

此错误的消息。

target

string

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

ErrorCode

ErrorCode

名称 类型 说明
conflict

string

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

contentFilter

string

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

fileImportFailed

string

导入文件失败。

forbidden

string

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

internalFailure

string

内部错误。 请重试。

invalidPayload

string

此操作的请求数据无效。

itemDoesAlreadyExist

string

该项已存在。

jsonlValidationFailed

string

jsonl 数据的验证失败。

notFound

string

找不到资源。

quotaExceeded

string

超出配额。

serviceUnavailable

string

该服务当前不可用。

tooManyRequests

string

请求过多。 请稍后重试。

unauthorized

string

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

unexpectedEntityState

string

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

ErrorResponse

ErrorResponse

名称 类型 说明
error

Error

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

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

string

此操作的请求数据无效。