Sends a message history to the OpenAI Responses API (POST /v1/responses) and
returns the assistant's reply. Supports streaming, tool use, structured output,
and reasoning models (o-series) via .reasoning_effort.
openai_chat(
.llm,
.model = "gpt-5.6-terra",
.max_output_tokens = NULL,
.temperature = NULL,
.seed = NULL,
.stream = FALSE,
.timeout = 60,
.verbose = FALSE,
.json_schema = NULL,
.max_tries = 3,
.dry_run = FALSE,
.reasoning_effort = NULL,
.tools = NULL,
.tool_choice = NULL,
.max_tool_rounds = 10,
.stateful = FALSE
)A new LLMMessage object with the assistant's response appended.
An LLMMessage object containing the conversation history.
The model identifier (default: "gpt-5.6-terra").
Maximum tokens to generate (caps reasoning + completion).
Sampling temperature (0-2).
Seed for deterministic sampling.
If TRUE, stream output to console (default: FALSE).
Request timeout in seconds (default: 60).
Print rate-limit info after the call (default: FALSE).
A tidyllm schema or ellmer type for structured output.
Maximum retry attempts (default: 3).
If TRUE, return the request object without sending (default: FALSE).
For o-series models: "low", "medium", or "high".
A TOOL object or list of TOOL objects for function calling.
Tool selection behavior: "none", "auto", or "required".
Maximum tool-loop iterations (default: 10).
If TRUE, use previous_response_id to pass conversation context
server-side instead of re-sending full message history. Falls back to full-history
mode silently when no previous response ID is available (first turn or prior turn
used a different provider), and with a warning if the server rejects the stored ID
(e.g., expired context). Default: FALSE.