Asking the server’s Sol
On this page
An app with the jethro.call grant can ask the server’s Sol, the one every person on the server has, for help with what they’re doing in it, such as summing up a long conversation or writing a reply. It reaches only that Sol, and only to ask. It can’t name another Sol, read the Sol’s conversations or change it.
Asking# Link to: 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": "…"}. The Sol 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 the Sol’s memory.
An answer can take a while, so give the request a generous timeout.
Naming the Sol# Link to: Naming the Sol
People name their Sols themselves, so don’t write a name for it in your app. Ask instead:
GET /api/jethroanswers{"name"}, what the person calls it.GET /api/jethro/faceis the Sol’s face in a circle, smiling, as a picture, to show beside what it wrote. It’s404until the Sol has one.
When it can’t# Link to: 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 the Sol out of your app for them |
502 |
The model isn’t answering, or the Sol gave no answer |
503 |
Sols aren’t set up on this server |
What your app shows# Link to: What your app shows
The Sol never sends, deletes or pays for anything without the person pressing the button. Show what it wrote for the person to use, change or throw away.
Drafts from Sols# Link to: 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.
Names in the API# Link to: Names in the API
The grant and the paths say jethro, the Sol’s name while was being built. They’re only names in the API, and people never see them.
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.