ByteChef LogoByteChef

TypeSafe AI

TypeSafe AI answers typed questions about a piece of content with structured values instead of generated text: a truth value (Noul), a selected label (Choice) or a position on a rubric (Score).

Categories: Artificial Intelligence

Type: typesafe/v1


Connections

Version: 1

Bearer Token

Properties

NameLabelTypeDescriptionRequired
tokenTokenSTRINGYour TypeSafe AI API key. A self-hosted System One server that does not check keys accepts any value.true
baseUrlBase URLSTRINGThe System One server that answers POST /v1/systemone. Keep the default for Jev, or point it at a self-hosted server of an open decision model, such as Laya (http://localhost:8000) or Ollama (http://localhost:11434).true

Connection Setup

  1. Sign in to your TypeSafe AI account.
  2. Open the API keys page of the dashboard.
  3. Create a new API key and copy it.
  4. Use the key as the Token of a new TypeSafe AI connection in ByteChef.

Actions

Noul

Name: noul

Ask a yes/no question about the state. The answer is a truth value between 0 and 1 rather than a boolean; there is no separate confidence, because the value already is the certainty.

Properties

NameLabelTypeDescriptionRequired
modelModelSTRINGID of the Jev model to use. The jev-latest and jev-preview aliases resolve server-side; pick a pinned version to keep answers stable across model releases. A self-hosted System One server takes its own model names, for example laya on Ollama.true
stateStateSTRINGThe content the question is answered against. Text, or a JSON object or array mapped from a previous step; name a field of an object in the instructions to point the question at it.true
instructionsInstructionsSTRINGThe yes/no question to ask, e.g. "Does this message convey urgency?"true
whenTrueWhen TrueSTRINGWhat a true answer means, written as a statement about the state, e.g. "The customer needs help within the hour".false
whenFalseWhen FalseSTRINGWhat a false answer means, written as a statement about the state, e.g. "The request can wait for the normal queue".false
thresholdThresholdNUMBERThe truth value at or above which Is True is reported as true.false

Example JSON Structure

{
  "label" : "Noul",
  "name" : "noul",
  "parameters" : {
    "model" : "",
    "state" : "",
    "instructions" : "",
    "whenTrue" : "",
    "whenFalse" : "",
    "threshold" : 0.0
  },
  "type" : "typesafe/v1/noul"
}

Output

Type: OBJECT

Properties

NameTypeDescription
typeSTRINGThe answer type, always noul.
noulNUMBERThe truth value, between 0 (false) and 1 (true).
isTrueBOOLEAN
Options true, false
Whether the truth value reached the threshold.
modelSTRINGThe model version the request resolved to, e.g. jev-1.13.0 for jev-latest.
usageOBJECT
Properties {INTEGER(input_tokens), INTEGER(output_tokens)}
Token usage of the request.

Output Example

{
  "type" : "",
  "noul" : 0.0,
  "isTrue" : false,
  "model" : "",
  "usage" : {
    "input_tokens" : 1,
    "output_tokens" : 1
  }
}

Choice

Name: choice

Pick exactly one label from a fixed set of options. Returns the selected label, a probability for every option and a confidence. A choice always names a winner, even when no option fits; ask a separate Noul if "none of these" is a real outcome.

Properties

NameLabelTypeDescriptionRequired
modelModelSTRINGID of the Jev model to use. The jev-latest and jev-preview aliases resolve server-side; pick a pinned version to keep answers stable across model releases. A self-hosted System One server takes its own model names, for example laya on Ollama.true
stateStateSTRINGThe content the question is answered against. Text, or a JSON object or array mapped from a previous step; name a field of an object in the instructions to point the question at it.true
instructionsInstructionsSTRINGThe question to answer by picking an option, e.g. "Which team should handle this?"true
optionsOptionsARRAY
Items [{STRING(label), STRING(description)}]
The labels to choose from. Labels must be unique.true

Example JSON Structure

{
  "label" : "Choice",
  "name" : "choice",
  "parameters" : {
    "model" : "",
    "state" : "",
    "instructions" : "",
    "options" : [ {
      "label" : "",
      "description" : ""
    } ]
  },
  "type" : "typesafe/v1/choice"
}

Output

Type: OBJECT

Properties

NameTypeDescription
typeSTRINGThe answer type, always choice.
choiceSTRINGThe label of the selected option.
probabilitiesOBJECT
Properties {}
The probability of every option, keyed by label; they sum to one.
confidenceNUMBERHow concentrated the probabilities are on the selected option, 0 to 1.
modelSTRINGThe model version the request resolved to, e.g. jev-1.13.0 for jev-latest.
usageOBJECT
Properties {INTEGER(input_tokens), INTEGER(output_tokens)}
Token usage of the request.

Output Example

{
  "type" : "",
  "choice" : "",
  "probabilities" : { },
  "confidence" : 0.0,
  "model" : "",
  "usage" : {
    "input_tokens" : 1,
    "output_tokens" : 1
  }
}

Score

Name: score

Place the state on an ordered rubric. The score is continuous and probability-weighted: 1.1 on a three-level rubric sits just past level 1, leaning toward level 2, so a threshold such as 2.0 is a real threshold rather than a rounding artefact.

Properties

NameLabelTypeDescriptionRequired
modelModelSTRINGID of the Jev model to use. The jev-latest and jev-preview aliases resolve server-side; pick a pinned version to keep answers stable across model releases. A self-hosted System One server takes its own model names, for example laya on Ollama.true
stateStateSTRINGThe content the question is answered against. Text, or a JSON object or array mapped from a previous step; name a field of an object in the instructions to point the question at it.true
instructionsInstructionsSTRINGThe question the rubric answers, e.g. "How frustrated is the customer?"true
levelsLevelsARRAY
Items [STRING]
The rubric, ordered from the lowest level (0) to the highest. Keep the levels genuine degrees of one thing; if they are alternatives, use Choice instead.true

Example JSON Structure

{
  "label" : "Score",
  "name" : "score",
  "parameters" : {
    "model" : "",
    "state" : "",
    "instructions" : "",
    "levels" : [ "" ]
  },
  "type" : "typesafe/v1/score"
}

Output

Type: OBJECT

Properties

NameTypeDescription
typeSTRINGThe answer type, always score.
scoreNUMBERThe probability-weighted level, between 0 and the highest level index.
legendOBJECT
Properties {}
The description of every level, keyed by level index.
probabilitiesOBJECT
Properties {}
The probability of every level, keyed by level index.
confidenceNUMBERHow concentrated the probabilities are, 0 to 1.
nearestLevelINTEGERThe index of the most probable level.
nearestLabelSTRINGThe description of the most probable level.
modelSTRINGThe model version the request resolved to, e.g. jev-1.13.0 for jev-latest.
usageOBJECT
Properties {INTEGER(input_tokens), INTEGER(output_tokens)}
Token usage of the request.

Output Example

{
  "type" : "",
  "score" : 0.0,
  "legend" : { },
  "probabilities" : { },
  "confidence" : 0.0,
  "nearestLevel" : 1,
  "nearestLabel" : "",
  "model" : "",
  "usage" : {
    "input_tokens" : 1,
    "output_tokens" : 1
  }
}

Ask Questions

Name: askQuestions

Ask several named questions about the state in one request, each a Noul, a Choice or a Score. Jev answers them all from the same read of the state, so several narrow questions cost about as much as one and are cheaper and faster than separate actions.

Properties

NameLabelTypeDescriptionRequired
modelModelSTRINGID of the Jev model to use. The jev-latest and jev-preview aliases resolve server-side; pick a pinned version to keep answers stable across model releases. A self-hosted System One server takes its own model names, for example laya on Ollama.true
stateStateSTRINGThe content the question is answered against. Text, or a JSON object or array mapped from a previous step; name a field of an object in the instructions to point the question at it.true
questionsQuestionsARRAY
Items [{STRING(name), STRING(type), STRING(instructions), STRING(whenTrue), STRING(whenFalse), NUMBER(threshold), [{STRING(label), STRING(description)}](options), [STRING](levels)}]
The questions to ask. Each answer is returned under the question's name.true

Example JSON Structure

{
  "label" : "Ask Questions",
  "name" : "askQuestions",
  "parameters" : {
    "model" : "",
    "state" : "",
    "questions" : [ {
      "name" : "",
      "type" : "",
      "instructions" : "",
      "whenTrue" : "",
      "whenFalse" : "",
      "threshold" : 0.0,
      "options" : [ {
        "label" : "",
        "description" : ""
      } ],
      "levels" : [ "" ]
    } ]
  },
  "type" : "typesafe/v1/askQuestions"
}

Output

Type: OBJECT

Properties

NameTypeDescription
answersOBJECT
Properties {}
The answer to every question, keyed by its name. Each answer has the shape the matching Noul, Choice or Score action returns, without model and usage.
modelSTRINGThe model version the request resolved to, e.g. jev-1.13.0 for jev-latest.
usageOBJECT
Properties {INTEGER(input_tokens), INTEGER(output_tokens)}
Token usage of the request.

Output Example

{
  "answers" : { },
  "model" : "",
  "usage" : {
    "input_tokens" : 1,
    "output_tokens" : 1
  }
}

How is this guide?

Last updated on

On this page