mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Apply ruff formatting to checkpoint encoding file
Co-authored-by: TaoChenOSU <12570346+TaoChenOSU@users.noreply.github.com>
This commit is contained in:
@@ -148,9 +148,7 @@ def decode_checkpoint_value(value: Any) -> Any:
|
||||
if cls is not None:
|
||||
# Verify the class actually supports the model protocol
|
||||
if not _class_supports_model_protocol(cls):
|
||||
logger.debug(
|
||||
f"Class {type_key} does not support model protocol; returning raw value"
|
||||
)
|
||||
logger.debug(f"Class {type_key} does not support model protocol; returning raw value")
|
||||
return decoded_payload
|
||||
if strategy == "to_dict" and hasattr(cls, "from_dict"):
|
||||
with contextlib.suppress(Exception):
|
||||
@@ -177,9 +175,7 @@ def decode_checkpoint_value(value: Any) -> Any:
|
||||
cls_dc: Any = getattr(module, class_name)
|
||||
# Verify the class is actually a dataclass type (not an instance)
|
||||
if not isinstance(cls_dc, type) or not is_dataclass(cls_dc):
|
||||
logger.debug(
|
||||
f"Class {type_key_dc} is not a dataclass type; returning raw value"
|
||||
)
|
||||
logger.debug(f"Class {type_key_dc} is not a dataclass type; returning raw value")
|
||||
return decoded_raw
|
||||
constructed = _instantiate_checkpoint_dataclass(cls_dc, decoded_raw)
|
||||
if constructed is not None:
|
||||
|
||||
Reference in New Issue
Block a user