OzMcp.Structs.ModelPreferences (OzMcp v0.9.0)

Copy Markdown View Source

Helper module used to build ModelPreferences structure: what the server prefers when the client chooses a model. The client has the last word.

(MCP protocol: 2025-11-25)

hints is a list of model names (strings) or maps with a name. The priorities are numbers from 0 to 1.

Short example:

%ModelPreferences{}
  |> ModelPreferences.hints(["claude-3-sonnet"])
  |> ModelPreferences.intelligence_priority(0.8)
  |> ModelPreferences.build()

Result:

%{hints: [%{name: "claude-3-sonnet"}], intelligencePriority: 0.8}

Specification: ModelPreferences

Fields

FieldSetterTypeRequired
hintshints/2list(String.t() | map()) | nilno
costPrioritycost_priority/2number between 0 and 1no
speedPriorityspeed_priority/2number between 0 and 1no
intelligencePriorityintelligence_priority/2number between 0 and 1no

Summary

Types

t()

@type t() :: %OzMcp.Structs.ModelPreferences{
  costPriority: number() | nil,
  hints: [String.t() | map()] | nil,
  intelligencePriority: number() | nil,
  speedPriority: number() | nil
}

Functions

build(struct)

@spec build(t()) :: map()

cost_priority(struct, value)

@spec cost_priority(t(), number() | nil) :: t()

hints(struct, value)

@spec hints(t(), [String.t() | map()] | nil) :: t()

intelligence_priority(struct, value)

@spec intelligence_priority(t(), number() | nil) :: t()

speed_priority(struct, value)

@spec speed_priority(t(), number() | nil) :: t()