Skip to main content
DocumentationDevelopers

Decisions

Ask Clef questions about a case and get calibrated numbers instead of text: likelihoods, choices and scores.

Documentation menu

Clef answers a set of questions about one state (a text or any JSON object) in a single call. It is built for routing and triage: every answer is a number you can put a threshold on.

Ask questions

curl
curl "$CCSIO_BASE_URL/systemone" \
  -H "Authorization: Bearer $CCSIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "clef",
    "state": {
      "ticket": 4312,
      "message": "Production has been down for two hours. This is the third outage this month and we will cancel the contract unless someone calls today."
    },
    "questions": {
      "urgent": { "type": "noul", "instructions": "Does this ticket need an answer within the hour?" },
      "team": {
        "type": "choice",
        "instructions": "Which team should take this ticket?",
        "criteria": {
          "billing": "Invoices, payments and refunds.",
          "technical": "Outages, errors and how the product works.",
          "sales": "Plans, upgrades and contracts."
        }
      },
      "frustration": {
        "type": "score",
        "instructions": "How frustrated is the customer?",
        "criteria": ["Calm.", "Annoyed.", "Angry.", "About to leave."]
      }
    }
  }'
JSON
{
  "model": "clef",
  "answers": {
    "urgent": { "type": "noul", "noul": 0.9542 },
    "team": {
      "type": "choice",
      "choice": "technical",
      "confidence": 0.927,
      "probabilities": { "billing": 0.0175, "technical": 0.927, "sales": 0.0556 }
    },
    "frustration": {
      "type": "score",
      "score": 2.8823,
      "confidence": 0.8997,
      "legend": { "0": "Calm.", "1": "Annoyed.", "2": "Angry.", "3": "About to leave." },
      "probabilities": { "0": 0.0035, "1": 0.0104, "2": 0.0863, "3": 0.8997 }
    }
  },
  "usage": { "input_tokens": 382, "output_tokens": 0 }
}

Question types

TypeYou sendYou get
noulA yes-or-no question in instructions.noul: the likelihood of yes, from 0 to 1.
choiceThe options in criteria, each with a description.choice, its confidence and the probabilities of every option.
scoreAn ordered scale in criteria.score on that scale, its confidence, the legend and the probabilities.
Explore the platform

Get your first API key

Registration is open. Four steps to your first call: create your account, create your organization, create your API key, and start using it.

  1. 01Create your account
  2. 02Create your organization
  3. 03Create your API key
  4. 04Start using it