다음을 통해 공유


Files - Upload

로컬 컴퓨터에서 데이터를 업로드하여 새 파일 엔터티를 만듭니다. 예를 들어 업로드된 파일은 미세 조정된 모델을 학습하거나 평가하는 데 사용할 수 있습니다.

POST {endpoint}/openai/files?api-version=2024-02-01

URI 매개 변수

Name In(다음 안에) 필수 형식 Description
file
formData True

file

Azure OpenAI에 업로드할 파일을 가져오거나 설정합니다.

purpose
formData True

Purpose

업로드된 문서의 의도된 목적입니다. 미세 조정을 위해 "미세 조정"을 사용합니다. 이렇게 하면 업로드된 파일의 형식에 대한 유효성을 검사할 수 있습니다.

endpoint
path True

string

url

지원되는 Cognitive Services 엔드포인트(프로토콜 및 호스트 이름( 예: https://aoairesource.openai.azure.com) "aoairesource"를 Azure OpenAI 계정 이름으로 대체합니다.)

api-version
query True

string

요청된 API 버전입니다.

요청 헤더

Media Types: "multipart/form-data"

Name 필수 형식 Description
api-key True

string

여기에서 Cognitive Services Azure OpenAI 계정 키를 제공합니다.

응답

Name 형식 Description
201 Created

File

파일이 성공적으로 생성되었습니다.

Headers

Location: string

Other Status Codes

ErrorResponse

오류가 발생했습니다.

보안

api-key

여기에서 Cognitive Services Azure OpenAI 계정 키를 제공합니다.

Type: apiKey
In: header

예제

Upload a file.

Sample Request

POST https://aoairesource.openai.azure.com/openai/files?api-version=2024-02-01

Sample Response

location: https://aoairesource.openai.azure.com/openai/files/file-181a1cbdcdcf4677ada87f63a0928099
{
  "purpose": "fine-tune",
  "filename": "puppy.jsonl",
  "id": "file-181a1cbdcdcf4677ada87f63a0928099",
  "status": "notRunning",
  "created_at": 1646126127,
  "object": "file"
}

정의

Name Description
Error

오류

ErrorCode

오류 코드

ErrorResponse

ErrorResponse

File

파일

FileState

FileState

InnerError

InnerError

InnerErrorCode

InnerErrorCode

Purpose

목적

TypeDiscriminator

TypeDiscriminator

Error

오류

Name 형식 Description
code

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

오류 코드

Name 형식 Description
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

Name 형식 Description
error

Error

오류
Microsoft REST 지침(https://github.com/microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses)에 정의된 오류 콘텐츠입니다.

File

파일

Name 형식 Description
bytes

integer

사용 가능한 경우 이 파일의 크기입니다(null일 수 있음). JavaScript 정수와의 호환성을 보장하기 위해 2^53-1보다 큰 파일 크기는 지원되지 않습니다.

created_at

integer

이 작업 또는 항목이 만들어졌을 때의 타임스탬프입니다(unix epoch).

filename

string

파일 이름입니다.

id

string

이 항목의 ID입니다.

object

TypeDiscriminator

TypeDiscriminator
개체의 형식을 정의합니다.

purpose

Purpose

목적
업로드된 문서의 의도된 목적입니다. 미세 조정을 위해 "미세 조정"을 사용합니다. 이렇게 하면 업로드된 파일의 형식에 대한 유효성을 검사할 수 있습니다.

status

FileState

FileState
파일의 상태입니다.

status_details

string

이 파일을 처리하지 못한 경우 세부 정보가 포함된 오류 메시지입니다.

FileState

FileState

Name 형식 Description
deleted

string

엔터티가 삭제되었지만 삭제를 예약하는 다른 엔터티에서 여전히 참조될 수 있습니다. 터미널 상태로 분류할 수 있습니다.

deleting

string

엔터티는 삭제할 프로세스인 ni입니다. 이 상태는 Azure OpenAI에서 반환되지 않으며 호환성을 위해만 노출됩니다. 활성 상태로 분류할 수 있습니다.

error

string

작업이 실패로 처리를 완료했으며 더 이상 사용할 수 없습니다. 터미널 상태로 분류할 수 있습니다.

pending

string

작업이 만들어졌으며 나중에 처리될 큐에 대기되지 않습니다. 비활성 상태로 분류할 수 있습니다.

processed

string

작업이 성공적으로 처리되었으며 사용할 준비가 되었습니다. 터미널 상태로 분류할 수 있습니다.

running

string

작업이 처리되기 시작했습니다. 활성 상태로 분류할 수 있습니다.

uploaded

string

파일이 업로드되었지만 아직 처리되지 않았습니다. 이 상태는 Azure OpenAI에서 반환되지 않으며 호환성을 위해만 노출됩니다. 비활성 상태로 분류할 수 있습니다.

InnerError

InnerError

Name 형식 Description
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

Name 형식 Description
invalidPayload

string

이 작업에 대한 요청 데이터가 잘못되었습니다.

Purpose

목적

Name 형식 Description
fine-tune

string

이 파일에는 미세 조정 작업에 대한 학습 데이터가 포함되어 있습니다.

fine-tune-results

string

이 파일에는 미세 조정 작업의 결과가 포함되어 있습니다.

TypeDiscriminator

TypeDiscriminator

Name 형식 Description
file

string

이 개체는 파일을 나타냅니다.

fine-tune

string

이 개체는 미세 조정 작업을 나타냅니다.

fine-tune-event

string

이 개체는 미세 조정 작업의 이벤트를 나타냅니다.

fine_tuning.job

string

이 개체는 미세 조정 작업을 나타냅니다.

fine_tuning.job.event

string

이 개체는 미세 조정 작업의 이벤트를 나타냅니다.

list

string

이 개체는 다른 개체의 목록을 나타냅니다.

model

string

이 개체는 모델을 나타냅니다(기본 모델 또는 미세 조정 작업 결과일 수 있음).