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/systemonewith a JSON body. - Read the body below: the text in
state, the model inmodel, and named questions inquestions. - 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,checkwarns and the usage totals leave them out. - Serve
https, or plainhttpon 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 .requestOutput
{
"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.
On GitHub: github.com/botassembly/thinkthen