Codex.OutputSchemaFile (Codex SDK v0.7.2)

Copy Markdown View Source

Persists structured output schemas to temporary JSON files so they can be passed to the Codex CLI. Returns the generated path alongside a cleanup function for RAII-style usage.

Summary

Functions

Persists the provided schema to a temporary JSON file and returns {path, cleanup_fun}.

Functions

create(schema)

@spec create(term()) :: {:ok, String.t() | nil, (-> :ok)} | {:error, term()}

Persists the provided schema to a temporary JSON file and returns {path, cleanup_fun}.

The schema may be any JSON-encodable term (map, list, primitive). When nil is supplied no file is created and the return path is nil.