Skip to content
TypeSafe AITypeSafe console
IntroductionScore

PRIMITIVES / QUESTIONS

Score

Score asks for a calibrated value on an ordered rubric.

When to use Score

Use Score when an answer belongs on an ordered rubric. The public primitive accepts two to ten levels and can return a fractional position between them. A score near a boundary is different from a confident categorical choice.

Request structure

Write criteria in ascending order and keep one dimension per question. This local example rates the urgency of a support request.

{
  "questions": {
    "urgency": {
      "type": "score",
      "instructions": "How urgently does this request need attention?",
      "criteria": [
        "Can wait for the next planned review",
        "Needs a response during the next working day",
        "Blocks work that is happening now"
      ]
    }
  }
}

Ready to copy

Response

The numeric value, distribution and confidence answer different questions. The values below are invented to make the presentation inspectable.

FieldLocal fixtureMeaning
score1.72Position on a zero-based scale; three criteria produce a range from 0 to 2.
probabilities[0.02, 0.24, 0.74]Probability assigned to each ordered level.
confidence0.81A separate signal; it does not grant permission to take an action.
Reading a value between levels

A fractional result preserves information that a single category would lose. Choose thresholds from the needs of the application, and route uncertain decisions to a fallback.

Writing useful levels

Describe observable differences between adjacent levels. If one rubric combines urgency, sentiment and impact, split it into narrower questions so the returned score has one clear use.

Short labels help readers scan a result, but the criteria themselves need enough detail to distinguish the levels. Test edge cases at each boundary before using a threshold in production.

Was this page helpful?Choose a local response. Nothing is sent.
Type a page name. Results stay inside this reference.
Enlarged captured poster of the public TypeSafe Smart Home Demo
Still image from the public Loom embed. Open the poster link on the page to watch the original video.