Levanto Sage

v1.7.0
io.github.levantolabs/levanto Checked 5 hours ago Published 6 hours ago

Typed 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…

ParameterTypeDescription
kind *stringThe type of decision.
contentstringThe text to judge. With an image file, the context to judge it with.
filestringPath to a local text file or a PNG, JPEG or WebP image to judge. Text is added after content.
instructionsstringThe question or rule, as you would brief a careful colleague. Required, except for tags.
itemsarraysort only: the things to order (2-120). Put any context in instructions.
levelsarrayscale only: 2-26 distinct whole numbers, e.g. 1 to 5, each best with a one-line description.
optionsarraychoice only: 2-256 options (20 with an image). A one-line description makes each option clearer.
reasoningstringoff (default) answers at once. auto thinks first when the rule is long or multi-step; on always thinks. Slower.
tagsarraytags only: 1-120 tags. name is the label plus one line of meaning.
web_searchbooleanSearch 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.

ParameterTypeDescription
documents *arrayThe documents, each with content or file (or items, for sort), and its questions.
reasoningstringoff (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…

ParameterTypeDescription
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…
contentstringThe document text.
filestringPath 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.

ParameterTypeDescription
documents *arrayUp 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…