OpenaiEx.ContainerFiles (openai_ex v0.9.18)

View Source

This module provides an implementation of the OpenAI Container Files API. The API reference can be found at https://platform.openai.com/docs/api-reference/container-files.

Summary

Functions

Retrieves the content of a container file.

Creates a new container file via upload or file reference.

Deletes a container file.

Lists all files in a container.

Creates a new file reference request with the given arguments.

Creates a new file upload request with the given arguments.

Retrieves a specific container file by ID.

Functions

content(openai, container_id, file_id)

content!(openai, container_id, file_id)

Retrieves the content of a container file.

See https://platform.openai.com/docs/api-reference/container-files/retrieveContainerFileContent

create(openai, container_id, request)

create!(openai, container_id, request)

Creates a new container file via upload or file reference.

See https://platform.openai.com/docs/api-reference/container-files/createContainerFile

delete(openai, container_id, file_id)

delete!(openai, container_id, file_id)

Deletes a container file.

See https://platform.openai.com/docs/api-reference/container-files/deleteContainerFile

list(openai, container_id, params \\ %{})

list!(openai, container_id, params \\ %{})

Lists all files in a container.

See https://platform.openai.com/docs/api-reference/container-files/listContainerFiles

new_reference(args)

Creates a new file reference request with the given arguments.

Example usage:

iex> OpenaiEx.ContainerFiles.new_reference(file_id: "file-123")
%{file_id: "file-123"}

new_upload(args)

Creates a new file upload request with the given arguments.

Examples

iex> OpenaiEx.ContainerFiles.new_upload(file: {"test.txt", "content"})
%{file: {"test.txt", "content"}}

iex> OpenaiEx.ContainerFiles.new_upload(file: {"/path/to/file.txt"})
%{file: {"/path/to/file.txt"}}

retrieve(openai, container_id, file_id)

retrieve!(openai, container_id, file_id)

Retrieves a specific container file by ID.

See https://platform.openai.com/docs/api-reference/container-files/retrieveContainerFile