Skip to main content

latest
Works with
It is unknown whether this package works with Node.js, Deno, Browsers, Cloudflare Workers, Bun
It is unknown whether this package works with Node.js
It is unknown whether this package works with Deno
It is unknown whether this package works with Browsers
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Bun
JSR Score29%
Published2 years ago (0.0.1)
function toFile
toFile(
value: ToFileInput | PromiseLike<ToFileInput>,
name?: string | null | undefined,
options?: FilePropertyBag | undefined
): Promise<FileLike>

Helper for creating a File to pass to an SDK upload method from a variety of different data formats

Parameters

value: ToFileInput | PromiseLike<ToFileInput>

the raw content of the file. Can be an Uploadable, BlobLikePart, or AsyncIterable of BlobLikeParts

optional
name: string | null | undefined

the name of the file. If omitted, toFile will try to determine a file name from bits if possible

optional
options: FilePropertyBag | undefined

additional properties

Return Type

a File with the given properties

Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@luca/openai

Import symbol

import { toFile } from "@luca/openai";
or

Import directly with a jsr specifier

import { toFile } from "jsr:@luca/openai";