Skip to main content

aip_sdk.save_eval_config

aip_sdk.save_eval_config(config: EvalConfig, path: str | Path) -> None

Serialise an EvalConfig to a YAML file.

None-valued fields are omitted. Comments are not preserved — they are not part of the data model (documented limitation).

Dumps in Python mode so the free-form parameters / metric_configs values are handed to yaml.safe_dump exactly as loaded: a YAML date stays a date, a set stays a set, and the file round-trips losslessly. mode="json" would retype every one of those to its JSON form to solve a problem only two fields have — EvalTarget.partition_type / span_kind are StrEnum\ s, which safe_dump cannot represent — so those two serialise themselves to plain strings instead (see EvalTarget._serialize_enum_as_its_value).