Skip to main content
Use openaiDecisions() from @agentium/core to evaluate a fixed set of questions. Agentium 4.1 adds OpenAIDecisionsProvider, DecisionQuestion, DecisionAnswer, and result.decisions. The adapter calls POST /v1/decisions. As of October 8, 2026, OpenAI documents this endpoint as public beta with gpt-6-luna as its supported model. See the official Decisions guide.

Classify a support ticket

Install Agentium and the optional OpenAI SDK. This adapter requires openai 7.30.0 or later.
Save this as decisions.ts:
Run npx tsx decisions.ts. The program prints one typed answer per question. Calls require an OpenAI API key and account access and incur provider usage. The exact answers vary with the input and model.

Questions and results

name is optional. Supplied names must be unique; unnamed answers use null. Answers retain request order. Agentium validates their types, names, choice values, and score levels against the questions. result.decisions contains the validated array. result.text contains that array as JSON. Refusals are answer data, not invented negative answers. An all-refused provider response uses finishReason: "content_filter"; a successfully completed Agent run can still contain refusals. Use question instructions to define the task. The adapter preserves Agent instructions and conversation history as text evidence: each message becomes a user message prefixed with [system], [user], or [assistant]. These labels do not recreate a chat endpoint’s role hierarchy.

Configuration and overrides

A run’s questions array replaces constructor defaults. An empty array is an error. Existing Jev question maps remain supported by jev(); the two providers reject each other’s question formats. The adapter forwards AbortSignal to the SDK. Agent runs use Agentium’s retry policy for rate limits and transient server failures. Direct provider.generate() calls do not retry. Credential overrides are not retained for later requests.

Images

Use Agentium’s multimodal input with { type: "image", data, mimeType }. Supply raw base64 with a supported image MIME type or a complete inline data URL. The endpoint supports up to 128 image parts per request. External image URLs, file IDs, audio, and file parts are rejected. See the request contract.

Streaming and costs

agent.stream() performs one complete request. It emits one text chunk containing the answer array, followed by a finish chunk with decisions and usage. It does not deliver incremental model output. The run.complete event also contains output.decisions. CostTracker uses the endpoint-specific key openai-decisions/gpt-6-luna. The default base estimate is $0.10 per million input tokens, with no output or cache charges. Configure CostTracker.pricing for regional or long-context adjustments. These are estimates; see OpenAI’s pricing and availability.

Integration limits

This provider rejects tools, structuredOutput, responseFormat, sampling controls, reasoning settings, and chat-specific provider options. Select an action with a choice question, then let application code execute it. Use a chat provider when you need generated tool arguments or arbitrary structured output. Agentium bypasses semantic caching for this provider because the semantic cache key does not include the question set. Memory features that add tools or make auxiliary chat calls require a compatible chat model. Use this provider for a dedicated decision agent or direct model calls. Tests exercise the installed OpenAI SDK against a local HTTP fixture, including cancellation, credentials, refusals, and streaming. These tests do not establish live account availability or model accuracy. Evaluate representative examples before selecting application thresholds.

Next steps