TypeSafeSDK (TypeSafeSDK v0.4.0)

Copy Markdown View Source

Elixir client for the TypeSafe AI API.

Use evaluate/4 for validated questions, caller-key preservation and enriched answers, or system_one/4 for the existing wire-oriented parity interface. Both execute through the same generated operations and Pristine runtime.

Summary

Functions

Strict ordered Choice constructor.

Evaluate with caller-key restoration and request-relative answer validation.

Evaluate or raise the normalized SDK error.

Collect the bounded evaluation stream.

Strict Noul constructor. Raises on invalid locally defined questions.

Validate and prepare questions once, returning a tuple.

Validate and prepare questions or raise.

Strict ordered Score constructor.

Legacy wire-oriented system_one call, raising on error.

Functions

choice(instructions, criteria, opts \\ [])

Strict ordered Choice constructor.

evaluate(client, state, questions, opts \\ [])

Evaluate with caller-key restoration and request-relative answer validation.

evaluate!(client, state, questions, opts \\ [])

Evaluate or raise the normalized SDK error.

evaluate_many(client, states, questions, opts \\ [])

Collect the bounded evaluation stream.

evaluate_stream(client, states, questions, opts \\ [])

Lazy, bounded evaluation. See TypeSafeSDK.Batch.

list_models(client, opts \\ [])

@spec list_models(TypeSafeSDK.Client.t(), keyword()) ::
  {:ok, TypeSafeSDK.ListModelsResponse.t()} | {:error, term()}

See TypeSafeSDK.Models.list/2.

new_client(opts \\ [])

@spec new_client(keyword()) :: TypeSafeSDK.Client.t()

See TypeSafeSDK.Client.new/1.

noul(instructions, opts \\ [])

Strict Noul constructor. Raises on invalid locally defined questions.

prepare(questions)

Validate and prepare questions once, returning a tuple.

prepare!(questions)

Validate and prepare questions or raise.

score(instructions, levels, opts \\ [])

Strict ordered Score constructor.

system_one(client, state, questions, opts \\ [])

@spec system_one(TypeSafeSDK.Client.t(), term(), map(), keyword()) ::
  {:ok, TypeSafeSDK.SystemOneResponse.t()} | {:error, term()}

See TypeSafeSDK.SystemOne.run/4.

system_one!(client, state, questions, opts \\ [])

Legacy wire-oriented system_one call, raising on error.

version()

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