SQLite functions that answer questions about text
Judge a whole table in one call, then join the answers back by key.
Install
| Channel |
|---|
.load ./thinkthen |
Set THINKTHEN_API_KEY in the environment.
A first call
.load ./thinkthen
CREATE TABLE messages(id INTEGER, body TEXT);
INSERT INTO messages VALUES
(1, 'Love the new dashboard, but export crashes ' ||
'the app,' || char(10) ||
'and I was charged twice.' || char(10));
SELECT id, thinkthen_tag(
'{"tag": "Which labels fit this message?",
"labels": ["praise", "bug", "billing"]}',
body) AS fitting_labels
FROM messages;What SQLite printed
1|["praise","bug","billing"]
Not sure comes back as NULL. Branch on it and send those cases to a person. Each function page shows its SQLite call.
Run facts
thinkthen_usage() gives the totals for the process.
Errors
A failure is an error whose text starts thinkthen <kind>: . The message follows, and the text ends with (retryable: yes) or (retryable: no).
Settings and recording
thinkthen_configure takes the settings as JSON. "record" writes a recording to a folder. "replay" answers from that recording with no connection. The Settings page lists every setting.
What is different in SQLite
- Only a query you type can call its functions. A view or trigger in an untrusted schema cannot call them to spend requests or read files.
On GitHub: github.com/botassembly/thinkthen