TypeSafeSDK.Client (TypeSafeSDK v0.4.0)

Copy Markdown View Source

Thin TypeSafe API client layered on Pristine.

Runtime code does not read OS environment variables. Explicit options win over application config; the included config/runtime.exs materializes the Python SDK-compatible environment names when this repo is the top-level Mix project.

Summary

Types

t()

@type t() :: %TypeSafeSDK.Client{
  api_key: String.t(),
  base_url: String.t(),
  context: Pristine.SDK.Context.t(),
  default_model: String.t(),
  headers: map(),
  max_request_bytes: pos_integer() | nil,
  pristine_client: Pristine.Client.t(),
  response_contract: %{
    on_unknown_answer: :preserve | :error,
    allowed_models: [String.t()] | nil
  },
  retry: TypeSafeSDK.RetryPolicy.t() | false,
  timeout_ms: pos_integer(),
  transport: module(),
  transport_opts: keyword()
}

Functions

extra_headers(opts)

@spec extra_headers(term()) :: map()

new(opts \\ [])

@spec new(keyword()) :: t()

pristine_client(client)

@spec pristine_client(t()) :: Pristine.Client.t()