ExAgent.Models.OpenAI (ExAgent v0.1.0)

Copy Markdown View Source

OpenAI Chat Completions provider. Talks the real API over Req.

model = %__MODULE__{model: "gpt-4o-mini"}
{:ok, %{output: text}} = ExAgent.run(agent_with(model), "hi")

The actual wire translation lives in ExAgent.Providers.OpenAIChat; this module just holds config and delegates.

Summary

Functions

Build an OpenAI model. :api_key falls back to OPENAI_API_KEY.

Types

t()

@type t() :: %ExAgent.Models.OpenAI{
  api_key: String.t() | nil,
  base_url: String.t() | nil,
  extra_headers: [{String.t(), String.t()}],
  model: String.t()
}

Functions

new(opts)

@spec new(keyword()) :: t()

Build an OpenAI model. :api_key falls back to OPENAI_API_KEY.