prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  fix: fix tags type after pydantic model
  
  
  </issue>
  <code>
  [start of docarray/document/pydantic_model.py]
  1 from typing import Optional, List, Dict, Any, TYPE_CHECKING, Union
  2 
  3 from pydantic import BaseModel, validator
  4 
  5 from ..math.ndarray import to_list
  6 
  7 if TYPE_CHECKING:
  8     from ..types import ArrayType
  9 
  10 _ProtoValueType = Optional[Union[str, bool, float]]
  11 _StructValueType = Union[
  12     _ProtoValueType, List[_ProtoValueType], Dict[str, _ProtoValueType]
  13 ]
  14 
  15 
  16 def _convert_ndarray_to_list(v: 'ArrayType'):
  17     if v is not None:
  18         return to_list(v)
  19 
  20 
  21 class PydanticDocument(BaseModel):
  22     id: str
  23     parent_id: Optional[str]
  24     granularity: Optional[int]
  25     adjacency: Optional[int]
  26     blob: Optional[bytes]
  27     tensor: Optional[Any]
  28     mime_type: Optional[str]
  29     text: Optional[str]
  30     weight: Optional[float]
  31     uri: Optional[str]
  32     tags: Optional[Dict[str, '_StructValueType']]
  33     offset: Optional[float]
  34     location: Optional[List[float]]
  35     embedding: Optional[Any]
  36     modality: Optional[str]
  37     evaluations: Optional[Dict[str, Dict[str, '_StructValueType']]]
  38     scores: Optional[Dict[str, Dict[str, '_StructValueType']]]
  39     chunks: Optional[List['PydanticDocument']]
  40     matches: Optional[List['PydanticDocument']]
  41 
  42     _tensor2list = validator('tensor', allow_reuse=True)(_convert_ndarray_to_list)
  43     _embedding2list = validator('embedding', allow_reuse=True)(_convert_ndarray_to_list)
  44 
  45 
  46 PydanticDocument.update_forward_refs()
  47 
  48 PydanticDocumentArray = List[PydanticDocument]
  49
  [end of docarray/document/pydantic_model.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/docarray/document/pydantic_model.py b/docarray/document/pydantic_model.py
  --- a/docarray/document/pydantic_model.py
  +++ b/docarray/document/pydantic_model.py
  @@ -7,7 +7,8 @@
   if TYPE_CHECKING:
       from ..types import ArrayType
   
  -_ProtoValueType = Optional[Union[str, bool, float]]
  +# this order must be preserved: https://pydantic-docs.helpmanual.io/usage/types/#unions
  +_ProtoValueType = Optional[Union[bool, float, str]]
   _StructValueType = Union[
       _ProtoValueType, List[_ProtoValueType], Dict[str, _ProtoValueType]
   ]
  
verification_info: {"golden_diff": "diff --git a/docarray/document/pydantic_model.py b/docarray/document/pydantic_model.py\n--- a/docarray/document/pydantic_model.py\n+++ b/docarray/document/pydantic_model.py\n@@ -7,7 +7,8 @@\n if TYPE_CHECKING:\n     from ..types import ArrayType\n \n-_ProtoValueType = Optional[Union[str, bool, float]]\n+# this order must be preserved: https://pydantic-docs.helpmanual.io/usage/types/#unions\n+_ProtoValueType = Optional[Union[bool, float, str]]\n _StructValueType = Union[\n     _ProtoValueType, List[_ProtoValueType], Dict[str, _ProtoValueType]\n ]\n", "issue": "fix: fix tags type after pydantic model\n\n", "before_files": [{"content": "from typing import Optional, List, Dict, Any, TYPE_CHECKING, Union\n\nfrom pydantic import BaseModel, validator\n\nfrom ..math.ndarray import to_list\n\nif TYPE_CHECKING:\n    from ..types import ArrayType\n\n_ProtoValueType = Optional[Union[str, bool, float]]\n_StructValueType = Union[\n    _ProtoValueType, List[_ProtoValueType], Dict[str, _ProtoValueType]\n]\n\n\ndef _convert_ndarray_to_list(v: 'ArrayType'):\n    if v is not None:\n        return to_list(v)\n\n\nclass PydanticDocument(BaseModel):\n    id: str\n    parent_id: Optional[str]\n    granularity: Optional[int]\n    adjacency: Optional[int]\n    blob: Optional[bytes]\n    tensor: Optional[Any]\n    mime_type: Optional[str]\n    text: Optional[str]\n    weight: Optional[float]\n    uri: Optional[str]\n    tags: Optional[Dict[str, '_StructValueType']]\n    offset: Optional[float]\n    location: Optional[List[float]]\n    embedding: Optional[Any]\n    modality: Optional[str]\n    evaluations: Optional[Dict[str, Dict[str, '_StructValueType']]]\n    scores: Optional[Dict[str, Dict[str, '_StructValueType']]]\n    chunks: Optional[List['PydanticDocument']]\n    matches: Optional[List['PydanticDocument']]\n\n    _tensor2list = validator('tensor', allow_reuse=True)(_convert_ndarray_to_list)\n    _embedding2list = validator('embedding', allow_reuse=True)(_convert_ndarray_to_list)\n\n\nPydanticDocument.update_forward_refs()\n\nPydanticDocumentArray = List[PydanticDocument]\n", "path": "docarray/document/pydantic_model.py"}]}