Class JevClient

java.lang.Object
xyz.tcheeric.jev.JevClient
All Implemented Interfaces:
AutoCloseable

public final class JevClient extends Object implements AutoCloseable
The one entry point into the evaluator.

A caller hands over a state and a fan-out of named, typed questions, and gets back the typed answers keyed by those names, in a single request. The client owns bearer auth, the request timeout, and retry with exponential backoff and jitter.

It owns nothing else. There is no method here that counts an answer, compares a date, or turns a probability into a decision (ADR 0002). Several consumers are ranked for this library and each calibrates its own thresholds; a convenience such as isSpam() would quietly make this library the owner of all of their judgement calls.

  • Constructor Details

    • JevClient

      public JevClient(JevConfig config)
    • JevClient

      public JevClient(JevConfig config, JevWireCodec codec)
      Takes the codec explicitly so that a corrected wire format can be supplied without touching this class. See WIRE.md.
  • Method Details

    • evaluate

      public Evaluation evaluate(String state, List<Question> questions)
      Asks every question about one state in one request and returns the answers by name.
    • evaluate

      public Evaluation evaluate(String state, Question... questions)
    • models

      public List<ModelCard> models()
      The model names the account may send. Aliases appear here too; this client still refuses them in JevConfig, so the list is for discovering the version an alias points at, not for choosing one at run time.
    • close

      public void close()
      Idempotent, and guarded by a ReentrantLock rather than a synchronized block, which would pin the carrier thread of a virtual thread mid-request.
      Specified by:
      close in interface AutoCloseable