Skip to content

Commit

Permalink
fix class var name
Browse files Browse the repository at this point in the history
  • Loading branch information
zmezei committed Jul 5, 2023
1 parent 59ea5ac commit 55d523f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/uagents/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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 = (
Expand All @@ -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}"
Expand Down
2 changes: 1 addition & 1 deletion src/uagents/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down

0 comments on commit 55d523f

Please sign in to comment.