Chapter 7½: inside ask/src

lib.rs, top to bottom:

  1. The page's small rules: MAX_INPUT_CHARS, THRESHOLD and is_yes, SURE and is_sure, likelihood, and clean (what is done to an input before it is asked: trimmed, and cut to 500 characters).
  2. Reading the kind: ALSO, kind_probability, readings, and question_id, which is how four facts share one question.
  3. The questions: fact_question (the eight from chapter 7, word for word), drafted_question (what the LLM wrote, as a Jev question), and check.
  4. The request: Wanted, wanted, and Prepared, which holds the exact bytes that will be sent.
  5. The answers: learned, Judged, judged, and the Outcome of a call, with send for a live call and read for a kept one.

tests.rs checks, among other things, that the body the page shows is the body the client sends (the_request_shown_is_the_request_sent), against a scripted transport, so no Jev key is needed.

Try it. cargo test -p ask.

FileWhat
lib.rsThe questions put to Jev, the request, and the record of each call.
tests.rsRequests, answers and kept responses, against a scripted transport.

← Previous: Chapter 7, ask/ · Up: ask · Next: Chapter 8, llm/ →