Skip to content

API Reference parrot.registry.routing.yaml_loader

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.registry.routing.yaml_loader

View source

YAML override loader for StoreRouterConfig (FEAT-111 Module 2).

Merges hardcoded Pydantic defaults with per-agent YAML overrides using the same precedence semantics as IntentRouterConfig.custom_keywords.

Usage::

from parrot.registry.routing import load_store_router_config

cfg = load_store_router_config("/path/to/router.yaml")
cfg = load_store_router_config({"top_n": 3, "margin_threshold": 0.20})

Alias StoreRouterConfig

Re-exported from parrot.registry.routing.models.StoreRouterConfig.

Function load_store_router_config

Load a StoreRouterConfig from a YAML file or a pre-parsed dict.

Scalar fields present in the source override the Pydantic model defaults. custom_rules from the source are appended to (not replacing) any rules already present in the defaults — following the precedence pattern of IntentRouterConfig.custom_keywords.

On any error (missing file, malformed YAML, Pydantic validation failure) the function logs the problem and returns StoreRouterConfig() (all defaults). It never raises.

load_store_router_config(path_or_dict: Union[_PathLike, dict]) -> StoreRouterConfig

Parameter Type Default Description
path_or_dict Union[_PathLike, dict] Either a filesystem path (str or :class:pathlib.Path) pointing to a YAML file, or a pre-parsed dict containing override values.

Returns: StoreRouterConfig — A fully-validated StoreRouterConfig.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally