Tinkex.Types.GetSamplerResponse (Tinkex v0.3.4)

View Source

Response from the get_sampler API call.

Mirrors Python tinker.types.GetSamplerResponse.

Fields

  • sampler_id - The sampler ID (sampling_session_id)
  • base_model - The base model name
  • model_path - Optional tinker:// path to custom weights

Wire Format

{
  "sampler_id": "session-id:sample:0",
  "base_model": "Qwen/Qwen2.5-7B",
  "model_path": "tinker://run-id/weights/checkpoint-001"
}

Examples

iex> json = %{"sampler_id" => "sess:sample:0", "base_model" => "Qwen/Qwen2.5-7B"}
iex> Tinkex.Types.GetSamplerResponse.from_json(json)
%Tinkex.Types.GetSamplerResponse{sampler_id: "sess:sample:0", base_model: "Qwen/Qwen2.5-7B", model_path: nil}

See Also

Summary

Functions

Create a GetSamplerResponse from a JSON map.

Types

t()

@type t() :: %Tinkex.Types.GetSamplerResponse{
  base_model: String.t(),
  model_path: String.t() | nil,
  sampler_id: String.t()
}

Functions

from_json(json)

@spec from_json(map()) :: t()

Create a GetSamplerResponse from a JSON map.

Handles both string and atom keys.

Parameters

  • json - Map with keys "sampler_id"/:sampler_id, "base_model"/:base_model, and optionally "model_path"/:model_path

Examples

iex> GetSamplerResponse.from_json(%{"sampler_id" => "s1", "base_model" => "Qwen", "model_path" => "tinker://..."})
%GetSamplerResponse{sampler_id: "s1", base_model: "Qwen", model_path: "tinker://..."}

iex> GetSamplerResponse.from_json(%{sampler_id: "s1", base_model: "Qwen"})
%GetSamplerResponse{sampler_id: "s1", base_model: "Qwen", model_path: nil}