• Preparing search index...
  • The search index is not available
@google/genai
  • @google/genai
  • interactions/internal/to-file
  • toFile

Function toFile

  • toFile(
        value: ToFileInput | PromiseLike<ToFileInput>,
        name?: null | string,
        options?: FilePropertyBag,
    ): Promise<File>

    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

    • Optionalname: null | string

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

    • Optionaloptions: FilePropertyBag

      additional properties

      A copy of the builtin FilePropertyBag type as it isn't fully supported in certain environments and attempting to reference the global version will error.

      https://github.com/microsoft/TypeScript/blob/49ad1a3917a0ea57f5ff248159256e12bb1cb705/src/lib/dom.generated.d.ts#L503 https://developer.mozilla.org/en-US/docs/Web/API/File/File#options

      • Optionalendings?: EndingType
      • OptionallastModified?: number
      • Optionaltype?: string

    Returns Promise<File>

    a File with the given properties

    • Defined in src/interactions/internal/to-file.ts:89

Settings

@google/genai
  • Loading...

Generated using TypeDoc