Jibu.Models (Jibu v0.2.1)

Copy Markdown View Source

The Models API: the models available to the API key, with their capabilities. Results are the API's JSON with string keys.

Summary

Functions

Retrieves one model by id or alias.

Returns one page. query takes the API's parameters, such as :limit, :after_id and :before_id.

Streams all models across pages, forward only. Raises Jibu.Error when a page fails.

Functions

get(client, id)

@spec get(Req.Request.t(), String.t()) :: {:ok, map()} | {:error, Jibu.Error.t()}

Retrieves one model by id or alias.

list(client, query \\ [])

@spec list(Req.Request.t(), keyword()) :: {:ok, map()} | {:error, Jibu.Error.t()}

Returns one page. query takes the API's parameters, such as :limit, :after_id and :before_id.

stream(client, query \\ [])

@spec stream(Req.Request.t(), keyword()) :: Enumerable.t()

Streams all models across pages, forward only. Raises Jibu.Error when a page fails.