Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/openai_deno/mod.ts>OpenAI#uploadFile

OpenAI API wrapper for deno.
Latest
method OpenAI.prototype.uploadFile
import { OpenAI } from "https://deno.land/x/openai_deno@v0.9.8/mod.ts";

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 OpenAI if you need to increase the storage limit.

Parameters

file: string | BlobPart

Name of the JSON Lines file to be uploaded.

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

purpose: string

The intended purpose of the uploaded documents.

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

optional
filename: string

Returns

Promise<OpenAIFile>

The uploaded file.