filter options
The command takes QUESTION or @FILE. It reads one record per line. A pointer from --field or a question file makes it read JSON Lines. Start with its value and exit code.
| Option | What it does |
|---|---|
--threshold T | The bar a record must reach. The default is 0.5. A band is a usage error. |
--true TEXT | What a yes means, in the words the model reads. |
--false TEXT | What a no means. |
--input FILE | Reads the evidence from a file instead of standard input. |
--plan | Prints the plan and sends nothing. It needs no key. |
--lines, --jsonl, --csv, --tsv | Says how a stream of records is framed. Pick at most one. |
--field POINTER | Names the part of each record to judge, as a JSON Pointer. It may repeat. |
--jobs N | How many requests run at once, from 1 to 32. The default is 4. It works on a stream of records, annotate on one document, and relate on one entity set. |
--model NAME | The model the request carries. Name a version to pin a run. The default is jev-1.13.0. |
--url BASE | The server's base address. It outranks THINKTHEN_BASE_URL. |
--timeout SECONDS | How long one attempt may take. The default is 30. |
--max-retries N | How many times a retried status is sent again. A transport failure is never sent again. The default is 3. |
--record DIR | Calls the backend and saves each exchange in DIR. |
--replay DIR | Answers from DIR alone, with no key and no network. |
--cache DIR | Answers from DIR when it can and saves new exchanges there. |
--no-cache | Turns off the answer cache for one run. |
--profile FILE | Applies local backend limits and names the calibration profile in use. |
More examples
The zipper, the color, and the strap are about the item. They stay, and the early delivery drops out.
question="Is this about the item itself?"
yes="Its build, size, color, or parts."
no="Delivery, price, or service."
cat <<'EOF' |
Arrived a day early. Thank you!
The zipper broke the first time I used it.
Does this come in blue?
The strap snapped on day two.
EOF
thinkthen filter "$question" \
--batch 1 \
--true "$yes" \
--false "$no"Output
The zipper broke the first time I used it. Does this come in blue? The strap snapped on day two.
exit 0: the run finished
Only R-2 complains, and it comes back as one JSON object, id and all.
question="Is this a complaint?"
cat <<'EOF' |
id,comment
R-1,Arrived a day early. Thank you!
R-2,The zipper broke the first time I used it.
R-3,Does this come in blue?
EOF
thinkthen filter "$question" \
--batch 1 \
--csv \
--field /comment |
jq .Output
{
"id": "R-2",
"comment": "The zipper broke the first time I used it."
}exit 0
On GitHub: github.com/botassembly/thinkthen