TypeSafe Evaluate

TypeSafe Evaluate

Certified

Evaluate content with TypeSafe

Evaluates a state against a map of typed questions via the TypeSafe System One API and returns one structured answer per question.

yaml
type: io.kestra.plugin.typesafe.Evaluate

Evaluate urgency and department

yaml
id: typesafe_evaluate
namespace: company.team

tasks:
  - id: evaluate
    type: io.kestra.plugin.typesafe.Evaluate
    apiKey: "{{ secret('TYPESAFE_API_KEY') }}"
    model: jev-latest
    state: Help! My payouts have been failing for 3 days.
    questions:
      is_urgent:
        type: NOUL
        instructions: Does this convey urgency?
      department:
        type: CHOICE
        instructions: Which team should handle this?
        options:
          billing: Payments, invoicing, refunds
          technical: Bugs, outages, integrations
          sales: Pricing, upgrades, new accounts

Rate content with a score question

yaml
id: typesafe_score
namespace: company.team

tasks:
  - id: score
    type: io.kestra.plugin.typesafe.Evaluate
    apiKey: "{{ secret('TYPESAFE_API_KEY') }}"
    state: "Customer is very frustrated with the service"
    questions:
      frustration:
        type: SCORE
        instructions: How frustrated is the customer?
        levels:
          - Calm
          - Frustrated
          - Very angry
Properties

TypeSafe API key

Bearer token sent in the Authorization header; store it as a secret.

Questions

A map of typed questions, keyed by an id you choose; answers come back under the same ids.

Definitions

A typed question evaluated against a state. Use options for CHOICE, levels for SCORE, and whenTrue/whenFalse for NOUL.

instructionsstringobjectarray

Instructions

The question to evaluate. Accepts a string or structured JSON (object or array); put the question in one field and data it refers to in the others.

levelsarray

Score levels

Only for SCORE questions: an ordered array of level descriptions. At least 2 levels, at most 10.

optionsobject

Choice options

Only for CHOICE questions: a map of option name to rubric description (use null when an option needs no extra detail). Maximum 255 options.

typeobject
whenFalseobject

Noul 'no' criteria

Only for NOUL questions: what a no answer (value near 0) means. Accepts a string or structured JSON.

whenTrueobject

Noul 'yes' criteria

Only for NOUL questions: what a yes answer (value near 1) means. Accepts a string or structured JSON.

State

The content to evaluate: a plain string for text, or structured data (object or array) for things like chat logs or records.

Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.

Definitions
assetFailureBehaviorstring
Possible Values
IGNOREFAILWARN

Asset failure behavior

Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.

enableAutobooleanstring

Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.

inputsarray

The assets consumed as inputs.

id*string
Min length1
typestring
outputs

The assets produced as outputs.

id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*string
Min length1

Custom asset type

descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
Defaulthttps://api.typesafe.ai

TypeSafe base URL

Base URL of the TypeSafe API. Override it to target a mock server in tests.

Defaultjev-latest

Model

The model that handles the request, e.g. jev-latest. The response reports the versioned model id that answered.

Answers

One answer per question, keyed by the same ids used in questions.

Definitions

The structured answer for one question. Only the fields matching the question type are populated.

choicestring

Choice selection

Only for CHOICE answers: the highest-probability option.

confidencenumber

Confidence

Only for CHOICE and SCORE answers: how certain the model is, between 0 and 1, derived from the probability distribution.

legendobject
SubTypestring

Score legend

Only for SCORE answers: each level number mapped back to its description.

noulnumber

Noul probability

Only for NOUL answers: the probability the answer is yes, on a scale from 0 (no) to 1 (yes).

probabilitiesobject
SubTypenumber

Probabilities

Only for CHOICE and SCORE answers: every option (or level) mapped to its probability (floats that sum to 1).

scorenumber

Score value

Only for SCORE answers: the probability-weighted answer across the levels; can land between levels.

typeobject

Model

The versioned model id that performed the evaluation.

Unittokens

Number of input tokens reported by the TypeSafe API for the request.

Unittokens

Number of output tokens reported by the TypeSafe API for the request.