Estimate the probability that a condition is true.
from langchain_openai.decisions import OpenAIDecisions, Predicate
decisions = OpenAIDecisions(model="gpt-6-luna")
response = decisions.invoke(
{
"input": "Production is down. Please help immediately.",
"questions": {
"urgent": Predicate(instructions="Is this request urgent?"),
},
}
)
if response.predicates["urgent"].probability >= 0.8:
page_on_call_engineer()