Inference (inference v0.1.0)

Copy Markdown View Source

Facade for semantic model inference.

The facade accepts an Inference.Client and either prompt text, message lists, or an Inference.Request. Provider-specific behavior stays behind the configured adapter module.

Summary

Functions

Builds a client.

Builds a client or raises when invalid.

Runs a completion through the configured adapter.

Starts a streaming completion when the adapter supports it.

Functions

client(attrs)

@spec client(keyword() | map()) ::
  {:ok, Inference.Client.t()} | {:error, Inference.Error.t()}

Builds a client.

client!(attrs)

@spec client!(keyword() | map()) :: Inference.Client.t()

Builds a client or raises when invalid.

complete(client, input, opts \\ [])

Runs a completion through the configured adapter.

stream(client, input, opts \\ [])

Starts a streaming completion when the adapter supports it.