Skip to content

Commit

Permalink
fix typo & update generatedV1 guide documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianMindee committed Sep 19, 2024
1 parent 0ec97fd commit de86c78
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion docs/extras/guide/generated_v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion mindee/product/generated/generated_v1_document.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit de86c78

Please sign in to comment.