llm_wire/openai

Configures the built-in OpenAI Responses adapter.

let config =
  openai.new(api_key)
  |> openai.with_project("my-project")
  |> openai.config

The adapter targets https://api.openai.com/v1; point it at a compatible server with llm_wire.with_endpoint. The key is held in a closure and never prints; llm_wire.prepare rejects an empty one with error.InvalidSetting(error.ApiKey, ..).

Types

pub opaque type Options

Values

pub fn config(options: Options) -> llm_wire.Config

The configuration of OpenAI calls, with the default limits and timeouts.

pub fn new(api_key: String) -> Options

Options for the API key api_key, trimmed.

pub fn with_organization(
  options: Options,
  organization: String,
) -> Options

Send OpenAI-Organization.

pub fn with_project(options: Options, project: String) -> Options

Send OpenAI-Project.

✨ Search Document