반응형
블로그 이미지
개발자로서 현장에서 일하면서 새로 접하는 기술들이나 알게된 정보 등을 정리하기 위한 블로그입니다. 운 좋게 미국에서 큰 회사들의 프로젝트에서 컬설턴트로 일하고 있어서 새로운 기술들을 접할 기회가 많이 있습니다. 미국의 IT 프로젝트에서 사용되는 툴들에 대해 많은 분들과 정보를 공유하고 싶습니다.
솔웅

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백

글 보관함

카테고리


반응형

https://beta.openai.com/docs/api-reference/files

 

Files

Files are used to upload documents that can be used with features like Fine-tuning.

파일은 미세 조정과 같은 기능과 함께 사용할 수 있는 문서를 업로드하는 데 사용됩니다.

 

List files

GET https://api.openai.com/v1/files

Returns a list of files that belong to the user's organization.

사용자의 조직에 속한 파일 목록을 반환합니다.

 

 

https://beta.openai.com/docs/api-reference/files/upload 

 

Upload file

POST https://api.openai.com/v1/files

Upload a file that contains document(s) to be used across various endpoints/features. Currently, the size of all the files uploaded by one organization can be up to 1 GB. Please contact us if you need to increase the storage limit.

다양한 엔드포인트/기능(endpoints/features)에서 사용할 문서가 포함된 파일을 업로드합니다. 현재 한 조직에서 업로드하는 모든 파일의 크기는 최대 1GB입니다. 저장 한도를 늘려야 하는 경우 당사에 문의하십시오.

 

 

Request body

file
string
Required

Name of the JSON Lines file to be uploaded.

업로드할 JSON Lines 파일의 이름입니다.

 

If the purpose is set to "fine-tune", each line is a JSON record with "prompt" and "completion" fields representing your training examples.

 

목적이 "미세 조정"으로 설정된 경우 각 줄은 교육 예제를 나타내는 "프롬프트" 및 "완료" 필드가 있는 JSON 레코드입니다.

 

purpose
string
Required

The intended purpose of the uploaded documents.

Use "fine-tune" for Fine-tuning. This allows us to validate the format of the uploaded file.

 

미세 조정에는 " Fine-tuning"을 사용하십시오. 이렇게 하면 업로드된 파일의 형식을 확인할 수 있습니다.

 

https://beta.openai.com/docs/api-reference/files/delete

 

Delete file

DELETE https://api.openai.com/v1/files/{file_id}

Delete a file.

파일을 지웁니다.

 

Path parameters

file_id
string
Required

The ID of the file to use for this request.

이 요청에서 사용할 파일의 아이디 입니다.

 

https://beta.openai.com/docs/api-reference/files/retrieve

 

Retrieve file

GET https://api.openai.com/v1/files/{file_id}

Returns information about a specific file.

특정 파일에 대한 정보를 반환합니다.

 

Path parameters

file_id
string
Required

The ID of the file to use for this request

이 요청에서 사용할 파일의 아이디 입니다.

 

 

https://beta.openai.com/docs/api-reference/files/retrieve-content

 

Retrieve file content

GET https://api.openai.com/v1/files/{file_id}/content

Returns the contents of the specified file

특정 파일의 내용을 반환합니다.

 

import os
import openai
openai.api_key = os.getenv("OPENAI_API_KEY")
content = openai.File.download("file-XjGxS3KTG0uNmNOK362iJua3")

Path parameters

file_id
string
Required

The ID of the file to use for this request

이 요청에서 사용할 파일의 아이디 입니다.

반응형