View Source ExOpenAi.Files.File (ex_open_ai v2.0.1)

Represents a file request to the OpenAI API.

examples

Examples

iex> params = %{
...>   purpose: "search",
...>   file: "file-uuid"
...> }
iex> ExOpenAi.Files.File.create(params)
{:ok, %ExOpenAi.Files.File{...}}

iex> ExOpenAi.Files.File.retrieve(%{})
{:error, %{}}

Link to this section Summary

Link to this section Types

@type t() :: %ExOpenAi.Files.File{
  bytes: integer(),
  created_at: integer(),
  filename: String.t(),
  id: String.t(),
  object: String.t(),
  purpose: String.t()
}

Link to this section Functions

Link to this function

create_with_file(data, file_key, options \\ [])

View Source
@spec create_with_file(ExOpenAi.Api.data(), atom(), list()) ::
  ExOpenAi.Parser.parsed_response()
@spec do_new(
  %ExOpenAi.Files.File{
    bytes: term(),
    created_at: term(),
    filename: term(),
    id: term(),
    object: term(),
    purpose: term()
  },
  attributes :: list()
) :: %ExOpenAi.Files.File{
  bytes: term(),
  created_at: term(),
  filename: term(),
  id: term(),
  object: term(),
  purpose: term()
}
Link to this function

keep_it_simple(response, _)

View Source
@spec new() :: %ExOpenAi.Files.File{
  bytes: term(),
  created_at: term(),
  filename: term(),
  id: term(),
  object: term(),
  purpose: term()
}
@spec new(attributes :: list()) :: %ExOpenAi.Files.File{
  bytes: term(),
  created_at: term(),
  filename: term(),
  id: term(),
  object: term(),
  purpose: term()
}
Link to this function

remove(id, options \\ [])

View Source
Link to this function

retrieve(id, options \\ [])

View Source
@spec retrieve(String.t(), list()) :: ExOpenAi.Parser.parsed_response()