Asking Jethro
An app with the jethro.call grant can ask the person's Jethro for help with what they're doing in it, such as summing up a long conversation or writing a reply. It reaches only Jethro, and only to ask. It can't name another Sol, read Jethro's conversations or change it.
Asking
Call from your back end, acting for the person:
curl -sS "$SOLEL_CORE_URL/api/jethro/ask" \
-H "Authorization: Bearer $SOLEL_APP_TOKEN" \
-H "X-Solel-Person: $PERSON" \
-H "Content-Type: application/json" \
-d '{"task": "Sum up this conversation in two short sentences.", "text": "Sam: I can grab the keys on the way down."}'
tasksays what to do, in up to 2,000 characters.textis what to do it with, up to 24,000 characters. It can be left out.- The answer is
{"answer": "…"}. Jethro answers as itself, straight from the model and without its tools, with only what was asked for. - Nothing is kept. No conversation is made, and nothing goes to Jethro's memory.
An answer can take a while, so give the request a generous timeout.
Naming Jethro
People can rename their Sols, so don't write "Jethro" in your app. Ask instead:
GET /api/jethroanswers{"name"}, what the person calls their Jethro.GET /api/jethro/faceis Jethro's face in a circle, smiling, as a picture, to show beside what it wrote. It's404until Jethro has one.
When it can't
| Answer | Why |
|---|---|
400 |
The task or text isn't right, with {"error"} saying how |
403 |
Your app wasn't granted jethro.call, or the person may not use Sols, such as a child. Leave Jethro out of your app for them |
502 |
The model isn't answering, or Jethro gave no answer |
503 |
Sols aren't set up on this server |
What your app shows
Jethro never sends, deletes or pays for anything without the person pressing the button. Show what Jethro wrote for the person to use, change or throw away.
Drafts from Sols
When someone asks their Sol to write an email, it leaves it in their Drafts for them to check and send. Solel hands it to the app that lists mail in its manifest's imports (see Importing), with POST /.solel/draft to its back end. Nothing is ever sent this way.
- Who's asking. Your app's own token, in
Authorization: BearerandX-Solel-Proxy-Token, andX-Solel-Person, whose draft it is. - The draft is JSON:
toandcc, lists of addresses likeSam Nguyen <sam@example.com>, andsubjectandbody, in plain text. - Answer
201or200with{"id"}once it's kept.400,413or422with{"error": "why"}turns it down, and the Sol tells the person why. Without anid, Solel takes it that your app can't take drafts.
You have 30 seconds to answer.
Older names
jethro.call was arch.call, and /api/jethro was /api/arch. A manifest that asks for arch.call gets jethro.call, and the old paths still work.