# TypeSafe AI v0.1.0-alpha.3 - Table of Contents

> Typed Elixir client for TypeSafe AI and its Jev System One model, with offline test stubs, concurrent fan-out, and atom-keyed answers. Unofficial; not affiliated with TypeSafe AI.

## Pages

- [typesafe_api](readme.md)
- [Changelog](changelog.md)
- [Design notes](design.md)

- Guides
  - [Getting started](getting_started.md)
  - [Errors and retries](errors_and_retries.md)
  - [Configuration and concurrency](configuration_and_concurrency.md)
  - [System One concepts](system_one.md)
  - [LiveDashboard metrics](live_dashboard.md)
  - [Broadway and Oban](broadway_and_oban.md)
  - [TypeSafe cheatsheet](cheatsheet.md)
  - [Speculative fan-out](speculative_fan_out.md)
  - [Confidence-gated routing](confidence_gated_routing.md)
  - [Composite scoring](composite_scoring.md)

- Livebooks
  - [TypeSafe live walkthrough](live_walkthrough.md)

- Examples
  - [Support triage example](support_triage_example.md)

## Modules

- [TypeSafeAPI.JSON.Encoded](TypeSafeAPI.JSON.Encoded.md): A value that has already been serialized to JSON iodata, and encodes as
those bytes wherever it appears.

- Getting started
  - [TypeSafeAPI](TypeSafeAPI.md): Unofficial Elixir client for the TypeSafe AI API.
Not affiliated with or endorsed by TypeSafe AI.
  - [TypeSafeAPI.Client](TypeSafeAPI.Client.md): Connection settings for the TypeSafe API, resolved once and passed around.

- Evaluating
  - [TypeSafeAPI.FanOut](TypeSafeAPI.FanOut.md): Evaluate many states against one question set, concurrently.
  - [TypeSafeAPI.Models](TypeSafeAPI.Models.md): The models endpoint: `GET /v1/models`.
  - [TypeSafeAPI.SystemOne](TypeSafeAPI.SystemOne.md): Layer 2 for the evaluation endpoint: typed questions in, typed answers out.
  - [TypeSafeAPI.SystemOne.Prepared](TypeSafeAPI.SystemOne.Prepared.md): A question set that has been validated, encoded, and had its caller keys
recorded, ready to send with any number of states.

- Questions
  - [TypeSafeAPI.Question](TypeSafeAPI.Question.md): The three question types and the functions that validate and encode them.
  - [TypeSafeAPI.Question.Choice](TypeSafeAPI.Question.Choice.md): Pick one option from a set you define.
  - [TypeSafeAPI.Question.Noul](TypeSafeAPI.Question.Noul.md): A yes/no judgment. The instructions may be a question ("Does this convey
urgency?") or a statement to evaluate ("This message contains unsolicited
advertising."); the answer is the probability that the answer is yes, or
that the statement holds.
  - [TypeSafeAPI.Question.Score](TypeSafeAPI.Question.Score.md): Rate the state along an ordered scale you describe in steps.

- Answers
  - [TypeSafeAPI.Answer](TypeSafeAPI.Answer.md): Decodes one wire answer against the question that produced it, and turns
any answer into a routing decision.
  - [TypeSafeAPI.Answer.Choice](TypeSafeAPI.Answer.Choice.md): A decoded Choice answer: which option the model picked, and how sure it was
about every option it was offered.
  - [TypeSafeAPI.Answer.Noul](TypeSafeAPI.Answer.Noul.md): A decoded Noul answer: the model's probability that the answer is yes.
  - [TypeSafeAPI.Answer.Score](TypeSafeAPI.Answer.Score.md): A decoded Score answer: a point on the scale, plus enough structure to use
it without hand-decoding probabilities yourself.

- Results and errors
  - [TypeSafeAPI.Error](TypeSafeAPI.Error.md): The single error value returned by every `{:error, _}` tuple in this library.
  - [TypeSafeAPI.Model](TypeSafeAPI.Model.md): A model available to the account, as listed by `TypeSafeAPI.models/1`.
  - [TypeSafeAPI.Result](TypeSafeAPI.Result.md): A fully decoded response: every answer keyed by the caller's own question
ids, plus usage and the raw decoded body for anything this layer doesn't
expose yet.
  - [TypeSafeAPI.Usage](TypeSafeAPI.Usage.md): Token counts for one call.

- Raw HTTP, retries, telemetry
  - [TypeSafeAPI.HTTP](TypeSafeAPI.HTTP.md): Layer 1: the raw HTTP client. Maps in, maps out.
  - [TypeSafeAPI.HTTP.Response](TypeSafeAPI.HTTP.Response.md): A successful raw response: the decoded JSON body plus the metadata the
typed layer and support conversations need.
  - [TypeSafeAPI.Retry](TypeSafeAPI.Retry.md): Retry policy mirroring the official TypeSafe SDKs, implemented as a Req step.
  - [TypeSafeAPI.Telemetry](TypeSafeAPI.Telemetry.md): Telemetry events emitted by this library, plus a small logger handler.

- Testing
  - [TypeSafeAPI.Test](TypeSafeAPI.Test.md): Stub the TypeSafe API in your tests without fixtures or a network.

- Internals
  - [TypeSafeAPI.Application](TypeSafeAPI.Application.md): Starts the one process this library owns: a `Task.Supervisor` named
`TypeSafeAPI.TaskSupervisor`, used by `TypeSafeAPI.FanOut`.
  - [TypeSafeAPI.JSON.OrderedObject](TypeSafeAPI.JSON.OrderedObject.md): A JSON object that encodes its pairs in the order given.
  - [TypeSafeAPI.Keys](TypeSafeAPI.Keys.md): Request-side registry of caller-supplied keys, so answers come back under
the keys you sent.

