Skip to content

Releases: vsekhar/decide

decide 0.4.1

Choose a tag to compare

@vsekhar vsekhar released this 27 Sep 22:24

--api-key - reads the API key from standard input, so the key stays out of your shell history and out of ps. At a terminal, decide prompts with API key: and turns echo off while you type. From a pipe it reads one line with no prompt. A bare --api-key with no value does the same. Both the run line and --set-config take it, so setup is now:

brew install vsekhar/tap/decide
decide --set-config --model typesafe:jev-latest --api-key -

A script pipes it: printf '%s' "$KEY" | decide --set-config --api-key -.

  • An empty key, end of file, or standard input that does not read exits 10 and writes no config.
  • - still reads standard input once per run: --api-key - beside --context - or --questions - is refused.
  • Ctrl-C at the prompt puts the terminal back before the process ends.
  • --help, the README's setup and command line configuration sections, and TESTING.md describe the flag.

decide 0.4.0

Choose a tag to compare

@vsekhar vsekhar released this 27 Sep 19:21

Two new flags, and the README's Streaming example now runs as written.

  • --context-json: a context whose value is parsed as JSON, so the model sees its structure: objects, arrays, numbers, and booleans, not one string. It takes every form --context takes: <json>, @<path>, and -, each with <name>= in front. A value that is not valid JSON exits 10 before any model call. Compact JSON with an = inside a string, such as a URL with a query or a base64 field, parses.
  • --each: decide once per line of standard input. Each line is one event, and the - context holds it; the questions run once per event, in order. With --json, every event prints exactly one line: its answers, its fallbacks, or an error record. An unsure event, a remote error, a line that is not valid JSON or UTF-8, and a context too large for the model are per event, and the final code is the highest code any event produced. Lines are read as they arrive, so a live producer such as tail -f works.

decide 0.3.0

Choose a tag to compare

@vsekhar vsekhar released this 24 Sep 05:21

Question files, named questions, and richer plain output.

Question files

  • --questions @file reads questions from a file, in the flag's place. It repeats and mixes with questions on the line.
  • A text file mimics the command line: shell-like quoting and # comments. It holds questions and their flags only.
  • A JSON file (one that starts with {) names questions, describes options and levels with summary, not_for, examples, and signals, and gives structured instructions with rules. A fault names the file and the JSON path.

Questions and output

  • --name names a question. A named question prints as name=answer, and the name is its key in --json.
  • --json prints one JSON object keyed by question, with each answer's kind, confidence, and probabilities.
  • --stats adds a question's confidence, probability, and a rating's score to its line. --distribution adds every option, level, or side with its probability. Fields are tab-separated, values in a field space-separated.
  • Several --context name=... flags compose one JSON object the questions can refer to by name.
  • --model and --api-key on the command line win over every setting for one run.

decide 0.2.0

Choose a tag to compare

@vsekhar vsekhar released this 23 Sep 04:19

What's new

  • --context is optional. A question that carries its own facts runs with no context: decide "Is Atlanta the capital of Georgia?" prints yes.
  • Config files. decide reads .decide/config from the working directory and each parent up to your home directory, then ~/.config/decide/config and ~/.decide/config. Files hold KEY = "value" lines for DECIDE_MODEL and DECIDE_MODEL_API_KEY, a subset of TOML. The nearest file wins per key, and the environment wins over every file. DECIDE_MODEL_API_KEY may appear only in the home files, so a key never lands in a repository. Any problem in a file exits 10 with a message naming the file and line.
  • --set-config. decide --set-config --model typesafe:jev-latest --api-key <key> writes those settings to ~/.config/decide/config, changing only those lines and keeping the rest of the file, comments included. --project writes ./.decide/config instead.
  • Built on DecisionModels 0.3.0.

Install

brew install vsekhar/tap/decide

decide 0.1.2

Choose a tag to compare

@vsekhar vsekhar released this 23 Sep 00:55

Adds --version, which prints the version and exits, and shows the version at the top of --help. Install with brew install vsekhar/tap/decide.

decide 0.1.1

Choose a tag to compare

@vsekhar vsekhar released this 22 Sep 06:42

Bugfix release. DecisionModels 0.2.2 drops the SwiftUI macro that needed Xcode, so the Command Line Tools now build decide. Install with brew install vsekhar/tap/decide.

decide 0.1.0

Choose a tag to compare

@vsekhar vsekhar released this 22 Sep 05:35

First release. Install with brew install vsekhar/tap/decide.