Tinkex.Types.GetServerCapabilitiesResponse (Tinkex v0.3.1)
View SourceSupported model metadata returned by the service capabilities endpoint.
Contains a list of SupportedModel structs with full metadata including
model IDs, names, and architecture types.
Migration Note
Prior versions stored only model names as strings. The new structure provides richer metadata while maintaining backward compatibility for parsing responses.
Summary
Functions
Parse from JSON map with string or atom keys.
Extract just the model names from the response for convenience.
Types
@type t() :: %Tinkex.Types.GetServerCapabilitiesResponse{ supported_models: [Tinkex.Types.SupportedModel.t()] }
Functions
Parse from JSON map with string or atom keys.
Handles various input formats for backward compatibility:
- Array of model objects with metadata fields
- Array of plain strings (legacy format)
- Mixed arrays
Extract just the model names from the response for convenience.
This is useful for callers who only need the names (legacy behavior).
Example
iex> response = %GetServerCapabilitiesResponse{
...> supported_models: [
...> %SupportedModel{model_name: "llama"},
...> %SupportedModel{model_name: "qwen"}
...> ]
...> }
iex> GetServerCapabilitiesResponse.model_names(response)
["llama", "qwen"]