From 55d523f8751e44d0a68e80d181eddb1da37cddeb Mon Sep 17 00:00:00 2001 From: zmezei Date: Wed, 5 Jul 2023 01:15:22 +0100 Subject: [PATCH] fix class var name --- src/uagents/models.py | 8 ++++---- src/uagents/protocol.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/uagents/models.py b/src/uagents/models.py index 8bae38ed..8311e05c 100644 --- a/src/uagents/models.py +++ b/src/uagents/models.py @@ -6,7 +6,7 @@ class Model(BaseModel): - _schema_without_descrs: ClassVar[Union[Dict[str, Any], None]] = None + schema_no_descriptions: ClassVar[Union[Dict[str, Any], None]] = None @staticmethod def _remove_descriptions( @@ -42,7 +42,7 @@ def _refresh_schema_cache(model: Type["Model"]): @staticmethod def build_schema_digest(model: Union["Model", Type["Model"]]) -> str: type_obj = model if isinstance(model, type) else model.__class__ - if type_obj._schema_without_descrs is None: + if type_obj.schema_no_descriptions is None: orig_descriptions: Dict[str, Union[str, Dict]] = {} Model._remove_descriptions(type_obj, orig_descriptions) digest = ( @@ -52,8 +52,8 @@ def build_schema_digest(model: Union["Model", Type["Model"]]) -> str: .digest() .hex() ) - if type_obj._schema_without_descrs is None: - type_obj._schema_without_descrs = type_obj.schema() + if type_obj.schema_no_descriptions is None: + type_obj.schema_no_descriptions = type_obj.schema() Model._restore_descriptions(type_obj, orig_descriptions) Model._refresh_schema_cache(type_obj) return f"model:{digest}" diff --git a/src/uagents/protocol.py b/src/uagents/protocol.py index a54da67a..bdda74a8 100644 --- a/src/uagents/protocol.py +++ b/src/uagents/protocol.py @@ -176,7 +176,7 @@ def manifest(self) -> Dict[str, Any]: for schema_digest, model in all_models.items(): manifest["models"].append( - {"digest": schema_digest, "schema": model._schema_without_descrs} + {"digest": schema_digest, "schema": model.schema_no_descriptions} ) for request, responses in self._replies.items():