ExTypesafe.Response (ExTypesafe v0.1.0)

Copy Markdown View Source

Structs representing a successful TypeSafe API response.

A Response contains:

  • model — the model that performed the evaluation
  • answers — a map of your question keys to typed Answer structs
  • usage — token counts for the request

Summary

Functions

Parses a raw API response map (as decoded JSON) into a Response struct.

Types

answer()

t()

@type t() :: %ExTypesafe.Response{
  answers: %{required(String.t()) => answer()},
  model: String.t(),
  usage: ExTypesafe.Response.Usage.t()
}

Functions

from_map(map)

@spec from_map(map()) :: t()

Parses a raw API response map (as decoded JSON) into a Response struct.