OpenAI.Client (openai_client v0.5.3)

Link to this section Summary

Functions

Initialize a new client for the OpenAI API.

Link to this section Types

@type body() :: Tesla.Env.body()
@type client() :: Tesla.Client.t()
Link to this type

new_client_opt()

@type new_client_opt() ::
  {:api_key, String.t()}
  | {:base_url, String.t()}
  | {:organization, String.t()}
  | {:timeout, integer()}
Link to this type

new_client_opts()

@type new_client_opts() :: [new_client_opt()]
@type result() :: {:ok, body() | function()} | {:error, term()}
@type t() :: client()
@type url() :: Tesla.Env.url()

Link to this section Functions

Link to this function

new(opts \\ [])

@spec new(new_client_opts()) :: client()

Initialize a new client for the OpenAI API.

options

Options

  • :api_key - API key to use for the client.
  • :base_url - URL for the OpenAI API.
  • :organization - specifies which organization to use for requests.