Omni.Dialects.TypeSafeSystemOne (Omni v2.0.0)

Copy Markdown View Source

Dialect implementation for the System One decision format.

System One is TypeSafe's decision API and the de facto open standard, served by TypeSafe, OpenRouter, OpenCode Zen, Ollama and others at <base_url>/systemone. See Omni.Dialect.Decision for the behaviour.

Encoding

  • The state and each question's instructions are parts: one part is sent on its own (a text part as a string, a data part as an object), several as an array of them.
  • Questions go in a map keyed by name. A predicate is a noul question, and its criteria become {"true": ..., "false": ...}.
  • Choices are sent as {key: description}, a nil description meaning the choice is judged by its key.
  • Levels are sent as a list of descriptions, lowest first; a level with no description sends its key. System One numbers levels by position, so the keys only map the answer back.

Answers

Probabilities come back keyed by choice name or level index and are mapped to the question's keys, in the question's order. The level legend is dropped as redundant. A refused question ({"type": "refusal"}, which OpenRouter documents) is answered with an Omni.Answer.Refusal; the others are still answered.

Compat flags

None yet. Hosts differ in option caps (26 choices on some), whether instructions is required, and confidence formulas; Omni leaves caps to the provider and passes confidence through.