simodocs

Asking questions

Request options

Python
c.ask(state, questions,
      media=[...],            # images / videos for <image:N> / <video:N>
      model="simo-1-pro",     # override the client's model
      self_check=True,        # each Fill / Extract gets answer.check: calibrated P(the value is right)
      debias=3,               # read each Choice under 3 option orders and average (steadier, slower)
      two_pass=True,          # reads first, then decisions that see the values read
      derive={...},           # exact arithmetic over values read
      cache=False,            # skip the exact-request response cache
      request_id="ticket-17") # sent as x-request-id; quote it to support

Over HTTP, options go in an options object in the body. derive and media are top-level fields:

JSON
{"model": "simo-1-pro", "state": "...", "questions": {...},
 "options": {"self_check": 1, "debias": 3, "two_pass": 1, "cache": 0}}

self_check

Each Fill and Extract answer gets check: a calibrated probability that the value is right. It costs one extra decision per read.

Python
r = c.ask(invoice_text, {"amount": Fill("the total due, in dollars", kind="number")}, self_check=True)
if r["amount"].check < 0.9:
    send_for_review(r["amount"].parsed)

debias

Reads each Choice under several option orders and averages them. Use it when option order might sway a choice: long lists, or options that are similar. debias=3 costs about three reads of each choice.

two_pass and derive

When a decision depends on a value in the input (a date, an amount), have Simo read the value first and decide with it written in front of the model. derive adds exact arithmetic over the values read. See Read first, then decide.

cache

An exact repeat of a request is answered from a cache, and r.timing.response_cache says so. Pass cache=False ("cache": 0) to bypass it, for example when benchmarking.

model

The model for this call. Defaults to the client's model, simo-1-pro. See Models.

request_id

Sent as the x-request-id request header. The service's own id for the request is in r.request_id; log it with any failure you report to support.

ask_json

c.ask_json(request_dict, **options) sends a request already in the wire format, for example loaded from a file.