Levanto Sage
v1.7.0Typed decisions (yes/no, choice, score, order, tags) and field extraction from Levanto Sage.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
decide Decide with Sage
Answer a question about content with a typed decision. kind: - yesno: answer "yes", "no" or null, and probability (P(yes)). - choice: one of options (2-256, 20 with an image); chosen is null when too close to call. - scale: levels (2-26 whole numbers); returns expectation (fractional level) and confidence. - sort: items to order best first by the instructions; returns sorted item ids. - tags: which tags apply (1-120); each tag's applies is true, false or null. Put the rule in instructions and the facts in content (or file). Content: up to 32K tokens (128K on the Growth plan). null means not su…
| Parameter | Type | Description |
|---|---|---|
kind * | string | The type of decision. |
content | string | The text to judge. With an image file, the context to judge it with. |
file | string | Path to a local text file or a PNG, JPEG or WebP image to judge. Text is added after content. |
instructions | string | The question or rule, as you would brief a careful colleague. Required, except for tags. |
items | array | sort only: the things to order (2-120). Put any context in instructions. |
levels | array | scale only: 2-26 distinct whole numbers, e.g. 1 to 5, each best with a one-line description. |
options | array | choice only: 2-256 options (20 with an image). A one-line description makes each option clearer. |
reasoning | string | off (default) answers at once. auto thinks first when the rule is long or multi-step; on always thinks. Slower. |
tags | array | tags only: 1-120 tags. name is the label plus one line of meaning. |
web_search | boolean | Search the web before deciding, for factual or recent questions the content doesn't settle. Not with sort or images. Each search is charged. |
decide_batch Decide with Sage, in batch
Several decisions in one call: a list of documents, each with one or more questions about it. Use it instead of many decide calls, e.g. the same question over many items, or several questions about one document. A document's content is counted once for all its questions. Each question takes the same fields as decide plus an optional id. For sort, the document gives items instead of content or file, and all its questions are sort. Returns, per document in order, each question's answer as decide returns it, or its error. null means not sure.
| Parameter | Type | Description |
|---|---|---|
documents * | array | The documents, each with content or file (or items, for sort), and its questions. |
reasoning | string | off (default) answers at once. auto thinks first when the rule is long or multi-step; on always thinks. Slower. |
extract Extract with Sage
Pull typed values out of a document. fields maps each name to: - a description string ("" if the name says it all), - {"type", "definition"} with type text, integer, decimal, money, date, time, datetime, duration, - or a one-item list of either, for every mention (["a product billed"]). fields can also be a question string (one answer) or [question] (every answer). Returns values (null when the document doesn't state it or Sage isn't sure) and, per field, its source: found (text, offsets, probability), absent or undecided. Values come only from what the text states: extract the parts and compu…
| Parameter | Type | Description |
|---|---|---|
fields * | What to find: an object of field name → spec (up to 256 fields; past 64, the document is read again, and charged, per 64), a question string for one answer, or [question] for every answer. A spec is… | |
content | string | The document text. |
file | string | Path to a local text file to read instead of, or after, content. |
extract_batch Extract with Sage, in batch
The same fields from up to 64 documents in one call. fields works as in extract. Returns, per document in order, its values and sources as extract returns them, or its error.
| Parameter | Type | Description |
|---|---|---|
documents * | array | Up to 64 documents, each with content or file (a local text file). |
fields * | What to find: an object of field name → spec (up to 256 fields; past 64, the document is read again, and charged, per 64), a question string for one answer, or [question] for every answer. A spec is… |