|
1 | 1 | from typing import Any, Optional, Type, TypeVar, Union |
2 | 2 |
|
| 3 | +from pydantic import Field |
| 4 | + |
3 | 5 | from docarray.base_doc import BaseDoc |
4 | 6 | from docarray.documents.mesh.vertices_and_faces import VerticesAndFaces |
5 | 7 | from docarray.typing.tensor.embedding import AnyEmbedding |
6 | 8 | from docarray.typing.url.url_3d.mesh_url import Mesh3DUrl |
7 | 9 |
|
| 10 | + |
8 | 11 | T = TypeVar('T', bound='Mesh3D') |
9 | 12 |
|
10 | 13 |
|
@@ -103,10 +106,24 @@ class MultiModalDoc(BaseDoc): |
103 | 106 |
|
104 | 107 | """ |
105 | 108 |
|
106 | | - url: Optional[Mesh3DUrl] = None |
107 | | - tensors: Optional[VerticesAndFaces] = None |
108 | | - embedding: Optional[AnyEmbedding] = None |
109 | | - bytes_: Optional[bytes] = None |
| 109 | + url: Optional[Mesh3DUrl] = Field( |
| 110 | + description='URL to a file containing 3D mesh information. Can be remote (web) URL, or a local file path.', |
| 111 | + example='https://people.sc.fsu.edu/~jburkardt/data/obj/al.obj', |
| 112 | + default=None, |
| 113 | + ) |
| 114 | + tensors: Optional[VerticesAndFaces] = Field( |
| 115 | + description='A tensor object of 3D mesh of type `VerticesAndFaces`.', |
| 116 | + example=[[0, 1, 1], [1, 0, 1], [1, 1, 0]], |
| 117 | + default=None, |
| 118 | + ) |
| 119 | + embedding: Optional[AnyEmbedding] = Field( |
| 120 | + description='Store an embedding: a vector representation of the 3D mesh.', |
| 121 | + default=[1, 0, 1], |
| 122 | + ) |
| 123 | + bytes_: Optional[bytes] = Field( |
| 124 | + description='Bytes representation of 3D mesh.', |
| 125 | + default=None, |
| 126 | + ) |
110 | 127 |
|
111 | 128 | @classmethod |
112 | 129 | def validate( |
|
0 commit comments