Class OpenAiOfficialDecisionModel

java.lang.Object
dev.langchain4j.model.openaiofficial.OpenAiOfficialDecisionModel
All Implemented Interfaces:
DecisionModel

@Experimental public class OpenAiOfficialDecisionModel extends Object implements DecisionModel
A DecisionModel backed by the OpenAI Decisions API, using the official OpenAI Java SDK. It answers yes/no, choice and scale questions about a text or image input with probabilities.
DecisionModel model = OpenAiOfficialDecisionModel.builder()
        .apiKey(System.getenv("OPENAI_API_KEY"))
        .modelName("gpt-6-luna")
        .build();
The input can be text, a Map (sent as JSON text), or a list of TextContents and ImageContents. Images must be inline (base64 data or data URLs): images referenced by URL are not supported by the API. The image detail levels LOW, HIGH and AUTO are supported.

The API can refuse to answer a single question, for example because it goes against the usage policies of OpenAI: the answer to that question is then a RefusalAnswer.

Since:
1.22.0