Jev invoice amount role selection

Jev invoice amount role selection. Which supplied candidate is explicitly the total due?

Use the surrounding wording to select one pre-parsed amount identifier, leaving exact copying and arithmetic to code.

Which supplied candidate is explicitly the total due?Live API
Try an example

Original input for the Candidate A outcome. Edit the evidence to send a new request.

Source: Background discussion on X

Source and example scope

These fictional inputs and decision rules were written for this page. The linked X discussion provides background; the technical implementation follows TypeSafe's Choice contract.

Select the candidate explicitly identified as total due.

Decision rules and labels
Candidate ACandidate BCandidate CNone of theseNeed evidence
A real response from the Jev API

Edit any input to explore a different decision. No request is sent until you run it.

Your next decision

Not run yet

Choose an example or write your own input, then run it to see the ranked choices.

Results are not stored by this site. Your submitted text is processed by the API provider.

The decision

Choose a role without asking the model to calculate.

The same numeric value can appear under a different candidate identifier. The model reads the surrounding wording and chooses the identifier whose span is explicitly total due. A consumer can then copy that stored span unchanged.

The missing-total fixture supplies numbers that could tempt a calculation. The rule forbids that calculation and requires None of these when no supplied candidate is labeled total due. Exact arithmetic belongs in ordinary code.

The source mentions replacing regex-heavy parsers, while the official TypeSafe cookbook explains pre-parsed span selection. This original demo uses fixed fictional candidates; it does not parse a live invoice or initiate payment.

These fictional inputs and decision rules were written for this page. The linked X discussion provides background; the technical implementation follows TypeSafe's Choice contract.

Conceptual illustration of supplied evidence entering a typed decision contract.
Shared conceptual illustration of the input contract; not a screenshot or measured performance result.
How it works

Run invoice amount role selection in four steps.

Use the supplied facts to inspect one bounded decision before connecting it to a larger workflow.

  1. Illustration of adding the text or evidence for a decision

    Supply the evidence

    Supply the extracted candidate IDs, exact spans and surrounding invoice wording. Extraction and structural validation should happen before this semantic selection.

  2. Illustration of defining a question and its allowed choices

    Read the allowed outcomes

    The decision rule and the choice labels are sent with the evidence. Keep Need evidence available when required facts are missing. A strong leading probability cannot supply a hidden fact.

  3. Illustration of sending one input and comparing the returned choices

    Run and inspect the distribution

    The window makes a fresh server-side API request. It displays the highest-probability label, elapsed request time and estimated token cost. A provider failure produces an error, not a missing-evidence label.

  4. Illustration of reviewing a result and an uncertain item before using it

    Replay a pending local result

    Preview a candidate identifier. Code must validate the identifier and copy the original span; no payment or amount calculation occurs. Download the requests and saved observations. The offline consumer validates their hashes and prints a pending packet without executing it.

Our API test

Recorded API observations

Recorded API observations
Original inputObserved labelLeading probability
A is payableCandidate A100%
B is payableCandidate B100%
C is payableCandidate C99.0%
No total statedNone of these99.0%
Do not calculate a missing totalNone of these99.0%
Candidate list absentNeed evidence100%

These are six original synthetic inputs, tested once per request revision. The percentage is the leading option probability, not measured accuracy. Authored expectations and any disagreements remain in the downloadable evidence. 6 of 6 results matched the authored fixture expectations.Verified

Worked example

Replay the exact requests

Compare each saved result with its authored expectation. A disagreement remains in the fixture review; the call is not repeated to obtain a preferred label.

The single-request SDK runner uses your private TYPESAFE_API_KEY. The offline consumer reads saved observations, checks request hashes and prints a pending output. It does not call the model or change any external system.

Sample requests and authored expectations

Saved API observations

Single-request SDK runner

Offline preview consumer

Compare other decision examples

Runnable offline example

Run one sample, then inspect the local packet

View the code example
Single-request replay
npm install @typesafe-ai/sdk@0.6.0
# Set TYPESAFE_API_KEY privately in your shell.
node run-choice-sample.mjs samples.json case-1
python preview_choice_workflow.py samples.json saved-api-results.json
Scope of this demo

Where this decision fits

Useful scope

  • Choosing a semantic role among already extracted spans
  • Testing missing-total and reordered candidates
  • Keeping exact value handling in ordinary code

Outside this demonstration

  • Inventing an amount absent from the candidate set
  • Using the model for arithmetic or payment authorization
  • Assuming a fictional invoice is authentic
Example FAQ

Questions about invoice amount role selection.

The rubric explains the decision; the application owns the next step.

Does Candidate A contain a computed amount?

No. It is an identifier for a span already supplied by the caller. The model does not calculate or rewrite the amount.

What if the total was not extracted?

Keep None of these available. Improve the extraction step or request more evidence instead of making the model invent a candidate.

Does the leading probability measure production accuracy?

No. It is the model distribution for this one request. The six examples are functional checks with authored expectations, not a representative benchmark. Inspect disagreements and evaluate your own examples before using the label.

What happens when the API fails?

The window shows an error and supplies no fresh judgment. The downloadable runner sends one request without retries. Need evidence is a valid outcome about incomplete input; it does not stand in for a network or provider failure.

Try your own invoice amount role selection input

Edit the evidence above or use the Playground to test another bounded question.