Buble.Files (buble v0.1.0)

Copy Markdown View Source

Source media upload methods.

Upload a file, then pass the returned URL into generation requests as image_urls, video_urls, audio_urls, start_frame, or end_frame.

Summary

Types

file_source()

@type file_source() ::
  String.t()
  | {:path, String.t()}
  | {:binary, binary(), keyword()}
  | %{
      :content => binary(),
      optional(:filename) => String.t(),
      optional(:content_type) => String.t()
    }

Functions

upload(client, file, opts \\ [])

@spec upload(Buble.Client.t(), file_source(), keyword() | map()) ::
  {:ok, map()} | {:error, Buble.Error.t()}

upload!(client, file, opts \\ [])

@spec upload!(Buble.Client.t(), file_source(), keyword() | map()) :: map()