LangChain runnable for the OpenAI Decisions API.
Convert state to a string or a list of user messages.
Strings are sent as is, and sequences of HumanMessage objects as user messages.
Anything else, such as conversations with system, AI, or tool messages, is
serialized to JSON text in a single user message, with base64 images from any
message kept in place as image parts.
Complete input for one OpenAIDecisions invocation.
Keeping the input and questions together in the Runnable input ensures both participate in composition, batching, and tracing.
Typed answers and metadata returned from one Decisions request.
Access every answer through answers, or use predicates, choices, scores,
and refusals for views filtered by answer type. Each mapping is keyed by the
question names supplied in DecisionRequest.questions.
Ask typed questions about text or images with the OpenAI Decisions API.
A single request can combine Predicate probabilities, Choice selections, and
Score ratings over shared input. The response preserves probabilities,
confidence, and token usage so application code can decide whether to act,
route, or request human review.
Sync and async OpenAI clients are created on first use of invoke or ainvoke
respectively.