OpenAiDecisionModel unstable
OpenAI implementation of DecisionModel over the Decisions API.
Constructors
Builds a decision service with tolerance for two-decimal probability rounding.
Details
String state is sent as input unchanged, and other state is sent as JSON.
With images, input becomes one user message with the state as text
followed by the images. Byte arrays and base64 strings are sent as data:
URLs, and data: URLs are sent unchanged.
Probability criteria are appended to the question instructions, and each
rating level is sent with its label and description.
String instructions and descriptions are unchanged; structured values and
null descriptions are serialized with JSON.stringify.
Gotchas
- Remote URLs fail with
AiError.InvalidUserInputErrorbecause OpenAI only accepts inline images. - Refusals yield
"Refused"withdecideSettled;decidefails withAiError.ContentPolicyErrornaming the refused decisions.
Signature
declare const make: (...args: [options: { readonly model: "gpt-6-luna" | string & {};}]) => Effect<DecisionModel, never, OpenAiClient>Creates a decision model with OpenAI provider metadata.
Signature
declare function model(model: "gpt-6-luna" | string & {}): Model<"openai", DecisionModel, OpenAiClient>