Private beta · Early access
Cookbook
Support triage
Send a new ticket, get back the queue, the tags, and the reply you would send.
Private beta. InferenceIndex is changing fast. Models, endpoints, pricing and these docs may change without notice, so check back before you build on a detail.
The same kinds of tickets come in all day, and they get sorted and tagged the same way. On our tests, one repeat of this job took about 0.5s and $0.00009, versus about 10s and $0.012 for a frontier agent.
The job
- New each run: the customer, the order, and what went wrong.
- Same each run: your queues, your tags, and your reply policy.
The call
python
import json
from openai import OpenAI
client = OpenAI(api_key="YOUR_KEY", base_url="https://inferenceindex-skills-25534459979.us-east4.run.app/v1")
SKILL_ID = "skl_YOUR_SKILL_ID" # this job, saved once as a skill
POLICY = """Queues: billing, shipping, account, bug, other.
Return JSON with keys: queue, tags (list), priority (low|normal|urgent), reply_draft."""
def triage(ticket: str) -> dict:
response = client.chat.completions.create(
model="inferenceindex-0.1/" + SKILL_ID,
messages=[
{"role": "system", "content": "You triage support tickets. " + POLICY},
{"role": "user", "content": ticket},
],
)
return json.loads(response.choices[0].message.content)What comes back
An example reply for "I was charged twice for order 1842":
json
{
"queue": "billing",
"tags": ["refund", "duplicate-charge"],
"priority": "normal",
"reply_draft": "Sorry about that. I can see two charges on order 1842 and have started a refund for the duplicate."
}In production
- Route by
queuein your own code, the same way you do today. - Keep the queue list in the system prompt fixed. If you change it, those tickets can go to your fallback model.
- Tickets about something new go to your fallback model.