Packages

Minimal Elixir AI SDK scaffolding for streaming text with tool calls.

Current section

Files

Jump to
ai_sdk_ex lib ai openai.ex
Raw

lib/ai/openai.ex

defmodule AI.OpenAI do
@moduledoc """
OpenAI model helpers.
"""
@doc """
Creates a model that uses the OpenAI Responses API.
Options are stored on the model and passed to the provider. Common options:
- `:base_url` - override the API base URL
- `:api_key` - override the API key
"""
def responses(model_id, opts \\ []) do
%AI.Model{
provider: AI.Providers.OpenAI.Responses,
model_id: model_id,
options: Enum.into(opts, %{})
}
end
end