Decisions
Answer typed questions with a decision model.
- Method:
POST - See OpenAI docs: Decisions guide and API reference
Requires a loaded decision model, not a regular chat model.
Python example
from openai import OpenAI
client = OpenAI(base_url="http://localhost:1234/v1", api_key="lm-studio")
decision = client.decisions.create(
model="model-identifier",
input="I was charged twice.",
questions=[
{"type": "predicate", "name": "angry", "instructions": "Is the customer angry?"}
],
)
print(decision.answers)Requires OpenAI Python 3.26.0+.