Skip to content

v0.2.0

Choose a tag to compare

@dannote dannote released this 21 Sep 13:14
· 8 commits to master since this release

The /v1/systemone wire format is now served by open decision models as well
as TypeSafe. This release lets one application talk to several of them.

  • Named endpoints: config :jev, endpoints: [laya: [base_url: ...]] and endpoint: :laya
    per call, from Jev.HTTP.post/3 or a Jev.Server reply. config :jev, endpoint: changes
    the default from :typesafe. Jev.HTTP.endpoint/1 returns the resolved settings.
  • A named endpoint sends no Authorization header unless it has an api_key, and its
    usd_per_million_input defaults to zero. Transport settings are inherited from the
    top-level configuration.
  • Jev.reply/3 and Jev.cost/2 take the price. When a server omits confidence, it is
    computed from the probabilities as TypeSafe defines it.
  • Telemetry metadata and Jev.Error carry the endpoint name.
  • Jev.Wire: the response body as JSONCodec structs. A 200 whose body does not fit the wire
    format comes back as {:error, %JSONCodec.Error{}} instead of a crash, integers are accepted
    where the API documents numbers, unknown fields are ignored, and
    Jev.Wire.Response.schema/0 is the JSON Schema of what the client accepts. Adds the
    json_codec dependency.
  • Jev.Test: respond/2 answers a Req.Test stub from a reply-shaped map, reading the questions
    from the request; error/3 sends a failure; body/2 is the pure half; request/1 reads the
    request. :plug becomes an optional dependency for these.
  • Jev.Backend: a behaviour with one callback, post/3. Jev.HTTP implements it and stays the
    default; backend: per request or config :jev, backend: picks another, for an in-process
    model or a fake. Jev.Telemetry.span/4 is the shared telemetry every backend wraps its work in,
    so events carry backend and are identical whatever answered.
  • Jev.confidence/2 is public: TypeSafe's confidence for a distribution.
  • [:jev, :answer] fires only for questions the server answered. A partial reply used to crash the
    request.