falaw.registry#
Tool and model registries.
Two registries, both queryable by tags/categories:
ToolRegistry— decorator-populated, holds the agent-facing surface.ModelRegistry— JSON-backed, catalog of fal models with quality tiers.
Bridges (skill / MCP / HTTP) read the tool registry. Operations call
pick_model to map a (category, quality) pair to a concrete fal model id.
Module Attributes
Identity a |
Functions
|
|
|
|
|
|
|
|
The capability/limit fields for a model — the "static reminder of limitations" a shot-list builder surfaces. |
|
|
Per-model parameters worth knowing before a call, |
The catalogue's version — see |
|
|
Pick a sensible fal model for a (category, quality) request. |
|
Decorator: register the wrapped function as a falaw tool. |
|
- falaw.registry.MODEL_CATALOGUE_TABLE = 'falaw/data/models.json'#
Identity a
falaw.CostBasisrecords for a catalogue-priced call.
- falaw.registry.model_constraints(id)[source]#
The capability/limit fields for a model — the “static reminder of limitations” a shot-list builder surfaces. Resolves aliases.
Returns a JSON-able dict;
max_clip_secondsetc. areNone/ empty when unknown for that model.- Return type:
- falaw.registry.model_params(id)[source]#
Per-model parameters worth knowing before a call,
{name: spec}.Each spec is
{"enum": [...], "default": ...}; resolves aliases. Forfal-ai/recraft/v3/text-to-imagethis showsstyledefaults torealistic_image— a photograph, whatever the prompt describes — and lists the styles that actually give a woodcut or a linocut. Empty when the catalogue records none (fal’s OpenAPI schema is the full source).- Return type:
- falaw.registry.models_table_version()[source]#
The catalogue’s version — see
falaw.base.data_table_version().Cached per process, like the catalogue itself.
- Return type:
- falaw.registry.pick_model(*, category, quality_tier='balanced')[source]#
Pick a sensible fal model for a (category, quality) request.
First-match semantics: when several models share a tier, the earlier entry wins. Curated entries are written first in
data/models.json, so they take precedence over corpus-merged additions. If no model has the exact tier, neighboring tiers are tried. KeyError only when the category is empty.- Return type: