TypeSafeSDK.SystemOneResponse (TypeSafeSDK v0.1.0)

Copy Markdown View Source

Typed System One response with grouped convenience accessors.

Responses produced by the HTTP client retain request metadata separately from the decoded API payload. request_id!/1 and raw_http_response!/1 mirror the Python SDK's metadata access without polluting the wire fields.

Summary

Types

answer()

t()

@type t() :: %TypeSafeSDK.SystemOneResponse{
  answers: %{required(String.t()) => answer()},
  model: String.t(),
  raw_http_response: Pristine.Response.t() | nil,
  request_id: String.t() | nil,
  usage: TypeSafeSDK.Usage.t()
}

Functions

choices(system_one_response)

@spec choices(t()) :: %{required(String.t()) => TypeSafeSDK.ChoiceAnswer.t()}

decode(transport)

@spec decode(term()) :: {:ok, t()} | {:error, TypeSafeSDK.Error.t()}

nouls(system_one_response)

@spec nouls(t()) :: %{required(String.t()) => TypeSafeSDK.NoulAnswer.t()}

raw_http_response!(system_one_response)

@spec raw_http_response!(t()) :: Pristine.Response.t()

request_id!(system_one_response)

@spec request_id!(t()) :: String.t()

scores(system_one_response)

@spec scores(t()) :: %{required(String.t()) => TypeSafeSDK.ScoreAnswer.t()}