ThinkThen

Backends

Servers without System One

ThinkThen speaks one wire shape, System One. A server with another shape needs a small server in front of it that speaks System One.

What the server must do

  • Accept POST BASE/systemone with a JSON body.
  • Read the body below: the text in state, the model in model, and named questions in questions.
  • Answer every question by its name, with a probability for yes, or one probability for each option or level it was sent.
  • Name the model that answered.
  • Report the tokens it used under usage. Without them, check warns and the usage totals leave them out.
  • Serve https, or plain http on this machine only.
  • Take a bearer key, or no key on this machine.
The plan prints the exact body a server receives at BASE/systemone.
question="Does the customer ask for a refund?"

printf '%s\n' "I want to send this back." |
thinkthen decide "$question" \
  --url http://localhost:8080/v1 \
  --plan |
head -1 |
jq .request
Output
{
  "state": "Each question quotes the text it asks about.",
  "model": "jev-1.13.0",
  "questions": {
    "q1": {
      "type": "noul",
      "instructions": "The text is \"I want to send this back.\\n\". Does the customer ask for a refund?"
    }
  }
}
exit 0

The backends specification gives every field of the request and the reply.

Test that server

Point thinkthen check at that server. When no row is critical, every ThinkThen command works through it. The System One page shows the check.