TypeSafeAPI.Models (TypeSafe AI v0.1.0-alpha.3)

Copy Markdown View Source

The models endpoint: GET /v1/models.

The path is not documented on the public API reference; it comes from the official Python SDK's constants (MODELS_PATH = "/v1/models"), and the response shape {"models": [{"name", "description", "release_date"}]} from its generated schema.

Because the endpoint is undocumented, list/2 is deliberately tolerant: an entry it cannot decode is logged at warning and skipped, and the models that did decode are returned. A list endpoint is the one place where one unfamiliar row should not cost you the other ten. Only a body with no models array at all is an error.

Summary

Functions

Lists the models available to the account.

Per-call options accepted by list/2.

The models endpoint path.

Functions

list(client, opts \\ [])

@spec list(TypeSafeAPI.Client.t(), keyword()) ::
  {:ok, [TypeSafeAPI.Model.t()]} | {:error, TypeSafeAPI.Error.t()}

Lists the models available to the account.

An unknown option is a :validation error and no request is sent, the same as for TypeSafeAPI.evaluate/4. An entry that fails to decode is logged and skipped; see the module doc.

Options

options_schema()

@spec options_schema() :: NimbleOptions.t()

Per-call options accepted by list/2.

path()

@spec path() :: String.t()

The models endpoint path.