espnet3.bin.atlas.core.utils.convert_pairs_to_dict
Less than 1 minute
espnet3.bin.atlas.core.utils.convert_pairs_to_dict
espnet3.bin.atlas.core.utils.convert_pairs_to_dict(pairs: list[dict]) → dict
Turn an agent’s [{"key": k, "value": v}, ...] list into {k: v}.
Agent replies are schema-constrained, which forbids free-form objects, so dotted-key patches and metric maps arrive as lists of key/value pairs. A repeated key keeps its last value.
Example
>>> convert_pairs_to_dict([{"key": "optimizer.lr", "value": 0.001}])
{'optimizer.lr': 0.001}