from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.router.decisions.create(model="openai/gpt-6-luna", questions={
"positive": {
"criteria": {
"false": "The customer is unhappy.",
"true": "The customer is happy.",
},
"instructions": "Is the sentiment positive?",
"type": "noul",
},
"rating": {
"criteria": [
"Negative",
"Neutral",
"Positive",
],
"instructions": "Rate sentiment.",
"type": "score",
},
"sentiment": {
"criteria": {
"negative": "Negative sentiment",
"neutral": "Neutral sentiment",
"positive": "Positive sentiment",
},
"instructions": "Classify sentiment.",
"type": "choice",
},
}, state="The customer says: I love this product. It is wonderful!", fallbacks=[
{
"model": "openai/gpt-5.6-luna",
},
], identity={
"display_name": "Sample customer",
"id": "customer-demo",
}, retry={
"count": 2,
"on_codes": [
429,
502,
503,
504,
],
})
# Handle response
print(res)