diff --git a/docs/extras/guide/generated_v1.md b/docs/extras/guide/generated_v1.md index 31a3f15e..47d53095 100644 --- a/docs/extras/guide/generated_v1.md +++ b/docs/extras/guide/generated_v1.md @@ -87,12 +87,20 @@ Generated builds always have access to at least two attributes: ## Fields -**fields** (`Dict[str`: `List[Union[`[GeneratedListField](#generated-list-field)[GeneratedObjectField](#generated-object-field), `(#stringfield)[StringField]]]`): +**fields** (`Dict[str`: `List[Union[`[GeneratedListField](#generated-list-field), [GeneratedObjectField](#generated-object-field), `(#stringfield)[StringField]]]`): ```python print(str(result.document.inference.prediction.fields["my-field"])) ``` +### Nested fields + +If your field `my-field` is a `GeneratedObjectField`, you can access its individual properties using the following syntax: + +```python +print(str(result.document.inference.prediction.fields["my-field"].my_attribute)) +``` + # Questions? [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/mindee/product/generated/generated_v1_document.py b/mindee/product/generated/generated_v1_document.py index 72785d65..1378fc63 100644 --- a/mindee/product/generated/generated_v1_document.py +++ b/mindee/product/generated/generated_v1_document.py @@ -35,5 +35,5 @@ def __init__(self, raw_prediction: StringDict) -> None: ): field_contents_str["value"] = str( field_contents_str["value"] - ) # str cohersion for numbers + ) # str coercion for numbers self.fields[field_name] = StringField(field_contents_str)