Function: useMastraDefaultModel()
useMastraDefaultModel(
agentId?,enabled?):object
Fetch the humanized name of the static default model the given agent (or
the server’s default agent) falls back to when no model is pinned, via
client.defaultModel(agentId). defaultModel is null while loading,
when the agent’s model is dynamic, or on error - the picker then shows a
plain “Default”. Pass enabled: false to skip the fetch (e.g. picker
hidden), which also clears any prior value. Returns an object to match the
shape of the sibling data hooks (useMastraModels,
useMastraSuggestions).
Parameters
Section titled “Parameters”agentId?
Section titled “agentId?”string
enabled?
Section titled “enabled?”boolean = true
Returns
Section titled “Returns”object
defaultModel
Section titled “defaultModel”defaultModel:
string|null
loading
Section titled “loading”loading:
boolean