POST https://api.phronic.ai/v1/decide
Authorization: Bearer $PHRONIC_API_KEY
Content-Type: application/json
{
"model": "pip-latest",
"state": "Help! My payouts have failed for 3 days.",
"questions": {
"team": {
"type": "choice",
"instructions": "Which team should handle this?",
"criteria": {
"billing": "Payments, invoices, refunds",
"technical": "Bugs, outages, integrations",
"sales": "Pricing, upgrades, new accounts"
}
}
}
}
POST https://api.phronic.ai/v1/decide
Authorization: Bearer $PHRONIC_API_KEY
Content-Type: application/json
{
"model": "pip-latest",
"state": "Help! My payouts have failed for 3 days.",
"questions": {
"frustration": {
"type": "score",
"instructions": "How frustrated is the customer?",
"criteria": ["Calm", "Frustrated", "Very angry"]
}
}
}
POST https://api.phronic.ai/v1/decide
Authorization: Bearer $PHRONIC_API_KEY
Content-Type: application/json
{
"model": "pip-latest",
"state": "Help! My payouts have failed for 3 days.",
"questions": {
"is_urgent": {
"type": "binary",
"instructions": "Does this need action today?",
"criteria": { "true": "Needs action today", "false": "Can wait" }
}
}
}
POST https://api.phronic.ai/v1/decide
Authorization: Bearer $PHRONIC_API_KEY
Content-Type: application/json
{
"model": "pip-latest",
"state": "Help! My payouts have failed for 3 days.",
"questions": {
"duration": {
"type": "extract",
"instructions": "How long has the problem lasted?",
"criteria": "A duration, copied as written"
}
}
}
POST https://api.phronic.ai/v1/decide
Authorization: Bearer $PHRONIC_API_KEY
Content-Type: application/json
{
"model": "pip-latest",
"state": "Help! My payouts have failed for 3 days.",
"questions": {
"team": {
"type": "choice",
"instructions": "Which team should handle this?",
"criteria": { "billing": null, "technical": null, "sales": null }
},
"escalate": {
"type": "binary",
"instructions": "Given the team, should this skip the queue?"
}
}
}
curl https://api.phronic.ai/v1/decide \
-H "Authorization: Bearer $PHRONIC_API_KEY" \
-H "Content-Type: application/json" \
-d '
{
"model": "pip-latest",
"state": "Help! My payouts have failed for 3 days.",
"questions": {
"team": {
"type": "choice",
"instructions": "Which team should handle this?",
"criteria": {
"billing": "Payments, invoices, refunds",
"technical": "Bugs, outages, integrations",
"sales": "Pricing, upgrades, new accounts"
}
}
}
}
'
curl https://api.phronic.ai/v1/decide \
-H "Authorization: Bearer $PHRONIC_API_KEY" \
-H "Content-Type: application/json" \
-d '
{
"model": "pip-latest",
"state": "Help! My payouts have failed for 3 days.",
"questions": {
"frustration": {
"type": "score",
"instructions": "How frustrated is the customer?",
"criteria": ["Calm", "Frustrated", "Very angry"]
}
}
}
'
curl https://api.phronic.ai/v1/decide \
-H "Authorization: Bearer $PHRONIC_API_KEY" \
-H "Content-Type: application/json" \
-d '
{
"model": "pip-latest",
"state": "Help! My payouts have failed for 3 days.",
"questions": {
"is_urgent": {
"type": "binary",
"instructions": "Does this need action today?",
"criteria": { "true": "Needs action today", "false": "Can wait" }
}
}
}
'
curl https://api.phronic.ai/v1/decide \
-H "Authorization: Bearer $PHRONIC_API_KEY" \
-H "Content-Type: application/json" \
-d '
{
"model": "pip-latest",
"state": "Help! My payouts have failed for 3 days.",
"questions": {
"duration": {
"type": "extract",
"instructions": "How long has the problem lasted?",
"criteria": "A duration, copied as written"
}
}
}
'
curl https://api.phronic.ai/v1/decide \
-H "Authorization: Bearer $PHRONIC_API_KEY" \
-H "Content-Type: application/json" \
-d '
{
"model": "pip-latest",
"state": "Help! My payouts have failed for 3 days.",
"questions": {
"team": {
"type": "choice",
"instructions": "Which team should handle this?",
"criteria": { "billing": null, "technical": null, "sales": null }
},
"escalate": {
"type": "binary",
"instructions": "Given the team, should this skip the queue?"
}
}
}
'
from phronic import Phronic
client = Phronic()
res = client.decide(
{
"model": "pip-latest",
"state": "Help! My payouts have failed for 3 days.",
"questions": {
"team": {
"type": "choice",
"instructions": "Which team should handle this?",
"criteria": {
"billing": "Payments, invoices, refunds",
"technical": "Bugs, outages, integrations",
"sales": "Pricing, upgrades, new accounts"
}
}
}
}
)
from phronic import Phronic
client = Phronic()
res = client.decide(
{
"model": "pip-latest",
"state": "Help! My payouts have failed for 3 days.",
"questions": {
"frustration": {
"type": "score",
"instructions": "How frustrated is the customer?",
"criteria": ["Calm", "Frustrated", "Very angry"]
}
}
}
)
from phronic import Phronic
client = Phronic()
res = client.decide(
{
"model": "pip-latest",
"state": "Help! My payouts have failed for 3 days.",
"questions": {
"is_urgent": {
"type": "binary",
"instructions": "Does this need action today?",
"criteria": { "true": "Needs action today", "false": "Can wait" }
}
}
}
)
from phronic import Phronic
client = Phronic()
res = client.decide(
{
"model": "pip-latest",
"state": "Help! My payouts have failed for 3 days.",
"questions": {
"duration": {
"type": "extract",
"instructions": "How long has the problem lasted?",
"criteria": "A duration, copied as written"
}
}
}
)
from phronic import Phronic
client = Phronic()
res = client.decide(
{
"model": "pip-latest",
"state": "Help! My payouts have failed for 3 days.",
"questions": {
"team": {
"type": "choice",
"instructions": "Which team should handle this?",
"criteria": { "billing": null, "technical": null, "sales": null }
},
"escalate": {
"type": "binary",
"instructions": "Given the team, should this skip the queue?"
}
}
}
)
{
"model": "pip-0.1",
"answers": {
"team": {
"type": "choice",
"choice": "billing",
"probabilities": { "billing": 0.91, "technical": 0.08, "sales": 0.01 },
"confidence": 0.86,
"evidence": [{ "text": "payouts have failed", "start": 9, "end": 28 }],
"abstained": false
}
},
"usage": { "input_tokens": 84, "output_tokens": 12 }
}
{
"model": "pip-0.1",
"answers": {
"frustration": {
"type": "score",
"score": 1.12,
"legend": { "0": "Calm", "1": "Frustrated", "2": "Very angry" },
"probabilities": { "0": 0.02, "1": 0.84, "2": 0.14 },
"confidence": 0.79,
"evidence": [{ "text": "Help!", "start": 0, "end": 5 }],
"abstained": false
}
},
"usage": { "input_tokens": 84, "output_tokens": 12 }
}
{
"model": "pip-0.1",
"answers": {
"is_urgent": {
"type": "binary",
"probability": 0.94,
"confidence": 0.9,
"evidence": [{ "text": "for 3 days", "start": 29, "end": 39 }],
"abstained": false
}
},
"usage": { "input_tokens": 84, "output_tokens": 12 }
}
{
"model": "pip-0.1",
"answers": {
"duration": {
"type": "extract",
"value": "3 days",
"confidence": 0.97,
"evidence": [{ "text": "3 days", "start": 33, "end": 39 }],
"abstained": false
}
},
"usage": { "input_tokens": 84, "output_tokens": 12 }
}
{
"model": "pip-0.1",
"answers": {
"team": {
"type": "choice",
"choice": "billing",
"confidence": 0.86,
"evidence": [{ "text": "payouts have failed", "start": 9, "end": 28 }],
"abstained": false
},
"escalate": {
"type": "binary",
"probability": 0.71,
"confidence": 0.64,
"evidence": [{ "text": "for 3 days", "start": 29, "end": 39 }],
"abstained": false
}
},
"usage": { "input_tokens": 84, "output_tokens": 12 }
}